Jump to content
Sign in to follow this  
BMA

Wondering How Spiderweb Games Compile

Recommended Posts

How is it that every SW game is so open that you can modify the scripts (especially the creature behaviour files) ? Are the scripts compiled just in time, before the game executes and if so how ?

Share this post


Link to post
Share on other sites

In BoA, at least, the scripts load as you get to each area, so a town script loads when you enter the town, and comparable things happen with the other scripts (the scenario script is loaded when you enter the scenario).

 

I believe that the script is compiled when it is loaded.

Share this post


Link to post
Share on other sites

Older SW games have the data stored as binary into a .dat file, with some stuff hard-coded iirc. However, the newer games also use an avernumscript-like format for some things.

 

The game then acts like a scripting engine, loading the scripts as it needs to and compiling them to bytecode in real-time. This is how most script languages (Python, PHP, prolly perl, etc) work.

Share this post


Link to post
Share on other sites

But what about the extra time taken in compiling each each script each time, in games like Geneforge where the script isn't normally expected to change between program executions ? I don't understand why Jeff took the trouble of creating a whole customized compiler (assuming that is difficult to do) unless he wanted players to understand what is actually going on, and create script-cheaters and AI-variations for his games (and that's improbable).

 

I was reading Scripting language and Softcoding. I understand that none of this actually matters to an end user, but I'm curious about why Jeff's doing things this way.

Share this post


Link to post
Share on other sites

Post-BoA, most stuff is scripted, but a few things are still written into the program itself. Shop inventories for starters. (In Geneforge 5, Special Items and Quests are hard-coded too.)

What is Jeff doing? He may not mind script cheaters at all, I have never seen any evidence that he minds.

Share this post


Link to post
Share on other sites

But what about the extra time taken in compiling each each script each time, in games like Geneforge where the script isn't normally expected to change between program executions ? I don't understand why Jeff took the trouble of creating a whole customized compiler (assuming that is difficult to do) unless he wanted players to understand what is actually going on, and create script-cheaters and AI-variations for his games (and that's improbable).

 

The advantage of using a custom scripting language is that it can be designed specifically to make it easy to do the kinds of task you want to do for a specific project, rather than wrestling with the complexity of a full general-purpose programming language. It also makes it easy to make small changes to the game during design and testing without having to recompile it every time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×