Tuesday, April 16, 2019

RTS_8 "Cities, Workers, and UI"

Believe it or not, half the time I spent on this update has been on the UI. Determining what the City UI & other UI will look like has been a big part of this game with many many hours spent designing and getting rid of various designs. I find that it's very vital that in order to work on something that I'm able to visualize it or have a general sense of what it'll feel/look/play like. With city's, this was very difficult because I hadn't exactly pinned down how I wanted them to operate, and after I did, I find it even more difficult to determine how that information would be displayed.

The best UI design I have found are systems that work off of a max of 2 clicks to do what you need to do, otherwise, it begins to feel cluttered. I learned this from playing different games and trying to determine what made some games feel more complicated than others, and it usually ended up being that standard actions took more than 2 clicks to do. Even if the systems themselves were less complicated than other games this gave the feeling of complexity.

Some examples of this smart design in some RTS games that I play are:
StarCraft II
Planetary Annihilation: Titans
Sid Meier's Civilization V

In all of these games, the user is generally only 2 clicks away from most core actions. Want to build something? In all of these games, you select the worker, then select what you want to build. The same goes for attacking, moving, and building units from buildings. This smart UI is extended even further with most information being displayed by placing your cursor over things rather than having to select them.

So with this newfound observation in mind, I decided to make sure that my game follows it. First and foremost that means that units no longer can select tiles in every direction. Selecting the tile, then the hex, then the building broke the 2-click rule. Now the buildings available to a unit display on the tile they're standing on as icons, and if you hover over them you can read the info on each one.



But with this new system brings up a question: Okay but rivers can't be walked on by land units, so how can workers build bridges? The solution was very straightforward, the worker can still build bridges on surrounding tiles, and the icon for doing so will show up on said tiles:



Hooray! So now workers fit within the 2-click system, which means that the game is once again simple and user-friendly. With that out of the way, I was able to continue my working on cities.

As I had said, the UI for cities is what took the longest as most of the code for cities I had already written, so here it is!



As you can see there are some systems in there that I have not yet explained.

Stability
The stability of a city is essentially the happiness of the city, the happier the citizens are the higher the stability the city has. Stability is based on 4 factors: Housing, Entertainment, Crime, and Food.

Housing
Citizens need somewhere to live, and unlike civilization new houses don't just appear out of nowhere! You have to make sure that you have at least as much housing available as population in order to keep happiness up.

Entertainment
Believe it or not, citizens like to do things other than work and serve you. An entirely work-based civilization tends to overthrow its leadership more often than not.

Crime
Pretty self-explanatory, unhappy people with no hope can turn to crime, and crime makes people unhappy with no hope. It's a vicious cycle. The best way to avoid crime is to keep your citizens happy in the first place, but if crime is already a problem then building things to stop it is a good choice.

Food
Although food is used to increase the population of a city over time, it also has to be abundant enough to feed the citizens who are already there. The happiness of food will be at 100% if you have at least half the food required to get to the next population.

With all of that in mind, I created a formula that is used at the end of every turn to determine the stability of every city:



Great! Right now there are no effects from having high or low stability but in the future, there will be such as increased production times as well as possibly spawning riot units.

As you can see, buildings will now also play a very important role in doing more than just spawning units or gathering resources. Having a large productive city also means you have to invest in a larger infrastructure for keeping your citizens happy. This gameplay element was inspired by Stellaris, and I think that'll help make cities feel more alive.

As for building inside of cities, it's not currently in the game but it's what I'm aiming to have finished in the next update, so stick around!

Sincerely,
Blake Gillman

P.S
This update is coming after 7 days instead of the usual 3~4 because it took so long to do that I needed some extra time to catch up and write more posts. But after this, it's back to a regular schedule!

No comments:

Post a Comment