Linux #127: repeated "teleport pc" quest action causes world falling outside [RESOLVED 0.11.4]

Locked
User avatar
Jay_H
Posts: 4062
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Linux #127: repeated "teleport pc" quest action causes world falling outside [RESOLVED 0.11.4]

Post by Jay_H »

Summary: Getting teleported to a dungeon via "teleport pc" works fine until you leave the dungeon. The game doesn't know what height to put you at, and can place you 50 meters above the ground or well below the surface.

(Repro quest expired, can recreate)

Steps: After starting the quest, use either "tele2exit" or "trans_out" console commands to leave repeatedly. The quest is programmed to trap you inside the dungeon. However, though the trigger works, it'll often send you under or over the world and cease recognizing location after the 2nd attempt or so.

Mods activated: None
Last edited by Jay_H on Thu Dec 20, 2018 9:30 pm, edited 1 time in total.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Linux #127: repeated "teleport pc" quest action causes world falling outside

Post by Interkarma »

I'm working on vampirism and believe I have another way to trigger this now. I'm fairly confident problem is related.
  1. Get infected (e.g. console "disease player vampire")
  2. Rent an inn, create a save, then rest until death.
  3. Exit dungeon after waking up.
  4. Reload previous save and rest until death again.
  5. Exit dungeon after waking up.
When exiting dungeon the second time, player and world are far outside of where game world should be. You might even see the exterior for a moment before falling into the void.

Jay, I'm taking a look at this one now and will let you know once resolved so you can test from quest actions again.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Linux #127: repeated "teleport pc" quest action causes world falling outside

Post by Interkarma »

Jay, this should be fixed now in live code if you're able to test from there. Otherwise it will be in first 0.7 builds.

Problem was simply one of floating origin not being reset when chaining interiors together. When player went back into outside world the environment would be setup at obscene offsets where physics don't work and player simply falls through ground or pops off into madspace.

Roughly two hours of debugging to make a one-liner change to code. That's game dev for you. :)

User avatar
Jay_H
Posts: 4062
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Linux #127: repeated "teleport pc" quest action causes world falling outside [RESOLVED]

Post by Jay_H »

Cool! I'll have to try it when 0.7 comes out but that's no problem. Thanks for looking into this.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Linux #127: repeated "teleport pc" quest action causes world falling outside

Post by Hazelnut »

Interkarma wrote: Tue Dec 18, 2018 5:04 am Jay, this should be fixed now in live code if you're able to test from there. Otherwise it will be in first 0.7 builds.

Problem was simply one of floating origin not being reset when chaining interiors together. When player went back into outside world the environment would be setup at obscene offsets where physics don't work and player simply falls through ground or pops off into madspace.

Roughly two hours of debugging to make a one-liner change to code. That's game dev for you. :)
Yeah, but this little bug has been eluding us for such a long time that's a massive win. Only 2 hours? That's a win! :D
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Jay_H
Posts: 4062
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Linux #127: repeated "teleport pc" quest action causes world falling outside [RESOLVED]

Post by Jay_H »

I'm making a quest with this action and the problem persists in #146. It seems to be as before. This save zip includes the text of the quest file I'm working on. If you enter the dungeon and exit twice, you'll be under the world.
Attachments
tele problems.zip
(148.36 KiB) Downloaded 194 times

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Linux #127: repeated "teleport pc" quest action causes world falling outside

Post by Interkarma »

Thanks Jay! Seems the problems weren't related after all. I'll take a look when I can.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Linux #127: repeated "teleport pc" quest action causes world falling outside

Post by Interkarma »

The issue here is related to parent task switching on/off between teleport actions. The teleport action does some followup work to reposition player after teleport completes. Because the action was switching off once player was outside, this followup work wasn't performed until player next teleported into dungeon. Then the previous followup would be called first, resulting in player desyncing from world.

I've fixed this specific bug, and teleport action needs a review in light of some other issues. This action might become non-rearmable in future, which would prevent quests like this from trapping player in a dungeon.

Locked