More about crashes...
In post #35, I explained why crashes are unavoidable: they happen if I don't let civ5 breath, but civ5 kills your civ if it ever breathes (since your units suddenly drowned after the map script put an ocean hex under their feet). I tried to move as much things as possible in pre-generation steps that are spread across multiple frames but there is still a final burst made of three step: killing the last unit of each civ, generating a new map, placing new units.
However, I found a solution: replace the Map and Plot objects with custom implementations! This is tedious (it requires twice much work than Reseed altogether), boring, but it should work. That way the map script could run without actually modifying the map: it would only modify a dummy, pure LUA, map. Once I get a LUA representation of the new map, I will be able to first modify the starting plots, then move all units to those ones, then progressively update the rest of the map across multiple frames.
That should fix crashes for all. Also, it should allow me to prevent the "random instant game over" bug that occurs if you every founded a city. Indeed, I would always be able to add new units before I kill the other ones and I guess it will be enough to prevent civ5 to trigger a player's death. This would allow me to remove the limit I had to set up in v4.5.
In post #35, I explained why crashes are unavoidable: they happen if I don't let civ5 breath, but civ5 kills your civ if it ever breathes (since your units suddenly drowned after the map script put an ocean hex under their feet). I tried to move as much things as possible in pre-generation steps that are spread across multiple frames but there is still a final burst made of three step: killing the last unit of each civ, generating a new map, placing new units.
However, I found a solution: replace the Map and Plot objects with custom implementations! This is tedious (it requires twice much work than Reseed altogether), boring, but it should work. That way the map script could run without actually modifying the map: it would only modify a dummy, pure LUA, map. Once I get a LUA representation of the new map, I will be able to first modify the starting plots, then move all units to those ones, then progressively update the rest of the map across multiple frames.
That should fix crashes for all. Also, it should allow me to prevent the "random instant game over" bug that occurs if you every founded a city. Indeed, I would always be able to add new units before I kill the other ones and I guess it will be enough to prevent civ5 to trigger a player's death. This would allow me to remove the limit I had to set up in v4.5.