Slashdot Mirror


Game Scripting With Python

P. Staurou writes "There is very interesting article about game scripting with Python over at Sylphis3d.com. It talks about how game engines should be structured as operating systems with actors being the processes. The proposed design is based on a special version of Python called Stackless and already successfully implemented in their own Sylphis3D game engine."

7 of 186 comments (clear)

  1. Syphilis in 3D? by groovemaneuver · · Score: 5, Funny

    Ewww!!!! Oh I misread... Whoops...

  2. Civilization 4... by Fortress · · Score: 5, Interesting

    ..supposedly will use Python scripts for most of the AI behaviour. It's supposedly the most easily and thoroughly modifiable game ever. I can't wait to see what the community produces. In fact, I'd say that the developers will incorporate user-generated content in the official patch system.

  3. Python is nice but consider LUA for game scripting by Anonymous Coward · · Score: 5, Insightful

    The game company I work for does cross platform console games for XBox, PS2 and GameCube. We use LUA as a scripting language. LUA is a small clean language with simple but powerful syntax. The run time memory footprint is pretty small (~100 kB) which is great when your writing your game for a console with less than 32MB available.

    If you are thinking about scripting languages for your games consider LUA. http://www.lua.org/

  4. EVE Online by Dr_Barnowl · · Score: 5, Informative

    ... is already using stackless Python, so it's a proven, successful multiplayer online game platform. EVE has upwards of 10,000 players most of the time.

  5. Not limited to Python. by indy · · Score: 5, Interesting

    TFA is talking about the use of coroutines to avoid programming state machines. Coroutines are really very useful, as they allow code as simple as the following:

    void Airplane::flyLooping() {
        levelOut();
        centerStick();
        pullElevator();
        while(!flyingUpsideDown())
            yield();
        while(flyingUpsideDown())
            yield();
        centerStick();
        levelOut();
    }
    The code, which is supposed to make an airplane actor fly a looping maneuvre, is much simpler than the corresponding state machine code, which would consist of four states. I used this sort of programming in my hobby flightsim project Thunder&Lightning using this C++ implementation of coroutines. There is also Io, an embeddable language with a very small footprint which is easy to learn and nice to program with and which supports coroutines as well (actors in Io's terminology).
  6. Re:Console Games? by UserGoogol · · Score: 5, Funny

    Sylphius uses Python. Python is Open Source, as is Linux. Linux was programmed by Linus Torvalds. Linus Torvalds was in Revolution OS which was narrated by Susan Egan, who was in Death and Texas with Charles Durning, who was in the made-for-TV version of Mister Roberts with Kevin Bacon .

    --
    "Never attribute to malice that which can be adequately explained by stupidity." -- Hanlon's Razor
  7. Ogre 3D engine and Python by gsherman · · Score: 5, Interesting

    Last weekend I pulled in the latest Python (2.4.1) for Winblows, the Ogre 3D engine binary , and PyOgre (http://www.ogre3d.org/index.php?option=com_remosi tory&Itemid=57&func=selectcat&cat=1).

    This combo rocks fairly hard.

    Run a 27 line Python script, and boom, you're looking at a working 3d engine. It's fast, too, probably because the heavy lifting is being done in the Ogre runtime binaries.

    For developing and prototyping, there's no time wasted (re)compiling changes; tweak some Python and away you go. And there's no reason the code or scene objects can't be tweaked while the engine is running, perhaps by means of a some sort of IPC, whether it's via a telnet/socket-type connection, or an XML-RPC daemon process, or whatever. Some people have even worked up demo on-screen overlays akin to the Quake console.

    I'm looking forward to the day I can interact with a 3D environment and manipulate 3D objects with the same immediacy I'm accustomed to manipulating data in the Python interactive prompt. Heck, I'd even learn Smalltalk if they plugged Ogre directly into something like Squeak. But for now, Python + Ogre (PyOgre) seems to show a lot of promise.