MicroCity - City simulation in your pocket

(Felipe Manga) #21

I kept wondering if my city was going to burn down any minute. :stuck_out_tongue:

Does it make any difference if power lines are over a road?

(James Howard) #22

The power lines are used for the flood fill algorithm to check what is powered by the power plant. I was planning to use a similar flood fill to determine which buildings are connected by the road network to weight how buildings influence one another.

Early on I did consider have the 2-bit tile map represent clear, road, power line or railway but ultimately thought it would be better to just skip having the railways and allow power lines to overlap roads like in the original SimCity.

(Erwin) #23

This is super cool and extremely polished but I feel that the game is quite easy as is, I mean I do not remember the old simcity but I used to suck on several “sim” games :stuck_out_tongue:

@jhhoward Are you going to add some objectives or challenges besides disasters?

(James Howard) #24

It probably is a bit too easy right now for the town’s population to grow quickly. There are several factors that affect growth based on crime, pollution and the types of buildings placed. I will probably tweak these for the next release to make gameplay more challenging. I could potentially add easy/medium/hard difficulty levels by having different sets of values so that e.g. there is more crime in hard mode.

In terms of objectives, the original SimCity has scenarios with existing cities, but I’m not currently planning to add those right now. It also had dialog popups with milestones once the city had achieved town, city and metropolis status which is something I might add to give some feedback on how you are doing.

(Kevin) #25

This is like the coolest thing in the world. It’s my new favorite game to show people :slight_smile: :cityscape:

(Stephane C) #26

Great job on creating a Sim game!!

Just a quick question, Is it normal that when this game is on my arduboy, when the arduboy boots there’s always 0BBB0 under the arduboy text? Was just wondering if it’s an issue with my arduboy or if it’s somewhat normal. It’s not doing this when i use other games.

additional info: I uploaded the .hex file using Arduboy Mate.

(James Howard) #27

@bateske Thanks! Glad to hear you are enjoying the game :smiley:

@Vampirics I believe this is a feature from the Arduboy2 library:

A user settable unit name of up to 6 characters can be saved in system EEPROM memory. If set, this name will be briefly displayed at the bottom of the boot logo screen, after the logo stops scrolling down.

I’m not entirely sure how you change this though? Anyway, doesn’t sound like there is anything wrong with your hardware!

(Scott) #28

It’s displaying the Unit Name from EEPROM which must have been set by a previous sketch (perhaps one that illegally wrote to the system EEPROM area). You can set a Unit Name, or disable the displaying of it, using the SetNameAndID example sketch included in the Arduboy2 library.
From the Arduino IDE select
File > Examples > Arduboy2 > SetNameAndID

(Stephane C) #29

Thank you for your quick reply. :wink:

(Holmes) #30

Wow. I am incredibly impressed! Do you have some sort of Twitter, @jhhoward?

(Josh Goebel) #31

You could probably rework the render engine to give you the 1kb from the buffer back for actual game use, but if the goal was to fit the save state into the 1kb of EPROM (which makes sense if you want to save to play later) then getting more RAM isn’t really going to help you much since you can’t effectively persist it.

(Josh Goebel) #32

If you have space left in flash some type of bit-wise RLE encoding on the road and power line data could possibly be quite effective.

(Alan Pope 🍺🐧🐱) #33

This is amazing. Thank you for creating MicroCity.

Could you please add a license to your github project, so we know what terms you’re distributing under.

Thanks <3

(James Howard) #34

Yup I’m @jameshhoward

Yeah this is something I initially considered but as you mentioned the EEPROM size is the real limit. I actually reuse the screen buffer memory when doing the flood fill for determining which buildings are connected to the power grid.

I also thought about how else I could compress this as it takes up such a huge chunk of space. The only problem with something like RLE is you can’t guarantee how much it is going to compress down to. It would really suck if sometimes you couldn’t save the game because you just so happened to have made a pattern that doesn’t compress well enough to fit.

Thanks! I’ve updated the github repo to include a license (GPLv3)

(Josh Goebel) #35

Build a “too many roads” errors into the game and stop someone from building more road if they get close. I’d wager for 99% of cases (lots of straight roads and long stretches of uninterrupted land) you’d be just fine with no issue at all. You could obviously do you own tests to confirm this or not.

(David Inwood) #36

This is the first time I’ve played an Arduboy game for multiple hours. :grinning: The save feature is really great in this one.
I’ve got a small city going right now that is perfectly stable. I’ve just been carrying the device around with me and hitting the B button every 66 seconds or so to get past the financial data that pops up every year. It’s nice to be able to just let a city go like that.

(Pedro) #37

Great game! That’s currently the permanent game of one of my 2 arduboys. Looking forward for the fire to destroy my too rich city!

(Kevin) #38

@jhhoward you might want to edit your post and warn people that they may need to use flashlight mode to reprogram their device as it seems like this game hits ye’ olde magic number glitch.

(James Howard) #39

I’ve updated the top post for anyone who gets stuck unable to flash a new game. Do you know what causes this glitch and how I might be able to work around it?

I have an update in the works which includes fire simulation but it isn’t quite ready to release yet. I just need to find some time to finish off a version 1.1 :slight_smile:

(Scott) #40

The work around is flashlight mode. There is a fixed location in RAM used for a “magic key” that tells the bootloader to enter command mode after a reset, to allow uploading a new sketch. The problem has to do with this location also being used by the sketch, and the key being overwritten before the reset occurs.

The next release of the Arduboy boards package will include a fix that will all but eliminate the problem, without requiring flashlight mode.