Wrong orientation for some levers

Discuss coding questions, pull requests, and implementation details.
Post Reply
MaxRebo
Posts: 8
Joined: Thu Jan 21, 2016 9:07 am

Wrong orientation for some levers

Post by MaxRebo »

While playing some DFU today I noticed in the dungeon "Ruins of Old Barbona's Place", some of the levers have the wrong Action Rotation axis. Instead of rotating about the Z-axis they rotate about the X-axis, which ends up looking like this:

Image

From retracing the callstack where the Action Rotation is applied to the lever's Action Script, it looks to me like the axis is coming straight from the data files. Am I assuming right this is an error in the DF data files?

I also tried to verify this by visiting the location in the original DF but it is suprisingly tedious to get to that specific location in that specific dungeon, so after a while I gave up on that. On that note - do you guys have some sort of testing environment set up for situations like these? If so, how does it work?

But back to the original problem - I'm not sure if the same error occurs in the original DF or not but would it be a viable workaround to force the Action Rotation to be on the Z-Axis in case the rotation is being applied to a lever object? If so, can we uniquely identify a lever object by its Model Description "C0Z"?

From the code it looks like this wouldn't be the only workaround like this anyways - there are such workarounds for Coffin lids & wheels already in place (RDBLayout.cs:1044+).

EDIT: Ok, it seems "C0Z" is used by a wall segment that is moved by the lever as well, so not exactly unique to the lever it seems. I could still work around that - at least for that instance - but no idea what other objects have that same description so thats probably not a good idea. I suppose identifying it by its mesh ID might work.

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

Re: Wrong orientation for some levers

Post by Interkarma »

The action data is read from classic, DFU should be matching outcome here. Unfortunately not much to do about this other than patch the data.

We cannot just force the lever axis, as levers can be mounted at other angles including on walls.

MaxRebo
Posts: 8
Joined: Thu Jan 21, 2016 9:07 am

Re: Wrong orientation for some levers

Post by MaxRebo »

Good point. Too bad, let's see if i can find something else to fix then :)

MaxRebo
Posts: 8
Joined: Thu Jan 21, 2016 9:07 am

Re: Wrong orientation for some levers

Post by MaxRebo »

By the way, while I'm at it - some of the staircases in dungeons are not aligned properly which results in some gaps between the starcases and the walls / ground:

Image
Image

Is this an issue with the data files too?

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

Re: Wrong orientation for some levers

Post by Interkarma »

The world is read directly from game data and generated at runtime from that. As a rough rule of thumb if you can see it, hear it, touch it, move it, spawn it, or teleport on top of it, there will be classic game data involved. The DFU side of things is mostly binary format readers and business logic for gameplay systems.

Post Reply