Vladimir Chavdarov
Tools and Gameplay Programmer
Vladimir Chavdarov
Tools and Gameplay Programmer
A fast-paced 2D RTS where 2 types of space ships battle in an asteroid field. My first project as part in my studies in Breda University of Applied Sciences.
🔧Engine/Language: C++
👥Team Size: Solo
⏳Duration: Sep. 2022 - Oct. 2022
💻Contributions: Architecture | AI | Game Math
🔗Code: github.com
🎮Game: itch.io
In order to have any sort of gameplay, you need some interactability. The most basic kind is movement, and with it, comes the risk bumping into stuff, a.k.a. collision. Although simple, this was my first practical introduction into vector math and was fundamental for my future projects.
Implemented basic AABB collision between units and terrain obstacles
Implemented smooth steering for all units, with different degree of angle sharpness.
All units auto-attack enemies in line of sight with some specified degree of tolerance. This cone of vision is projected with trigonometric functions. Every enemy that traces a vector back to the unit that is within the border vectors of the cone is considered a viable target.
During the last week of the project, I developed a simple collision avoidance algorithm, following this article by Andrew Fray.
Using dot products between the destination vector and the green vectors (see gif), and comparing them between the dot products between the obstacle vectors and the green vectors. Then, by multiplying their magnitude by the calculated products, the algorithm chooses the most optimal direction.