Kazade / Ignition-Tools

A set of tools for ripping and converting resources from Ignition
http://blog.kazade.co.uk/2011/01/reverse-engineering-abandonware-game.html
MIT License
8 stars 3 forks source link

Additional information #1

Open Ryder17z opened 1 year ago

Ryder17z commented 1 year ago

If there is still interest in learning how this game works, I'd like to contribute some new findings.

Do you still have an interest in learning more about this game?

Kazade commented 1 year ago

Yeah definitely! I actually have a blender plugin which loads the track meshes which I should add to this repo :)

Let me know what you know 😁

Ryder17z commented 1 year ago

That's great to hear. Me and my friend originally thought this was abandoned.

For IGN_WIN and IGN_3dfx https://github.com/avast/retdec seems to give a slightly more useful output than a poorly prepared ghidra attempt. But IDA Pro 5 https://www.scummvm.org/news/20180331/ might be more suitable.

The main executable for DOS was built with https://en.wikipedia.org/wiki/DOS/4G using https://en.wikipedia.org/wiki/Watcom_C/C%2B%2B

We can examine MAINDOS.EXE using https://github.com/fonic/wcdctool

0000:0190 - 0000:0300 allowed characters for the player name?

0000:380 - ???? "Maindos" internal subroutines or such?

000D:05B0 - 000D:3D40 strings and file references

000D:52D0 - 000D:5310 strings?

000D:5340 - 000D:53C0 ghost car file references

000D:53D0 - 000F53F0 string: Select your language

000D:6930 - 000D:6AC0 file references

000D:6AC0 - 000D:6AF0 cheat codes! (has to be activated at the main menu) SLASKTRATT All Cars SURMULE All Tracks FILMJOLK Constantly Flip Screen SVINPOLE Drop Camera View Angle STRINGS Flat Opponent Cars SKUNK Only Wheels Visible BANARNE Stretch Cars Vertically

000D:6B00 - 000D:7F80 strings

000D:8270 - 000D:A080 d3d stuff file references strings writing data to \DEFAULT.FIL (frametime) more strings error messages for internal development

000D:A080 - 000D:A0B0 easter egg

000D:A0C0 - ABE0 error messages for internal development

000D:ABF0 - B1B0 key names for keyboard configuration

000D:B1D0 - 000D:B980 strings and error messages, some with debug data

000F:07E0 - 000F:0910 allowed characters for ?

000F:0E10 - 000F:1080 special characters for some langauges

000F:1140 - 000F:3930 strings and car/track references

000F:4EE0 - 000F:5300 qwerty keyboard table + extras for locale

000F:62A0 - 000F:62F0 qwerty keyboard table + extras for locale

0011:7910 End of file


Example of developer commentary marked as "easter egg" above.
String: "Nä nu ger jag upp! ingen yta under bilen vid restart!"
Translation: "I give up! no surface under the car when restarting (the race)"

* Note: wcdtool can and probably will create a lot of duplicate information when attempting to disassemble this executable.

Regardless of what game executable is examined, they all contain:
* file names and/or paths (it varies)
* strings (car names, track names, strings for the menu navigation and etc, including localization)

---

* Folder name "BALTAZAR" - likely the name of the game engine or a toolset for it. (speculation)

---

