Hey Everyone, here's the deal:
The Blog - I've decided to start writing up new posts EVERY week instead of whenever I feel like it. Hopefully it'll both help me stay motivated, and help promote/push information to you (the reader). So this should be the first of a weekly series highlighting my blog.
The Game - A lot has happened since my last update, sadly a lot of it isn't very noticeable. I built and rebuilt an editor, did a LOT of research and theory pertaining to programming Zity, and spent a lot of time with friends/family (not programming).
The most noticeable addition has been the Semi-Block Editor. This editor will be used to create pre-made sections of the city that will be used in the pseudo-random generation.
Let me explain -
The map in Zity has gone through a few changes in how it will be generated. From my first idea of complete procedural island/city/building/room generation I've come to realize that procedural generation is HARD. Seriously if anyone reading this has ideas about a procedural game then they need to be SURE that they have a plausible, simple, straight-forward idea about how to generate it.My new way of generating the city combines random elements with preset elements:
Island - The island will be a simple preset circular shape outlining the water/land regions. From there trees and foliage will be generated across the length of the island with a tendency to clump together in areas.
City - To generate the city I start with a location. From the starting location somewhere towards the center of the island I will generate a square city-block. From there on a simple recursion algorithm is used to generate more blocks branching off of the first which in the end will create a city-like blob of city-blocks.
City-Block - These city-block are where the semi-block editor comes in. Each city-block is a collection of four semi-blocks, which are simply one section of the city-block divided evenly into four pieces (corners). The semi-blocks are created beforehand using the editor. Each one will have all the information it needs to be a complete section of a full city-block including building/item/spawning information. The only thing the city-blocks are responsible for is matching up the roads surrounding them.
Semi-Block - When a city-block is created it will randomly pick four semi-blocks as it's four corners while following some global rules about building scarcity (I don't want a block to contain four semi-blocks all with gun shops). By picking the semi-blocks randomly each city-block will be different on each play through (except the odd chance where you play enough to see a repeat).
Placeholder Tiles - Another layer of randomness comes in the semi-blocks themselves. Using the editor I create all the information about where walls, floors, doors, objects, and items ARE but I do not specify a specific image for them. What this means is that when the algorithm selects a semi-block to use it will also populate every tile that I marked as a *wall* with a random wall tile. For example it might decide that in this semi-block all the walls will be brick and then fill in all the wall tiles with brick tiles. Or it might choose stone, wood, steel, and so on. The same goes for the floor tiles and the objects themselves. Floors will be replaced by carpet, wood, or tile - while objects like beds and couches will be replaced with worn-out furniture or good looking furniture.
All of this semi-randomness is to give the cities in Zity a procedural feel while not being insanely difficult to program and alter. For instance if I want a new type of shop I don't have to make a whole new algorithm to create the buildings, place the objects, and so forth. Instead all I have to do is create a new semi-block in the editor with the correct information and meta-data and it will be added to the game automatically.
My next post will explain some of the other changes Zity has gone through in the past few months. I felt like it was too much information for a single post.
No comments:
Post a Comment