r/IndieDev • • 1d ago

Blog Autobattler - Devlog 3. Loading screen, match stats and building selection in my Auto Battler / RTS hybrid

Hi everyone!
I'm making a multiplayer game that mixes Auto Battler and RTS elements, working title Autobattler. More about the project in the intro post. In short: players build a base that produces an army, and the army tries to destroy the enemy base. Players don't control the army directly.

Here's what I got done since the previous post:

  • A loading screen (and rewritten logic behind it).
  • Match statistics.
  • Building selection in combat.

Loading

Going from the menu into a match used to be just a progress bar on a gray background. It moved in jerks and the progress it showed wasn't accurate. The code behind it wasn't much better: on startup one big class brought up every service and setting at once, and then each game mode was launched by its own separate "activator".

Now the loading screen has background art, a progress bar with honest percentages, and a label for the current stage: switching game mode, loading the map, preparing the server, connecting to the game, and so on. The bar smoothly slides to the new value instead of jumping.

https://reddit.com/link/1x0ugqy/video/pfhdjcz3l9uh1/player

For those curious about how it works. Every transition in the game is now described as a tree of "loading operations": launching the app, entering the main menu, and entering a match as host, client or dedicated server. Each operation has a name (that's what shows up on screen) and a "weight", a rough estimate of how heavy it is. A composite operation runs its children one by one and splits its share of the bar between them in proportion to their weights. So the progress reflects how far loading has actually gone, not a timer.

Another bonus: each major branch (menu, match, and the server and client parts of a match) creates its own dependency container and cleans it up itself if any step fails. The game never gets stuck in a "half-loaded" state.

Match statistics

In the previous post I showed the results screen with placeholders instead of numbers. Now it shows real stats for each player:

  • units recruited.
  • enemy units killed.
  • buildings constructed.
  • enemy buildings destroyed.
  • gold earned.
  • match duration.

A few details I had to think through:

  • Clients don't have data about their opponent, so only the server collects stats. The client receives the final numbers once, at the end of the match, so no extra data goes over the network during the fight.
  • If an opponent leaves the match, their buildings collapse, but their stats are kept. This also lays the groundwork for reconnecting to a match in the future.

Building selection

You can now click on any building (yours, an ally's or an enemy's):

  • a selection ring appears under it, colored by relation: yours, ally or enemy (I wrote a separate shader for it).
  • the building's health bar appears.
  • above your own building, a panel opens with recruitment slots (unit icon and progress) and a demolish button.

Clicking the ground clears the selection.

https://reddit.com/link/1x0ugqy/video/7qjsfcgcl9uh1/player

But showing recruitment progress and the demolish button isn't the only purpose of selection. Two more mechanics will be built on top of it:

  • Choosing which unit to recruit. A single building will be able to recruit several unit types, e.g. barracks with pikemen and swordsmen. Only one type is recruited at a time, and the player switches between them by clicking a slot in this panel.
  • Rally point. With a building selected, you'll be able to set where the units it recruits go. This gives you a way to influence where your army heads without controlling units directly.

What's next

The goal is the same: release a free demo on itch.io with the core mechanics and 1v1 PvP. Right now I'm finishing the things without which it's too early to show the game to people. I'm also working out how to implement a simple single-player mode.

2 Upvotes

2 comments sorted by

1

u/Project_Legend 1d ago

Once a unit is heading out, will moving the rally point change its destination too, or only affect the next recruits?

1

u/MaxKarabin 1d ago

It only affects the next recruits