The Charm Cities Project has begun coding!
by Martin Sherman-Marks in Project Notes |
We're writing code! We've put together a preliminary road map and are working our way through it now. You can follow our progress on GitHub and can even clone the repository and check it out yourself. You'll need Unity 2019.1, because this project is using the new Unity Input System, which is still in preview release and isn't supported before that version.
So, what does it look like? Well, about eight hours into Phase One, it doesn't look like a lot:
But that's the goal! We're only using the most basic and ugly UI and assets right now - no point in spending hours in Blender lovingly crafting a perfect replica of a real power station just for us to decide that we're going to decide it actually needs to be five meters shorter. Right now, we're focusing our attention on the most basic elements: can you navigate the scene, and can you build a building?
The answer to the first question, as of the most recent commit, is "yes!" The camera can be panned, orbited, and zoomed using either keyboard, mouse, or gamepad controls. This is all thanks to the new Input System, which makes it much more practical to handle multiple input sources and to remap controls, which is key to meeting our accessibility requirements. Instead of saying "when the player moves the mouse, pan around" we can now say "when the player inputs a pan command, pan around." The new Input System lets us create a list of bindings of various different possible inputs, so that all sorts of things can be defined as "pan" and the bindings can be remapped in code. The documentation is rather lacking and there are still some confusing elements, as you'd expect from a preview package, but it's made the process much more pleasant. The default controls (which are subject to change) are described in the road map.
We're making great progress on the second question as well. In the picture above, you can see two planned power plants that have been placed on the terrain. These are planned power plants - you can see in the top right that the game is in "Plan" mode - and haven't actually been built yet. The next step will be to allow the user to switch to "Build" mode and watch as their new power plants get built. By the end of the current phase, actual residential buildings will be popping up, populated by "HONs" (the AI agents who will make up our citizenry) who will only buy land and build on it once they have both power and road access. That's enough to qualify as an actual city-building game!
Of course, Phase One isn't intended to end with a particularly exciting city-builder game. In fact, a lot of the code from phase one will probably be rewritten entirely later on as the game grows in complexity. But this right here is the most basic core of the game, and the foundation we lay down here will define the game for years to come.
Please check out the GitHub repository if you're into that kind of thing! Or, if you're not the coding type but still have big opinions about cities, come check out our Discord server! And if you just want to keep updated, keep following us on Twitter and Facebook, and watch this blog - we're only just getting started.