Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Non-flying enemies sent off the visible screen die

8 replies · 1,791 views · Started 01 June 2008

Title says it all. To test, download the latest version of Zodiac from Quest Announcement and use the ice beam on enemies. Flying enemies freeze as expected. Non-flying enemies freak out and change to garbage tiles.

What is happening is: when an enemy is hit with the ice beam, it is stashed off screen at -16,-16. The script draws the enemy's tile at the freeze location. Flying enemies tolerate being off screen just fine, so their tile displays properly. Non-flyers die shortly after being off screen.

Not sure if this behavior is intended for something, or a bug.

C-Dawg wrote:What is happening is: when an enemy is hit with the ice beam, it is stashed off screen at -16,-16.
And then the enemy falls down to -16,192, at which point it dies from Bottomless Pit's Disorder.

...Unless you explicitly hold the enemy in place for each frame?

Yes, I do. I move it to -16.-16 each frame. I accounted for the fact that you have enemies die when they fall in a pit. 😉

You know this is sorta strange. I'm wondering if it has something to do with gravity at all. What would happen if you changed your ghosted enemy (fire or flier) for a walking enemy in the shmup parts and boss battles where you hide them off screen?

Well that doesn't make sense, I don't think fire enemies are "flying" enemies...Maybe I'll try changing my enemy 255 and see what happens.

I was thinking about this today, and it suddenly occurred to me: enemies have a "fall" variable as well for vertical acceleration to account for gravity. This isn't accessible in ZScript, so what I think is happening is that while C-Dawg continually keeps the enemy in place, its falling speed continues to accelerate, and after merely a few seconds is increased to ridiculous levels, which means that the game engine will move the enemy past the threshold for death in a single frame. The script can't correct the position of the enemy because it no longer exists.

I guess this means we need new variables to access fall speed :P

jman2050 wrote:enemies have a "fall" variable as well for vertical acceleration to account for gravity. This isn't accessible in ZScript

Wrong: Link->Jump and npc->Jump.

I called it Jump rather than Vz because in Sideview it applies to the Y axis.

Furthermore, it is not possible for enemies to fall faster than the quest's Terminal Velocity constant (in Init Data).

For testing purposes, I changed the script so the enemy is stashed at 0,0. And is visible. This works fine - walking enemies don't die. Some enemies, like Vires, refuse to actually go to 0,0, but instead just get somewhere close to it. Wierd.

Anyway, the critical factor is whether the enemy is off-screen or not, it seems.

Update!

I've discovered something that makes this bug a little more critical. Turns out that if you make a Trigger enemy on a screen with Sideview Gravity enabled, the trigger enemy dies if you linger on the screen for a few seconds. I cured the problem in my quest by making Enemy 1 a trigger enemy and then putting Combo Flag - Enemy 1 somewhere inside a solid combo. That worked fine.

I speculate that Trigger enemies get created off-screen, normally, which means they fall prey to the same problem haunting my freeze ray script.