Jump to content


Wondering How Spiderweb Games Compile

Compilation

  • Please log in to reply
6 replies to this topic
BMA BMA

Sorcerer

  • Member
    • Member ID: 5,939
  • 663 posts

Posted 06 February 2014 - 10:02 AM #1 Wondering How Spiderweb Games Compile

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 ?

Kelandon Kelandon

!!!

  • Global Moderator
    • Member ID: 2,682
  • 9,815 posts

Posted 06 February 2014 - 10:20 AM #2 Wondering How Spiderweb Games Compile

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.
VCH: I believe we settled this way back when: Kelandon was the most attractive.
SoT: You'd be happy, too, if you were such a clever spider.
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!

sylae sylae

Wisebottom

  • Global Moderator
    • Member ID: 5,482
  • 3,336 posts
  • LocationPortland, Oregon, United States

Posted 06 February 2014 - 10:23 AM #3 Wondering How Spiderweb Games Compile

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.

BMA BMA

Sorcerer

  • Member
    • Member ID: 5,939
  • 663 posts

Posted 07 February 2014 - 03:26 AM #4 Wondering How Spiderweb Games Compile

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.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 07 February 2014 - 03:53 AM #5 Wondering How Spiderweb Games Compile

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.

Lilith Lilith

in before the apocalypse

  • Global Moderator
    • Member ID: 669
  • 19,845 posts
  • LocationMelbourne, Australia

Posted 08 February 2014 - 08:03 PM #6 Wondering How Spiderweb Games Compile

View PostBMA, on 07 February 2014 - 03:26 AM, said:

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.

BMA BMA

Sorcerer

  • Member
    • Member ID: 5,939
  • 663 posts

Posted 09 February 2014 - 07:05 AM #7 Wondering How Spiderweb Games Compile

That's neat, I didn't think of that.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users