* **Graphics: generic**
The drop shadows in the textures are actually slightly transparent [image with boosted contrast](https://github.com/Kazade/Ignition-Tools/assets/2000703/ecb042e1-df8c-4b27-9cb6-641c344531e0)
This is from the game's title in **/N_SYSGFX.PIC**
It's likely that this transparency is hardcoded somewhere else, i.e. 
`if(pixel_data[x,y] == "0x000000") SetTransparency( "20%");`

* **Graphics: PAN file**
Affects how the HUD overlays the rest of the game for that particular track
![image](https://github.com/Kazade/Ignition-Tools/assets/2000703/193e78f5-5c30-429f-aafb-a8dc1d7ada1d)
Here the **/LEVELS/AUSTRIA/AUSTRIA.PAN** file was replaced with an empty file and each track has it's own for some reason so this only applies to the track modified. And it seems like *.PAN is also related to color palettes.

You cannot replace one PAN file with one from another track, this causes the HUD to look weird, albeit stay functional (it will have visual glitches) 

---

* **Audio: PAT files**
Some cars, tracks and misc have WAV files for the sounds, but others use "PAT" files which turns out to apparently be part of the "Gravis Ultrasound" thing that was kind of common in the 90's - This is according to an ancient tool named **SoundForge 3** which could successfully convert these.
This ZIP file contains all of the PAT files converted to WAV: [Ignition_SF3asWAV.zip](https://github.com/Kazade/Ignition-Tools/files/12825741/Ignition_SF3asWAV.zip)

Note: The results do sound slightly off; but they are converted without distortion or other problems that would ruin quality.

* **Audio: XI files**
file headers: 

Extended Instrument: WAV_2_XI (c) by Extended Instrument: Rull_Asfalt_H”g FastTracker v2.00 ...

also there seems to be *.wav filename references in these like in **\GENERAL\SOUND\ROLL\01_R_GRA.XI** there is a reference to **WET_ROA2.WAV** 
Presumably this is from some sound library purchased during development. 

---

* DEFAULT.FIL 
some kind of performance test/debugging output, if you open it in a text editor, it will at the end contain i.e. "Average framerate:32" 
This file is always updated whenever the game runs. It typically also contains the string "Ignition has been shutdown normaly" (this is misspelled in the file)

---

* Unknown: /BALTAZAR/DATA/MENU
MENU.TAB is significantly bigger than MENU.COL - Speculation is that *.TAB would be the "ROW data" and "COL" would be the corresponding column data, could include menu behavior/navigation as well.

* Unknown: /IGN_WIN.BTZ  and /IGN_DOS.BTZ 
Both of these will be updated regardless of which executable is used.
Presumably these are "Best TimeZ" as they have a number of shorthand names inside such as PL1, PL2, PJ4, BAN and so on.

* Unknown: *.SHD
Assumed to be related to be related to DirectX 3.0 shaders or similar, probably pre-compiled or otherwise optimized before runtime.
Could also just be the "shadow data" for tracks but that seems less likely.

* Unknown: *.SRF
Assumed to deal with positional sound effects. If one is swapped out between track the game will crash when loading the affected track, presumably because the sound started playback outside of the track boundaries.

* Unknown: `/LEVELS/*/*.TRI`  (Racing lines)
These files stand out as there is pre-compiler things near the end of these files.
From /LEVELS/USA/USA/.TRI:   [HEX offset: 1A1FC to 1A354]
`if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(push)
#endif
#pragma pack(1)
#else
#pragma pack(1)
#endif
#endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))`

But are easily confirmed to be the racing lines as the opponents will not follow the track if you swap these out between tracks.

---

From a forum post; unable to verify most of these (http://www.abandonia.com/vbullet/archive/index.php/t-249-p-2.html) because there is no information on the formats: 

COL: The colors palette. Format known. MSH: The world meshes (including moving objects). Format known, except Flags still unknown. PAN: Format unknown. PIC: An image. Format known. (this we have already confirmed in this repo *) PLC: The position (and probably flags) of the MSH meshes. Format known, except Flags still unknown. POS: Data for the moving objects. Format unknown. SHD: Unknown. SRF: Unknown. TAB: Unknown. TEX: The textures. Format known. TRI: Likely the racing line. Format unknown.



---
* Misc findings:

There exists a bug in the DOS version specifically: It is triggered by the boost/turbo button being pressed before you respawn just after crashing. The game will keep exploding your car and respawning it until you abort/restart the race or the race finishes.

* Additional links:
https://web.archive.org/web/19990423090439/http://www.uds.se/ignition/ignbehind.html   (very generalized development talk)
https://www.bobulous.org.uk/ignition/index.html (generic information)
Ryder17z commented 1 year ago

Forgot to add /CARS/TEST.AIS which seems to be related to car handling, probably used by the opponent AI. But it might also affect the handling for the player(s).

Ryder17z commented 1 year ago

Also: One image embedded in the 3dfx and IGN_WIN executable files is this one, used by the multiplayer configurator IGN_EXE_Bitmap114

I don't think there is any more of these embedded images (except for the icon), but the lightning strikes have not been spotted in the .PIC files so those might be stored inside the executable, possibly not as some kind of images but rather as a simple 2d drawing function.

Ryder17z commented 1 year ago

Update: /CARS/TEST.AIS appears unused, the game seems to be functioning properly without it.

The BTZ files do more than just store the "best times" They seem to also be used to determine what difficulties are unlocked as apparently: deleting the respective BTZ file resets your progress

Kazade commented 1 year ago

Wow that's a lot of cool stuff!

I just committed my Blender plug-in for loading track meshes: https://github.com/Kazade/Ignition-Tools/blob/master/io_scene_ignition.py

Ryder17z commented 1 year ago

Interestingly, when Mirror difficulty is selected:

On the 3 other difficulties;

This is reflected in the car select menu. This should be a decent indicator that the racing lines are also lacking a mirror dataset.

And each TRI file needs to at least contain 2 racing lines (if it has one junction) each to accommodate junction data - it's not predetermined what opponent will take which racing line as for example in "Lost Ruins" you can occasionally see the monster truck attempt to take a really narrow path when it's the widest car in the game.

Ryder17z commented 1 year ago

Regarding the AIS file, I would assume it is a leftover from development. I'm not entirely sure how it was supposed to work but there is not just acceleration and topspeed defined in it, but also it seems to define "slope influence" and "curve influence" which seems like it could be a lot of fun to play around with after figuring out where the actual handling data is stored and how

Ryder17z commented 1 year ago

Huh?

There's the falling rocks from USA.MSH "Gold Rush" embedded in the track mesh. image There is also some windmill pieces outside this track. The windmill is also animated, making this an odd place to store that in. I can also spot the other moving obstacles like the little train, trucks and the tornado.

Ryder17z commented 1 year ago

\BALTAZAR\DATA\TEXTURES\CANADA.TEX is different from \LEVELS\CANADA\CANADA.TEX

If you swap them with each other, the moose on the sign right after the railway crossing gets replaced with the text "Blip". The textures are not only different, but some parts are at different locations leading to odd voids void example Other than this and the wood bridge near the end of the track changing a little, there is not that much difference between the two.

But this does mean that when we view the game menu, the track that is shown behind is not the same as the track you actually drive on. (since different texture file and texture coordinates) but everything else should just be provided by the existing files, i.e. the track mesh should be the same file.


\CARS\CARS.TEX is the same as \BALTAZAR\DATA\CARS.TEX

But the respective MSH and PLC files are different as this happens if you swap the two sets with each other Ign_win_MV99ly9WgU Note: The game will crash when starting a race if you do this. The game will also crash if only one of the two are changed.

Ryder17z commented 1 year ago

I created a local copy of your python script with a few things commented out to see if cars.msh and menucar.msh were the same and I see no visual difference between them in blender so I'm not sure why they're so different

Ryder17z commented 1 year ago

Seems \FLAGGOR.PIC is unused. Editing or even removing/deleting the file seems to have no effect.

\BALTAZAR\DATA\FLAGGOR.PIC is used however - not sure why there is (sometimes?) a copy in the game root directory.

Ryder17z commented 1 year ago

Turns out the following files contain the intro with the car crashing into the game logo:

Ign1.cdp
Ign2.cdp
Ign3_0.cdp
Ign3_1.cdp
Ign3_2.cdp
Ign3_3.cdp

Swap the filenames of two and the sequence will be playing out-of-order.

Format unknown - RAD video tools cannot read it. (same with ffmpeg) so it's yet another mystery.