Archived

This topic is now archived and is closed to further replies.

HarryW

Python

Recommended Posts

Hi all. I just found out that Severance: Blade of Darkness (that''s the European title I think) uses Python for its script files. I was just wondering if this is done in any other games? I was quite surprised and kind of pleased because I know some Python already. If it''s not common, why don''t other developers do it? Thanks for any info Harry.

Share this post


Link to post
Share on other sites
Vampire: The Masquerade used it as well. I would expect that over time more and more game will use it. After all is it a game company or is it a scripting language company? My own view is that unless you are going to make a scripting language that is actually better than if you used Python then you should use Python. That makes for a lot of work that really has little to do with creating a game. If all that work doesn''t give you a competitive advantage then it was just a waste of your money.

Share this post


Link to post
Share on other sites
I was thinking something vaguely similar - why develop your own scripting language when there''s a perfectly good one already around? Perhaps there is a good reason not to that I don''t yet realise.

Could you use an existing Python interpreter do you think? Or would you have to parse the code yourself as you would with a custom script language? I don''t know much about scripting engines, in case that''s a silly question.

Harry.

Share this post


Link to post
Share on other sites
You can both extend and embed Python. With a game you would both extend and embed Python. An extension is a program that can be called from a Python script. Embedding is calling a Python script from a program. Within a game you do both. When your program starts you initialize the Python runtime. That would include registering your extensions as well as creating some global variables. When some event occurs you check if a script has been assigned to the event and if so call that script. Prior to calling it you may set some variables such as a handle to the unit similar to a this pointer in a C++ program. When you call the script you either load the script into a buffer and call Python telling it to execute that buffer or you can tell it to execute a file instead. Which one depends upon how accessible you want your system to be.

Blade of Darkness seems to be somewhat of an extreme. It looks almost like they just have a game engine and everything else is scripts. I haven''t dug all that far into it so I may be wrong. If I''m not then I''m surprised that it runs as well as it does. The only problem I''ve seen in the game is the mouse being overly sensitive when moving. The combat system is amazing and a bit overwhelming, but the type of thing you would expect when the designers are able to do things like that without a programmers help. I think the graphics are excellant and overall the system seems pretty bug free which I would assume comes from letting the programmers do what they do best. I think that scripting support clearly produces better games.

I just read an article in Game Developer Mag by a person complaining about the demise of the programmer/designer. His biggest complaint was that programmers make countless small decisions that has a substantial impact on the feel of the game and thus it''s entertainment value. I feel that scripting resolves much of that problem in that the programmer isn''t forced into making a decision. It lets the programmer focus on the stability and functionality while the designer turns that technological wonder into something fun to play. Being a RPG fan with a warrior spirit games like Blade of Darkness are a delight. I always tire of the mage getting all the style and the warrior always just getting a wide choice in weapons to use in exactly the same manner. Diablo II was a step in the right direction with the warcries, but most of the style came from the weapons. Blade of Darkness took combat to a whole new level. Perhaps that has little to do with the scripting, but I suspect it would have been scaled back a great deal without the scripting.

Share this post


Link to post
Share on other sites
I see... cool Yes it seems that more or less everything except the engine in Severence is done with scripts. You said Vampire was scripted with Python too, but it doesn''t seem to have any .py files with it, I suppose that means that the code is hidden away in a file somewhere.

I haven''t played Severance yet myself, I just heard about the Python thing yesterday. I was at an interview for a job involving mainly Python, and I was doing some pair programming (they practice XP at this company) with a guy who had bought the game and had the box on his desk. He had written some of his own moves and cheats for it, apparently there is a specific .py file provided for you to code your own

Well anyway, perhaps you (or anyone) could answer my other question - why would someone not use Python for their scripts?

Harry.

Share this post


Link to post
Share on other sites
What about Guile? Anyone know if any games uses it? It''s becoming pretty standard...
Perhaps you could even use Ruby...it''d probably be a little overkill though


"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album

Share this post


Link to post
Share on other sites
The Python scripts are in data files that are in zip format. I believe the reason they did that isn''t to hide the stuff, but rather to keep from wasting space on a huge number of small files since each file takes ((size/minsize)+1)*minsize. I think the minsize with FAT32 is 4,096. With FAT16 it was up to 32K depending on the size of the partition. If I''m right about the size then 100 1k files takes 400k of space where if you pack them into one file it just takes 100K.

Share this post


Link to post
Share on other sites