
Hi everyone,
A little while ago, in post 157, I outlined some essential questions I had to go through to decide how to design the wagon, and ultimately decided that I would go with a completely new setup for it - so today I want to take a minute to tell you oh how wrong I was.
Let me qualify that statement. If I had to restart the wagon, I would still set it up to be its own, completely new entity. This is the best way forward, and especially with the transport wagons (see last week’s post) in mind, there really is no other alternative.
However, I would be a lot less naive about how many different things the wagon would become on the way. As I mentioned in post 157, many systems have been created with specific units or code in mind - and things were not as easy as running the existing code for the wagons. Let me give you an example:
The strategy and tactical maps have icons for both buildings and soldiers (but not regular villagers). The soldier icons are built with updates for their position in mind, while the buildings also have the icons for waypoints attached. With the wagon, I now needed to use both. With no building to “back up” a wagon, the wagon needs to keep track of its own waypoints, and needs to also have a representation of those on the map. At the same time, the wagon needs to be able to move - meaning I needed to create a completely different structure for the wagon which utilised aspects of both the buildings and the soldiers icons.
The list does of course go on. The wagon uses the inventory system designed for villagers and the inventory user interface in the menu that goes with it - while the wagon’s actual “book page” utilises the same user interface structure as buildings (so it can be selected directly). Selecting the wagon, of course, was a challenge all by itself: The game so far had been designed around interacting with, and selecting, primarily buildings. Even when the player selects a villager, they select primarily the building the villager belongs to, and secondarily they select the villager out of the buildings residents or employees. Creating a new villager profession, for example, is super quick - as the villager still uses the same underlying system - but creating a unit that isn’t associated with a building to start with, made this a lot harder.
All of that is to say that I have found solutions for most problems I have encountered, and that the game is now able to actually accommodate the wagons existing in the context of the village and faction, rather than just as a spawned-in, independent entity. There are already many aspects of this (and as a result of the villagers and buildings) that I would love to refactor eventually, but that will have to wait until at least halfway through 0.9 so I don’t keep you waiting for new features any longer!
Until next week!