RPG Development Log #2

Time for another dev log! This week there was a mix of refactoring / new functionality.

Refactoring

The logic that was handling player input specifically checked if a message box was open before continuing. This works out well for a small number of input handlers, but doesn’t scale so well when there are a large number of different flows that need to respond to player input (e.g. a menu, a choice selection screen for dialogue).

To help manage this the Stateless library was added. It can easily be setup to handle managing different states of the application. At the moment it is used to switch out input handlers when switching from movement to menuing!

New Functionality

Plots

On to new functionality! Plots are what the player will see before they place buildings on them. For balancing reasons buildings will only be able to be placed in specific locations. There may also be different sizes of plots for different tiers of buildings.

A basic plot was created for testing purposes, the size isn’t fully decided on but it does the job for now.

Plot Building

As can be seen above, interacting with a plot replaces it with a building! Down the line, a menu will be opened up when interacting with a plot. The player will need to spend resources in order to build on plots. Part of this effort involved discovering how to dynamically load .tscn files and attach scripts to them. It took a while but figuring it out will make things easier in the future.

The plot placing / menuing will likely be the next tasks worked on this week.

Until next time.