jorio / OttoMatic

Pangea Software’s Otto Matic 🤖
https://pangeasoft.net/otto
Other
141 stars 13 forks source link

Enemy despawning too frequent #10

Closed 6exagon closed 1 year ago

6exagon commented 2 years ago

Because the original PowerPC version of the game had a smaller render distance, enemy caps weren't hit much. In the original Intel version though, enemy caps were hit a lot, and this made the game a lot easier. Because in the source code I saw that the enemy caps are only there so the computers of the era could handle them, maybe they could be removed? I saw a comment saying these are to "keep from getting absurd", but it's possible to despawn at least 5 dinosaurs at once on Planet Sulak which is a little bit absurd. Also, there are enemy-specific caps, but those don't seem to be explained in the code either.

This new version is a little bit better than the original Intel one when it comes to enemy despawning, but I was still able to get 4 dinosaurs and several mantises to despawn on my first try by accident, and none of these will ever despawn on PowerPC, even running straight through the level without killing anything.

jorio commented 2 years ago

Wow, great observation! I hadn't noticed this. We can certainly try raising enemy caps. I think we'd need to do some thorough testing to see if it throws off balancing in any way. Here are some things we can try to tweak:

Supertile active range

To test different draw distances, you can tweak SUPERTILE_ACTIVE_RANGE in terrain.h. This version uses a range of 9 active supertiles, unchanged from the code dump I got from Pangea. I believe the PPC version had a range of 5 active supertiles or so. The code supports values 4 through 9 — any other values will fail to compile.

Perhaps it's worth looking into lowering the supertile active range just a bit; it'll relieve some of the pressure on the enemy caps. Some levels aren't really designed to look good with a long draw distance anyway — I'm thinking of ugly gaps in the terrain in level 2.

Global enemy cap

I believe the global enemy cap (gMaxEnemies = 20) is purely meant to help with performance and memory usage, as opposed to having any kind of role in gameplay balancing. I'm pretty sure we can safely raise it because the enemy-specific caps will limit the amount of enemies anyway.

Some areas of the game hit 20 simultaneous enemies pretty quickly indeed, such as parts of level 6 with a supertile active range of 9. It seems to be less extreme with a supertile active range of 8.

Note: the global enemy count can be viewed in-game by pressing F8.

Enemy-specific caps

Some of the enemy-specific caps are meant to keep the game balanced. For example, in level 2, without MAX_BLOBS, you'd quickly be swamped with blobs as soon as more than a couple frozen slime balls start thawing. I can think of the following infinitely-respawning enemies that may need a hard cap for balancing: Corn, Onion, Tomato, Blob, EliteBrainAlien.

On the other hand, some enemies that are important milestones in the flow of the level probably shouldn't be capped at all. I'm thinking of the GiantLizards in level 6; they're large and carefully spread out across the map, so it's probably best to do away with those enemy-specific caps altogether.

For all other enemies, those caps might not have much gameplay value. However, the game does run into, e.g., MAX_BRAINALIENS right at the beginning of level 1, even with the PPC version's draw distance. We should definitely do some testing here to see whether or not the game gets noticeably harder after lifting those limits.

jorio commented 1 year ago

Otto Matic 4.0.1 fixes the missing GiantLizards and Flytraps.