Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

AI Queuing

Starting off this week I'd decided to work on the customer AI queuing system in order to allow the customers to walk to the order registration area and form a line behind one another. The issues I had trying to implement this functionality had to do with the timing of the simultaneous line up. At first, I was able to get multiple customers to go to one spot. This is when I realized that I would need to think of a way to implement this functionality to have a sort of synchronization to it. I had to sit and think about how I could implement a method to reach my result.



Using my knowledge I'd learned from network programming, I was able to understand this how this concept would work. The first step to my solution began when I identified my "critical point" in my code to set up an "access system" using a conditional statement. In my case I decided to make the game object I had set for the target positions go inactive and active again. Whenever a game object would go inactive, the position of it would then be a target for the customers to walk to. In order to prevent the customers from all walking to the same place, I would make the game object of that position active once a customer has set it as it's target before looping back around to set a new target.
 

This is the result:


Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.