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.

7 of 41 comments (clear)

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

  2. Great News by boeserjavamann · · Score: 2, Interesting

    I really like Python, its a well designed language (ruby would be the best non-typesafe language, but the syntax sucks a little in the eyes of a java freak :)) and its increasing popularity (check http://www.tiobe.com/tpci.htm) is surely a good point for using it as a modding language.

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

  4. Re:I don't want to miss the opportunity to give pr by Deekin_Scalesinger · · Score: 2, Interesting

    It's more like you run up and light a fuse, then see if a cannonball explodes 5 minutes later. Nah - it's not as bad as that :) They have early versions of tanks and armored cars, trench combat, flyable zepplins and biplanes, etc. Yeah it is indeed an adjustment from the normal "set plasma cannon to 50 megawatt range" that most FPS give you, but it balance out when you realize the other guy as equipment as arachic as you. Moreso, serious war history buffs spend a lot of time critiquing the accuracy of layout of this vehicle or that, which some people get into...

    --
    "As the intrepid kobold companion continues his journey, he begins to wonder... if priests raises dead, why anybody die?
  5. Re:Python's too slow for gaming by Chyeld · · Score: 2, Interesting

    Do what Blizzard did with LUA and only implement the core functions and libraries you consider 'safe' and leave the others out.

    Of course, the scope of a mod for a full game would be greater than the scope of just a quick add-on to the UI to keep track of the number of copper bars you are carrying around, but there are still limitations to what you can specificly expect a mod to use. How many mods can legitimately claim a need to be able to write to files outside the game's own folder? Implement your version to be automaticly 'jailed' to that folder. How many times, legitimately, can a mod claim to call an outside program. Remove the ability to do that. etc. ad nausium.

  6. The language doesn't matter... by Cap'n+Steve · · Score: 2, Interesting

    ...it's the documentation that's important. Look at all the great stuff made by the bf1942 community, and then realize that until the release of Battlecraft 42 (which was actually created by a modder, who was then hired by DICE, which delayed his tool for months), there was absolutely no help from the developers.

    If you read some of the first posts on the modding forums, it's mainly people trying to figure out the format of the level archives and then write a program to extract them.

  7. Re:Python's too slow for gaming by thedustbustr · · Score: 2, Interesting

    The builtin modules (c modules created by the interpreter) are enough to fsck up a computer (pun intended). This is hackable, of course (I heard a rumor that Zope has its own custom sandboxed python interpreter, but for some reason you can't use it without the rest of zope?), but beyond the scope of most projects (if security is a concern, I've heard that lua and javascript sandbox quite easily).

    A hackish way to implement security in python is to check every untrusted line with a custom parser, not allowing anything to execute certain builtins, but this is very undesirable - how much of a pain would it be to disallow file opening only for files outside of the root folder?

    Enough rambling. It would be interesting to see how Freedom Force et. al. handled untrusted python code... maybe they HAD to roll their own interpreter.

    --
    This sig is false.