After a spending sometime away working on other projects, I finally reach the point where I need to revisit my Infinite Axis Utility AI System, IAUS. For those of you who are unfamiliar with this project, I attempted to write an Utility AI System using DOTS for the #Devtober. Over the month of October, I wrote the base of the IAUS system and was partially able to get a completed system running. Unfortunately, at the time, my skills in Unity ECS were limited. The system required a lot of work with programmer side. The goal of the project was to create something that was simple and easy for designer to use with minimal support programmers. Ideally the programmers would design the state and actions once and designer would be a modify within reason. Similar to the system used in The Division AI system by Ubisoft.
The goals of the refactor are to majorly simplify the system and focus on designer editable behavior. On my first attempt, I focused to much on Archetype, ie grunt, soldier and Boss. This time I am focus on making states modular and flexible. Each State is broken down into 3 components, Consideration, Scorer and Action. Each state is made up of list of consideration to determine is score. Designer will not be able to change this considerations as it stands. But they will be able to change the weight of each consideration. The Scorer System goes and gets all relevant state data to determine a state’s utility score and determine the best state action. The action performs the action.
Between the Holiday celebration and family gathering, I have working on Project Rebirth and the Unity DOTS Character Controller System. At this point, the system is entering the most difficult part of development, polish and refinement. The core system has been completed and run well. Now it is time to make those small tweaks, performance improvement and add the features that make games ohh and awe.
Unfortunately, most of the work requirement on the controller system requires me to back burner the project until other systems are up to date. The two big things left to do are create UI system for rebinding and saving controller inputs at runtime and Aerial Combat. At this time, I still need to develop UI and Game Saving System as well as decide the nature of combat for my project. Are players going to be able to Fly through the sky and fight DBZ style or simply be able to jumping attacks that hold them in the air while attacking? At this point, it is unclear.
In order to get a better idea of performance cost, I have decide to make a sample game that will combine the DOTS Infinite Axis Utility AI system I created as part of Devtober with DOTS Character Controller. In addition to testing performance, I will be able to get feedback on what works and what needs a redesign.
For those of you who actually do use or review the GitHub repo, I am working on adding a wiki for usage of both, the Character Controller and IAUS AI systems.
Next steps.
The next phase is to work on the same game mention above. Today, I will starting a new GitHub repo for a Spawning System using Unity DOTS. The objective is to create a single spawning system that can be used to spawn all objects. Enemies, Allies, Items, and Loot Drops will all be spawn on the map using this single system. As soon as I get things setup, I will post links to the repo.
Last month, I set out to start creating a single character system using the Unity DOTS Framework. For those unfamilair with the DOTS acronym, Data Oriented Tech Stack, this is Unity’s implementation of the Entity Component System. Time for a progress report.
Review the new Input System
I have decided against using the new Input System package. This is mainly because I am going to roll out my own system using ScriptableObjects. Also right now, Unity has been doing a poor job of providing useful information on the new packages.
Write a single movement system that can be used both AI based and Controller driven Animator StateMachines
Complete and tested using Infinite axis AI System.
Create an Input System for Controller and Keyboard focus on rebinding at runtime
For this, I have created a ScriptableObject that will hold each button keycode.
Adding a new subtask of creating a UI system for rebinding the controls. This will be do in a much later update as it is not mission critical.
Create a switching system to change between party members
Needs more work
Stretch Goal Combat Animation
Purchased 3 set of animation for combat system.
Grim Reaper
Rapier
Sword
New Subtask added Create a Button queuing system
If you are interested in the system, you can find it here. The animation I am using for the Controller are not include. There are links to purchase them. I am not affiliated with the Animation Creator
One of thing I realized during Devtober is that I suck at project management. By nature, I am doer. I see a problem and I tackle headfirst. For anyone that has worked in worked in software or game development long enough know this is the fastest way to burn out and or failure. I have my todo list and apps but just dont use them due to being in such as rush and caught in the moment.
So I intend to start using the devlog as an accountability system. At the beginning of each month I am going to create a major goal todo list on trello followed by a post here. As each post is completed, I will do a follow up post and try to do some High level tutorial for people trying to wrap their heads around DOTS. I will be the first to admit, I dont fully understand it but I would rather share the little I do know. Right now, info and tutorial on DOTS are so lacking that most of my google searches for answer direct me back to forum post I created. But I digress.
I have been a little swamped with work so I am a few day late with this update but better late than never. Devtober is completed and I have been somewhat successful with my Infinite Axis Utility AI system. I was able to develop a functional AI system based on Dave Mark’s Infinite Axis System and get it running in Unity Data Oriented Tech Stack. I was also able to rewrite my enemy detection system using the Jobs System for a major improvement. If you want to check it out, follow this link to our Github page.
Where I failed was developing a full test case. I wanted to design a mini AI Driven Cop and Robbers, where Robbers attempted to steal for shopping citizen and cops would attempt to arrest them. However writing the underlying logic proved more challenging.
I will be continuing to update this project but it is moving to the back burner as I need to get back to work on my main project.
If you have an question, be sure to asked them in the comments
The first weekend of devtober has been majorly wasted. The majority of the code that I have written will need to be refractored and redesign. Ultimately I brought too much of the object-oriented thought process into ECS data oriented design. While none of the code write will be used, it has improved my understand of ECS. Going forward I will be focus on writing a system approach to using ECS. On the plus side, I am able to more 100 cubes around the screen without much issue.
Day 2 of Devtober has come and we are cooking with gas. With the help of the r/GameDev community, I have found a solution to passing a random size list of transform position into an entity. This has been a huge hurdle prevent me from getting my AI System running in a efficient use of ECS. Since components have to have set size into order efficient allocate memories arrays and list cannot be used in directly in ECS. However with Dynamics Buffers, we can allocate a maximum allotted size for buffer and reserved that space on creation. This will be used in maintain a list of patrol point and attack able characters in range.
One small bug to overcome is the new unity Translation, ECS equivalent of Transform, does not update when using Hybrid ECS. I have previously written code with handle the update as Unity has not update the Job System that previous handle it after the depreciate the GameObjectEntity.
In an effort to get back on track with the project, I am trying my best to take part in Devtober this year. It’s heavily inspired by the popular Inktober, which is a challenge about doing an inked drawing every day of October. Except here the focus is on game development. The rules for this challenge are simple
Work on a game a little every day
Post your progress on social media (use the hashtag #devtober!)
On the very last day, write a post mortem
So to kick off this Devtober, I fired up Unity and Visual Studio and got to work converting my Utility AI System from Monobehaviour to Unity DOTS, Data Oriented Tech Stack. Today was a day of learn how to think about how to structure code. The power of ECS/DOTS is being able to handle work in batch and splitting that work load work to different threads. The challenge is that is a completely different mind set from MonoBehaviour and GameObjects. Also, the development is not completed either.
Once the ECS/DOTS click for you, it really starts to become quick in easy.
First attempt at write the code to evaluate distance to target
Final Version
Both of the methods above perform the same calc. However the first attempt take rough .56ms to distance to a point for 500 Entity/GameObject, while the second takes only .07ms on a 1800x running stock. This test were run in editor.
With one day down and better understanding of the API, this could be a great challenge
Once again I am face to face with my old nemesis, AI. Coming from gameplay programming, AI has been a particular thorn in my side on every project I work on. An with my self driven push to include more ECS based system in my project, AI have really been a challenge this time. So this month, I am focus on developing a Hybrid ECS based Infinite Axis AI System. Want to follow along and tell me about everything I am doing wrong? Check out the github page. The system I am developing is based off the Infinite Axis Utility System developed by Dave Mark. Fast Foward to 33 minute mark to learn more.
While updating my packages and get the HD Render Pipeline Package on Wednesday night, I came across a recently added package. The AI Planner package was release into the wilds back in March of 2019 with no fanfare.
First talked about at Unite 2017, there has been a group of user waiting for more info on this. After watching the 3 Unity Conference talks on this, I have decided to try to give this a test run and decide on whether or not to keep working on my Infinite Axis Utility AI Implement or not. The success of this project will be based on the Total time to implement the system, performance penalty, and whether or not the objective can be completed. This post, or possible series of post, is by no means intended to be a tutorial of the system. This meant to be a hands on review.
Getting Started
The Goal for the project is to create a 3 relatively simple AI systems that improve on the previous version. The hope is to examine the ease of development and get an idea of the perfomance of the system in its current state. It is important to not that will be using AI Planner version 0.1.1. Any conclusion drawn on are based on this version alone.
The first AI System being created is simple Standing Guard. The agent will go to a point and guard it. Every once in while the agent will get bored and wander around the area for a bit. After a set amount of time guard the point, the agent will return home to recharge for the next guard shift. The Second Agent is a roving guard that will monitor security cams for x amount of time and then walk around to check point. The Final example will be a combination of both guard types with multiple instances of running.
Putting a Pin in it
So after spending Friday night struggle to understand the system because I was using outdated Documentation and half of Saturday getting the standing guard working I decided to put a pin in this test for the time being. While it is known that preview packages are not production ready, I feel like this package is not even preview ready. While there is great potential here, there is still a lot to do and improve on. The example project, Otto, was not really a good representation on my 1800x at least in editor. In editor, the Otto update function run at 18.8ms but the dev build bouncing between 1.35ms up to 15ms. My biggest issue at this time is that it very non deterministic. For those unaware, Unity’s example is the workaholic Otto. The Otto AI have 6 actions he can take based on his needs which are hunger, thirst, and fatigue. Otto can either work, sleep, eat, drink or store food or drink. In my many test runs to figure out what what going on with performance, Otto never show consistency in his action choices. Sometimes he would go straight to work. Other times he would max out his inventory before going to work. Few time he would loop between getting food and drinks. On a few rare occasions, he would just malinger around until his need states were half depleted before taking a distinct action.
So after playing around with the system, I feel it is better to press pause than rushing to a snap judgement. The AI Planner system was first announced at Unite LA 2017. This release feels like a “we need to release something” move by the Unity Labs team developing it.