G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

Is it possible to create complex rg *without* implementing scripting
language (for levels, monsters, items) and parsers, just by keeping
*order* in code?
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

At Mon, 12 Sep 2005 09:37:30 +0200,
Kolczuga wrote:

> Is it possible to create complex rg *without* implementing scripting
> language (for levels, monsters, items) and parsers, just by keeping
> *order* in code?

Yes. For reference, look at most of popular roguelike games in their
earlier stages.

--
Radomir `The Sheep' Dopieralski @**@_
:) ) 3 Snap!
. . . ..v.vVvVVvVvv.v.. .
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

Radomir 'The Sheep' Dopieralski wrote:
> At Mon, 12 Sep 2005 09:37:30 +0200,
> Kolczuga wrote:
>
> > Is it possible to create complex rg *without* implementing scripting
> > language (for levels, monsters, items) and parsers, just by keeping
> > *order* in code?
>
> Yes. For reference, look at most of popular roguelike games in their
> earlier stages.
>

Is there a good reference for someone who doesn't know anything about
using scripts in games and would like to learn about it?
An article or a small roguelike which shows it nicely...
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

At 12 Sep 2005 02:00:38 -0700,
Michal Brzozowski wrote:

>
> Radomir 'The Sheep' Dopieralski wrote:
>> At Mon, 12 Sep 2005 09:37:30 +0200,
>> Kolczuga wrote:
>> > Is it possible to create complex rg *without* implementing scripting
>> > language (for levels, monsters, items) and parsers, just by keeping
>> > *order* in code?
>> Yes. For reference, look at most of popular roguelike games in their
>> earlier stages.
> Is there a good reference for someone who doesn't know anything about
> using scripts in games and would like to learn about it?
> An article or a small roguelike which shows it nicely...

AFAIR there are several articles about embedding scripts on python.org

--
Radomir `The Sheep' Dopieralski @**@_
(`') 3 Grrr!
. . . ..v.vVvVVvVvv.v.. .
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

"Michal Brzozowski" <rusolis@poczta.fm> schrieb im Newsbeitrag
news:1126515638.440517.269680@g43g2000cwa.googlegroups.com...
>
> Radomir 'The Sheep' Dopieralski wrote:
>> At Mon, 12 Sep 2005 09:37:30 +0200,
>> Kolczuga wrote:
>>
>> > Is it possible to create complex rg *without* implementing scripting
>> > language (for levels, monsters, items) and parsers, just by keeping
>> > *order* in code?
>>
>> Yes. For reference, look at most of popular roguelike games in their
>> earlier stages.
>>
>
> Is there a good reference for someone who doesn't know anything about
> using scripts in games and would like to learn about it?
> An article or a small roguelike which shows it nicely...

I learned the basics of Lua scripting from these introductional articles:

http://www.gamedev.net/reference/articles/article1932.asp
http://www.linux-magazine.com/issue/45/Lua_Programming.pdf

They are really easy to understand even for non-professionals like me.

I assumed that you use C or C++. If you use something unusual these articles
are quite useless. For example if you use Java you probably want to look
into JVM scripting languages like Groovy or even use Java itself for
scripting..


copx
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

"Michal Brzozowski" <rusolis@poczta.fm> wrote in
news:1126515638.440517.269680@g43g2000cwa.googlegroups.com:
> Is there a good reference for someone who doesn't know anything about
> using scripts in games and would like to learn about it?
> An article or a small roguelike which shows it nicely...

You could take a look at ZZT; it's a rather famous game with some roguelike
features. The most interesting feature that it has is the vast collection
of players who modify the game and write scripts for it. Therefore, I think
its scripting language is well worth looking at.

http://zzt.the-underdogs.org/
http://zzt.the-underdogs.org/?p=zoh

The language is very simple and yet clever, I think. It abstracts the
control of creatures in a way that seems so hard to do in the
implementation language, i.e. the scripts run simultaneously without having
to explicitly give up control at the end of every turn.

In usual roguelike programming it is tempting to program a creature only
within a single turn and then start fresh for the next turn, perhaps with
some complex system of states to provide some kind of memory of what this
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.

The language is also designed with the unusual notion that it can be
interrupted at any time by external events. Execution changes without
warning from wherever it is in a script to an event handler without any way
of returning. For general purpose languages, this would be intolerable, but
for guiding a monster's activities, it seems to work nicely.

The language itself is needlessly simple, though, so as I am creating my
version of it for my roguelike, I will be adding additional features that
can be used to make complex behaviors easier to script, but I will keep the
ideals and the simplicity intact by making most of the new features
optional and intuitive.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

At Mon, 12 Sep 2005 21:00:15 GMT,
Brendan Guild wrote:

> "Michal Brzozowski" <rusolis@poczta.fm> wrote in
> news:1126515638.440517.269680@g43g2000cwa.googlegroups.com:
> The language is very simple and yet clever, I think. It abstracts the
> control of creatures in a way that seems so hard to do in the
> implementation language, i.e. the scripts run simultaneously without having
> to explicitly give up control at the end of every turn.
>
> In usual roguelike programming it is tempting to program a creature only
> within a single turn and then start fresh for the next turn, perhaps with
> some complex system of states to provide some kind of memory of what this
> 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... :)

--
Radomir `The Sheep' Dopieralski @**@_
($s) 3 Ching!
. . . ..v.vVvVVvVvv.v.. .
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

Radomir 'The Sheep' Dopieralski wrote:

> At Mon, 12 Sep 2005 21:00:15 GMT,
> Brendan Guild wrote:
>
>> "Michal Brzozowski" <rusolis@poczta.fm> wrote in
>> news:1126515638.440517.269680@g43g2000cwa.googlegroups.com:
>> The language is very simple and yet clever, I think. It abstracts the
>> control of creatures in a way that seems so hard to do in the
>> implementation language, i.e. the scripts run simultaneously without
>> having to explicitly give up control at the end of every turn.
>>
>> In usual roguelike programming it is tempting to program a creature only
>> within a single turn and then start fresh for the next turn, perhaps with
>> some complex system of states to provide some kind of memory of what this
>> 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... :)
>

Even better, use the module py.magic.greenlet you can find here :
http://codespeak.net/py/current/doc/
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

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.

--
Risto Saarelma
 
G

Guest

Guest
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.. .
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.development (More info?)

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.
>

There that for Python too :
http://codespeak.net/py/current/doc/greenlet.html

And I seem to recall that you can indeed pickle them :)