Latest Posts

Topic: More settings for AI players?

Mr.Ravi
Avatar
Topic Opener
Joined: 2023-08-17, 13:51
Posts: 10
OS: GNU/Linux
Version: 1.2
Ranking
Pry about Widelands
Posted at: 2024-06-25, 16:13

Hello!

For a game that is built around building instead of destroying, the Normal AI is such a jerk!

May I know why is it that the AI player ALWAYS attacks me when it can, except for when I defeat it multiple times, weakening it so much that it is "unable" execute another successful attack?

The Normal AI refuses all diplomacy requests unless it is at gross military disadvantage or when it is far from my borders, making alliance and neutrality pointless. it also breaks all alliances once it establishes some military power and gains ability to attack.

I am not asking for a peaceful game, but I really think constant war is pointless, draining, and unpleasant; also it keeps me from actually playing, I can't do stuff if I have to constantly worry about my 5 borders' being attacked by an AI that can't be reasoned with!

There should really be an option to allow real players to kick AIs and also the ability to make permanent teams. It would be really nice if we could set a level of aggression for each AI player!


If You Have Lost Heart In The Path Of Love, Flee To Me Without Delay, I Am A Fortress, Invincible.
-Mulana- (Rumi)

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2470
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2024-06-25, 17:10

In general the ai code is not really maintained because widelands is lacking developers. The AI code regarding diplomacy is pretty new and minimal, same for the ai code regarding naval warefare. I am glad that the ai works under most circumstances, although it seems sometimes very stupid...

Defining permanent teams should be possible in the game setup menu. Don't know if you have to forbid diplomacy if teams are predefined. The option to forbid diplomacy can also be found in the game setup menu, a bit hidden below the button "Show more options":

game options


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Mr.Ravi
Avatar
Topic Opener
Joined: 2023-08-17, 13:51
Posts: 10
OS: GNU/Linux
Version: 1.2
Ranking
Pry about Widelands
Posted at: 2024-06-26, 13:04

Okay, thanks.

So how can I make this AI stop attacking me? Can't I just bribe it or something?! -_-


If You Have Lost Heart In The Path Of Love, Flee To Me Without Delay, I Am A Fortress, Invincible.
-Mulana- (Rumi)

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2470
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2024-06-26, 15:16

Mr.Ravi wrote:

Okay, thanks.

So how can I make this AI stop attacking me? Can't I just bribe it or something?! -_-

face-grin.png

AFAIK the AI starts attacking if the ai player is stronger than you. So just focus on gaining military strength until you meet an ai-player. And keep some distance to ai players, where distance means don't expand your territory to the border of the ai-player, seeing his border is a good distance.

This is just my experience, gained while play testing the map Amoebae. In the first test game all ai players starts attacking me, during other test games i used the tactics mentioned above and than it was much easier to win. But i think on most other maps you have time enough to gain some military strength and other ai-players are far away, or, you can catch one after the other.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
mxb2001
Avatar
Joined: 2019-05-20, 17:49
Posts: 266
OS: Linux
Version: 1.2
Ranking
Tribe Member
Location: The land of the thirsty spider
Posted at: 2024-06-26, 16:59

Actual artificial intelligence is likely centuries away. I like to call them AO Automated Opponents or more rudely AS Art. Stupidity. : ) But hey, no complaints. I can actually beat them. Uh, sometimes.


--
To Boldly Go Where No Man Has Gone Before

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2675
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2024-06-27, 20:27

If you don't wan't the AI to attack we have the option to play a peacefull match.
Diplomacy is like it is in real world, treaties are always broken sooner or later.
For years we had complaints about the poor AI so I spent hundreds of hours to improve it. I am happy that I had some success obviously.
The game is about growing an economy that can sustain a huge military production and training chain, and it aims at conquering the whole map from opponents. If you do not want that part you could play without opponents. You may also choose a weak AI however that is only affecting the later game as it limits economy size rather then slowing the AI in the beginning. That is already on my list though.


Top Quote
MarkMcWire
Avatar
Joined: 2017-02-08, 20:06
Posts: 334
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2024-06-28, 13:13

I have a lua code for my own tribe that maybe can used for this problem. I programmed a ban on certain buildings into my starting conditions. These buildings are only unlocked gradually over the course of the game. This way I wanted to get the AI ​​to not waste too many building materials at the beginning of the game. In particular, the unnecessary upgrades of buildings should be prevented in the first few hours of the game.

