Python Used as Modding Language for Battlefield 2 41
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.
Opensource tools (Score:5, Interesting)
Modifications .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)
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++
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.
Great News (Score:2, Interesting)
Python Ideal for Game Logic (Score:5, Interesting)
I'd jump at the chance to use Python as a the scripting language in a first-person shooter. The Conitec engine [conitec.net] 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. [dejobaan.com]
Re:I don't want to miss the opportunity to give pr (Score:3, Interesting)
Re:Python's too slow for gaming (Score:3, Interesting)
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.
The language doesn't matter... (Score:2, Interesting)
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.
Re:Python's too slow for gaming (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.