Uploaded February 2024 | Updated November 2026, 3 hours ago
Whenever we start building AI, it's important to determine how frequently they will be updated, on this video using our RTS project I am going to show you why processing AI functions using a timer or frame is a bad idea, instead we are going to discuss how to implement a queue method, to cycle between all units in the game, this way we don't waste perfomance computing everything at the same time, but rather we run with just a few units per frame.
This ensures your AI code to run smoothly even with hundreds of units, the key is not updating all of them at once, but rather to limit this reaction by smaller quantities, so our perfomance can keep a smooth and stable experience.
Whenever we start building AI, it's important to determine how frequently they will be updated, on this video using our RTS project I am going to show you why processing AI functions using a timer or frame is a bad idea, instead we are going to discuss how to implement a queue method, to cycle between all units in the game, this way we don't waste perfomance computing everything at the same time, but rather we run with just a few units per frame.
This ensures your AI code to run smoothly even with hundreds of units, the key is not updating all of them at once, but rather to limit this reaction by smaller quantities, so our perfomance can keep a smooth and stable experience.










