Commit graph

19991 commits

Author SHA1 Message Date
mattsc
d88bc01f62 Lua AIs: do not use empty tables as filters
It’s faster not to provide any argument to wesnoth.get_units() if all
units are to be found.
2014-04-26 07:19:04 -07:00
mattsc
984f8b196a ai_helper.get_live_units: don't use filter_wml
It’s slow, the new method is between 10 and 20 times faster.
2014-04-26 06:47:22 -07:00
Groggy Dice
219dc47817 html.py: import re module
Bugfix for last commit.
2014-04-25 02:46:57 -04:00
Groggy Dice
15899daee4 html.py: format add-on description for HTML
The description text does not get rendered very well on a webpage. One
solution might be to use pre-wrap/word-wrap in the CSS, but due to
differences between browsers, that's a can of worms (at least for me, I'm
not a web pro).

So, the not-so-elegant solution is to add <br/> to every line.

URLs are also not linked in the plain text. Although in modern browsers
you can select the text and right-click, it's still convenient to turn
them into actual links.
2014-04-25 01:29:21 -04:00
Groggy Dice
2740384796 wmllint: change "usage of" magic comment to re.search
There seems no particular reason to require that this magic comment be at
the very beginning of the line, so why not switch from re.match to
re.search.

Also, update comments to reflect the fact that UtBS no longer uses this
magic comment.

A suggestion has been made to get rid of this magic comment now that UtBS
is no longer using it, but it may still be in use in some UMC somewhere.
2014-04-25 01:28:56 -04:00
mattsc
2a3af50400 battle_calcs.lua: fix bug in get_attack_map_unit() for enemy units
Own units with MP left need to be taken off the map before enemy path
finding, not just added to the table.
2014-04-23 18:49:53 -07:00
mattsc
8ffcc6eefc battle_calcs.lua: fix a variable name 2014-04-22 16:47:30 -07:00
David Mikos
7022481d40 AnimationWML: explicitly set movement animations for vampire/blood bat. 2014-04-21 17:50:09 +09:30
mattsc
f02857b0f1 Micro AIs other engines: code cleanup 2014-04-20 14:31:05 -07:00
mattsc
ac89d4e1e9 [micro_ai] tag setup: minor code cleanup 2014-04-20 14:30:55 -07:00
mattsc
924c42f407 Goto Micro AI: prevent potential conflict between Goto MAIs
If several Goto MAIs are used on the same side and both have
unique_goals=yes set, they previously might have interfered with each
other, one preventing the other from working correctly. Now the “goal
taken” information is saved such that it only applies to the CA by
which it was set.
2014-04-20 14:30:45 -07:00
gfgtdf
ad9d70fcc1 LoW: Initialize units in start events
previously this was done in side 1 turn 1 events because start events
wasn't synced.

After the fix for 21933 players now loose when they have no units after
start events, so we need to do this in a start event.

replacing check_victory with check_end_level after start events in
play_controller.cpp line 572 doesn't work because we still have the
check_victory in playmp_controller when waiting
for remote packages, that check_victory is needed in order to sync the
behavior of ai turns which calls check_victory after every action on the
local client.
2014-04-20 03:23:35 +02:00
mattsc
e4d0206565 Bottleneck Defense Micro AI: code cleanup 2014-04-19 13:10:54 -07:00
mattsc
7b5b35ce7e Messenger Escort Micro AI: code cleanup 2014-04-19 13:10:34 -07:00
mattsc
c84879a4dc SotBE S6: remove AI controller
It does not work with leaderless allied sides.
2014-04-18 19:34:55 -07:00
mattsc
1d2b3b8ffb Micro AIs: don't check for specific value of move rating
Don’t check whether rating equals (or doesn’t equal) -9e99 or the like,
verify that a valid move was found instead.  Also, avoid setting
variables to empty tables if not needed.
2014-04-18 07:55:50 -07:00
mattsc
14e55fc14c Protect Unit MAI test scenario: use fight_on_without_leader=yes
So that the scenario continues even if the side 2 leader is killed.
2014-04-17 21:05:00 -07:00
mattsc
cff3b5a35d ai_helper.lua: avoid using table.remove
It’s slow. The inverse logic using table.insert is much faster,
especially for large tables.
2014-04-17 21:04:51 -07:00
mattsc
f7049e1140 battle_calcs.lua: avoid using formula= in SUFs
It’s slow for finding units with moves or attacks left. The alternative
method of getting all units and then looping over the table with a
condition is much faster.
2014-04-17 21:04:41 -07:00
mattsc
7d88f9211a Fix a typo 2014-04-17 21:04:31 -07:00
mattsc
fe49356eba AI helper functions: code cleanup, first pass
These function libraries are still work in progress and change
frequently, so the code cleanup is mostly just to make sure the syntax
is consistent with that used in the Micro AIs.  Changes or improvements
to the algorithms might be made at a later time.
2014-04-17 21:04:21 -07:00
mattsc
c64d8f0f84 Experimental AI: fix a parameter in call to healer support AI
This was an oversight from a change made in d4917d534e just two days
ago, so it was not in any released version.
2014-04-17 07:12:44 -07:00
mattsc
c70ecc9b65 SotBE S3: make the two sets of objectives consistent with each other
This does not add any strings.
2014-04-16 21:29:32 -07:00
mattsc
007082009a SotBE S2: end scenario if Kapou'e is already at signpost
… when the messenger reappears.  Previously, one would have had to move
Kapou’e off the post and back onto it.
2014-04-16 21:29:23 -07:00
mattsc
160f80cc63 SotBE S2: adjust starting villages
So that they are more consistent with the situation at the end of the
previous scenario.
2014-04-16 21:29:15 -07:00
David Mikos
b7d22fea3b AnimationWML: Fix sound timings for drake fire animation macros 2014-04-17 06:49:09 +09:30
mattsc
9396f20e59 Goto Micro AI: code cleanup 2014-04-16 09:48:28 -07:00
mattsc
3b8b923d7f Protect Unit Micro AI: code cleanup 2014-04-16 09:48:19 -07:00
mattsc
04bf7c56e0 Protect Unit Micro AI: fix bug in goal selection
There was a typo in the goal table indexing.  It worked for the
multi-unit test scenario (the Elves Besieged) because the goal x
coordinates for both units were the same.
2014-04-16 09:48:09 -07:00
mattsc
cce0dcba9d Healer Support Micro AI: code cleanup 2014-04-16 09:47:51 -07:00
aquileia
19bc318236 Reapply a5cb1492c4 on 1_Tutorial.cfg
The tutorial produced a row of warnings because the WML container
next_turn and its members weren't initialized.
2014-04-16 17:30:44 +02:00
David Mikos
e586dd3203 Fix bug #21914: allow drake walking corpse variation to move on unwalkable 2014-04-16 08:06:40 +09:30
mattsc
2396ccacb8 Micro AIs: prevent potential conflicts of stored data
It’s theoretically possible that different Micro AIs’ evaluation
functions store information in the same variable within self.data.
This would only happen if the CAs have the same score and while this
should generally be avoided when setting up a scenario, it is better to
ensure that it cannot cause conflicts (not in the stored data at least,
the MAIs might still interfere with each other in other respects).
2014-04-15 08:18:20 -07:00
mattsc
1ab3faca44 Hunter Micro AI: code cleanup 2014-04-15 08:17:30 -07:00
mattsc
1928836333 Random Recruiting Micro AI: code cleanup 2014-04-15 08:17:06 -07:00
mattsc
ab1a4cd96f Hang-out Micro AI: code cleanup 2014-04-15 08:16:56 -07:00
mattsc
6db0160295 Multi-pack Wolves MAI: code cleanup 2014-04-15 08:16:46 -07:00
mattsc
dc3f503be0 Animals Micro AIs: code cleanup 2014-04-14 12:47:39 -07:00
mattsc
8ea8cd5bd4 Big Animals MAI: check that attack target is enemy of AI side
… not only that it is on a different side.
2014-04-14 12:47:30 -07:00
mattsc
864063915e Micro AIs: make loop variables more descriptive 2014-04-14 12:47:20 -07:00
mattsc
e65705a247 Herding Micro AI: code cleanup 2014-04-14 12:46:58 -07:00
mattsc
d063521934 Recruit Rushers Micro AI: remove unused library 2014-04-14 12:46:48 -07:00
mattsc
0920d94e56 Wolves Micro AI: code cleanup 2014-04-14 12:46:36 -07:00
ln-zookeeper
62549bfccb Don't bother with stolen gold if there wasn't any 2014-04-13 14:31:32 +03:00
ln-zookeeper
6905294ccf Tweaks to two event triggers
Allows units other than Gweddry to find the gold, and triggers the
academy-finding dialogue when moving close to it, but not if Dacyn
already got there first.
2014-04-13 13:37:58 +03:00
mattsc
947cb78eb3 Guardian Micro AIs: code cleanup 2014-04-12 22:00:02 -07:00
mattsc
4d52a057ef Patrol Micro AI: code cleanup 2014-04-12 21:59:52 -07:00
mattsc
c9fca061ae Lurkers Micro AI: code cleanup 2014-04-12 21:59:27 -07:00
mattsc
b9955c9453 Swarm Micro AI: code cleanup 2014-04-12 21:59:15 -07:00
mattsc
b6559a82e2 Simple Attack Micro AI: code cleanup 2014-04-12 21:59:02 -07:00