This method can also be used to limit military buildings. The AI ​​actually only needs small Sentry / Guardhouse to expand territory. It cannot launch a successful attack with these buildings because they can only accommodate a maximum of 2 soldiers. On the other hand, we could simply ban the AI ​​from building training sites so that it cannot produce heroes. This would quickly put it at a disadvantage in military statistics and it would no longer attack.

However, this would have a significant impact on the way the AI ​​organizes its economy, since without training sites certain wares would no longer be needed and thus the production chains would be disrupted. The AI ​​would simply produce weapons and armor until the warehouses were full and then the smithies would no longer produce anything. This would mean that there would no longer be a need for metal and the smelting works and mines would also eventually stop producing, meaning that food would no longer be needed either. This would give the AI ​​a signal not to build any more buildings, because quantity-limits of severals wares.

Edited: 2024-06-28, 13:14

My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
MarkMcWire
Avatar
Joined: 2017-02-08, 20:06
Posts: 334
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2024-06-28, 13:19

The entire game mechanics is designed to collect as many wares as possible in order to produce armor and weapons in order to recruit and train soldiers and thus defeat the other players. The game's economy is very linear. There are no complex dependencies and therefore no realistic economic simulation. There is not even a "population" that needs to be fed and clothed.

What you are looking for is probably more in the direction of "Anno" or "Civilization" and less in the direction of "Settlers".


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
Mr.Ravi
Avatar
Topic Opener
Joined: 2023-08-17, 13:51
Posts: 10
OS: GNU/Linux
Version: 1.2
Ranking
Pry about Widelands
Posted at: 2024-06-28, 13:48

hessenfarmer wrote:

If you don't wan't the AI to attack we have the option to play a peacefull match.
Diplomacy is like it is in real world, treaties are always broken sooner or later.
For years we had complaints about the poor AI so I spent hundreds of hours to improve it. I am happy that I had some success obviously.
The game is about growing an economy that can sustain a huge military production and training chain, and it aims at conquering the whole map from opponents. If you do not want that part you could play without opponents. You may also choose a weak AI however that is only affecting the later game as it limits economy size rather then slowing the AI in the beginning. That is already on my list though.

Nice job with the AI. You have had more than "some" success, the game is really pleasant with the AIs in it. face-grin.png

The point of an alliance is to keep countries from tearing each other apart so that they can reach a common goal, if a country was to make and break 5 alliances per minute, its behavior wouldn't have been tolerated by others.

But, as I said, I wish not for a peaceful game, I just thought this behaviors were worth mentioning.


If You Have Lost Heart In The Path Of Love, Flee To Me Without Delay, I Am A Fortress, Invincible.
-Mulana- (Rumi)

Top Quote
Mr.Ravi
Avatar
Topic Opener
Joined: 2023-08-17, 13:51
Posts: 10
OS: GNU/Linux
Version: 1.2
Ranking
Pry about Widelands
Posted at: 2024-06-28, 13:50

MarkMcWire wrote:

I have a lua code for my own tribe that maybe can used for this problem. I programmed a ban on certain buildings into my starting conditions. These buildings are only unlocked gradually over the course of the game. This way I wanted to get the AI ​​to not waste too many building materials at the beginning of the game. In particular, the unnecessary upgrades of buildings should be prevented in the first few hours of the game.

This method can also be used to limit military buildings. The AI ​​actually only needs small Sentry / Guardhouse to expand territory. It cannot launch a successful attack with these buildings because they can only accommodate a maximum of 2 soldiers. On the other hand, we could simply ban the AI ​​from building training sites so that it cannot produce heroes. This would quickly put it at a disadvantage in military statistics and it would no longer attack.

However, this would have a significant impact on the way the AI ​​organizes its economy, since without training sites certain wares would no longer be needed and thus the production chains would be disrupted. The AI ​​would simply produce weapons and armor until the warehouses were full and then the smithies would no longer produce anything. This would mean that there would no longer be a need for metal and the smelting works and mines would also eventually stop producing, meaning that food would no longer be needed either. This would give the AI ​​a signal not to build any more buildings, because quantity-limits of severals wares.

Thank you so much! I don't think I'll be using it though, I've given that map up. I've started a new one : "Europe"


If You Have Lost Heart In The Path Of Love, Flee To Me Without Delay, I Am A Fortress, Invincible.
-Mulana- (Rumi)

Top Quote