The random ramblings of a French programmer living in Norway...
2021
← Timeco Trivia TimeInternal Structures →
  High Quality Resources
Sun 8th August 2021   
Adeline Software
 Part 1 Part 2 Part 3 Part 4 Part 5 Part 6  

Time to get our sleeves up and dig into the nitty gritty dirty details about how all that worked together.

Before entering into the details, I need to highlight a few facts about why things were somewhat better back in the days1!

Perfect knowledge

Modern game development is fundamentally different to what it used to be.

These days, the same code base is expected to run with as little modifications on a Windows PC, Nintendo Switch, even sometimes on a mobile phone or web browser2.

These games may be running on hard drives or SSD, on mobile processors or overclocked crunching beasts, on a vast range of gpus.

These games even have to support patches, downloadable updates and user created content.

For the developer, what that means is that you cannot rely on anything really, because you don't know how much cpu power, memory, graphical ability, storage or amout of data to deal with, so you can't really do any assumption about memory layout, number of animations, disk capacity and speed, etc...

By comparison, back in the days we could look at a PlayStation, and clearly see that:
  • We have two megabytes of main RAM
  • There is one megabyte of 2D addressable Video RAM
  • We can use up to 512 kilobytes of ADPCM compressed audio
  • All the data is static and comes from a 2X CD ROM drive
  • The CPU is a R3000A running at 33mhz
  • We know exactly how many clock cycles each instruction takes
  • We know exactly how the cache behaves
  • We have full control on the co-processors and DMA

Optimizations

When you know all that, you can do many assumptions, and you can do many optimizations based on these:
  • Since you know all the resources up-front, you can access them directly by index instead of fancy look-up strategies
  • You can load all the data you need as one big blob directly into memory, without any allocation
  • You can make the program cache friendly by playing with the linking order

Obviously for the PC version of Time Commando some of the possible optimization would not apply since the hardware could change, but we could still target for the lowest spec system, knowing that better machines would just handle that fine3.

If you dig into the files on the Time Commando CD ROM4, you will see that the game levels are made of one HQR5 and one ACF6 file.

People who digged into Little Big Adventure already know the HQR format because it already existed, while the ACF file format was created specifically for Time Commando.

The ACF files contains data which is only relevant at specific locations in the level sequence, such as the background pictures, the additional rooms, as but also the camera position and zbuffer data used to handle the overlapping sections of graphics behind which the character can move... and they will require their own posts because there's quite a lot thing to cover!

HQR Files

HQR files are basically the conceptual equivalent of archives such as ZIP or PAK files, and were created by the MAKE_HQR tool.

MAKE_HQR.EXE
MAKE_HQR.EXE

The way it's used in Time Commando, our scene compiler would look at what the gameplay designers did, collect the list of all the 3D models and textures, animations and particle effects, musics and sound, ... and then use this information to generate binary versions of the level data optimized specifically for this specific scene content, as well as creating the LST files used by MAKE_HQR to generate the final data for both platforms.

Here is an example of what the .LST files7 for the first level of the game look like on PC and PlayStation:

#rem
#rem Liste HQR des fichiers nécéssaires au fonctionnement
#rem de TimeCommando PSX
#rem
#rem SAMPLES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.SAX
#rem Music Midi Track
F:\PROJET\TIME\MUSIC\STAGE00\PSX\TC300_PS.SNG
#rem Music SAMPLES
F:\PROJET\TIME\MUSIC\STAGE00\PSX\TC300_PS.SNV
#rem TEXTURES des OBJETS et ARMES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.TEX
#rem Texte démarrage en 16 couleurs (4bits)
F:\PROJET\TIME\PSX\RESS\TEXTS0.DAT
#rem SPRITES 640x240
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.SPR
#rem PROGRAMMES (tracks) des OBJETS
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.TRK
#rem BODIES des OBJETS et ARMES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.BOX
#rem ANIMATIONS des OBJETS
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.ANX
#rem FICHES des OBJETS et des ARMES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.FIX
#rem FEUILLES 3D du sol
F:\PROJET\TIME\GRAPH\DECORS\STAGE00\RUN0\SCENE.SOL
#rem définition des QUAD
F:\PROJET\TIME\SCENE\STAGE00\RUN0\SCENE.QAD
#rem définition des ZONES, COLLISIONS, BONUS, FLOTS et EFFETS
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.BNX
#rem OBJETS et ARMES de la scène
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.SCC

#rem
#rem Liste HQR des fichiers nécéssaires au fonctionnement
#rem de TimeCommando PC
#rem
#rem OBJETS et ARMES de la scène
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.SCC
#rem FICHES des OBJETS et des ARMES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.FIC
#rem PROGRAMMES (tracks) des OBJETS
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.TRK
#rem BODIES des OBJETS et ARMES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.BOC
#rem SAMPLES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.SAC
#rem ANIMATIONS des OBJETS
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.ANC
#rem TEXTURES des OBJETS et ARMES
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.TEX
#rem FEUILLES 3D du sol
F:\PROJET\TIME\GRAPH\DECORS\STAGE00\RUN0\SCENE.SOL
#rem Palette SHADE
F:\PROJET\TIME\GRAPH\DECORS\STAGE00\RUN0\PALTIME.SHD
#rem SPRITES 320x240
F:\PROJET\TIME\GRAPH\SPRITES\STAGE00\ICO240.GPH
#rem SPRITES 320x480
F:\PROJET\TIME\GRAPH\SPRITES\STAGE00\ICO480.GPH
#rem SPRITES 640x480
F:\PROJET\TIME\GRAPH\SPRITES\STAGE00\ICO640.GPH
#rem définition des QUAD
F:\PROJET\TIME\SCENE\STAGE00\RUN0\SCENE.QAD
#rem définition des ZONES, COLLISIONS, BONUS, FLOTS et EFFETS
F:\PROJET\TIME\SCENE\STAGE00\RUN0\TEMP\SCENE.BNC
#rem définition des SPRITES 3D
F:\PROJET\TIME\GRAPH\SPRITES\STAGE00\EFFETS.GPR
#rem définition des MUSIQUE OPL
F:\PROJET\TIME\MUSIC\STAGE00\MUSIC_OP.XMI
#rem définition des MUSIQUE GENERAL MIDI
F:\PROJET\TIME\MUSIC\STAGE00\MUSIC_GM.XMI

