Hey all. I was able to successfully implement a simple soccer AI simulation; I wrote about it at My first Unreal Editor Soccer AI Simulation - Gamieon's Journal - GameDev.net and you can download the project from that link.
I have concerns about how I accessed character and global values from the blueprint tasks and I’d like help with figuring out whether I’m doing it right because I suspect I’m not. In my simulation are these persistent actors:
- Soccer Ball
- BotTeammate characters (derived from Character)
When the simulation begins I search for all of those actors and add them to my own GameMode-derived class, to be treated as global values, like this:
Whenever I want to access the BotTeammate that corresponds to an AI task, I do something like this:
Whenever I want to access a global value from an AI task, I access my GameMode-derived class like this:
Even though this all works without issue, it seems like a hassle just to get the controlled character in a task and I don’t think GameMode was intended to house global values. Can anyone offer me advice on how to improve these blueprints?