Archived from groups: rec.games.roguelike.development (
More info?)
At Sun, 18 Sep 2005 16:08:16 +0000 (UTC),
Risto Saarelma wrote:
> On 2005-09-12, Radomir 'The Sheep' Dopieralski <thesheep@sheep.prv.pl> wrote:
>>> creature was doing just a moment ago. But with a scripting language like
>>> this, you can explicitly tell a monster what to do without caring how many
>>> turns it will take to do it.
>>
>> Seems like you could use 'yield' in python...
>
> Python and Lua currently indeed have a yield, which allows writing nice
> scripts that unfold over time as described. But the big problem with
> these is that the continuation objects they produce cannot, as far as I
> know, be easily serialized. And that's exactly what you want in a
> roguelike. When the player saves, the script state of every active
> entity must be saved, and if you can't save the state of the yielded
> scripts, you basically lose either the ability to use yield for
> controlling any game logic or to save the game whenever you want.
>
> The crudest solution would be to only allow the game in special
> situations where there are no active entities around, like between
> levels. This is a very bad solution, as the player should be able to
> save to suspend the game at any time even in permadeath games. Still,
> limited save opportunities are used in almost all console games.
>
> Another solution would be to hack the scripting language so that it does
> allow serializing continuations. Maybe this could be done with Stackless
> Python. The people who scripted EVE Online MMORPG with Stackless might
> know something about this.
>
> A third solution is to make your own scripting language that supports
> serializable continuations. Tim Sweeney did this with UnrealScript.
> Another game-specific feature in UnrealScript is explicit support for
> state machines. Both continuations and state machines built in a script
> are probably ideas worth looking into for roguelike scripting as well.
Another option is to not use yield, but write your own continuation
object and use it instead. Python gives you access to all the variables,
so if you manage to take care about the calling stack...
--
Radomir `The Sheep' Dopieralski @**@_
(@a) 3 Be?
. . . ..v.vVvVVvVvv.v.. .