URL:
<http://gna.org/patch/?967>
Summary: for python AIs: wraps raise_user_interact() and
adds a function to test a possible move.
Project: Battle for Wesnoth
Submitted by: mesilliac
Submitted on: Tuesday 02/05/2008 at 00:10
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Wrapping raise_user_interact() allows python AIs to avoid locking up the UI
if they spend a long time calculating something without running any wesnoth
functions.
For the test_move function I added, I mainly just copied some code from
move_unit, and from attack_statistics for the temporary unit placement. It
takes two locations: the location to move from and the location to move to;
and returns the wrapped enemy srcdst and dstsrc move_maps that would apply if
the unit at 'from' were to move there.
It's necessary if the AI wants to account properly for its changed zone of
control from a potential move.
I haven't really written much C++ before, so I might have done something
stupid... but I have been running my AI fine with the patch applied, and have
tested these as much as I can.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tuesday 02/05/2008 at 00:10 Name: ai_python.diff Size: 4kB By:
mesilliac
patch to ai_python.cpp and ai_python.hpp to add raise_user_interface() and
test_move()
<http://gna.org/patch/download.php?file_id=3736>
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?967>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs