4 ms·
I've been working on a city builder/simulation video game for the last few months. If that's something you're curious & passionate about, send me an email (see
by eezurr 5y ago
I've been working on a city builder/simulation video game for the last few months. If that's something you're curious & passionate about, send me an email (see profile).
The game is built from the ground up with SFML and C++. The graphics are sprite/tile based. The game is top down, 2D, and will display the interior of buildings so you can watch your citizens live their lives. You'll be able to change z-levels for multi level buildings.
The focus of the game will be more on the simulation (Dwarf Fortress is a huge inspiration) than on building pretty cities (e.g. Cities: Skylines), although I do care about the art direction.
I have a long runway to take off from, about 2-3 years, so I have the time (and patience, and desire) to care about quality and efficiency.
What Im working on now:
Here's a brag & demo of the pathfinding I am currently wrapping up:
https://i.imgur.com/vtKXKLK.mp4 https://i.imgur.com/vtKXKLK.mp4
Note a few things:
* All possible paths are found in O( m + n log n ) time, even though there's a binomial coefficient number of possible paths in this grid. The tree is stored in memory for constant time access. Im using parallel flat hash maps to significantly lower the memory footprint.
* The units choose the shortest path that match their preference (i.e. the color of the unit), thus choose a path that contains the most tiles of their color.
* Pink units dont have a preference and will use any of the paths available.
* I'm not an artist!
* Currently wrapping up multi-lane road pathing (which is quite tricky!).
* In the game, preferences will be history, tourism, beauty, food, neighborhoods the unit can relate to (religion/nationality), etc.
- skulk 5y agoSince you're inspired by DF, are you going to do a similar macro/micro split simulation that DF does? I thought this was one of the most interesting aspects of the game and implementation: how do you give the illusion to the player that other civilizations are evolving in a way that's not unlike the evolution of the player's fort without actually doing the CPU-crushing fine-grained simulation outside of the player's map?
- eezurr 5y agoIndeed! The largest problem I will be tackling is simulating (to the best extent possible) an economy. One thing I liked (and made a lot of sense, at least to me) in SimCity 2000 is that the first demand you had to fulfill was industry. So the player will choose an industry to build their city around (though they'll be able to diversify any time. The price for that is possibly losing their edge in said industry). One of the goals in the game is cashflow. Each service/industry/utility (SIU) that is outsourced is lost tax revenue for the city. For example, a new map will contain national power lines running through it. You'll have to tap into those for power initially. This means your citizens will pay a higher price for electricity, which limits tax revenue in two ways: 1.) You're not taxing the profits of the power plant 2.) You're citizens have less money to spend, thus the businesses in your city have smaller profits to tax. Now iterate that math for every SIU required (which depends on city size). To counter this, the player starts by owning all the land, so the city's initial revenue is from property sales. As the city grows, land value goes up. (Fun point, once the land is sold, its permanent until you can afford a great lawyer on your board to win an eminent domain case). Over time the city will grow and more SIU's will be localized, increasing the cash flow of the city (more tax income). But, to attract/retain talent (thus have larger corporations), the city needs to spend this cash on services to make the city a desirable place to live. I think some fun side goals would be, for example, attracting the best chefs, artists, musicians, that are available, and have them e.g. open a restaurant in your city. So, the macro scale is competing against other cities (both for talent and services/industries). I could say the winning condition is to be at the apex in every industry in the game, though that will likely be impossible, and I dont plan on having any real win condition. I haven't sat down and mapped out how to simulate the competition (other cities), but I dont see a need to simulate each city at the micro level. I believe DF takes a similar approach. If anything, an infrequent mass calculation could determine who moves where and why, and to compare business competition. Im using SQL for storing game data to take advantage of what it does best, so this should be relatively easy.
- mboekhoff 5y agoThis sounds very, very cool. Sadly I'm not much of a gamedev, otherwise I would take part, but I really would love this come to fruition!
- eezurr 5y agoThanks! Once I've got a base game equivalent to SimCity 2000 in functionality + real time traffic, I'll release the game for free. When the game can begin competing with Cities: Skylines on a simulation level, I'll start charging for it.