Jump to content

AI Behavior (surrendering, taunting, strategy, etc.)


Recommended Posts

I am wondering how difficult it would be to give the AI some more character. The AI currently already has the ability to ask for help, ask for tribute, decides to tribute resources to you when you're low on resources, tells you when it's planning to attack the enemy, etc.

Some things I think we could add:

 

Personalities

I think we could assign personalities to each of the AI names listed in the civ json files. So, we could make some of the names act defensively, some act aggressively, and others balanced. Perhaps we can weight each of these behaviors as well.


	"AINames": [
		{
			"Name": "Cimon",
			"Behaviors": [
				{ "Aggressive", "Weight": 3 },
				{ "Defensive", "Weight": 1 },
				{ "Balanced", "Weight": 2 }
			]
		},	
		"Aristides",
		"Xenophon",
		"Hippias",
		"Cleisthenes",
		"Thucydides",
		"Alcibiades",
		"Miltiades",
		"Cleon",
		"Cleophon",
		"Thrasybulus",
		"Demosthenes"
	],

Please forgive my syntax, I'm not a programmer, but I think the above is a decent illustration of what I mean. Weight, for lack of better term, would be the ratio of how likely that AIName will choose that behavior. If no behavior is chosen (as with the rest of the list here, I'm lazy), then the behaviors all default to 1. 

Then we can assign different taunts/chats for each behavior, so that by how they are talking to you, you can understand how they'll behave. 

 

Surrendering

The AI should see that its cause is hopeless and surrenders. The criteria for this can be based on the behavior the AI has been given. We'd just have to choose and assign parameters for this to happen.

The AI should have events that trigger chats which indicate it's about to surrender. It'll tribute resources to its allies, and perhaps the ratio of resources it tributes can be determined by its chosen Behavior as well (aggressive gives all resources to the strongest ally; defensive to the weakest ally; balanced an equal share to all allies). And then the AI surrenders. It shouldn't all happen at once. Perhaps 10 seconds between events/chats/tributes.

 

  • Like 2
Link to comment
Share on other sites

It sounds nice to give the AI more character.

I think right now the default setting is random if the AI behaves aggressive, defensive or balanced; I don't know how your suggestion exactly would influence that.

The AI being able to surrender also sounds nice, although I'm fine with them hanging on to their life as long as possible; worst thing to happen right now is to check if there's a woman standing around in the woods or if some of them went off to build a dock somewhere... I don't know how difficult or expensive their ability to surrender might be.

  • Like 1
Link to comment
Share on other sites

On 04/09/2023 at 3:39 AM, Gurken Khan said:

worst thing to happen right now is to check if there's a woman standing around in the woods

Happens to me all the time: I spend 10 (real) minutes sending cavalry units all across the map hunting for the last woman hiding under a tree... I'd really appreciate if the AI gracefully surrendered in those cases...  :(

 

  • Like 2
Link to comment
Share on other sites

2 minutes ago, krt0143 said:

Happens to me all the time: I spend 10 (real) minutes sending cavalry units all across the map hunting for the last woman hiding under a tree...

Maybe you should use search pattern delta two.

(joke) Do you know "attack move"? It's CTRL+Q+right click; it makes your units attack enemies they encounter on the way. That way you don't have to watch them the whole time.

I don't think I've spent more than two real minutes with that, on turtle speed. I try to exterminate thoroughly and you kinda get an idea where those women might be (either a remote forest or a place where they can build a port as a last resort). Let me tell you a story from before the war when you had to hunt down orphaned fishing boats...

Link to comment
Share on other sites

1 minute ago, Gurken Khan said:

I don't think I've spent more than two real minutes with that, on turtle speed.

Depends on the size of the map, I play on big maps... Also, when my rams plow through the enemy city, men fight but the women scatter, sometimes they run across the whole map (usually they try to build a new town center, if they have the resources).
If for some reason I didn't see in which direction everyone left, I need to sift through the whole map...

Anyway, my point is, I vote for surrender.
AoE had it, and it sure sped things up. At some point the AI knows it has no real chance of survival anymore, in this case it should give up (but not too soon either, or you should have the option to refuse).

Link to comment
Share on other sites

I think for new players understanding AI Behavior {Random, Balanced, Defensive, Aggressive} is easyer then Personalities.
I image myself always searching the personality who is most likely defensive.

On the other hand it's less abstract to play against a personality instead of a set of attributes.
It would be nice if we can play against (the personality of) "the enemy in a campain" outside the campain.

I don't agree with the proposed attributes {Aggressive, Defensive, Balanced} because they are only values on the Aggressive-Defensive-Spectrum.
I'm more for a single value:
Aggressiveness of 0.17 is defensive.
Aggressiveness of 0.5 is balanced.
Aggressiveness of 0.83 is aggressive.

Not realy related to your "Personalities" idea but i would like when AI's have another degree of freedom appart from "AI Behavior" (which should be called Aggressiveness IMO).
A new degree of freedom like "Supportivity":
An AI which is not supportive never sends their allies resources and does not help in wars of allies.
An AI which is very supportive often sends their allies resources and sends many units to help in the wars of allies. (even if the eco of the AI is going to die)

 

