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.
For mods, it's OK, but it's simply too high a level code for the main game. Battlefield already runs too slowly on my computer (UT2k4 works 10x better). I don't want it going even slower!
43rd Law of Computing:
Anything that can go wr
fortune: Segmentation violation -- Core Dumped
To those who made BF42 so much fun:
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.
"As the intrepid kobold companion continues his journey, he begins to wonder... if priests raises dead, why anybody die?
BF 1918?
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.
Pretty Pictures!
.
Ok... Is it safe to assume that the _whole_ game is coded in Python then?
.
A horse can't be sick, you know, even if he wants to.
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.
It uses the Source engine (the Half-Life 2 one).
Vampire: Bloodlines
Source engine feature list
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
Python intergrates well with C/C++. Amazingly well, actually, and I think any C/C++ coder should go through the tutorial, 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.
"A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
Did you even read the pages you linked to? Troika added a Python interpreter to the engine.... along with cloth simulation, a scriptable particle simulator, a dialog system, melee combat, and hundreds of other things that an RPG requires that a vanilla FPS doesn't.
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.
That sounds as dumb as BF 1860.
Marching in formation, shooting eachother in nicely formed colomns.
More like 1680, not 1860. They didn't exactly line up in formations during the civil war.
Sid Meirs Civ 4 will also be using python and xml for its scripting language.
Hummn. I seem to have implied that the python interpreter is a feature of the Source engine and not something Troika added themselves. Sorry.
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.
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.
We're indie. We're working on our 14th game.
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?
So there will be one single mod, ever?
Marxist evolution is just N generations away!
...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.
Not about the python, but about the modding tools, they kept promising it for Battlefield 1 and people waited and waited and waited and waited and waited and waited and waited and waited and waited and waited ...
If Google really cared they would fix Android Chrome to reflow text, instead of discriminating
Buy Steampunk Clothing Online!
Homeworld 2 uses LUA as well for modding, and in fact for all config files. I prefer it to Python as the whole whitespace thing in Python drives me crazy.
They given you what basically amounts to a free game and now they dare trying to make some money off their talent? Shame on them! Way to go on the name calling. Don't stop the rage. PS: What the hell would you need DC for in BF2? Seeing as BF2 spends most of its time in the desert, doing combat.
___
No power in the 'verse can stop me
Well, Python integrates tolerably with C and fairly poorly with C++. It's clumsy, verbose, and annoying, but the end result does work well.
Libraries like Boost::Python and tools like Pyrex help a *lot* when trying to make Python/C integration a bit less excruciating.