URL:
<http://gna.org/bugs/?13520>
Summary: Possible pathfinding improvement in
unit::movement_cost
Project: Battle for Wesnoth
Submitted by: crab
Submitted on: Wednesday 05/13/2009 at 23:38
Category: Feature Request
Severity: 4 - Important
Priority: 5 - Normal
Item Group: Units
Status: None
Privacy: Public
Assigned to: crab
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: trunk
Operating System: any
_______________________________________________________
Details:
see ftp://ftp.terraninfo.net/wesnoth/ai_2009may13_r35622.jpg
note unit::movement_cost:
========
int unit::movement_cost(const t_translation::t_terrain terrain) const
{
const int res = movement_cost_internal(terrain, 0);
if(utils::string_bool(get_state("slowed"))) {
return res*2;
}
return res;
}
=======
Line if(utils::string_bool(get_state("slowed"))) costs us 10% of total AI
turn time. The problem is that A* cost calculator is not *stateful* enough -
we calculate movement cost for the same unit, a lot, but the poisoned state
of the unit doesn't change. So, it makes sense to cache the 'slow-or-not'
state of unit.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?13520>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs