AI improvement idea

AI improvement idea

Postby tavariz91 » 03 Apr 2013, 11:38

Hi everyone!

For my first post, I want to tell you the idea I had yesterday evening and that made not sleep for hours...

here's the idea:
every actual value of the AI should be an average. For every kart on every race, the values are changed in a random variation between -5% and +5%. After the race, the first AI kart's values are used to partially change the AI average, so the AI karts become stronger and stronger in a darwinian selection.

If the human player loses (maybe is in the fourth quarter of the list after a race), It's not the best but the worse AI that is selected, so the AI stays adapted to te player.
If the human player is the last one X times in a serie, the AI comes really easyer (with the original defaults values?)


What do you think of it?
"I do not agree with what you say, but I will fight up to death so that you have the right to say it"
- Voltaire
User avatar
tavariz91
 
Posts: 146
Joined: 03 Apr 2013, 11:22
Location: Lausanne, in my Sweet Zerland

Re: AI improvement idea

Postby AleXoundOS » 03 Apr 2013, 15:36

Good idea.

Adjusting AI values based on results introduces some learning mechanisms. (However deciding what to define as "AI values" can not be easy)

And I think that making AI easier must be optional (and it's not a problem).
AleXoundOS
 
Posts: 4
Joined: 03 Apr 2013, 15:10

Re: AI improvement idea

Postby bonifarz » 03 Apr 2013, 18:55

Heheh, Genetic algorithms for the STK AI? Well, that's something one could basically apply to anything. But if you are more specific with your idea, do you refer to AI parameters in the config file, like the relative probability to use skidding and collect items? Many of these already have a dependence on the relative distance to the players kart, so the AI already gets weaker when it is far ahead. I think a GA would take way too long to adapt to some player behavior/strategy, and the effects of the parameters on the "fitness" are rather clear and not as complex as in typical applications for GA.
User avatar
bonifarz
 
Posts: 379
Joined: 09 Apr 2012, 12:16
Location: switzerland

Re: AI improvement idea

Postby E-Dragon » 03 Apr 2013, 22:08

We already have 3 different AI difficulties, so you can chose who suit to you most.
The thing I would prefer is to implement is some kind of cheating AI, just like in some other games, where the AI gets faster, the faster you are and becomes really slow , when you are.The difficulty can be suited about how much they cheat. (for example on easy mode ,they don´t even cheat, while in hard mode, you never get rid of them )

How do you think about this ?
E-Dragon
 
Posts: 43
Joined: 31 Jan 2013, 18:41
Location: Germany

Re: AI improvement idea

Postby Totoplus62 » 03 Apr 2013, 22:49

E-Dragon {l Wrote}:We already have 3 different AI difficulties, so you can chose who suit to you most.


Exactly, imagine (an example) your little sister run the game on your computer without creating a new profile. She will have problem to play because you are an hardcore player -> So this is currently enough good i think because you can choose the difficulty. ;)
"Imagination is more important than knowledge." Features under CC-BY 3.0, CC-BY-SA 3.0 or equivalent GNU license
Image SuperTuxKart Popularity
User avatar
Totoplus62
 
Posts: 584
Joined: 10 Nov 2012, 13:33
Location: France - Pas-de-Calais

Re: AI improvement idea

Postby hiker » 04 Apr 2013, 01:41

Hi,

while adjusting the AI is an interesting idea, it has some drawbacks. Main problem would be that it is difficult to tweak the challenges. With your design if you have a problem with a challenge, you would have to drive really bad for a few races, then do the challenge again. Also while some parameters might be easy to tune (i.e. increasing the value lead to better AI), it's certainly not going to be the case everywhere. Example: increasing the skidding probability might actually result in bad behaviour, i.e. the AI skidding too often and in places where it just doesn't work. It could lead to bugs (e.g. AI getting stuck, which only happens with certain parameter values). There's actually a lot of work done in tweaking the AI parameters to make them work properly in all tracks.

It would also make it very difficult to debug any AI problems: if you have a problem, e.g. AI getting stuck, it might be impossible for us to reproduce and fix the issue (unless we get all your adjusted values).

So if anyone wants to experiment with this, certainly go ahead and keep us posted, but I at least won't work on this.

E-Dragon {l Wrote}:We already have 3 different AI difficulties, so you can chose who suit to you most.
The thing I would prefer is to implement is some kind of cheating AI, just like in some other games, where the AI gets faster, the faster you are and becomes really slow , when you are.The difficulty can be suited about how much they cheat. (for example on easy mode ,they don´t even cheat, while in hard mode, you never get rid of them )


Our AI doesn't cheat, but already does some rubber banding: if it's too far ahead, it won't skid as much and drives slower (but if it's behind it does not drive faster). And those parameters are also adjusted by difficulty, i.e. on hard the AI must be further ahead before it slows down.

We intend to make a fourth level AI available in the future, where all rubber banding is disabled.

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: AI improvement idea

Postby bonifarz » 04 Apr 2013, 11:48

E-Dragon {l Wrote}:We already have 3 different AI difficulties, so you can chose who suit to you most.

