MicroCity - City simulation in your pocket


(James Howard) #41

Hmm do you think it might be possible to specify a .bss section that is at the address of where the magic key lives so that the compiler avoids allocating it to something else?


#42

Not reliably @dxb tried, see here

Untill the new board package is out, you could add the new wiring.h to your sketch folder to add the bootloader and reset button features. Pressing LEFT+UP+A+B for 2 seconds will put Arduboy in bootloader mode.


(Scott) #43

How is this better than using flashlight mode?


#44

You don’t have to turn Arduboy off and on again to use it.


(Scott) #45

But the timing becomes tricky because the uploader isn’t doing the reset.


(Kevin) #46

Further discussion of boards files should move to it’s own thread.

Thanks @jhhoward and @MLXXXp

Working on getting this game featured on the front page next week!


(James Howard) #47

That’s awesome! I’ll have to get that version 1.1 uploaded soon then! :smiley:


(Gavin Atkin) #48

Looks cool! Haven’t gotten a chance to try it yet, but I did have a question as I was browsing the code.
"typedef struct
{
uint16_t year; // Starts at 1900
uint8_t month;
uint8_t simulationStep;

int32_t money;

// 2 bits per tile : road and power line
uint8_t connectionMap[MAP_WIDTH * MAP_HEIGHT / 4];

uint8_t terrainType;

Building buildings[MAX_BUILDINGS];

uint8_t taxRate;

uint16_t residentialPopulation;
uint16_t industrialPopulation;
uint16_t commercialPopulation;

int32_t taxesCollected;
uint8_t policeBudget;
uint8_t fireBudget;
uint16_t roadBudget;

uint16_t timeSinceLastDisaster;

} GameState;"

I haven’t seen a struct being used this way. What is the benefit of declaring a structure type like this?


(Pharap) #49

Do you mean the typedef thing?

If so, it’s a C thing.
C requires the keyword struct in front of all structs unless you use typdef, in which case struct isn’t needed.

In C++ and Arduino usage it’s pretty pointless.


(Gavin Atkin) #50

Interesting, I hadn’t seen the syntax written that way so I was wondering if it had any efficiency bonus. Thank you!


(James Howard) #51

Ah yes just a habit I have from writing things in C. No efficiency bonus or anything, purely old fashioned syntax!


#52

Absolutely amazing.
Disasters? DO NOT INCLUDE THEM. I was tumbled all over the place by that stupid Dr. Vu. Now you have club wars. Great.
Will be as big a hit here as it is on Apple mobile devices.


(James Howard) #53

The only disaster I am currently planning to include is fire outbreaks. If there is a fire department nearby then it will be put out automatically (this is how the original SimCity worked). It makes there an actual reason to build fire stations!


(James Howard) #56

I have just released version 1.1 of MicroCity on Github

New features:

  • Added fire system with random outbreaks. Nearby fire departments will put out fires.
  • New tiles for water edges and rubble from bulldozer / destroyed buildings
  • Auto-budget system which skips the end of year budget screen when there is a positive cash flow and positive funds (on by default but can be disabled)
  • Tweaked population growth algorithm which makes the game more challenging
  • Greater capacity for placing buildings: up to 30% more

Note that save games are not compatible with version 1.0 so if you update you won’t be able to load your old city.


#57

Thank you again for microcity! Everything seems to work great, i do have a question though. When I start my city, i don’t see buildings until around the 5th or 6th year and even then it’s only one. after 20 or so years i might have half a residential filled. I’m assuming this might be in part to time being rather fast. I’ts also likely i suck at building. Is the building ratio similar to the original simcity?


(James Howard) #59

@HercTNT @CDR_Xavier
Version 1.1 is a bit more challenging so here are some tips for building a good city:

  • Buildings need to be connected to the power station and have roads built next to them to function
  • The balance should be roughly 50% residential zones, 25% commercial zones and 25% industrial zones
  • Industrial zones and power stations generate pollution so avoid placing your residential zones too close to these areas.
  • Lowering the tax rate in the budget will encourage population growth so can be a good idea when first starting your city. Once you have a stable population, raise the taxes again.
  • Building parks has a small positive influence on nearby residential areas
  • Crime will increase as your city grows. High crime will discourage growth. Build police departments to reduce crime in the surrounding area, but don’t build too many as it will cost too much in the yearly budget!
  • Occasionally buildings will catch fire. Nearby fire departments will help put the fire out but if you haven’t built any in the area then the fire will spread.

Hope that helps, have fun!


#60

Thank you :slight_smile:


#61

Thank you! Microcity may just become a permanent fixture on my arduboy. It’s looking like I should buy another one to play anything else.


(James Howard) #62

I have now packaged up MicroCity in the .arduboy format to make it easier for those using a game loader like @crait’s Arduboy Manager.

It is now included in the Github release page

Or directly download MicroCity.arduboy


#63

I was in fact quite busy with the 1.0. VERY, VERY good game. Easily comparable to the one on iOS, and perhaps a bit more fun.
You can’t watch cars and traffic going around. There is simply not a high-resolution colored display, and not enough RAM and processing power. Very nice game still. I had fun just looking at the lake.
BUT:
There is this bug where you can’t put two power stations. (strange.) If you put another one down, the other one will simply be dead and stops generating. In fact itself would be out of power. (strangER) That happens both when it is connected to another one via buildings or ‘wire’, or when not connected. Stadium is interesting. But does it do anything?
There is also bugs where you can put road on top of water (seems to be a visual glitch, it turns normal when it went off-screen and reappears. You can also NOT place building on it although I wanted(POLICE STATION!). Placed road in this manner looks properly.) No bridges so that is the only way I can place road on water (bridge)
You took the park from ROYAL GARDEN. Cool. Nicely done.
Where’d you take the others?
Edit:
Tax rate was reasonable in the 1.0 version. In the 1.1 version the announcement of disasters was good, but things like tax rate was awful. OR, it was problem with pollution. (You cannot do much with pollution if you demand a industrial area for every two residential area)
And yes, less industrial and commercial building requirements. (My SimCiry have 75 residential and only 8 factories and 8 “industrial” areas.)
Instead of the stadium, consider a government. (a city need a government, and it’d better be a good one.)
Consider the City Hall when making the sprite. (the greek temple-like building where you collect tax)