-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-implement the Easy AI pt. 1 #4858
Conversation
…ver/fa into refactor/engineer-manager
@relent0r introduced a basic silo behavior. You can enable the behavior through this hotkey: All selected units are assigned to the platoon that manages (tactical) silo's. You can find the file here:
This resembles a very basic platoon: the moment the silo is done building it triggers the platoon to start scanning for targets. It will scan for targets and pick one randomly. The scanning thread stops when it runs out of ammo, just to be triggered again when the silo is done building the next missile basic-silo-platoon.mp4The behavior is very basic, it could be improved in a thousand ways:
But the idea was to show an initial basic platoon! I'll create another platoon that resembles the |
Adjusted the silo behavior so that it supports multiple launchers: basic-silo-platoon-02.mp4 |
Brain
Doubles-down on the new idea of having separate brain classes. Each brain class can load in the datastructures / files that it requires. The start of this can be found in
lua/aibrains/easy-ai.lua
, where the easy AI tells the game to:And soon more to follow. These data structures are built to simplify all sorts of queries into simple, low-complexity operations. As a result they can be queried many times over without you having to worry about performance problems.
Introduces the
OnBeginSession
event which triggers after all props, resources and (initial) units exist.Navigational mesh
Introduces various new utility functions that work seamlessly with the navigational mesh. They can be found in
lua/sim/NavUtils.lua
, as a summary:DirectionsFrom
computes all directions one can take from a given layer / position. Returns a list of vectors that represent the locations you can navigate to. Accepts a length parameter so that all distances are at an equal length from the position. Useful to generate rally points or to generate a series of directions a platoon can navigate towards toRandomDirectionFrom
similar toDirectionsFrom
but instead of returning a table of waypoints it returns one at random.RetreatDirectionFrom
returns a random retreat direction given a layer, position and a threat that you wish to retreat from. The direction is choosen randomly, in the future this may change.DirectionTo
similar toPathTo
but instead of returning a table of waypoints it returns the next waypoint at a given length. This is a basic approach to 'smoothing' the path and it guarantees that each waypoint is of a certain length from the origin.Platoons
Introduces a new platoon framework, including one example: the simple raid platoon. The new framework does not rely on callbacks. It can directly interact with unit events. This is not only more efficient but it also gives us as a developer more control packed in better code style.