-
-
Notifications
You must be signed in to change notification settings - Fork 60
Classic mode vs. enhanced mode
In order to play back the pre-recorded demo, RigelEngine needs to match the original executable's behavior perfectly. But that includes replicating many smaller bugs, quirks, and limitations. For a smoother experience, RigelEngine runs in an Enhanced Mode by default. This removes limitations and fixes bugs, at the cost of not being quite 100 % faithful to the original anymore in some minor details. This page explains what the differences are.
Any differences not explicitly listed here are considered bugs. Please report if you find any!
- Unlimited particle effects: The original game can only show up to 320 particles at the same time. In Enhanced Mode, there is no limitation, resulting in richer effects.
- Unlimited effect sprites: Similar to particles, the original game can only show up to 18 effects like explosions, fire, flying debris etc. In Enhanced Mode, there is no limitation.
- Unlimited shots: In the original, only 6 shots fired by the player can exist at the same time. There is no limitation in Enhanced Mode.
- Unlimited number of enemies, objects, destructible walls etc. The original limits these.
- In the original, only one wall explosion effect can occur at the same time. In Enhanced Mode, there is no limitation.
It may seem like these limitations are purely visual (aside from the number of shots), but they also affect random number generation and thus impact gameplay. For example, the Blue Guard enemy uses random numbers to decide whether to fire a shot at the player. Imagine that the player is shooting an item box while a Blue Guard is looking at them. The exploding box normally creates particle effects. If the max number of particles is already visible however, then no additional particles will be created, which means that the random number generator will be in a different state when the Blue Guard makes its decision, and the situation might play out differently. This applies to many other enemies as well.
These bugs occur in Classic Mode, but not in Enhanced Mode.
- When shooting rockets or normal shots to the left or downwards (i.e. while hanging on a climbing pipe/vine/etc.), the position at which the shot appears is slightly off. With the rocket in particular, this means it takes a little bit longer for shots to reach their target.
- When the player fires a shot right before jumping or landing on the ground, it's not possible to fire a shot on the frame following the jumping/landing animation, even though it normally is.
- After shooting off an aggressive prisoner's hand, the creature still has collision detection with the player's shots during its death animation, which can cause shots to be stopped.
- The missile that flies up and destroys part of the ceiling has one frame of animation skipped depending on which side (left or right) it was shot at.
- It's possible to destroy laser turret with the normal shot if the player picks up a weapon or enters the ship before the shot reaches the turret.
- Debris from exploding walls disappears too early.
- When the stone shell covering the green lizard/dragon creature bursts, parts of it are positioned incorrectly.
- Enemy laser shots can fly through walls under certain conditions.
The following changes aren't really bugs, but cases where the original game is inconsistent in the way certain things happen/work. In enhanced mode, the behavior is made consistent.
- When the fire button is already held down while collecting rapid fire, Duke sometimes starts shooting on the very next frame, sometimes only the frame after the next. In enhanced mode, it always starts on the next frame.
- The white flash indicating an enemy taking damage applies only to parts of an enemy's sprite for certain enemies. This is made more consistent in Enhanced Mode.
- Burnable walls like the wooden beams in some of the cave levels don't always burn up completely from a single hit. In Enhanced Mode, this is more consistent.
- The radar doesn't show irrelevant objects like background decorations in Enhanced Mode.
Classic Mode is based on my 100% accurate reconstruction of the original Duke Nukem II source code. The parts of the code which implement the game logic were copied into the RigelEngine code base, adapted as needed to make the code compile with a modern compiler, and then hooked up to RigelEngine's rendering and asset loading infrastructure. This is basically as close as it gets to an actual source port. After integrating the code, I also verified its correctness by dumping the state of all gameplay variables out each frame while running the demo, dumping the emulated memory content of the original game running in DosBox each frame, and then comparing the two. At least when running the demo, all variables are 100% identical on each frame between the DOS original and RigelEngine.
Enhanced Mode on the other hand is code that I wrote based on the original executable's assembly, but with various differences in the architecture to make the code more readable and easier to extend with modern enhancements. Since that code is quite different from the original, it's not possible to verify it the same way as with the Classic Mode code. I did however spend many hours meticulously verifying the behavior of the code by recording video captures from the original running in DosBox, and from my version, and then stepping through the recordings frame by frame and comparing the visual output. As a result, the code is still extremely accurate to the original game, just not quite to the same degree as Classic Mode.