Posts

Showing posts with the label AI

Farm & Farmer AI

Image
Man this one was challenging to do but done it! Features: 1. Farm 2. Farmer AI    1. Farm: This structure produces products. For now it is only able to produce wheat. The player can decide how big the farm should be. For now the cost of making the farm is fixed but in future the size of the farm will decide the cost of making it. Also added Day feature so the crops can grow based on the days passed.    2. Farmer AI: Added another AI. This one tends to the farm. It plants the crop and once the crop has grown to full size it will start to harvest them. This AI also transport the harvest crop to the storage building. Notes:    Will improve the farm feature a bit. Will add farm UI so the player can choose what type of crop to grow and how many workers can work in one farm. Also will add a UI that shows the cost of buildings. And maybe will try to make a bakery building and AI by this week. K Out!

AI and Structures being built

Image
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 ...