Post 08 Mar 2017, 06:43 by Lewin
Sometimes happens: "EAssertionFailed: UpdateWalkConnect failed due too many unconnected areas" in file KaM Remake\Trunk\src\KM_TerrainWalkConnect.pas, line 294.
This occurs when more than 255 separate "islands" are created on the map. As an optimisation the pathfinding code assumes there will never be more than 255 different islands (which is fine for normal maps). For example this would probably happen if you set the height of all tiles on the map to a random value since you will end up with lots of disconnected islands of 2-3 tiles.
Desynchronisation breaks singleplayer replays as well, so it's not just a multiplayer issue. As Krom said there are alternative ways to implement timing logs like BeginPeriod / EndPeriod. Desynchronisation bugs are extremely difficult to track down since they will usually occur a long time after the desynchronisation occurred in some other random place. I'm strongly against adding anything to the API which allows scripts to cause desynchronisation as it puts too much onus on the script authors to follow arbitrary guidelines, and desynchronisation crashes will make the game appear buggy and be misattributed to the game rather than the script. Right now it's basically impossible to crash the game from the script which is a great thing IMO.
PascalScript is executed as bytecode, it's not going to be nearly as fast as compiled code. If you implemented your random map generator in the native KaM Remake code your performance issues would stop being a problem, and you would also avoid having to reimplement your terrain painting functions (managing tile transitions) since we have those already. I'm happy to help you get it compiling on your machine if you are interested.