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.
Python's too slow for gaming (Score:1, Insightful)
Re:Python's too slow for gaming (Score:2)
The speed in games is not influenced much by the language that the high level logic is written in.
Re:Python's too slow for gaming (Score:5, Insightful)
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...
Re:Python's too slow for gaming (Score:4, Informative)
Yeah, that's one of Python's shortcomings I think. There is the 'rexec' module which is meant to do this, but it apparently it has unspecified holes in it. The 'pickle' module has similar flaws. You could do some neat RPC stuff passing around picked objects, but only at the risk of introducing security holes. Oh well.
Re:Python's too slow for gaming (Score:2)
Hacking it in is very difficult, and none of the python attempts I've seen actually work.
Just think how many languages which have been designed with that in mind end up with bugs/flaws that result in holes - it's hard to get right when it is designed in from the start...
Re:Python's too slow for gaming (Score:2)
Might not be the quickest, but so what?
Re:Python's too slow for gaming (Score:1)
Re:Python's too slow for gaming (Score:5, Informative)
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.
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 versio
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 allowi
Homeworld 2 (Score:2)
I don't want to miss the opportunity to give propz (Score:3, Informative)
Desert Combat - http://www.desertcombat.com/
Battlefield 1918 - http://www.bf1918.com/
Forgotten Hope - http://forgottenhope.bf1942files.com/main.html
These three mods (and many more out there) took BF42 to new places, especially DC. Glad to hear that they are giving modders even more tools with BF2 - I can't mod or skin my way out of a paper bag, but I am grateful to those who can and give their talents to their community gratis.
Re:I don't want to miss the opportunity to give pr (Score:2)
Peopel shooting at eachother from trenches 100 yards away from eachother or so?
That sounds as dumb as BF 1860.
Marching in formation, shooting eachother in nicely formed colomns.
Re:I don't want to miss the opportunity to give pr (Score:3, Interesting)
Re:I don't want to miss the opportunity to give pr (Score:2)
Re:I don't want to miss the opportunity to give pr (Score:1)
so.. (Score:2, Funny)
Ok... Is it safe to assume that the _whole_ game is coded in Python then?
.
Re:so.. (Score:1)
Re:so.. (Score:5, Insightful)
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.
Python/C API (Score:2)
Libraries like Boost::Python and tools like Pyrex help a *lot* when trying to make Python/C integration a bit less excruciating.
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.
Troika used python for the scripting in Bloodlines (Score:3, Informative)
Vampire: Bloodlines [vampirebloodlines.com]
Source engine feature list [valvesoftware.com]
Re:Troika used python for the scripting in Bloodli (Score:1)
It is a very impressive game and I enjoy playing it a lot (even though it could've done with some more time for bug testing).
I just wanted to let people know that Battlefield 2 wasn't the first big game that used Python for its scripting.
EVE Online (Score:5, Informative)
Good choice. (Score:4, Informative)
Python intergrates well with C/C++. Amazingly well, actually, and I think any C/C++ coder should go through the tutorial [python.org], and see what python can do for you. Yes, I know other enviroments promised the same thing before, but Python delivers.
Python is powerful, but easy to learn. Personally, I think we should be teaching kids Python in elementary school. And if it's your first language, you won't get all hung up on the whitespace thing.
Anyone coding an app that could benifit from a scripting language needs to take a look at python.
Re:Good choice. (Score:1)
Re:Good choice. (Score:1)
Re:Good choice. (Score:2)
Sadly, SWIG breaks for more complicated C++ stuff, so you're better off using boost::python (http://www.boost.com). Very nice.
Great News (Score:2, Interesting)
CIV 4 is also using Python (Score:3, Informative)
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]
TOOWTDI (Score:1)
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.
We've heard that one before (Score:2)