ikonhero
Member
So I had this idea of a city builder. Something similar to sim city, but with a different look.
I figured I made the buildings sort of procedurally generated instead of using sprites.
Here's what I came up with so far:
Each zone draws a cube as a house. It's size represents the population capacity, and color brightness will eventually represent current population for the building.
At this point the only sprites I'm using are for the grid tiles and the roads.
As you may see in the screenshot I'm getting only 43 real FPS. So this may not be a very executable idea.
The thing is, with this system you can let the color of the buildings represent all kinds of things, for instance switch to "land value" view where all buildings would color in relation to land value.
As for my actual question. I was was wondering on how one would approach the handling of all the data for a simulation like this. I did a test where I filled up a 64x64 grid with small building zones and roads and the game froze instantly.
So, I set up a timer to update each zone's stats every 3 secons, but that only resulted in the game freezing every few seconds .
I guess things can be optimized to run more smoothly by having the game check only the very minimum required data in every step. Right now I'm checking lots of things, like surrounding zone types. trying to find nearest subway station and storing its distance, etc.
So, do you think a game like this is possible?
Are there any ideas on how one would approach the handling of data for each zone? Could it be useful to make a massive 2d array for the map and store each zones statistic as value in that array? Or maybe a DS grid?
I would really be interested in your ideas.
Thank you!!
I figured I made the buildings sort of procedurally generated instead of using sprites.
Here's what I came up with so far:
Each zone draws a cube as a house. It's size represents the population capacity, and color brightness will eventually represent current population for the building.
At this point the only sprites I'm using are for the grid tiles and the roads.
As you may see in the screenshot I'm getting only 43 real FPS. So this may not be a very executable idea.
The thing is, with this system you can let the color of the buildings represent all kinds of things, for instance switch to "land value" view where all buildings would color in relation to land value.
As for my actual question. I was was wondering on how one would approach the handling of all the data for a simulation like this. I did a test where I filled up a 64x64 grid with small building zones and roads and the game froze instantly.
So, I set up a timer to update each zone's stats every 3 secons, but that only resulted in the game freezing every few seconds .
I guess things can be optimized to run more smoothly by having the game check only the very minimum required data in every step. Right now I'm checking lots of things, like surrounding zone types. trying to find nearest subway station and storing its distance, etc.
So, do you think a game like this is possible?
Are there any ideas on how one would approach the handling of data for each zone? Could it be useful to make a massive 2d array for the map and store each zones statistic as value in that array? Or maybe a DS grid?
I would really be interested in your ideas.
Thank you!!
Last edited: