Duke4.net Forums: Grins of Divinity Ladder Problem - Duke4.net Forums

Jump to content

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

Grins of Divinity Ladder Problem  "Unrelated to regular spriteladders"

#1

Grins of Divinity uses a very specific method to implement ladders, let me demonstrate: https://streamable.com/n1pbq
As you can see, the mod uses a floor-aligned sprite that raises once the player presses 'use' or jumps while near its position, in order to simulate ladder climbing

This behavior however broke with eduke32 r7436, and is still broken with r8603. This is what happens now: https://streamable.com/jceia

From what I can tell, the ladder platform is supposed to lower when near the ceiling the actor is in, but for some reason the current version always thinks that this is the case, and thus it is always pushed down.
The CON code used for the ladders is the following:
action ALAD_UP 0
action ALAD_DN 0
action ALAD_ST 0 
action ALAD_NO 0
action ALAD_AUTO 0

move LADUP 0 -80
move LADDN 0 80
move LADNO 0 512
move LADST 0 0
move LADAUTO 0 -2048

ai AILADUP ALAD_UP LADUP 4
ai AILADDN ALAD_DN LADDN 4
ai AILADST ALAD_ST LADST 4
ai AILADNO ALAD_NO LADNO 4 
ai AILADAUTO ALAD_NO LADAUTO 4

state lads 
    ifpdistl 512
        {
        
        ifhitspace
            {
            action ALAD_UP
            tip
            }
        else
            {
            ifp 8
                action ALAD_DN
            else
                action ALAD_ST
            ifp 8
                tip
            }
        }
ends


actor 5289 0
    // cstat 32801 // normally invisible
    cstat 33
    ifp 16
        {
        ifp 64
            action ALAD_AUTO
        else
            action ALAD_NO
        }

    ifceilingdistl 272
        action ALAD_DN
    else
        state lads

    ifaction ALAD_UP
        ai AILADUP
    ifaction ALAD_DN
        ai AILADDN
    ifaction ALAD_ST
        ai AILADST
    ifaction ALAD_NO
        ai AILADNO
    ifaction ALAD_AUTO
        ai AILADAUTO
enda


Specifically, after pressing use on the ladder in the tutorial map, the conditional "ifceilingdistl 272" always returns true, and thus prevents the ladder from moving up, as its action will be locked to ALAD_DN.

Link to the file used: https://www.sendspace.com/file/cfgsmf

This post has been edited by Doom64hunter: 06 February 2020 - 03:12 AM

2

User is offline   Danukem 

  • Duke Plus Developer

#2

I would expect ifceilingdistl being broken to impact a lot of stuff, not just Grins of Divinity. That is a large number (272) though. I wonder if the command maxes out at 255 or some lower number nowadays.
0

#3

Yeah it seems that this TC uses some very strange hacky method to make the ladders function, it doesn't really make sense to me why it works in versions prior to r7436.
Still it's worth noting that the behavior did change.
0

User is offline   Hank 

#4

This issue applies also to the ladders of SST, and since I took the code from this team, on my maps.

p.s. the code is the same to GoD, except that SST has a height feature.

This post has been edited by Hank: 06 February 2020 - 09:02 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#5

But it seems like we are burying the lead here by talking about these specific projects, if the underlying problem is that the basic CON command ifceilingdistl is broken, since that's used in the vanilla scripts and in pretty much all mods.
1

User is offline   Hank 

#6

Really? In this case, remove my post.
0

User is offline   Jimmy 

  • Let's go Brandon!

#7

GoD had some very brilliant but hacky shit in it. I personally wouldn't expect it to run properly in EDuke32 regardless.
1

User is offline   Kyanos 

#8

Spoiler


It's in the code to tell the trooper to jetpack to higher players. Working on the latest builds. Also I set it to 272 just to test and worked then too.
0

User is offline   Kyanos 

#9

Something about this line is being read literally now, I think.
ai AILADAUTO ALAD_NO LADAUTO 4

It calls the action ALAD_NO when using ai AILADAUTO, which then triggers.
  ifaction ALAD_NO
    ai AILADNO

Both actions no and down go down, I'm not sure if this is what is happening, when I put a bit of effort into debuging the con both addlog and addlogvar wouldn't work on my end...


edit.
Yeah it's definitely ifceilingdistl that's acting up, it turns positive too soon as if the math is adding up to fast somewhere. The liztroopers are probably a poor test because I expected them to fly and they did, although probably a bit too soon which I didn't notice. They probably won't fly indoors despite high ceilings... off to test.

This post has been edited by Photonic: 06 February 2020 - 03:00 PM

0

User is offline   Kyanos 

#10

            vInstruction(CON_IFCEILINGDISTL):
                VM_CONDITIONAL((vm.pSprite->z - vm.pActor->ceilingz) <= (*(++insptr) << 8));
                dispatch();

^ current
v r6428 (it was lying around)
        case CON_IFCEILINGDISTL:
            insptr++;
            VM_CONDITIONAL((vm.pSprite->z - vm.pActor->ceilingz) <= ((*insptr)<<8));
            continue;


The whole thing has been reworked, I think that moving insptr++ into the calculation may be the issue


Nope... I'm out.

This post has been edited by Photonic: 06 February 2020 - 03:40 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#11

I'm wondering if vm.pActor->ceilingz itself got changed. Like maybe it now takes slopes into account when it didn't previously.
0

User is offline   Kyanos 

#12

Heres a red flag
    int const clipDist = A_GetClipdist(spriteNum, -1);

    VM_GetZRange(spriteNum, &ceilhit, &florhit, pSprite->statnum == STAT_PROJECTILE ? clipDist << 3 : clipDist);

^7437
was
v7435
    VM_GetZRange(spriteNum, &ceilhit, &florhit, (pSprite->statnum == STAT_PROJECTILE) ? 4 : 127);


Quote

---------------------------------------------------------------- --------
r7436 | terminx | 2019-03-19 10:10:17 -0700 (Tue, 19 Mar 2019) | 1 line

This should fix most of the remaining issues with projectiles colliding with ledges they shouldn't be hitting


So now it's using clipdist instead of 127, on a floor aligned sprite the z range clipdist is 1 or 0 and it isn't working.

This post has been edited by Photonic: 06 February 2020 - 04:24 PM

0

User is offline   Jimmy 

  • Let's go Brandon!

#13

Yes, it was made for 1.5 but has some very advanced stuff for the time, like I said, very hacky in it's application but it worked well then.
1

User is offline   FistMarine 

#14

View PostRadar 100 Watts, on 12 February 2020 - 07:19 PM, said:

Which level in the mod are these recordings from?

Training Course
1

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