Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)(-1)

Hello Werdin!

So, the values that I need to calculate can be calculated on demand when the player performs the action. The game is currently designed to stop simulating until all decisions are resolved. So I could use a naïve algorithm to calculate those values. What the player would experience is one second pause (approximately) while the game calculates the values before presenting the player with a choice. This doesn't seem like big deal, but this precludes me from ever using that same algorithm in situations that do not involve pausing the game.

What I want (and I already have a solution in mind. I just haven't written the code yet) is an algorithm that updates those values on-the-fly while minimizing the recalculations. This way, the values will be already calculated before the player performs the action and there will be no delays in presenting the player with a choice. If this works, then I will be able to use that same algorithm in situations that do not require the simulation to pause.

Like I said, I already have a solution in mind. It's not perfect and will require a bit of work. But it's a decent solution that solves the bigger problem: What I need is something that gives me the bounds of a polity (in map squares) without going through every cell. That is, without doing 'n' checks (where n is the number of cells in the polity). If my solution works, I will be able to do it by performing roughly sq(n) checks (where 'sq' is the square root). Also, this is an operation that I will only need to do very occasionally. 90% of the time, I will only need to perform one check when I need to update the bounds of the polity.

(-1)

Your comment is really expanded, and I am glad that you responded. Thank you very much, now it became a little easier for me to understand and present your choice.