Westward dev log #13: Shaping up

Progress has been made on various fronts to the extent that several gameplay loops will soon be closing in. The battle interface has been improved a bit, while multiplayer battles are now possible. On the economic front, buildings are now functional, in the sense that they can build themselves and produce resources. Read on for more information.

Click here to play the demo and discover the changes discussed in this post.

Multiplayer battles

While it should be possible to play it alone, Westward will put a lot of emphasis on cooperation. Players will have to cooperate to develop their settlements, they will have to cooperate to keep a healthy economy running and able to provide them with what they need, and they will have to cooperate on the battlefield as well. The last part is now possible.

In practice, a battle starts when you click on an animal. Colored tiles will appear around you and your foe, delimiting the battle zone. There are now two mechanisms in place to involve additional participants in the battle:

  • Any creature, be it a player or an animal, that is present in the battle zone when the battle begins, will automatically be part of the battle and will have to fight!
  • Any creature, be it player or animal, who steps into the battle zone of an ongoing battle will be included in the fight, and won’t be able to leave it until it ends.

So when you see a friend in battle, you can step in and give a hand. See the previous dev log for more details about the course of a fight.

Below you can see a short gif showing a few turns of such a multiplayer battle. For now the possible actions are pretty limited, but they will be expanded soon.

Buildings

Another great area of progress is the buildings. I have spent considerable time making complex UIs for several types of buildings: the fort, buildings under construction, and production buildings namely. The shop interface of the trade post hasn’t changed much.

Below you can see a screenshot of the interface of the Fort. In addition to the interactive map of the settlement, it displays several panes, such as the list of buildings in the settlement (together with their status), the resources stockpiled in the fort, and some information about the settlement such as population and taxes.

If you visit other buildings, you will encounter different interfaces displaying the relevant info. The nice thing is that most of them get updated in real-time, as the economy of the settlement churns. The hunter hut produces food at regular intervals, for example, which is stored in the Fort.

There is still some work to be done on that front, but it’s progressing well and getting close to the “first playable prototype” milestone.

In order to achieve this, I have spent a lot of type on developing a modular and flexible set of classes to build user interfaces from. This may sound like premature optimization, but I actually think that it was very necessary. It allowed me to subsequently very easily build and modify interfaces, experiment with them and iterate, in order to achieve the results I really wanted. In addition, it works very well and without bugs compared to my first attempts, which also saves time.

To give you an idea of the scale and structure, I have a Frame class, which is the parent of almost all of what you see in the UIs. A Panel class inherits from it, and adds a few features specific to the panels in the menus. And then, inheriting from Panel, a total of 17 specialized panels (such as InventoryPanel, ProductionPanel, BattleTimerPanel…), plus a few extra classes providing useful functionalities (Button, ProgressBar…).

In addition to building the menus, it is necessary to update them efficiently. When updates arrive from the server, a basic, custom event system kicks in, to dispatch them to the relevant menus and panels, who all expose update() methods. This consistency in behavior across all UI elements makes it very easy to add new dynamic elements to them.

It may look a bit complex, but it only reflects the complexity of the interfaces that need to be built, and in the end it turns out to be very convenient and useful. Writing UI code turned out to be much more interesting than what I’d have previously thought.

Chat

Oh, and by the way, you can chat now (as already shown in the gif above). Just press enter, type something, and it’ll appear in a speech bubble above your character. It’s a small thing but it’s nice to have it.

What’s next

I try to contribute to #screenshotsaturday and feedback Friday as much as I can, to give me small deadlines to pursue. For the end of this week, I’m aiming to add one particular functionality to the battle system (surprise), as well as to set up help panels and tools to make playtesting more interesting, and to allow the players to provide feedback or signal bugs very easily. In parallel to that, I’ll keep elaborating the economic aspect of the game by finishing implementing some key building features.

If you share my enthusiasm about the progresses of Westward and would like to contribute, consider having a look at my new donation page. In particular, take a minute to have a look at my Patreon page, where you can find a listing of rewards for various levels of recurring contributions!

Jerome Renaux

I'm an independent game developer, working mainly on browser-based multiplayer online game (HTML5 & Javascript). I love to discuss about all aspects of game development so don't hesitate to get in touch!

More Posts

Follow Me:
Twitter

Jerome Renaux

I'm an independent game developer, working mainly on browser-based multiplayer online game (HTML5 & Javascript). I love to discuss about all aspects of game development so don't hesitate to get in touch!