Slashdot Mirror


Python Used as Modding Language for Battlefield 2

Dutch Dopey writes "In an interview with Lars Gustavsson of DICE, it was mentioned that Battlefield 2's modding tools are going to be delivered with the game, and that the tools are the same ones used to develop the game. The modding language in use is Python, and will support all aspects of the language.

6 of 41 comments (clear)

  1. Re:Python's too slow for gaming by sholden · · Score: 4, Insightful

    That hasn't stopped Troika Games using it for Greyhawk or Irrational using it for Freedom Force. Not for the entire game engine but as the level scripting engine. The bit that actually matters in the game, the bit which makes the *fun* stuff rather than the pretty stuff.

    And of course there's BaseGolf which is completely implemented in python.

    The problem I see with using python as a modding language is that it makes it very difficult to enforce safety in mods. It'd be nice if the modding language was sandboxed so that you could download a mod and know it won't format your hard drive.

    But it makes sense to use an existing language engine instead of creating yet another scripting language for the level designers to use. And python is much easier for non-programmers to write in than lua, in my opinion anyway...

  2. Opensource tools by petteri_666 · · Score: 5, Interesting
    from the article

    Modifications
    FZ: When Valve released Half-Life 2 last year criticism quickly arose due to the fact that they assumed people wanting to do modifications would have access to the commercial compiler and IDE Microsoft Visual C++ .NET 2003, which costs several hundreds of euros. What tools will be required to fully modify Battlefield 2 in addition to the tools that DICE will provide?(Steven Svensson)

    LG: We have greatly enhanced our support for modders by giving the option to create modifications through the script language Python. This means that there will be no requirement to have access to Microsoft Visual C++ as you mentiond in your question.

    This is perfect use for python language. Nice to see this kind of solution in a commercial game.

  3. EVE Online by Winterblink · · Score: 4, Informative

    The developers of EVE Online utilize Python for their game logic. Linkage

    --
    "I'm a leaf on the wind. Watch how I soar."
    -Hoban Washburn
  4. Re:so.. by Jerf · · Score: 4, Insightful

    Ok... Is it safe to assume that the _whole_ game is coded in Python then?

    Not in the slightest. Python integrates well with C and C++. (Some other languages do it without somewhat less boilerplate in the integration code, but Python is one of the languages that basically integrates 100% feasibly.)

    In fact, quite the opposite; it's safe to assume only the high level is in Python. That's Standard Operating Procedure for high-performance code in the Python world.

  5. Re:Python's too slow for gaming by snorklewacker · · Score: 4, Informative

    The holes in rexec have been acknowledged to the point where importing the module throws an error about its complete lack of actual security. Expect it to be removed entirely in some future version. Pickle is importing arbitrary code, which can do arbitrary things. There really isn't a sensible way to protect against this in a dynamic environment.

    It's not like lua lacks file and system access primitives either, though those tend to be easier to hack out if necessary (which it usually isn't, since it's the game logic that's written in lua, not third party mode). The appeal of lua is the smaller footprint.

    --
    I am no longer wasting my time with slashdot
  6. Python Ideal for Game Logic by MiceHead · · Score: 4, Interesting

    We've used Python in a few projects, from a relatively simple action/puzzle game, TapDown, to a larger, multi-user game. As jericho4.0 points out, it binds well with C, so for both projects, we wrote C/Python binders for the Fastgraph graphics library and the BASS audio library. I find that it's much easier to prototype in Python than in C, so, for example, when we wanted to implement a modified Perlin Noise algorithm for the larger project, we modelled it in Python first, then optimized the processor-consuming bits by implementing them in C.

    I'd jump at the chance to use Python as a the scripting language in a first-person shooter. The Conitec engine uses something called C-Script, which is nice, but not nearly as sexy as Python is. Some drawbacks come to mind, (just off the top of my head, it may be tricky to have an entity sit around in the middle of its script), but its ease-of-use, combined with the simplicity of dropping down to C for the lower-level stuff makes it very appealing for all sorts of games.
    _________________________________________________
    Inago Rage - Create, fight, and fly in a first-person shooter.