- Added a command-line option to invoke wesnoth's built-in python
interpreter in interactive mode.
- Exposed wesnoth's random number generator to python.
...move into separate cpp/hpp pair. The code under src/ was modified
mainly using a global search-and-replace. This change allows reducing
code dependencies and gets rid of inner-class confusion (parts of the
code had to use "location" when referring to gamemap::location, it is
now consistent across the codebase.)
Revert relevant files to revision 2008-09-16T17:45:50Z!lari.nieminen@iki.fi. This backs out suokko's
changes to the AI between 2008-09-16 and 2008-09-18. Three bug fixes
by other people also get thrown out. These are:
mordante's 2008-09-18T19:42:07Z!koraq@xs4all.nl fix for a compiler warning
soliton's 2008-09-16T20:07:54Z!soliton@wesnoth.org fix for a warning.
dragonking's 2008-09-16T18:41:30Z!b.waresiak@gmail.com fix for bug #11916.
I'll try to do more merges forward before we ship, but at least
these changes get the blocker out of the way.
File Omitted revs (*= not suokko's)
--------------------- -----------------------------------------------
ai.hpp 2006-01-08T19:52:44Z!me@jwbjerk.com
2008-09-18T14:30:42Z!paniemin@cc.hut.fi
2008-09-16T19:26:36Z!paniemin@cc.hut.fi
2008-09-16T18:14:54Z!paniemin@cc.hut.fi
ai.cpp 2006-01-08T05:21:35Z!me@jwbjerk.com
2008-09-17T00:33:01Z!paniemin@cc.hut.fi
2008-09-16T20:00:03Z!paniemin@cc.hut.fi
2008-09-16T19:26:36Z!paniemin@cc.hut.fi
2008-09-16T18:14:54Z!paniemin@cc.hut.fi
ai_attack.cpp 2006-01-08T19:57:59Z!me@jwbjerk.com
2008-09-18T19:42:07Z!koraq@xs4all.nl*
2008-09-18T14:30:42Z!paniemin@cc.hut.fi
2008-09-17T00:33:01Z!paniemin@cc.hut.fi
ai_interface.hpp 2006-01-07T18:11:36Z!n1401e@hotmail.com
ai_move.cpp 2006-01-08T19:57:59Z!me@jwbjerk.com
2008-09-18T14:30:42Z!paniemin@cc.hut.fi
2008-09-17T10:01:20Z!paniemin@cc.hut.fi
2008-09-17T00:33:01Z!paniemin@cc.hut.fi
2008-09-16T20:00:03Z!paniemin@cc.hut.fi
2008-09-16T18:14:54Z!paniemin@cc.hut.fi
ai_python.cpp 2006-01-08T05:21:35Z!me@jwbjerk.com
2008-09-13T21:59:45Z!paniemin@cc.hut.fi
ai_village.cpp 2006-01-08T05:21:35Z!me@jwbjerk.com
2008-09-17T00:33:01Z!paniemin@cc.hut.fi
2008-09-16T18:14:54Z!paniemin@cc.hut.fi
formula_ai.hpp 2006-01-07T18:11:36Z!n1401e@hotmail.com
formula_ai.cpp 2006-01-07T19:31:27Z!crazy-ivanovic@gmx.net*
2008-09-16T19:26:36Z!paniemin@cc.hut.fi
2008-09-16T18:41:30Z!b.waresiak@gmail.com*
* Improved default the attack selection of default AI
* Improved movement target selection
* Allowed leader to retreat from dangerous location
* Tried to teach AI to understand poison and leadership in attack
selection but result wasn't 100% success
* Fixed some minor bugs found from AI
...as it was far too confusing to properly maintain GIL
lock-strategy. This should be last major round of GIL-lock
optimization and bug fixes. Not every corner case has been tested but
thus far, things look real stable.
...which does not use Py_RETURN_TRUE or Py_RETURN_FALSE. This means
the function does not return a boolean value. A doxygen todo comment
was added to revisist this at a later time.
Modernized some code to comply with newer (python 2.4+) C-API
interfaces. Some wesnoth functions now return bool values, as
documented, rather than ints. A new version of bruteforce has been
added which shows unsafe AI. This AI runs 2x-14x faster than the stock
bruteforce because of memoize pattern and psyco. The AI is only
available if unsafe AI execution is enabled (disable option).
If the key is not found, the default value is returned. set_variable
exception handling has been fixed to return an exception in the
current call frame.
Many wesnoth module functions now release the python GIL when it is
both safe to do so and the function call takes long enough where it
also makes sense. A new global boolean variable, 'restricted' is now
set before the user AI script is invoked. This variable indicates if
it is running inside of a restricted python environment or not. A new
class of unrestricted scripts are now listed. Previously only scripts
which have '#!WPY' at the top are allowed. If only allow safe python
scripts is disabled, scripts which start with #!UNSAFE_WPY are also
shown to users. This allows AI authors to specifically target either a
restricted or unrestricted environment. New "system" class attributes
are exposed in the restricted environment. These include; '__call__',
'__copy__', '__deepcopy__', '__doc__', '__name__', '__repr__' and
'__str__', in addition to the old __init__ method.
could not be marshalled, an exception was throw but not indicated
by the return value. This confused the exception stack causing
the stack to unwind - ignoring the existing stack frame. This
essentially prevented the exception from being caught unless
wrapped in double try/except blocks.
- get rid of redundant functionality
- make the unit_type_data interface more easily accessible
- reduce the public interface of unit_type_data
- rename unit_type_factory to unit_type_map_wrapper
- add a whole lot of "const"
I silenced a gcc 4.3 warning by adding parens around a shift. Based on what
I see in the code it looks like the parens really were needed and that
previously it was doing the wrong thing.