Isaac Clerencia Perez
48e0e47791
Merged 13001 13007 13014 13055 13108 13109 into trunk
2006-08-17 06:53:11 +00:00
Rusty Russell
81e004c22a
Fast path simple cases of attack_prediction.
...
Wesbench_ai time before: 2.3 seconds, after: 1.95 seconds.
(Not really worthwhile, but I'd already written code before AI cache,
and it's more impressive than it seems because the AI is only a small
part of that test now).
2006-06-11 10:09:10 +00:00
Gunter Labes
23ca57f01e
ran codeclean over all files and set them all to svn:eol-style 'native'
2006-06-05 20:02:25 +00:00
Rusty Russell
5b91e70fb1
Don't use default copy constructor for combatant:
...
...causes reference to u_ after free when battle_context is copied.
We should reconsider this structure, maybe integrate with unit_stats,
after 1.2.
2006-05-31 09:22:28 +00:00
Rusty Russell
3cc4a763c0
Correct average HP calculation
...
(dead units don't get healed, and N*0 == 0, so should not add
hp_dist[0] anyway)
2006-05-25 23:27:46 +00:00
Rusty Russell
8b50f26df7
Fix (one?) cause of AI regression w/ new attack_prediction code:
...
take into account healing defender will receive from village (as old code did).
2006-05-25 12:35:21 +00:00
Rusty Russell
64b6b55c03
Use simulation to choose weapons, making for a more accurate choice
...
(it takes into account the exact circumstances of the battle).
This roughly doubles the calls to attack_prediction's fight() routine
during heavy AI load, but optimization yet to come.
battle_context/combatant could now use some cleanup.
2006-05-21 13:03:34 +00:00
Rusty Russell
47e4ec7038
Allow sharing of previous combatant status for AI.
...
Simplify average_hp() as pointed out by Decker2 (and return double).
Correct cumulative calc of poisoned/slowed.
2006-05-15 00:03:18 +00:00
Rusty Russell
0f1337059c
Encapsulate poison and slow prob in calculations, provide average_hp calc.
...
This will be used by AI.
2006-05-09 04:01:39 +00:00
Jörg Hinrichs
d7da277891
replace ugly C-cast with better one
2006-04-12 20:54:28 +00:00
Jörg Hinrichs
87e73e88ae
minor correction to make vc++ compile
2006-04-11 17:34:18 +00:00
Rusty Russell
aa48048b51
Enhance attack_prediction to handle stoning, non-30 berserk, non 1/2 slow.
...
For stoning we set damage to maximum (ie. kill) then revert after simulation.
For berserk we actually record how many rounds are set, not assume 30.
For slow we actually use the given "slowed" damage rather than assume
it's 1/2 normal.
Also remove debugging prints when configured with --enable-debug.
2006-04-11 10:31:55 +00:00
Dominic Bolin
415025c2f8
Illumination now lays an overlay on the ToD graphic;
...
convert some files to unix line endings.
2006-04-09 18:24:14 +00:00
Jörg Hinrichs
f0f3a5b873
moves include of global.hpp to the very beginning of attack_prediction...
...
...to silence some vc++ warnings
adds support for upload_log again (i thought i checked everything but
this must have been slipped through)
2006-04-09 13:47:55 +00:00
Rusty Russell
3367b8d31b
Tie attack_prediction into using battle_context's unit stats,
...
...so you can use them together.
2006-04-09 01:08:43 +00:00
Rusty Russell
8f1f7e1b63
Strip ^M from lines which somehow crept in.
2006-04-09 00:23:02 +00:00
Dominic Bolin
8e516e87e8
Fix building with gcc 4.1
2006-04-07 17:33:29 +00:00
Jörg Hinrichs
45dd38ff87
merges the gameplay_refactoring branch
...
please report any problems to me
2006-04-06 21:31:55 +00:00
Rusty Russell
2c6e8a3bc5
Sew attack_prediction code into the Makefile.am,
...
and expose through header (decker2's changes coming soon).
2006-04-05 03:15:14 +00:00
Rusty Russell
5e5b383977
Fix completely unrealistic "touched" calculation with almost-correct one.
...
Fix bug in wesnoth-attack-sim --check which caused it not to warn
about differences.
2006-02-19 12:16:41 +00:00
Rusty Russell
043e69cb2b
Enhance attack simulation and prediction file...
...
...to show problem with "touched" calculation (first step to fixing it).
2006-02-11 10:29:07 +00:00
Rusty Russell
1cfab21cba
Change check code to print P(untouched) not P(touched).
2006-01-30 05:37:58 +00:00
Rusty Russell
bbc65610b0
Fix crash on slowed unit vs. unit with slow attack.
...
Fix obvious bug with opp.untouched initialization.
2006-01-30 04:59:10 +00:00
Rusty Russell
7d76a74f1f
Attack prediction code giving probability of each unit's possible HP values.
...
Code is not currently built by default, as it's not used anywhere yet.
The tools/ code can be used to check the correctness of the algorithm,
esp for any future modifications. Handles slow, drain, berserk,
firststrike and swarm.
2006-01-17 13:22:12 +00:00