Duke4.net Forums: hardcoded water and enemies stuff - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

hardcoded water and enemies stuff

User is online   Danukem 

  • Duke Plus Developer

#1

I'm curious about this code which blocks certain enemies from getting on top of water:

   if (isEnemy)
    {
        // Handle potential stayput condition (map-provided or hard-coded).
        if (newSectnum < 0 ||
            ((actor[spriteNum].actorstayput >= 0 && actor[spriteNum].actorstayput != newSectnum) ||
             (pSprite->picnum == BOSS2 && pSprite->pal == 0 && sector[newSectnum].lotag != ST_3) ||
             ((pSprite->picnum == BOSS1 || pSprite->picnum == BOSS2) && sector[newSectnum].lotag == ST_1_ABOVE_WATER) ||
             (sector[oldSectnum].lotag != ST_1_ABOVE_WATER && sector[newSectnum].lotag == ST_1_ABOVE_WATER &&
              (pSprite->picnum == LIZMAN || (pSprite->picnum == LIZTROOP && pSprite->zvel == 0)))))
        {
            *(vec2_t *) pSprite = oldPos;

            // NOTE: in Duke3D, LIZMAN on water takes on random angle here.

            setsprite(spriteNum, (vec3_t *)pSprite);

            if (newSectnum < 0)
                newSectnum = 0;

            return 16384+newSectnum;
        }


Specifically, why are pigcops excluded? Is it because the developers hated police, or is it because this code was a kludge motivated by the pool in E3L1, which has no pigcops around it?
0

User is offline   Jimmy 

  • Let's go Brandon!

#2

I'm not sure if there's a technical reason for the boss enemies, but I know the Protector Drone exhibits some bizarre behaviour when it jumps in or around water. I imagine the Enforcer had the same issues, and by the time they coded the Protector Drone they forgot about the water/jumping issues.
0

User is offline   TerminX 

  • el fundador

  #3

Not sure why PIGCOP isn't included in that check. I suppose I could check out some ancient alpha and beta versions of the DOS source and see what it looks like, but if I had to guess it would be that LIZTROOP and LIZMAN are both evolutions of stuff that existed as far back as LameDuke whereas the PIGCOP isn't.
0

User is online   Danukem 

  • Duke Plus Developer

#4

I still think the pools near the start of E3L1 may be what drove it. The regular enemies listed (liztroop and lizman) are near the pool and would fall in otherwise -- they probably did that a lot and then someone said "fuck it I'm hardcoding this shit". And I can't think of any other official map where enemies start near an open pool (EDIT Hotel Hell duh). The real mystery is why BOSS1 and BOSS2 are included in the water ban, especially since any pal 0 BOSS2 is already prevented from entering any sector that isn't lotag 3 in the same block of code.

This post has been edited by Trooper Dan: 13 May 2017 - 10:40 AM

0

User is offline   TerminX 

  • el fundador

  #5

Looks like the check was added toward the end of 1995, long before E3L1 existed in any form. It originally checked for any actor that wasn't a JELLYFISH (which later became OCTABRAIN). They probably changed it later when they noticed it broke stuff like the shark, as they were working pretty heavily on just the shareware version at the time.
2

#6

From the top of my head I don't recall many situations in the game where Pig Cops would fall in water, though there are quite a few of them near water (E1M3 for example).

It usually happens when there's an RPV whose route goes over submersible water and you destroy it. Even then, a Pig Cop will not fall in water, it walks on the surface with its lower body submerged. This is standard behavior for Pig Cop I think, because I don't recall seeing one underwater in the vanilla game, while the others can fall in water because they use jetpacks and/or are capable of high jumps, so they require code that prevents them from falling in water simply by walking into it.
0

User is online   Danukem 

  • Duke Plus Developer

#7

View PostDuke of Hazzard, on 16 May 2017 - 09:21 PM, said:

Even then, a Pig Cop will not fall in water, it walks on the surface with its lower body submerged.


I'm pretty sure they will fall in and get transported to the under water sector, if there is one. They will stay half-submerged if it is a water sector with no transporter. I would have to run some more tests to be 100% sure.
0

#8

Pig cops aren't suitable for aquatic environment. Let's call the hippo cops!

Posted Image

No seriously, someone must make an enemy edit. :(
0

#9

View PostTrooper Dan, on 17 May 2017 - 12:14 PM, said:

I'm pretty sure they will fall in and get transported to the under water sector, if there is one. They will stay half-submerged if it is a water sector with no transporter. I would have to run some more tests to be 100% sure.


Yesterday I played through E4M4 aka "Babe Land". In that level there's an RPV near the pirate ship. The surface around the ship is submersible slime, therefore the sector must have a transporter. When I destroyed the RPV, the Pig Cop did not fall in water.

This post has been edited by Duke of Hazzard: 17 May 2017 - 08:25 PM

0

User is offline   Jolteon 

#10

View PostTrooper Dan, on 13 May 2017 - 10:14 AM, said:

The real mystery is why BOSS1 and BOSS2 are included in the water ban, especially since any pal 0 BOSS2 is already prevented from entering any sector that isn't lotag 3 in the same block of code.


Isn't it because of Flood Zone (E3L3)? I remember reading somewhere if a Battlelord (BOSS1) fell in the water in Flood Zone, it would have ended the threat early (At least if you have done everything underwater). I'm not sure About Cycloid Emperor (BOSS2) though.
1

#11

View PostJolteon, on 17 May 2017 - 09:01 PM, said:

Isn't it because of Flood Zone (E3L3)? I remember reading somewhere if a Battlelord (BOSS1) fell in the water in Flood Zone, it would have ended the threat early (At least if you have done everything underwater). I'm not sure About Cycloid Emperor (BOSS2) though.


Yes it is. It can be seen in one of the 1.3D demos.

A Battlelord is hiding behind a secret door. When triggered (done by moving towards the red key door), he'll move forward and land on a small platform on the edge of a building. If this code didn't exist, the Battlelord would keep going and fall in water, because it's not a STAYPUT sprite (as it moves across sectors). It would defeat the point, because he's there so that you don't cruise to the red key door unharmed.

In Come Get Some difficulty, there's another one, but I believe this one stays in the hidden platform, unlike the other one.

This post has been edited by Duke of Hazzard: 19 May 2017 - 01:00 AM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options