My RTS Can Finally Box Select Units | DEVLOG 1
Building selection for my minimalist C++ RTS: single-unit selection, multi-selection, drag-box selection, movement, and the bugs I hit along the way.
What I worked on
This devlog covers the unit-selection system for my minimalist RTS built in C++ with raylib.
The main goal was to make selecting and controlling multiple units feel predictable before moving further into combat.
Single-unit selection
I started with click selection and deselection. This exposed a few problems around click detection and accidentally selecting units while dragging.
Box selection
The next step was drag-box selection. I convert the mouse position into world coordinates and build a selection rectangle between the drag start and current mouse position.
Units inside the rectangle are added to the current selection.
Movement and formations
Once multiple units could be selected, I started working on moving them as a group instead of sending every unit to exactly the same point.
This is also where collision and spacing problems started becoming more obvious, especially when several units try to move through the same area.
Current result
The RTS now supports the basic interaction I need before combat becomes useful: select units, select groups, drag a box around units, and give movement commands.
What comes next
The next major work is formation cleanup and combat: target detection, attack range, health, damage, and deciding how units should behave when other units block their path.