Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Mattfrie1

Dissecting the console ports of Hexen

Recommended Posts

Danfun64 said:

So...what engine does the N64 version use?


The N64 port uses the retail PC version as a base engine. The IWAD is located at 0X7A34FC in the NTSC-U version of the game, and at 0X7B6D64 in the Japanese version.

I've tried to look into contacting the programmers behind the Saturn port, and sadly none of them appear to be active online.

Share this post


Link to post

So after playing the Sega Saturn port a little bit more, I noticed one more interesting bit of behavior about the fly. Much like the PSX port, the fly finally "lands" after a certain period of activity. However, the curious thing is that the design of the room differs between the PSX and Saturn versions, thus changing where the fly lands. The Saturn port's room is designed just like the regular PC version with two rows of three thin pillars in the rear portion of the room across from the exit portal door. The PSX port however only includes two wider pillars on both sides instead. Whereas the fly lands on the corner of the pillar on the PSX port (likely a glitch), it simply lands on the ground in front of one of the pillars in the Saturn port.

I find the changes in level architecture between these two ports to be very fascinating, considering that these two ports were being worked on at the same time. Most of the time, the Saturn version appears to feature several minor differences to make the levels more like their PC versions, yet still retains some of the changes that are seen in the PSX levels as well creating an odd hybrid.

Share this post


Link to post
Arctangent said:

Honestly, I'm more surprised that the PC version doesn't have that. Seems like it'd be simple enough to implement that serves the same purpose as like the rats from Strife.

The PC version would've likely been made before the console versions, sometimes console versions get added extras.

Share this post


Link to post

Here is my limited analysis of the fly from the DOS Hexen Beta.

MT_FLY - C7030h
doomednum    = 112
spawnstate   = 2301
spawnhealth  = 1000
seestate     = 0
seesound     = 0
reactiontime = 8
attacksound  = 0
painstate    = 0
painchance   = 0
painsound    = 0
meleestate   = 0
missilestate = 0
crashstate   = 0
deathstate   = 0
xdeathstate  = 0
deathsound   = 0
speed        = 6
radius       = 5
height       = 5
mass         = 2
damage       = 0
activesound  = 198  (FlyBuzz)
flags        = 1552 (MF_NOBLOCKMAP | MF_NOGRAVITY | MF_DROPOFF)
flags2       = 4096 (MF2_PASSMOBJ)

state table begins at: ABF5Ch
state 2301 begins at:  BBB08h
State  Sprite   Frame    Tics     Action   NextState    Misc1  Misc2
2301:  276      0        20       45184    2301         0      0
2302:  276      0        3        45376    2303         0      0
2303:  276      1        3        45376    2304         0      0
2304:  276      2        3        45376    2305         0      0
2305:  276      3        3        45376    2302         0      0

Action 45184 = offset: 532D4h, rva: 1B080h
Action 45376 = offset: 53394h, rva: 1B140h
Frame 2301 - Idle Function - Repeat once every 20 tics
Randomly pick a "thinker" on the map. (things, lights, platforms, doors, etc...)
Make sure it is a thing.
Make sure it is a corpse.
Make sure it is not already fly's target. (Fly doesn't rebuzz previous target)
Make sure it can be seen.
If a check fails, try the next "thinker" in order immediately after that check.
Only 100 things may be sight checked this tic.
If all checks pass, set that thing as fly's target and become active.
If checks fail for all "thinkers" or sight check limit is hit, remain idle.

Frames 2302-2305 - Active Function - Repeat once every 3 tics
Make sure fly has a target.
Make sure target is a corpse.
Get a random number.
If it is < 5, become idle.
Look at target.
Try to move towards target.
Gain random x and y momentum.
Gain random z momentum based on height of target. Tries to stay level?
Randomly make or do not make a buzzing sound.
If all checks pass, remain active.
If a check fails, become idle.

The fly has no seestate and doesn't use the standard monster AI.
Need 2+ corpses to keep continuous activity. (Fly doesn't rebuzz previous target)
Extremely erratic movement may cause fly to move out of sight range of corpses.
Fly does not lose momentum when becoming idle. (Floats away/up in straight line)

Share this post


Link to post
Avoozl said:

The PC version would've likely been made before the console versions, sometimes console versions get added extras.


In this case, since the ports are likely based on an earlier PC build, it's more like they retained some unique features rather than anything was added to them.

Share this post


Link to post

Great work Randy! It's crazy to see how they put so much work into coding the fly's behavior just to remove it from the final version.

Share this post


Link to post

Something else to note. GZDoom and GZDoomBuilder support the fly. The fly's behavior appears to be broken, but looks relatively easy to fix. This suggests that at some point, someone else tried to reverse engineer the fly from the beta or Hexen 1.0? I see no code references to the fly in the released source.

Share this post


Link to post

@Mattfrie1 I've been reading this thread because I'm working on a data extraction tool for the N64 version of the game. However, I must first mention that the Hexen PSX version uses the same rendering method as the Doom PSX version, but it improves the code a bit to prevent stretching and deformation of wall textures.

 

Now, regarding the N64 version, I have a curiosity about the Japanese version of the game. Does the game freeze on map 25? There's a graphic in this version that gets decompressed incorrectly, causing the game to crash.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×