SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
88 stars 18 forks source link

Map Editor failing to save assets correctly. #3505

Closed average0belgian closed 1 year ago

average0belgian commented 2 years ago

I didn't really know how to format this well. Recently my editor (and from more people too I assume) has been wonky & annoying in saving assets that NEED to be alligned. image I have placed this road on the EXACT same height using Ctrl B & Ctrl N. After saving & going into singleplayer. It got missalligned. This happend to all my road pieces. Including my bridges...

As a person with OCD its quite annoying that this keeps on happening. I can't fix it cuz it'll just miss-alling itself after saving & quitting the map editor...

SDGNelson commented 2 years ago

Sorry about this! I think there may be some unnecessary jitter introduced because all transforms were using a world to pivot space then pivot to world space matrix transformation. The next update will only use this matrix transformation for scaling.

As far as I can tell it seems fine lining up roads in the next update, but if you would like to copy your map and give it a try on the preview version we can double-check it is fixed:

  1. Right-click Unturned in your Steam Library
  2. Select Properties... > Betas
  3. From the dropdown select "preview"
  4. Duplicate your map folder, rename it, and edit the copy rather than the original otherwise the old version is not forwards compatible if you try to open the map saved with the newer version
average0belgian commented 2 years ago

I'll check right now, Does this still allow me to play on Servers that aren't in preview "mode"? And what do you mean with " otherwise the old version is not forwards compatible if you try to open the map saved with the newer version"? I don't quite understand

average0belgian commented 2 years ago

image After booting up this beta, Weird "red boxes" appeared in my map. Is this an "error"?

SDGNelson commented 2 years ago

It is only compatible with servers running the preview version, so my suggestion would be to try on the preview branch and then go back to the default branch.

Clarifying the map compatibility: there are some changes to map savedata on the preview branch with objects and nodes. These have a higher version number on the preview branch. If you save the map on the preview branch with this higher version number then the default branch does not know how to load the map with a future higher version number. For this reason you should save a copy of the map so that when you go back to the default branch you can continue editing the original map and delete the copy.

average0belgian commented 2 years ago

image Seems like the gaps are still occuring, Way less & violent then before though

SDGNelson commented 2 years ago

And before saving it does line up? This is perplexing because I cannot reproduce it. Even building a road at a crazy angle in the sky it lines up normally after saving/loading multiple times:

image

average0belgian commented 2 years ago

Yeah even after replacing the entire bridge + ramp it still gets missaligned. I'll try to make it completely new in a couple of hours

average0belgian commented 2 years ago

@SDGNelson image Inside the map editor

image Loading the map up in SP & Re-opening the map in editor. Bridge gets missaligned.

average0belgian commented 2 years ago

^^ Does not happen with the other "Modular Bridge Exit #2" From DE steam mod.

average0belgian commented 2 years ago

image Seems like its still happening, Less violent though.

SDGNelson commented 2 years ago

Can you think of anything that would be unusual about your map's object setup or size? Alternatively, I wonder if you could send your map to me at nelson@smartlydressedgames.com and maybe I can replicate it when I use your map? If I can replicate/reproduce it in the editor that would make it a lot easier to fix.

average0belgian commented 2 years ago

There shouldn't be anything unusual. I'm editing Washington & revamping all mayor locations for an RP server. I can send you my map but it requires steam mods. I'll make a quick collection so you can easier subscribe to the mods.

EDIT: The only "un-usual" would be that my roads (not bridges) are a bit lower then normal. Using the scaling tool

average0belgian commented 2 years ago

Also seems like the offset isn't only vertical, I just noticed that my bridges are also offset horizonatlly image

SDGNelson commented 1 year ago

Following up: it seemed that most of the objects in the city had some amount of error in their rotation or scale. For example rotated 89.99 degrees or a scale of (1.001, 1, 1). The vanilla maps do not have this, so it must have been an earlier problem with some of the tools - perhaps with the error accumulation while dragging.

In order to eliminate this noise I made some changes so automatically snap scales and rotations that are very near to axis-aligned. For example 1.001 scale is corrected to 1, (and -1.001 to -1), and 89.99 degrees is corrected to 90. Testing on your map I found the gaps in the bridge, fixed them by repositioning the objects with Ctrl+B/N, and after saving/reloading it seems to be back to normal.

Sorry for all the hassle! If you have a moment I would be curious to know whether it seems to be fixed for you in version 3.22.19.103 on the preview branch. My hope is that this scale/rotation fixup will make it easier to snap other objects in the future as well.

average0belgian commented 1 year ago

Following up: it seemed that most of the objects in the city had some amount of error in their rotation or scale. For example rotated 89.99 degrees or a scale of (1.001, 1, 1). The vanilla maps do not have this, so it must have been an earlier problem with some of the tools - perhaps with the error accumulation while dragging. A: Impossible, I remade the bridge multiple times & expanding the parts copy pasting, So they should have been 100% alligned.

Sorry for all the hassle! If you have a moment I would be curious to know whether it seems to be fixed for you in version 3.22.19.103 on the preview branch. My hope is that this scale/rotation fixup will make it easier to snap other objects in the future as well. A: I'll be checking it out right now

average0belgian commented 1 year ago

(also sorry for my "useless" mail I send around 5-ish mins ago xd)

average0belgian commented 1 year ago

Seems like everyting stays in its original position after saving & reloading the map editor multiple times!

Thank you very much for fixing this bug that has been bothering me for a while ^_^

SDGNelson commented 1 year ago

Phew, glad to hear it!