Jump to content
Double Fine Action Forums
Sign in to follow this  
Ryukaki

Collision Bug and Searching for Solutions.

Recommended Posts

So, there is a known bug in the game where you can sometimes get locked out of the cages in the CodePuzzle rooms.

It turns out, this issue stems from the fact that for some reason, Bob is counted as a trigger point for interaction with trigger lines/volumes, and his orbit can occasionally bump into the trigger volume inside the cage upon approach and lock you out!

I've been searching around in the lua for an easy way to fix this problem, and so far, haven't really been able to determine what it is that decides that Bob is an extension of the player's hitbox.

It occurs to me upon searching, that maybe these trigger volumes don't care what invokes them, so I tested it, and I'm right. Bob can trigger ANY of the trigger volumes in the game.

However, I can't seem to locate a non-arbitrary method of identifying between the player and bob as a callable argument. There are plenty of ways to do it arbitrarily, but I am having trouble finding a non-arbitrary one.

By arbitrary, I mean I can search for, for instance, Bob's name, and check it against the player name, and then NOT trigger the volume if it finds Bob's name, but do if it finds the player's. Or I could search for a certain sprite, and only trigger it if I find Alice's sprite, rather than Bob's. But these are arbitrary!

Is there a function I can pass as an argument to an if statement that will cleanly identify between Bob and Alice that is NOT arbitrary, or am I missing something super simple?

In the long run, though, this probably requires a deeper fix that stops letting the attached sprite trigger volumes.

Thanks to anyone if you can help out!

Share this post


Link to post
Share on other sites

Is that a known issue? I don't recall seeing it documented.

In any case, it's hard to say without knowing what the callstack is. From my experience, there's only 3 ways to do it. From cleanest to dirtiest:

1 - Pass the object that triggers the event (usually self) as an argument of the function and compare it with the expected object inside the function

2 - Block the function call except when applicable

3 - Set a global variable to a specific value immediately before calling the function and revert the change immediately afterwards

Hopefully that helps.

...actually, now that I think of it, seeing the entire callstack when the universe collapses would be an amazing feature.

Share this post


Link to post
Share on other sites

Should be a known issue. It's on my bug list, anyways. If you're outside a cell and the orbit of Bob happens to pass over the trigger volume inside the cell, it'll close and lock the doors and trigger the whole "locked in" event, locking you out of the cage. Pretty neat, actually.

The approach I will probably be taking is just to dig in and figure out how the game decides who can trigger a trigger volume, and find a method of preventing the function call unless Alive is the invoker. I'm not 100% familiar with how all of their stuff works yet, so I've got a lot more research to do, dun dun dun. Probably also need a separate function for handling if Bob needs to trigger something, though I haven't seen any instances where that's true.

I've cleaned up a bunch of other bugs, though, and had a lot of fun doing it. Making it a pet project to clean up all of the bugs on my buglist and making the lua edits available, and hopefully I'll understand enough of this stuff to make my own levels/puzzles soon enough, most of it's really not actually that hard to work with, even without tools.

Thanks a bunch for the feedback!

Share this post


Link to post
Share on other sites

It's my intention to maybe possibly be of some use to the guys over at Doublefine, mostly out of interest in learning more about applied Lua, but also because I think this project is really something special. Figured a good way to go about it was to be able to find and offer fixes to bugs, instead of just finding them.

Thanks for the link, I'll have a look at it!

Share this post


Link to post
Share on other sites

Well, in this case I suggest working on the decompiler first. This would make everything else easier.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×
×
  • Create New...