David McMurdo
Member
Hello Everyone,
I'm still working on my strategy game with all the good advice that you've given me thus far, and this may be the last issue that I need to inquire about, but as ever, it's kind of tricky to explain.
I've attached a screenshot of my game here. See on the far left you have two groups of humans: a group of ten citizens, and a group of five spearmen. Every nation begins with these units. See that isolated block in the centre? That's a "foundation stone", and what each nation needs to do immediately is seek out such a foundation stone and then use their citizen unit to build a settlement around it. I've put a village in the room to the right just to show you what it looks like once a foundation stone has been settled—the stone becomes the centrepiece of whatever settlement is built there.
Now if I was enabling a human player to do this, I understand how I would do it: enable them to select the citizen unit, and have a choice in their options enabling them to settle. But in this case I'm trying to get the AI to do the same thing. However, I don't want to "fake it"—the AI should be making decisions just like a human player would. And my basic question is: what would that look like in code? This forum has already explained the use of states in AI decision making to me, but here I'm thinking more on the micro level. So I can have the AI in a state called "settle", say, but what would the code of that state look like?
Let's say that a group of citizens can not only settle, but also mine, or stand there dancing for no reason. How would I present such a choice to the AI in code, getting it to recognise that, at the present time, what they need to do is settle? I'm not asking anyone to write the code for me, I'd just appreciate some pointers as to what "features" of GML I should be working with, bearing in mind that there might be good reason to avoid claiming the first foundation stone they come upon (maybe it's right next to a monster lair or something).
In a related issue, there are going to be multiple competing nations in any given game, and at the beginning they are all seeking to settle. So obviously the AI would need a way of knowing whether or not a foundation stone had already been claimed. Am I right in thinking that the simplest way would be to have states for the foundation stone instances themselves: "claimed" and "unclaimed"? The AI would then have a way of distinguishing between those foundation stones that are available to them and those that aren't.
I'm still working on my strategy game with all the good advice that you've given me thus far, and this may be the last issue that I need to inquire about, but as ever, it's kind of tricky to explain.
I've attached a screenshot of my game here. See on the far left you have two groups of humans: a group of ten citizens, and a group of five spearmen. Every nation begins with these units. See that isolated block in the centre? That's a "foundation stone", and what each nation needs to do immediately is seek out such a foundation stone and then use their citizen unit to build a settlement around it. I've put a village in the room to the right just to show you what it looks like once a foundation stone has been settled—the stone becomes the centrepiece of whatever settlement is built there.
Now if I was enabling a human player to do this, I understand how I would do it: enable them to select the citizen unit, and have a choice in their options enabling them to settle. But in this case I'm trying to get the AI to do the same thing. However, I don't want to "fake it"—the AI should be making decisions just like a human player would. And my basic question is: what would that look like in code? This forum has already explained the use of states in AI decision making to me, but here I'm thinking more on the micro level. So I can have the AI in a state called "settle", say, but what would the code of that state look like?
Let's say that a group of citizens can not only settle, but also mine, or stand there dancing for no reason. How would I present such a choice to the AI in code, getting it to recognise that, at the present time, what they need to do is settle? I'm not asking anyone to write the code for me, I'd just appreciate some pointers as to what "features" of GML I should be working with, bearing in mind that there might be good reason to avoid claiming the first foundation stone they come upon (maybe it's right next to a monster lair or something).
In a related issue, there are going to be multiple competing nations in any given game, and at the beginning they are all seeking to settle. So obviously the AI would need a way of knowing whether or not a foundation stone had already been claimed. Am I right in thinking that the simplest way would be to have states for the foundation stone instances themselves: "claimed" and "unclaimed"? The AI would then have a way of distinguishing between those foundation stones that are available to them and those that aren't.
Attachments
-
256.5 KB Views: 23