Picture albums
Recent comments
-
2 days 23 hours ago
-
3 days 13 hours ago
-
1 week 1 day ago
-
1 week 1 day ago
-
1 week 5 days ago
-
1 week 6 days ago
-
1 week 6 days ago
-
2 weeks 16 hours ago
-
2 weeks 16 hours ago
-
2 weeks 16 hours ago
-
2 weeks 3 days ago
-
2 weeks 3 days ago
Follow us
Elk News - the email newsletter
Subscribe to the Elk RSS feed, including blog posts, pictures and videos.
Titles only
Full content
Comments aren't included in these feeds. For them you can click the RSS icon in the Recent Comments box.
Our videos at
YouTube

Comments
Copypaste from Ancient Savo discord, describing the problem at hand;
so, the AI keeps asking the question "to produce item X what do I need? Do I have the needed raw materials? If not, what do I need to produce them", and so on. And I thought it would produce a tree-like structure. Which it did, but now as I'm looking into the details to ensure everything works properly, I unlocked a new problem.
One of the needed raw material for producing iron items is charcoal. And to produce charcoal you need a kiln.
To produce a kiln there are two alternatives;
the AI goes on to evaluate both of the alternatives to figure out which one to pick. Evaluating option 1. goes down to further tasks as expected. But what happens when evaluating option 2? How to get a burnt kiln? Easy, burn a kiln! To do that you need a kiln. How to get a kiln? Well, there are two options; either build one from a scratch, or reset and clear a burnt one. Which one to pick?
so we can see that it is about to dive into an endless loop of trying to figure out if it is faster to build a kiln from a scratch, or to reset a burnt kiln which can be produced by burning a kiln which can be produced by resetting a burnt kiln which can be produced by burning a kiln which can be produced by resetting ...
This would be a rather straight-forward problem to solve if I was going with hard-coded stuff. But the thing is that I want the AI to be able to handle what ever tasks and descriptions there are in the XML. So that future me or modders can just add in any kind of items and tasks and crafting recipes, and the AI will be able to figure out how and when to craft this or that.
A middle-ground option would be to include "manually defined instruction for AI" in the XML files, but if possible I try to avoid that.
At the moment I'm thinking about adding a simple "circularity detection" for the AI, but this needs some more consideration. Just to think if that is the best way to go, or if there are alternatives, or if the circularity detection could fail, or create new problems.
Add new comment