Openapoc: UFO is outside of the map\world border

Created on 27 Jul 2019  路  4Comments  路  Source: OpenApoc/OpenApoc

When loading a different save file, one of the four UFOs on the map is way out of bounds. I don't believe this occurred during the original play though but only occurred after loading the save. The game will immediately crash when unpaused unless the debug command to crash all craft is used. However, I believe the game will still crash later due to the UFO still being out of bounds.

Here are the last few lines when the game crashes without crashing the UFOs:

W 28314459700 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Clamped object to {0,0,0}
W 28319742700 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Trying to place object at {-9001,-9000.27,0} in map of size {140,140,13}
W 28326447400 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Clamped object to {0,0,0}
W 28350414200 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Trying to place object at {-9001,-9000.19,-9001} in map of size {140,140,13}
W 28358854300 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Clamped object to {0,0,0}
W 28368126200 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Trying to place object at {-9001,-9000.19,0} in map of size {140,140,13}
W 28381914700 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Clamped object to {0,0,0}
E 28399855200 void __cdecl OpenApoc::Vehicle::leaveDimensionGate(class OpenApoc::GameState &): Trying to launch already-launched vehicle
0x00007FF60C7D72C8 PHYSFS_writeSLE64+0x100e48
0x00007FF60C7CB405 PHYSFS_writeSLE64+0xf4f85
0x00007FF60C7D7815 PHYSFS_writeSLE64+0x101395
0x00007FF60C7DC75A PHYSFS_writeSLE64+0x1062da
0x00007FF60C6F173A PHYSFS_writeSLE64+0x1b2ba
0x00007FF60C5EBB40 PHYSFS_writeSLE64+0xfffffffffff156c0
0x00007FF60C515857 PHYSFS_writeSLE64+0xffffffffffe3f3d7
0x00007FF60C4F3A2E PHYSFS_writeSLE64+0xffffffffffe1d5ae
0x00007FF60C928265 PHYSFS_writeSLE64+0x251de5
0x00007FF60C6D6F10 PHYSFS_writeSLE64+0xa90
0x00007FFC87647974 BaseThreadInitThunk+0x14
0x00007FFC8A23A271 RtlUserThreadStart+0x21

Here are the last few lines when crashing the UFOs and allowing some time to pass:

W 35584581200 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Clamped object to {0,0,0}
W 35590199200 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Trying to place object at {-9001,-77.8232,0} in map of size {140,140,13}
W 35601557700 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Clamped object to {0,0,0}
W 35662200900 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Trying to place object at {-9001,447.177,-9001} in map of size {140,140,13}
W 35672603900 void __cdecl OpenApoc::TileObject::setPosition(struct glm::vec<3,float,0>): Clamped object to {0,141,0}
E 35676941200 class OpenApoc::Tile *__cdecl OpenApoc::TileMap::getTile(int,int,int): Incorrect tile coordinates 0,141,0
0x00007FF60C5B055C +0x7ff60c5b055c
0x00007FF60C8B6568 PHYSFS_writeSLE64+0x1e00e8
0x00007FF60C7F22A0 PHYSFS_writeSLE64+0x11be20
0x00007FF60C7DA9DB PHYSFS_writeSLE64+0x10455b
0x00007FF60C7DB216 PHYSFS_writeSLE64+0x104d96
0x00007FF60C7DC898 PHYSFS_writeSLE64+0x106418
0x00007FF60C6F173A PHYSFS_writeSLE64+0x1b2ba
0x00007FF60C6F4033 PHYSFS_writeSLE64+0x1dbb3
0x00007FF60C5EBA79 PHYSFS_writeSLE64+0xfffffffffff155f9
0x00007FF60C515857 PHYSFS_writeSLE64+0xffffffffffe3f3d7
0x00007FF60C4F3A2E PHYSFS_writeSLE64+0xffffffffffe1d5ae
0x00007FF60C928265 PHYSFS_writeSLE64+0x251de5
0x00007FF60C6D6F10 PHYSFS_writeSLE64+0xa90
0x00007FFC87647974 BaseThreadInitThunk+0x14
0x00007FFC8A23A271 RtlUserThreadStart+0x21

save_Stream Test 2.zip

!BUG! MEDIUM PRIORITY Pathfinding

Most helpful comment

OK, so debugging this the issue is that at load time, all vehicles are assigned a tileObject based on their current 'location' in GameState::initState() , but vehicles currently in the "traveling through dimension gates" state expect not to have tileObject and have a nonsensical location (which is clamped to the top-corner).

The Vehicle::leaveDimensionGate() function then triggers an error, as it wasn't expecting there to be a 'valid' tileObject when called.

All 4 comments

Also its not possible to even destroy UFOs by debughotkey by clicking on ufo icon at menupanel!
this feature should be added coz never know where UFO can go)

Here's a clip from my stream showing the issue. https://www.twitch.tv/videos/459284150

So "Alien Bomber 8" has the mission "ArriveFromDimensionGate" in the save, with the -9001 position that seems to be used as some kind of tag, but the state seems to have got messed up and doesn't correctly handle emerging from the dimension gate.

There may be a general issue with saving when a vehicle is in the process of travelling through a dimension gate.

OK, so debugging this the issue is that at load time, all vehicles are assigned a tileObject based on their current 'location' in GameState::initState() , but vehicles currently in the "traveling through dimension gates" state expect not to have tileObject and have a nonsensical location (which is clamped to the top-corner).

The Vehicle::leaveDimensionGate() function then triggers an error, as it wasn't expecting there to be a 'valid' tileObject when called.

Was this page helpful?
0 / 5 - 0 ratings