About the surrendering there is #2195

Link to comment
Share on other sites

14 minutes ago, phosit said:

they are only values on the Aggressive-Defensive-Spectrum

Not necessarily: The opposite of "aggressive" can also be "apathetic" or "conflict averse" (fleeing if attacked). Just saying.

About tuning the AI, I'd love to be able to slow down its actions, not by depriving it of resources, but simply by introducing almost human second-long pauses between each action. My fingers don't move at 4.7 GHz... :rolleyes:

Link to comment
Share on other sites

  • 2 weeks later...
4 hours ago, Radagast. said:

Or sort AI names by aggressiveness (assuming the simplification earlier speaker proposed)

Let player choose an aggressiveness

Find a valid index in AI names (random if index resolves to multiple)

and use this name for the AI

I think it could go both ways. Random AI name or choose a specific name to battle against.

  • Thanks 1
Link to comment
Share on other sites

On 11/09/2023 at 7:56 PM, krt0143 said:

About tuning the AI, I'd love to be able to slow down its actions, not by depriving it of resources, but simply by introducing almost human second-long pauses between each action. My fingers don't move at 4.7 GHz... :rolleyes:

They might not always make pauses between decisions, but they do have idle workers sometimes. Moreover they're pretty inefficient: sometimes they send workers across ~half the map for a new task; sometimes they gather res really far from a storehouse and they don't build new storehouses for example at woodlines. All those shuttling times really add up.

Spoiler

I remember from earlier versions when I could hear my neighbors slaughter their chickens while I was still on the loading screen; I thought that was really unfair.

 

  • Haha 2
Link to comment
Share on other sites

7 hours ago, Gurken Khan said:

Moreover they're pretty inefficient: sometimes they send workers across ~half the map for a new task

Your own workers do it too, unless you micromanage them... Imagine building a storehouse in a wooded area and setting some workers to cut wood. Now instead of progressively clearing out the area around the storehouse, progressively moving further and further away from the storehouse, sometimes they leave in a straight line, and if you leave them be, they will be cutting wood far, far from the storehouse while there are still lots of trees much nearer...
Since it's the same AI for both, but the AI player lacks the optimizing human oversight, I'm not surprised they sometimes do stupid things.

That been said, we're back to resource gathering. I don't have any beef with the AI's resource gathering. It's its overall speed of decision, reactivity and omniscience which bothers me. Humans are fallible, can be caught unawares, if something is pointless, they decide to try something else.

Speaking of which, unlike the AoE AI, the 0 A.D. AI does indeed sometimes try different things (usually different paths to come attack me), I'd like more of that. I like to be kept on my toes. :thumbsup:

 

Link to comment
Share on other sites

49 minutes ago, krt0143 said:

Your own workers do it too, unless you micromanage them... Imagine building a storehouse in a wooded area and setting some workers to cut wood. Now instead of progressively clearing out the area around the storehouse, progressively moving further and further away from the storehouse, sometimes they leave in a straight line, and if you leave them be, they will be cutting wood far, far from the storehouse while there are still lots of trees much nearer...

Ofc I micro my workers.

AFAIK the gathering far away only happens if they were gathering far away before; then they will cut the tree next to the one they were working on before... I've never seen a worker take off to distant goods after they built a storehouse.

Link to comment
Share on other sites

1 minute ago, Gurken Khan said:

I micro my workers.

Who doesn't.

 

1 minute ago, Gurken Khan said:

AFAIK the gathering far away only happens if they were gathering far away before

Not my experience. Just yesterday I set them to make a clearing. When I checked back some time (couple minutes) later, they were off cutting in a straight line from where they started, despite having still lots of trees really close to the storehouse.  :shrug:

Anyway, not a huge problem, just not optimal. Especially when you're also managing more delicate situations elsewhere at the same time.

Link to comment
Share on other sites

  • 1 month later...
On 04/09/2023 at 1:39 AM, Gurken Khan said:

I think right now the default setting is random if the AI behaves aggressive, defensive or balanced; I don't know how your suggestion exactly would influence that.

There are some good suggestions below this quote, although I think it's great that the options are so simple already. There are only 3, you don't need to signal to players that each character name makes them act differently. Even if we added more, like 5 options, it's still easier for a player to understand than a list of names. So I think it's best to have the player choose their gameplay style (aggressiveness) and then have the game choose a personality which fits.

If we pick Defensive, then it can pick a random historical personality from that civilization who was considered a defensive leader.

Edited by GumballForAPenny
add detail
Link to comment
Share on other sites

It's not really a question of aggressiveness, but of strategy/timing imho.

Will the AI try to snipe your workers ? Will it try to prevent you from extending ? Will it use its first expansion to develop its economy or to block your/prepare an attack ? Will it attack your town center as soon as it has a ram of wait until it has a serious siege force ?

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...