I knew from the start I would have elevation be a big part of this game. I knew slopes would be tricky so I decided early on that there would be sharp elevation increases and decreases.
But how would units traverse these cliffs and get to higher ground if necessary? I started out with the simple solution, that you could build stairs. But the result was both inelegant and didn't fit the theme. The next natural choice was ladders. I created a simple ladder model and got to work on the functionality.
I wanted ladder climbing to not be a task. The easiest way to create ladder functionality is, with a unit selected, you click on a ladder, he goes and climbs it. But I didn't want that. The functionality I'm looking for is, with a unit selected, you click on a higher elevation, he finds a ladder on his own, climbs it, and carries on.
This is what I came up with:
Basically what's going on is: there's a check to see if the desired destination (the yellow vector) is not reachable from the unit's current location. If it is, go ahead and walk to the destination. Otherwise, do the "Get Ladder" function. In that function, it searches to see if there are any ladders that are reachable from the destination, if so, get the nearest one, and move to it. Once at the ladder, the "Climb Ladder" function gets called and the unit floats to the top (or bottom) of the ladder, a delay is placed for the time that it takes the unit to climb the ladder (1.3 seconds) then the unit carries on to the desired destination.
I hope that makes sense. Otherwise, don't worry about it! It works great. I even have it working for houses with ladders at their entrance.
It works well enough for me now, but there are a few downsides I've found. First, this only works for one level of elevation change. If there are two ladders in a row to get to a destination, it won't work, yet... Second, the "Climb Ladder" function is called inside each individual unit, so more than one unit can climb up and down the ladder at the same time. I feel like I'm clogging the units up with functionality. Third, the entire function has to run any time a unit is told to move anywhere, which may be a problem down the line. And yes, I know the characters "run" up and down the ladder, but I kinda like it, and I'm keeping it that way.
Hopefully I can use this same system to get units to traverse small bodies of water using available boats. All in all, I'm pretty happy with how it turned out!
This is still very much a work in progress...but today I'm going to talk about my Landmass system.
I wanted to make a randomly generated map, that was different every time you played, but I didn't want to create an algorithm to generate elevation in a believable way. Some people spend years on those types of algorithms, and I was not prepared to spend that kind of time.
Instead, I came up with a different system, one that I haven't seen implemented in a strategy game so far.
I actually got the idea from Diablo 3. Their procedurally generated dungeons are split into giant chunks, and each chunk has a specific entrance shape that lines up with other chunks in that tile set.
I decided to take this mechanism and implement it in an outdoor setting. But how would I make different tiles fit along the edges? It's easy to do in a dungeon with narrow hallways, but how could I do it with an open air environment?
I realized that the edges were the most important part of all of this. So I decided to make the edges of each tile a combination of elevations. Then tiles with a similar elevation combination can line up with that edge. I limited the elevations to 3 types: Low (L), High (H) and Water (W), but that alone wouldn't work. I decided to have each edge split half-and-half between two elevations. Half one elevation and half another elevation on each tile edge.
Each chunk edge can have one of the combinations above.
Then we can create tiles that look something like these above, with each edge a combination of 2 elevations.
I realized, that as long as the edges remain clean, the middle of the tile can run with creativity.
As there are 9 edge combinations, and although each tile has 4 edges, the actual total number of tile chunks I created is just 18. There are 4 combinations I omitted because they're strangely arranged (I may add them at a later date).
So basically that's it! The map ends up looking something like the sketch above. I created an algorithm that generates tiles, one at a time, by reading the edges of the tile right before it and the one above it, then choosing a random tile that fits.
You can see that this system allows for quite a bit of flexibility while remaining relatively simple. The texturing and colors are not final but I'm really happy with how it turned out!
From the beginning I wanted structures to be varied and interesting. I also wanted structure construction to be more than it is in most RTS games. Watching someone hammer the corner of a house as it "inflates" into full form is not satisfying to see. Again I looked to Populous: The Beginning as an example.
The structures I created are built up in segments, with half the workers hammering and the other half periodically going out to find more resources. Each added resource increases the buildings' model by one. The advantage to this system is I can easily make different buildings require more resources by just adding more segments thus making it slightly more difficult to build.
Also, as a building gets destroyed, it can be broken down by these segments as well.
I ran into the problem that I didn't want to be creating hundreds of unique building types and all their respective construction stages. So I came up with a modular system.
At the moment my game has only two resource types: wood and adobe. So I started with these two material type wall models, making them the same size. Then I created a variety of roof types that fit on either wall model which makes a diversity of structure appearances with just a little work.
The next step is to make a different shapes and sizes for each roof and wall type, so I can mix and match them freely, allowing me to make a huge variety of structures using combinations of these different models.
This is all still very much a work in progress but I feel it's coming along nicely. I hope you can see the idea here, and the flexibility this will hopefully allow for in the future.
If you have any questions or comments, please let me know!
I like the look of 2D sprite based units running around a 3D world. I knew this was going to be a part of my game from the very beginning. It has a goofy nostalgic look and it's really enjoyable, at least for me.
Using Unreal Engine 4 for this is very counterproductive. 3D characters are easier and more streamlined but I stubbornly stuck with my plan and I like how it turned out.
First I drew every animation frame on a piece of paper, scanned them and recently re-drew them digitally.
Here is the difference.
These are just 4 frames, so it looks clunky but you get the idea.
Then you have to draw the same 4 animations for all 8 angles of the sprite. I named my angles off of directions so below we have North-West, West, South-West, South, South-East, East, North-East and North, in that order.
Turns out animation is a lot more tedious work than I thought!
Since these are animated, you cannot use a Billboard component on your Character class as far as I know, so I used the Flipbook component and angled the flipbook to face the camera on tick.
I simply find the angle between the character and the camera and then set that as the flipbook's rotation (-90 degrees).
After doing this you will find that the flipbook behaves now like a billboard, always facing the camera but the animation will not change based on what angle the character itself is facing.
To do this we need a bit more calculation.
I have 8 sprites each at their own increment of 45° so I take the character's rotation ÷ by 45 to get our angle between 0 and 7 (Unreal Engine is 0 based so we begin at 0 instead of 1).
That is subtracted by the camera's angle to get the angle the character is facing in relation to the angle the camera is facing. I did a quick check to make sure the number is between 0 and 7. I saved that number as a variable "angling" and used it later to choose the correct flipbook.
The Switch on Int is using our "angling" to set the flipbook to the right angle. It took a bit of tinkering to get this right but it's pretty straight forward. Through testing I've found 0 = West, 1 = NorthWest, 2 = North, etc. Then you just place the correct flipbook and set it to our character's flipbook component.
I made a call to a struct that has all 8 angles of each specific flipbook type so the flipbook can be changed easily for different units.
You can see above that the units face the same direction as the camera rotates around them. This is a small but necessary detail. One of those things you only notice when it's missing.
It doesn't look particularly impressive but it does the job and I like the look.
And that's how I've made 2D characters able to run around in a 3D world and face the right way!
I want this game to be set in both an ancient and timeless world. In some kind of lost age with tribal communities all unique and different. Unit differences (as in model types) seemed to me like tedious work at the moment so I'm focusing on buildings, their architecture and how they're built.
This was probably the first color drawing I did with this idea in mind. Three different cultures, placed in the exact same spot, and how they would differ from one another. This was a good start, but I quickly expanded to thinking why different cultural architecture is the way it is. Building materials are usually those that are available, of course. Building shapes and height relate to environmental impacts or lack there of. Finally, cultural flairs are also a part of ancient architecture. These three elements combined are what is known as Vernacular Architecture and it explains why different cultures build buildings the way they do.
I wanted to implement this into my game. Building with materials available to create the basic structure, then altering the roof type to adjust to the current climate and weather, then additional structural improvements (stilts, etc.) as needed. I plan to have very extreme weather patters (floods, snow storms, forest fires) and you as a city planner must mitigate these problems as best you can. I suppose the point of the game is to create a culture which is perfectly adjusted to the local resources, region and weather patterns, all while defending from attackers. The difficulty will slowly ramp up until one day you're overrun with problems. Fun right?
The above pictures are an example of three different cultures handling both a flood and a snow storm differently. They all manage (although arguably the adobe houses struggle with the flood) while using completely different strategies.
This is basically the goal of the final product. I don't believe a village building game has been created yet that focuses on developing around your available resources and local environment, so I'm excited to see how it plays out.
One of my favorite video games as a child was Populous: The Beginning. It was a mystical RTS set in a solar system of village combat where each map was a spherical planet. The terrain was dynamic, the combat was hectic, there was an element of discovery and wonder to the whole thing. Unfortunately the camera controls are archaic as it was created before these things became commonplace. The Shaman was overpowered and reduced even large armies to dust in seconds, as someone who always liked the unit combat, this bothered me.
One of the best mechanics I liked was that you needed a unit to train another type of unit. You couldn't just throw 100 wood at a barracks and get an archer. Also, besides a few specific maps, building resources came relatively easy. I set out to create a village builder that uses this major mechanic:
"Units are your main resource"
It's important in video game design that the main focus guides all major design decisions. In order to hammer this in, I cut the idea of resource stockpiles because I believe stockpiles unintentionally make a city-building game into a stockpile-managing game.
The second mechanic I wanted was to have your architecture and building style change based on your environmental conditions. So that every play-through would be new and interesting. I didn't think having ridged "cultures" with their own appearance was the right way to go. I wanted something more dynamic, something that changed based on your needs.
I have always been fascinated with ancient architecture variety and I knew I wanted to make it a part of this game. This is an early sketch and the building system works differently now but the idea of variety based on resources remains the same.
This picture has different combinations of three resources: mud (circles), wood (lines) and stone (squares) and all the possible combinations. Currently stone is cut from the game to simplify the process.
So now the backbone of the game is: people are your main resource, and your environment affects your technology. Every decision has to be put through those lenses.
A few other design decisions have been made early on. First, there will be no game saving and loading. I find this rogue-like influence will have a positive effect to gameplay making each session feel a bit more intense as you know you may lose it all. Second, the world will be procedurally generated to increase replay-ability and add some spice into each play-through. That's it really!
I'll try to keep these posts short and specific, so that's basically where I started!
I create, design and develop video games I'm interested in playing.
The Fire System
Melee and Ranged Units
Weather and "Seasons"
Ladders and Elevation
Animating 2D units in a 3D world
Setting the Theme
Setting the Focus