EPIC

TFX, Inferno, Wargasm, Typhoon, …
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

EPIC

Post by mikew »

Some months ago, I bought this 'EPIC + Inferno Bundle' from GOG:
https://www.gog.com/game/epic_inferno_bundle
Finally, I've got some time to play them and will start with EPIC, which is DiD's second game (I think).
I haven't heard of Ziggurat Interactive before, but even if only 0.1% of the world population buy this bundle at $4.56, it's like $150 million so they must be a pretty big outfit and no doubt will have re-implemented the game for modern systems using Unity or Unreal.

This is going to be awesome! :)
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

Hmmn, looks like most of the money has gone on hookers and blow as this appears to be the original game running in Dosbox. :twisted:

They've done a good job of integrating it though. It runs fine and the cut scenes are fantastic, although a bit blocky on a 65" TV.
I only tried the first mission and ran out of time on each of my lives. The problem with these DOS games is that you need some skill to win. :)

I'm not that interested in the gog specific stuff, but it sets up Dosbox and then launches start.exe with some parameters.

start.exe is the only notable difference between the gog installation, and a version I got from some abandonware site years ago.
The gog start.exe is about twice the size.
epic_files.PNG
epic_files.PNG (22.9 KiB) Viewed 4131 times
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

I'm ignoring the gog launcher and running start.exe directly with Dosbox-X and it works fine.
If I run start.exe from the other version, I get 4 pages of Hungarian text before the game starts. A 5th page in English tells me that it's not a ransomware attack.
If you've got any files you want to swap, give this guy a call. :)
epic_hung.PNG
epic_hung.PNG (15.54 KiB) Viewed 4127 times
I'm not sure of the relationship with start.exe and the file game.dat which is also an exe.
If I rename game.dat, I get a 'not enough memory' error,
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

The ‘Hungarian’ start.exe is compressed in some way which explains its comparatively small size.
The date of May 1992 indicates an early crack and I suspect that the start.exe from gog is pretty much the same thing.
On closer inspection, there are vast swathes of game.dat inside start.exe, so it can’t have been like that from the start.

The original files haven’t changed as both game.dat and the data archive epic.dat are exactly the same in the gog version as they were in 1992.

The exe situation is a bit complicated, so let’s look at the data archive epic.dat for a while.
It can immediately be seen that this is a bit different in format as the later games in that it only contains the data ‘payload’ and the file information of each name, offset and length are stored on the exe game.dat (and start.exe)

If we resolve this and separate out the 350 files included in epic.dat, we end up with a structure like this:
Screenshot 2022-07-02 at 21.51.24.png
Screenshot 2022-07-02 at 21.51.24.png (200.78 KiB) Viewed 4120 times
User avatar
Krishty
Site Admin
Posts: 1391
Joined: 2022-Jan-09, 00:59

Re: EPIC

Post by Krishty »

🍺🍿
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

Running with the extracted files doesn't work on the first attempt. I'm not getting any good error code to know why.
While files can be modified, and epic.dat rebuilt, the exe would also need to be modified to reflect the changes. Adding files would be awkward, as that would require adding bytes to the exe which isn't likely to go down too well.

The .3 files can be loaded into 3View, but are invisible. I need to take one apart to find out why. These would be the earliest .3 files we've dealt with.

Lean Viewer handles the .lbm files (except one which is corrupt, maybe an extraction problem) well, and also some .smb sprites. I don't think I've come across that file extension before.
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

I probably won't go much further with this for now, so here's a summary of how I think the system works...
The file 'epicflow.jr' looks like a script that defines when everything happens. In this picture is the part that deals with the intro up until the enroll screen.
The intro is made up of a combination of .256 file animations defined by ANIM, STATic images that call .lbm and what I guess are predefined sequences using the In Game ENgine with the .ig files.
I've included the first, paulX1.ig in the picture, but the ships move against a background that I don't see defined anywhere. There's some text that rolls across the screen during the IGEN sequence, but I don't know where that comes from either.
The TEXT keyword calls up snippets of text from epictext.jr.
Music is turned on and off with the MARS keyword. My theory is that MARS is short for Midi, Adlib,Roland,Soundblaster but that's maybe going too far. :)
epic_var.PNG
epic_var.PNG (179.47 KiB) Viewed 4110 times
The intro sequence can be seen in the first 3 and a bit minutes of this video.

Now, I might actually get around to playing it. :D
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

I can't really blame TFXplorer for not rendering EPIC's .3 files as DiD must have changed their 3D model API between EPIC and TFX, so around 1992.
A good test is to use the TAW 'Custom Combat' preview screen. If I replace TAW's 'hercules.3' with TFX's 'f117a.3', we successfully see something that looks like a F117:
tfx_in_taw.PNG
tfx_in_taw.PNG (30.2 KiB) Viewed 4093 times
However, if I do the same trick with EPIC's 'epicship.3', we get a crash on startup with this:
need_newer_3d.PNG
need_newer_3d.PNG (7.88 KiB) Viewed 4093 times
I've seen that error string in TAW's exe before, and now we know what triggers it, although not exactly what gets tested.
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

Somewhat unsurprisingly, EPIC's .3 files are a cruder version of what came later. The header is similar and I haven't come across any opcode higher than 0015. Opcodes, 0000,0001,0002,0003,0004,0007,0008 and 0015 are the same as we're used to.
There are also 0005,0006,0009 and 0011, but I'm not sure what they do yet.

From what I can see, the highest palette index is 39, but are mostly a lot lower. I have no idea where the palette is stored though, so I'm using a TAW palette where the low palette indices produce some garish colours.
Screenshot 2022-07-16 at 23.24.14.png
Screenshot 2022-07-16 at 23.24.14.png (42.7 KiB) Viewed 4087 times
User avatar
Krishty
Site Admin
Posts: 1391
Joined: 2022-Jan-09, 00:59

