RTS4 – Cliff models

Using a mesh for the cliff face turned out to be quite a bit more difficult than I originally thought. It’s finally working, though still incomplete. I’m not sure its worth the processing requirements and complexity it adds. I’ll probably disable it and decide later. Using a mesh means the cliff can have nice crevices that match the texture mapping, and have little ledges and rocks poking out. Otherwise without using a mesh, I’ll add some variation to make it look less rigid, but the texture wont match the mesh as nicely.

Other problems that this approach presents:

  • The cliff model would not be able to wrap around a raised plateau without a geometry seam (potentially showing through to the void below)
  • Matching the cliff model offset between terrain chunks is very complicated and unlikely to ever work completely (nasty geometry seams between each chunk)
  • Floating point errors cause holes in the geometry or can potentially crash the game
  • The cliffs are significantly higher poly
  • A mesh should be made for each cliff type, adding to the workload

This picture from Unity RTS shows a hand-modeled example of what I was going for.
Notice the darker sections of the cliff texture are inset.


RTS4 – Progress Update 2

I wanted to get the cliffs using their own model and material tonight, but I got stuck with a silly bug for far too long (two variables named “c”, one overwriting the other). The game now has basic terrain, with units being draw at the correct terrain height.

Play in browser

RTS4 – Progress update

I’ve got back into the WebGL port of RTS4. I had previously done a lot of work for.. something.. I can’t quite remember, but I left it in a broken state. It’s now been fixed and had a little more progress made:

  • The UI is all data-bound through Knockout
  • Users can now box-select stuff
  • Units/buildings have a visual thing below them when selected
  • Constructing things now has a construction phase
  • The object bounds are used for building/attacking/gathering (instead of the unit walking to the object centre)
  • Scripts are combined into a single all.js file, reducing the load on my poor server
  • Models (including animations) are loaded in a much smaller binary format, meaning MUCH faster load times, and less content to download
  • Model transforming happens through an (as yet unseen) node.js server, which also opens a socket to the client; some basic multiplayer tests/features shouldnt be too far off.
  • Basics of an “EntityGroup” class, which manages a collection of entities that satisfy a list of requirements. (the “Villies” print out is using this system to count units)

I made a few models earlier, and since they look much better than the current build, ill post them here instead.

“Play” in browser (IE11 or Chrome)

Next step will probably be terrain and other visual improvements. The action system also needs to be revamped; the over-engineered “resources” system needs to be integrated into the entities themselves, rather than a separate component (health and population are considered resources in this system). The resources overhead is insignificant, and almost every entity that needs behaviours, needs resources. This may make it easier to integrate more concepts (like line of sight) to be resources (probably to be renamed to “properties”), which will make buffs much easier.

Note to self: I’d also like to have a concept of “abilities”, such as “move” and “face direction”, so that the correct action can gain access to the abilities they need (otherwise a unit ordered to move left but attack right wont know which order should control movement)



Unity RTS Updates 2

I havent done much this update, but thought I should have the latest version up. This update is primarily just touching up the fog of war, it is now blocked by trees and cliffs (and any other high objects). The ambient occlusion was also changed, not sure if its an improvement. And theres been a ton of code cleanup to get the fog of war code into something that would be more easily plugged into a new project.

If you want to build an RTS of your own, Elgar’s Code Musings is a decent place to start, he’s written up his findings while developing an RTS in Unity.

Unity RTS game

I’ve been getting a bit annoyed at the slow progress on the WebGL RTS4 project. I know what the problem is; I’m over-engineering it, trying to design it to be very general purpose and flexible, but as such it becomes very difficult to make progress.

I decided instead to see how far I could get building in a more purpose-built way. Over the last few weeks I’ve been putting together a model pack for Unity, to be released on the Asset Store along with a sample project to see the assets in action; this would be my sample project. The models were created in a hand-drawn cartoony style.


The current version was built over about a week:

  • Day 1: Pathfinding and unit movement
  • Day 2: Resource management, gathering, and melee combat
  • Day 3: Town Centre model, buildings as pathfinding obstructions
  • Day 4: Placement of buildings, terrain fog of war
  • Day 5: Hydra, Unit fog of war, FOW fading to grayscale over time

Some of the code is designed similarly to the WebGL RTS4 port, but with more stuff assumed (ie. only 1 action can be active at a time, terrain is a heightmap, buildings are rectangular).


Play in your browser (Unity)

Ludum Dare 26

I was planning on doing Uni work this weekend, but lots of friends were entering the Ludum Dare gamejam, and the theme was pretty cool, “Minimalist”. I decided to put together the quickest RTS I could, based off of SimWar.

I’ve managed to get multiplayer working with lockstep synchronisation, along with some basic RTS features: team colours, collision checks, the worlds worst pathfinding, unit selection/ordering/placement. The games page is available here:
Ludum Dare – SimWar

I’m pretty happy with the results, especially for less than 24 hours of development time. It gave me a good way to test how the networking would work for RTS4. It also allowed me to test the simulation rate being significantly slower than the rendered framerate (simulation is at 4fps) and the visuals being interpolated. I had previously been told that this wouldn’t work, however it seems to be quite effective and wold make fast forwarding through replays much faster.

AOM-inspired and compatible game

I’ve decided to create a blog to document progress on random projects I’m working on, the latest one being an AOM-inspired RTS.

A wise man (Dylan from AGDC) once taught me of the importance of coming up with a mission statement for each game, so that the original intent of the game remains throughout development. My goals for this game are pretty simple:

Bring the latest improvements and expectations from the RTS genre to Age of Mythology

This is impossible by simply modding the existing game, and doing that would be no fun, so instead I am on my way to build my own game, attempting to achieve the same style and feel as AoM, but going beyond what was possible back in 2001, when Ensemble built their masterpiece.

The modding community at http://aom.heavengames.com/ has invested a huge amount of time and effort into building innovative and wonderful extensions and tweaks for the game which should not be ignored. This new game will be built to take advantage of as many of these assets as possible.

Random Maps

Age of Mythology has quite a unique random mapping system, in which a relatively short code file builds a complex, beautiful, and balanced game world with a given seed. This gives an effectively infinite number of possible maps each with unique opportunities for strategies and gameplay. These maps are written in a language called XScript, in an environment called RMS. The maps define Areas with tile sets to decorate and define those areas, Connections connecting the various areas and ensuring paths are possible, and object/player placements.


I have not yet investigated in much detail how the AI works in Age of Mythology, but this appears to also make use of the XScript language to define behavioral properties.

Tech Tree and Entity Properties

Age of Mythology is a very data driven game, most properties about the buildings, units, god powers, and tech tree of the game is driven by XML files. An XML file for a building will describe all the units which can be produced from it, through icons in a grid. The system can then look the data file for the units to extract more information about them. The units can then have their own set of actions for things they can produce, which then reference yet more entities. A number of constraints on these items prevents them from being visible until the appropriate tech has been unlocked.

More progress has been made at the time of this writing, but the initial build looked something like this with the acropolis.xs map loaded. This build had a very rough first-pass area system just for testing, had scale issues, and didnt support smoothing properly, but this shows the XScript compiler working, a map loading, and the API’s being executed correctly.

This game will be code-named RTS4 from now on (ignore that the title bar says AOT)