Desynced Feedback

Search
IDRatingCategoryDescriptionScreenshotDate
5365🙂SuggestionThis is a suggestion to assist in modding. I'm sorry for the wall-o-text. I'm including my use case with this suggestion as I realize the ideal solution for me might not be a great idea, so hopefully an alternate solution could be found.

For some mod testing purposes, it would be great to have the ability to more quickly end and start a new game.

Ideally? An API that is active only when in Mod Dev mode that can be called from within simulation code that will end the current game and start a new game with identical settings (just a new seed) or with provided settings.

Other options would be something like:
-- hotkeys that can be used to do the same, or at least separately end and start a new game.
-- From the [ESC] menu in a running game, have a New Game option rather than requiring ending the current game to return to the main menu.

Why?
I expect I may be a bit unique in wanting this, though I can image my use case wouldn't be the only possibility, but my reason for wanting this is because I am attempting to create a mod that allows the player the ability to set the richness and rarity of some of the resource nodes. From my reading the notes left in the landfeatures.lua file, I understand I can add a filterless chance ({chance = x}) into the feature's or node's functions table. However, in my testing of this, it appears the affects this has on how many of the resource node will spawn are non-linear. In other words, adding in {chance = 0.1} does not result in a simple 10% of the amount of resources spawning compared to a value of 1. In fact, from the testing I did, values less than 1 for rich crystal (at least... I haven't properly tested anything else) caused an *increase* in how many spawn until ~0.1 (110% of what spawns with a value of 1), and drops back down to 100% (equal to a chance value of 1) at ~0.05. Then the amount spawned starts to drop below what will spawn with a chance value of 1 from there with smaller numbers. To actually get a true 10% spawn rate? A value a bit more than 0.001 (9.3%) must be used.

These tests were done by creating a custom scenario that spawns a bot with an increased vision range to 255 and then using the API Map.GetEntitiesInRange() with a range set for 500 (to encapsulate everything that generates with that vision range), filtered and further checked to count only the specific resource I was evaluating, and then done 50 times per value of chance used to create a semi-good average to account for RNG. I have somewhere around 40 values for chance I want to test, each needing the 50 games to create a semi-good average. This means I need to start and end at least 2000 games.

I've managed to automate as much as I can, but it still requires me to be at the computer to manually start and end each game session: click New Game, select my custom scenario, click Start, wait the second or so it takes for the game to load and the 1 tick delay to fire (at which point it counts the number of resource nodes generated on the map, adds them to a table in the mod's profile along with a couple other calculations, and prints something to the console so I know it's done), press [ESC], click End Game, and then the confirmation dialog. 1 done.

Repeat another 1999 times.

It would be faster if from the [ESC] menu of a current game there was a New Game option, thus allowing me to skip the need to End Game and return to the main menu.
It'd be even faster if I could just press a set of hotkeys, one to end the game and another to start a new one (with same settings as the last except with a new seed), or faster still if these two actions could be combined into one hotkey.
The fastest method, of course, would be the mod dev mode only API that could be called by the simulation code in my custom scenario to do this for me. I already have a functional loop that keeps track of how many times I've started a new game and automatically increments my chance value that is being tested each time I hit 50 and prints extra stuff to the console once I hit the end of the values for chance I want to test.

However, I do recognize the abuse potential there, even with making it active only when in mod dev mode. So that's why I've included my use case above. Maybe you can think of a better solution. Or maybe {chance = 0.1} is supposed to make the resource node only have a 10% chance at spawning and there's a bug in the code that you can fix (if only, right?). Either way, I hope you can understand and implement something that will help me out here. As a last thought before submitting this, maybe even some command line arguments that allows starting of the game from a batch or powershell file to a defined scenario and a new "print" API to send values to the calling script so that it can process it and then call for the game to end. Then the external script file can handle the looping of the game starts and ends automatically.

Thank you for taking the time to read this. :)
2025-06-05 01:14:45

IDReplyAuthorDate

EULA    |    Privacy Policy    |    Presskit


© 2025 Stage Games • All rights reserved