Re: EPIC

Post by Krishty »

That’s good news (that they are similar and use known opcodes mostly) and bad news (that they don’t render in 3View anyway).

Idea: I think the playable models of F-117, EF2000, and F-22 in EF2000’s did.dat are leftovers from TFX. (I use that model to display the F-22 in EF2000 mode, and EF2000 didn’t have a playable F-22, so it must be from TFX, right?)

Have you checked whether they are identical or whether any kind of conversion took place? In the best case, we’d have some kind of Rosetta Stone with identical shapes in two different versions.
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

There's a lot of similar looking filenames, so I'm not certain which are used but I'm guessing the largest files are the most detailed.
The file 'f22_glob.3' only differs by 2 bytes between TFX and EF2000, although the sizes of the other files look quite different.
ef_tfx_comp.PNG
ef_tfx_comp.PNG (26.08 KiB) Viewed 4083 times
Aren't TFX models already handled quite well in 3view?

This thread is mainly about EPIC though, and some changes would have to be made for the EPIC models to be visible in 3view.

.
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

It would be good if I could find a more appropriate palette for EPIC, but I guess it's buried in the exe somewhere.
Maybe the same palette is used elsewhere, so had a look at the .lbm and .smb files.
The palette's in the .lbms are all over the place, but seem constant for the .smbs. This might sense in that a sprite might be used at the same time a .3 model is displayed, so the palette may be the same.
epic_pals.PNG
epic_pals.PNG (110.27 KiB) Viewed 4081 times
...but I can't find the palette in an .smb file if I open it in a hex editor. At least not the byte values I see if I roll over each palette entry in Lean Viewer. So, either the smb file uses some bit level coding or the palette is hard coded in Lean Viewer...
User avatar
Krishty
Site Admin
Posts: 1391
Joined: 2022-Jan-09, 00:59

Re: EPIC

Post by Krishty »

Sorry to break it to you; I had forgotten about it …

Code: Select all

// Formats DID SPR.cpp

	// TFX formats are often indexed, but none of them contains an actual palette. Instead, palettes are global resources from dedicated palette files.
	// In order to display indexed data properly anyway, a standard palette is embedded into the viewer.

	VISUAL_CPP_ALIGNMENT_WORKAROUND(GFX::SRGB_888) constexpr GFX::SRGB_888 standardPalette_tfx1[] = { // “Somalia” was the arbitrary choice
		{   0,   0,   0 }, { 125, 158, 130 }, {  81, 109,  85 }, {  52,  60,  48 },
…
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

Aha, I suspected that later as even the explosion sprite was just shades of grey. It's cool that Lean Viewer picks up the .smb extension as a sprite. Those from TFX have extension. .spr.
Anyway, with a game exe size of about 170kB, it's possible to scroll through it looking for palette-ish data, ie a block of 768 bytes, with max value 0x3f, and arranged largely in groups of 3.
About a minute later, I found such a section, clipped it out and saved it as a .col file.
Reasonably lucky I would say...
epic_pal.PNG
epic_pal.PNG (28.51 KiB) Viewed 4078 times
User avatar
Krishty
Site Admin
Posts: 1391
Joined: 2022-Jan-09, 00:59

Re: EPIC

Post by Krishty »

AMAZING!
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

That video I embedded above is quite useful in that it shows I have a sphere missing on one of the ships.
So, now I know what Opcode 0005 is for. Just need to work out how to implement it.
epicsphere.PNG
epicsphere.PNG (111.61 KiB) Viewed 4069 times
So, for this line:
0005000d003100002580
000d is the palette entry, 0031 the vertex, and the rest somehow defines the size of the sphere.
User avatar
Krishty
Site Admin
Posts: 1391
Joined: 2022-Jan-09, 00:59

Re: EPIC

Post by Krishty »

Interesting. The other known sphere opcodes are

Code: Select all

005C <color> <position> <radius> draw sphere
005D <unknown> <color> <position> <radius> draw semi-transparent sphere
005F <number> (<color> <position> <radius>)[<number>] draw multiple spheres
0060 <number> (<unknown> <color> <position> <radius>)[<number>] draw multiple semi-transparent spheres
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

I suppose it would be the equivalent of 005C. I'm not sure what the units are, but dividing that last number by 128 seems to be about perfect when used as the radius of a VRML sphere.
epic_spheres.PNG
epic_spheres.PNG (41.83 KiB) Viewed 4057 times
I think the 'fuelpaul' model should have two spheres, so I've probably been a bit too aggressive in my de-duplication of primatives.
So, only opcode 0006 and 0011 to go. I thought there was a 0009, but that disappeared when I realized the 0004 opcode lines will have different lengths depending on the number of polygon vertices.
User avatar
Krishty
Site Admin
Posts: 1391
Joined: 2022-Jan-09, 00:59

Re: EPIC

Post by Krishty »

mikew wrote: 2022-Jul-18, 20:51seems to be about perfect
is perfect
See, I fixed it for you!
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: EPIC

Post by mikew »

Well, it needs to be perfect. You know what those EPIC rivet counters are like. :D

Mobygames has some screenshots from what's supposed to be the DOS version:
https://www.mobygames.com/game/dos/epic/screenshots
...which is quite interesting for comparative purposes.

There isn't a special opcode to make the volcano smoke semi-transparent like that, so some other mechanism is involved.
epic_div.PNG
epic_div.PNG (19.97 KiB) Viewed 4051 times
Post Reply