Thanks. Based on my testing, the number of players joining and leaving the game, the number of players who get a save code, and the number of players who use the loading station (even without loading a hero) all increase the risk of crashes. Some maps seem to be a bit more likely to crash than others.
The server crashes, unfortunately, are a problem I do not know how to solve anymore. I really tried everything I could, removed a lot of features (players used to be able to carry 20 items in their inventory, there were hud texts in the color of the item rank, colored explosions when picking up loot, in-world texts for stations, in-world texts showing the enemy rank and type, a boss icon, 5 teleporters instead of 2 on every map, a quest system, etc.), I rewrote the entire script over and over again, greatly reduced the number of global and player variables used, but the crashes still happen.
There appears to be a problem in workshop that I’ve encountered in many of my other game modes as well which makes the server crash when you have relatively large arrays (even one global variable array with ~50 integer values seems to be enough) and the script changes too many of of the values in these arrays. For some reason, this appears to put a ton of stress on the server, and it does not make any difference how fast or slow you change these values (when I put a wait time of 1 second after every single set global variable at index action in other projects, the server still crashed just as often).
So changing an array of that size appears to be too much for the server, when you have some other things going on, even when there’s just a relatively low number of effects in the game. Loot Quest does have global cooldowns for enemy spawn and despawn events and player-specific cooldowns of 1-10 seconds for complex actions such as equipping an item. When a player receives a save code, no player can perform any complex action for 5 seconds, no loot is created for that time, and enemies won’t spawn or despawn. But this didn’t help avoid the crashes.
Equipping an item is another action that caused a lot of crashes in every version of Loot Quest, and all it does, is temporarily save the equipped item array (19 integer values) in a global variable, replace the equipped item array by the inventory item array, and then replace the inventory item array by the temporary global variable. So copying 3 arrays with 19 entries each crashes the server. Maybe someone can explain this to me, but with my limited technical knowledge I simply cannot understand how that can be too much for the server to handle.
At this point, I also do not have any idea on how to optimize the save code system without completely redesigning it (including the item stats). Right now, the codes saves 18 values of the equipped item (7 of them have 2 digits, the others 1), a player’s gold (4 digits), the number of boss summon stones (1 digit), the player’s level (2 digits) and EXP% (4 digits). 4 digits are reserved for the validation system (so a randomly entered code only has a chance of 1 in 10,000 to be a valid code).
There are things, I could try to make Loot Quest more stable. One of them would be to remove the colors of the loot sphere effects on the ground (turn them into permanent effects that only have their position adjusted), or reduce the number of item stats (for example, by removing max health and projectile velocity and by reducing damage dealt, damage taken, and move speed to single-digit stats), or I could remove the reroll and refine systems I just added (just to reduce the size of the script in the hope that that would help), but - at this point - I’m not willing to spend that much time to remove features from the game mode, for the slim hope that it might help with server stability (and also, changing the item stats would render all previous save codes invalid which is something I really want to avoid so players don’t lose their save states).
Sorry, for the long reply. I just wanted to explain why - at the moment - I have no plans to work on newer versions of Loot Quest.