Juliette Foucaut - 26 Jan 2019
We've also fixed some visual bugs as well as a problem with the collision system which made it difficult to hit targets (details in the change log). In this post we'll talk a bit more about the in-game user interface and how the turrets work.
But first a word about what's not yet released: the in-game building tool. We decided to delay it as we felt it needed more work. Most of the progress is hidden but some of the changes we've made in preparation for it are visible in 0.3.4: a 'Max' tool in the Voxel Editor and the in-game tool selector.
Players will notice a new HUD (head-up display) at the bottom of the screen consisting of four boxes. Each corresponds to an in-game tool they can select using their keyboard (those selection numbers may change):
The symbol in the crosshair at the center of the screen changes according to the tool selected.
To spawn a turret, players select '4' on the keyboard, then click with the mouse. The turret will appear in front of them.
Turrets use a similar very basic AI system to the other drones in the game, except without any movement. The turrets randomly pick a potential target which is in view, and in range to fire at. If they can't they spin around looking for one whilst avoiding looking at the ground.
The spawning of turrets uses a new 'ToolSpawnSystem' (Avoyd uses a component system approach), and on the client this sends a spawn request message which is processed on the server. Avoyd uses messaging internally, so a stand alone client or a client which is also acting as a server also uses the same system. Clients track the number of requests they've made to prevent superfluous messages, and reliable messaging is used. The server sends a message back to the client to inform them which entity their spawned turret is for book keeping and eventually permitting more refined client side control over their turrets along with better turret information displays.
The in-game HUD uses NanoVG with a very light C++ wrapper so we can use our own math primitives. Whilst we use dear imgui for the rest of the UI, NanoVG is better for animated content and the lack of automatic layout and input handling isn't an issue for HUD elements.
Eventually turrets will tie into the other build and resource features of the game, but they already offer a significant upgrade. Playing with turrets in the game opens up a surprising number of tactical choices and we think it substantially increases the fun of playing.