AI and Structures being built



Like usual any work were AI is involved is extra tricky and needs to be made with caution. So here we have it our first AI. It is a builder AI. For now the AI just looks for any building being placed and if so then it will start to gather the materials and start the build process.

Image 1: Showing the Material Stat UI and the Storage Building

Image 2: Path of AI. Green: The fastest path taken.
Red: The slowest path not taken.


Features:

1. Builder AI
2. AI path
3. Storage Building
4. Material Stat UI


   1. Builder AI: This AI is responsible for building any building placed in the game world. It will search for any placed building and then locate the nearest Storage building to gather the materials. For now it searches the nearest Storage building within a range from itself. It brings the necessary materials from the Storage building and starts to do its job.

   2. AI path: This is the path that the AI follows. From the video we can see that the AI is taking the dirt path to traverse. This is because the dirt path makes the AI move around faster. From Image 2 we can see the path taken by the AI in green line which is the fastest. The red line shows another path could have been taken but it would have been slower.

   3. Storage Building: This is the place where are the materials are stored and retrieve, like wood, stone, food etc.

   4. Material Stat UI: This is where all the stat about the materials will be shown, Image 2. For now only wood, stone, bread, iron ore and iron are updated. I will work with the others once I have implemented those features. From the video we can also see that the stat info is movable meaning it can be moved around the screen.

Notes:

   Again these are just place holders for now. They will be replaced in future. Making the AI feature was a challenge once again. But at least it is done and hopefully other AI types will be done much faster. Next target is to make more AI types, day/night cycle and some more buildings. Also since today is Sunday, will be restructuring the code as well.

K Out!

Comments

Popular posts from this blog

3rd Person Update

More updates and features

Update: Day/Night Cycle, Marriage and More!