You can actually make them quite a bit harder than that. The settings i once experimented with are found in this topic.
User avatar
bonifarz
 
Posts: 379
Joined: 09 Apr 2012, 12:16
Location: switzerland

Re: AI improvement idea

Postby tavariz91 » 06 Apr 2013, 00:03

Waow, I did'n thought ther could be so many interesting answers.
@ Hiker, I was thinking about one AI setting per challenge, so no cheating unless you modifiy a file named "AI parameters" or something like that, which would be user-dependant. In this file, you would have something like
" TRACK "
setting 1 =
setting 2 =
...
"TRACK_END".
"TRACK 2 "
etc.

Not so hard to give the file for debugging ;)

If the track is new, hard settings (without rubberbanding) would apply.
For the fourth level (Let's call it "diabolic level") it could be great :) it would become more and more difficult, with an "infinite" challenge.

@ Bonifarz
For the values to modify and how much, I don't know at all but I'll check before may (not much time :) ). I refer to every variable applied only on the AI without making any cheating / rubberbanding /place-anything-not-expected-for-a-fair-play-game-here, so basicelly I think about skidding, accelerating, using nitro, not using nitro :) time / triggers for using objects (immediately or later?), time before calling thunderbird for help.

Short example: A (2/2) throws a cupcake on B( 1/2), who is invunerable because he was shot by the rubberball 3 seconds before. A stays behind because he didn't waited enough, and loses. B is selected, because he was fast enough (maybe by "cutting" bends) to keep 5 seconds in advance and because A was not patient enough to send his cake on B at the right time. Every parameter is important.

The code in the link you give could be a good starting point for the possible values. (I'll try this hard AI later, thanks :) )

@ E-dragon: kind of frustrating thing to see the Ai make what you cannot. Have you ever played to command & conquer (first in the serie), where the computer builds up to 4 buildings exactly at the same time, and you, poor player, can only build one? I hated it ;)
"I do not agree with what you say, but I will fight up to death so that you have the right to say it"
- Voltaire
User avatar
tavariz91
 
Posts: 146
Joined: 03 Apr 2013, 11:22
Location: Lausanne, in my Sweet Zerland

Re: AI improvement idea

Postby hiker » 12 Apr 2013, 01:40

...
tavariz91 {l Wrote}:Not so hard to give the file for debugging ;)

Sure, I am more thinking of getting people unfamiliar with using a computer to find those files ;)

We actually had one suggestion on irc: with the new high level AI we could try to switch the AI to use a higher level. I won't have time to look into this any time soon, but that might also be an option.

...
[code]
@ E-dragon: kind of frustrating thing to see the Ai make what you cannot. [/quote]
Yes, we try to avoid this. Only exception is boss battle, to make them a bit more challenging (where nolok gets more bubble gums), but I think that's obvious that something is different, and acceptable.

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: AI improvement idea

Postby hiker » 12 Apr 2013, 01:42

bonifarz {l Wrote}:You can actually make them quite a bit harder than that. The settings i once experimented with are found in this topic.

Thanks for this. I've recently added them as 4th level AI to our current trunk. I still have to lock this AI, but it should be available officially in 0.8.1 (and on any nightly builds already).

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: AI improvement idea

Postby tavariz91 » 12 Apr 2013, 10:55

Hi!
Then look at my god level design (In the easter egg's section).

Regards,

tavariz91
"I do not agree with what you say, but I will fight up to death so that you have the right to say it"
- Voltaire
User avatar
tavariz91
 
Posts: 146
Joined: 03 Apr 2013, 11:22
Location: Lausanne, in my Sweet Zerland

Re: AI improvement idea

Postby rubberduck » 28 Apr 2013, 15:02

i have also an ai improvement idea, but i don't know, if it is possible to do that.
I don't know if this would be hard to add

it would be good to have something like a warning-zone for ai in hard curves

in the object-menu in blender should be an option to assign a warning-zone to an object(for example a normal cube)
this warning-zone should be an area, where ai tries to avoid this zone and drive a bit slower in a curve near this curve
this would be good for tracks, where the ai often drives against the wall or it would be good to avoid that ai get stuck
https://notabug.org/rbduck/Nucleagacy
my puzzle / action game in godot 4
User avatar
rubberduck
 
Posts: 910
Joined: 23 Apr 2013, 18:31
Location: sitting with tux in a bathtub

Re: AI improvement idea

Postby Auria » 29 Apr 2013, 01:25

rubberduck {l Wrote}:i have also an ai improvement idea, but i don't know, if it is possible to do that.
I don't know if this would be hard to add

it would be good to have something like a warning-zone for ai in hard curves

in the object-menu in blender should be an option to assign a warning-zone to an object(for example a normal cube)
this warning-zone should be an area, where ai tries to avoid this zone and drive a bit slower in a curve near this curve
this would be good for tracks, where the ai often drives against the wall or it would be good to avoid that ai get stuck



I don't think this is required, at this time the AI drives quite well, when AIs drive into walls it is typically because the drivelines are not correctly formed. Either the drivelines are too close to walls, or they contain too long polygons that should be subdivided
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Who is online

Users browsing this forum: No registered users and 1 guest