Logically, the same files should have been present at the same location, but for some reason it did not happen because of the two different codebases.

Using these LST files and VIEWHQR.EXE, it's then possible to extract back the content of the HQR files.

VIEWHQR.EXE
VIEWHQR.EXE

The command C:\HQR\VIEWHQR.EXE SCENE.HQR -lSCENEPC.LST returns the following list:

ViewHqr V1.11 (c)Adeline Software by Seb (Jan 14 1997 / 15:11:34)

File ..\SCENE.HQR - Size: 1001450 - Entries: 17
--------------------------------------------------------------------

Num Name Offset Size SizeComp Method
---- ------------ --------- --------- --------- -------
0 SCENE.SCC 74 1124 539 LZMIT
1 SCENE.FIC 626 8864 3813 LZMIT
2 SCENE.TRK 4450 5039 2952 LZMIT
3 SCENE.BOC 7414 257580 144617 LZMIT
4 SCENE.SAC 152042 919600 699052 LZMIT
5 SCENE.ANC 851106 241360 75052 LZMIT
6 SCENE.TEX 926170 106496 40654 LZMIT
7 SCENE.SOL 966834 8476 3743 LZMIT
8 PALTIME.SHD 970590 4096 1898 LZMIT
9 ICO240.GPH 972498 3095 2972 LZMIT
10 ICO480.GPH 975482 5954 5408 LZMIT
11 ICO640.GPH 980902 9920 8802 LZMIT
12 SCENE.QAD 989714 4400 2377 LZMIT
13 SCENE.BNC 992102 1392 1026 LZMIT
14 EFFETS.GPR 993138 1669 381 LZMIT
15 MUSIC_OP.XMI 993530 5698 3797 LZMIT
16 MUSIC_GM.XMI 997338 5820 4100 LZMIT
--------------------------------------------------------------------
Total: 1590583 1001183 37.06%
--------------------------------------------------------------------

The tools

Of course, we did not only have MAKE and VIEW HQR, we had plenty more tools!

I will have to dig in my archive to find a complete list of all the file formats and tools involved, but that should give you a rough idea of what we used.

Here is a list of some of the tools involved...
  1. 3DS (PC) or SoftImage (Silicon Graphics)
  2. TCED aka "Time Commando EDitor"
  3. DOFIELD
  4. DELUXE PAINT
  5. VOLGRAPH
  6. MAKE_HQR
  7. PALEDIT
  8. CODE
  9. DECOMP
  10. VIEWACF
  11. COMPRESS
  12. ACFTOOLS
  13. ACFCONC
  14. ACFPAD (.BAT file using #10/#12)
  15. ACFIDX
  16. ACFSTAT
  17. ACFLOAD
  18. RECOUVRE
  19. MAKEFLOW
  20. PSXSND
  21. AIFF28
  22. PSCONV (.BAT file using #21)
  23. SNDPCNV
and in addition we can use whatever text editor (Boxer/BC/Edit/MultiEdit/QEdit/...) people would choose to use to edit the scripts or configuration files.

File formats

And the associated list of file formats (the number refers to the tool number on the list above)

  • (STG) Level configuration (text)
  • (HQR) Resource archives (8,6)
  • (SCE) Scene description (text)
  • (VUE) Camera information (1)
  • (ACF) Compressed video streams (11-17)
  • (ZBF) Source ZBuffer data (1+IPAS)
  • (ZMI) Masks (18)
  • (SOL,FIE) 3D ground information (2/3)
  • (S3D,O3D,F3D,3DP) 3D characters and items (6)
  • (ANI,A3D) Animations (6)
  • (GIF,JPG,TGA,TIF,FLC,PCX) Misc pictures formats
  • (GPH,GPR) Compressed sprites sheets (5)
  • (SHD) Color palettes (7)
  • (MAT) Materials and effects (text)
  • (ARM) Weapons (text)
  • (FIC) Character sheets (text)
  • (FLW) Particle flows (19)
  • (MID,XMI,WAV) PC audio formats
  • (SNG,SNP,SNV,VAG) PlayStation audio formats (20-23)
  • (C,CPP,H,S,ASM) Source code (text)

When put all together, the actual process looks like this8:

Level Export Flowchart
Level Export Flowchart

That's all for today!

Adeline Software
 Part 1 Part 2 Part 3 Part 4 Part 5 Part 6  



1. Or at least, things that made it somewhat easier to make games
2. At least some of us tried, you can find them drooling in mental asylums
3. With the exception of the Pentium Pro CPU, which unfortunately would drop in performance like a ston when trying to access 8 bit part of registers such as AL, BL, AH and BH, which our video decompression system did a lot
4. There are slight differences between the PC and PSX version, but these are not relevant for the discussion
5. HQR stands for "High Quality Resource"
6. ACF stands for "Adeline Chunk Format"
7. Including the original French comments with proper accentuation.
8. Click on the picture to see a larger view
comments powered by Disqus