Things have been a little slow the last couple days in terms of doing Torque tutorials. That’s because I had an idea for something I want to try in Torque but at this point I know C++ a lot better than Torquescript so the prototype has to be made in C++.
Waaaay back in the mid to late 90s, my brothers and I had a hobby: hacking games. I had an adequate grasp of BASIC to do some fun little nonsense programs (like a Martian ATM that was deeply sarcastic and somewhat influenced by Douglas Adams) and enough Visual Basic to do some simple screen-savers. The original Dark Basic wasn’t out yet, so I was stuck knowing one version of BASIC that was graphically horribly primitive and another that was designed primarily for making boring office applications (in the last decade VB has gotten better but at the time it was about as counter-intuitive for trying to make a game as programming languages get). Anyway, my point is that making games from scratch was a huge pain at the time, so instead we found ways to mess with games already in existence.
Hex Editing is a wonderful thing. (Or it was: I haven’t done much lately) Never mind if a cheat doesn’t exist: you can make them with the PC’s practically built-in version of a Game Genie. Good ol’ MS DOS Batch files and Win 3.x .ini files could also work wonders. But if a developer leaves an unencrypted file in the game’s directory, it’s like striking gold.
One of my favorite pranks my middle brother played on me is the EGGS logo in the PC version of Virtua Cop. “What EGGS logo?” you say. It’s the SEGA logo loaded into MS Paint and vandalized. Because it’s just a plain bitmap, just sitting there in the directory, it was simple for him to change. I was stunned for a few seconds and then very proud. I hadn’t even looked in the game’s directories (that’s “folders” to you young ‘uns)!
Anyway, this is a long winded way of getting around to Dungeon Keeper. The original Dungeon Keeper is nothing less that an open vein of purest mithril, with creature.txt shining brightly for those who bother to look. Let me show you a little of what’s in the file:
General Game Values
Description Number Value
GAME_GOLD_PER_GOLD_BLOCK 0 1024
GAME_POT_OF_GOLD_HOLDS 1 250
That’s a straight cut & paste. The file is actually an Excel spreadsheet, but saved in plain text. If you open it in Excel all of the cells align and you can read it better. But if you don’t have Excel, or don’t realize initially that it is a spreadsheet, it also works fine in Notepad. No arcane hex editing required.
The creature.txt file enables you to change pretty much all of the numerical values used in the game. You can make imps have no cost to summon, make them as tough as the Horned Reaper, immune to lava, and use lightning bolts as their normal attack. You can make the Horned Reaper really mellow. You can make slaps deal huge amounts or no damage at all (or make it cost gold for every slap if you really want). You can make dungeon tiles impervious to vandalism. You can do pretty much anything that’s possible by just tweaking numbers.
Whatever game we choose to make, I want to have the same capability from week 2: have Torque read all numerical data from a simple text file that anyone on the team (or any player when the game is released) can tweak and experiment to see what might make the game better. Right now, I’m working on the C++ prototype, but when that’s working I’ll try to port it to Torquescript. Then, if I still have time before the semester starts, I’ll mess around with the example card games that come with T2D.