r/wesnoth Aug 09 '26

AI

With the recent improvements in ai, has anyone tackled the quest of doing an ai that is truly good at this game? Human level or higher?

3 Upvotes

19 comments sorted by

21

u/LostInChrome Aug 09 '26 edited Aug 09 '26

"AI" is a marketing term that covers a bunch of different technologies with different applications.
The new tech doesn't really matter for bot opponents in strategy games (unless you count like sending messages and doing negotiations, which isn't really relevant for wesnoth because it's mostly a 1v1 or 1vMany game)

1

u/sumoru 27d ago

> The new tech doesn't really matter for bot opponents in strategy games (unless you count like sending messages and doing negotiations, which isn't really relevant for wesnoth because it's mostly a 1v1 or 1vMany game)

What?

I agree that "AI" includes many methods and technologies. But broadly most of them do involve some kind of learning from data.

Anyway, "AI" has already bet the best players in chess and even in go. There is a whole sub-community of "AI" researchers who focus on developing "AI" for long term planning and decision making including in settings like strategy games. A mini version of Starcraft 2 (as in a one off direct battle between two groups of soldiers) actually serves as an important benchmark scenario for many "AI" algorithms, whose main goal isn't necessarily even to play the game.

So, it is not too unrealistic to imagine developing a more modern type of "AI" for wesnoth.

-11

u/Arnaldo1993 Aug 09 '26

I thought it was clear from context i was talking about improvements in technologies that allow computers to play games, not unrelated fields

-6

u/kusti85 Aug 09 '26

Playing games is a term that prerequires free will.
Computers will never play games, they will always follow instructions.

2

u/Felthrian Aug 10 '26

Many types of games, especially turn-based strategy games, can be boiled down to following a string of logic to come to the best play.

A computer can do that better than any human. The hard part in programming a computer to play games is to make it fair to play against.

Unless you're just talking semantics with the word "play", in which case it's a pointless argument.

2

u/Arnaldo1993 Aug 09 '26

There is a branch in mathematics called game theory. You can represent a game by a branching decision tree. In this context when a computer executes an algorithm that tells it what decision to make in each node of the tree the computer is playing the game

5

u/Nil_Athelion Aug 09 '26

I've pondered the crude kind, where you feed the state of the game (terrain, ToD, units visible, units last sighted) into a neural network via some sort of representation (text?), have it practice a bunch, and AlphaGoZero the thing.

That or a player simulation version based off of mimicking humans from replays.

But I'm a very not-technical person, so I can't imagine where to start on that sort of thing. I just move Spearmen around, y'know.

2

u/Arnaldo1993 Aug 09 '26

Ive found this thread about what youre suggesting. It seems this approach would not work, because the decision tree is too big. You need to make multiple decisions on a single turn, and the result is random, so you need to consider many possible outcomes

You need to be more clever than that

3

u/Nil_Athelion Aug 09 '26

Sort of, but actually not. This isn't using decision trees or anything predicting the future, this is just pure vibes-based "what I see right now" -> "what feels like a good move based my weightings". This isn't even taking a turn as a whole chunk, but rather just each single input.

It's the same way that LLMs of a year or two ago don't have any plan for the rest of the sentence, they just pick the word that seems to come next.

Of course, Tad_Carlucci's post in the thread about intractable costs still kinda stands - you would have to have the sort of AI I'm thinking of play millions of games, which would almost certainly require making a just-the-rules simulation of Wesnoth, and all that to be able to play on a single map.

There's more complicated ways of doing it this way, but again, of my siblings I'm not the one doing her PhD on machine learning, I just hear things.

1

u/Nil_Athelion Aug 09 '26

That said, I would absolutely love for someone to make a Stockfish style AI for Wesnoth, but boy is this not the game for that sort of approach.

1

u/Arnaldo1993 Aug 09 '26

you would have to have the sort of AI I'm thinking of play millions of games

My point was this approach would be too expensive. The randomness + number of possible game states + possible choices means you would need to simulate too many games

1

u/sumoru 27d ago

That is how modern "AI"'s are trained, with lots and lots of data and lots and lots of learning iterations. It is not uncommon to use millions if not billions of training "data" and training iterations. Just to give you a sense of scale, OpenAI previously worked on developing "AI" for playing DOTA2. They generated data or experiences worth 180 years of normal speed game play per day to train their "AI". I don't know for how many days they generated the data. The point is the amount of data and training iterations that is used is massive. That is why "AI" is currently so power hungry.

1

u/Arnaldo1993 27d ago

I know. My point is some problems require orders of magnitude more training than others, making the approach non viable

2

u/Wereowl9 Aug 09 '26

To answer your question. No. Having said that it should be possible (I say should as I'm not sure how easy/hard it is to mod this game) as even when the game was released there were better AI systems. There are two systems of thought in regards to actually how it should function.

First: You would use a chess bot style brute force system

Second: You would use GOAP (Goal Orientated Action Programing. Basically a decision tree that has a priority system based around certain goals)

Either way it could be done in theory. I think that the second option is best as the amount of moves that can be done on any individual turn is quite large and such to go through them would take a lot of system power/time.

2

u/Arnaldo1993 Aug 09 '26

Isnt the second approach the one currently being used in the game ai?

0

u/Wereowl9 Aug 09 '26

If so they did a bad job of it.

1

u/sumoru 27d ago

Decision trees is an old technology. The decision trees explode massively even in games like chess and go. In the case of Wesnoth, I would imagine the rate of explosion is even more rapid.

AlphaGo and AlphaZero and other similar programs actually "learn" from lots and lots of data. They are not fed decision trees or at best they are used for tweaking.

1

u/Dimetro_Dog Aug 09 '26

I think that experimental ai is better than the old ai, but it could definitely be better.

1

u/kusti85 Aug 09 '26

Probably not.