Jump to content


Photo

AI With a Memory


8 replies to this topic

#1 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 02 February 2006 - 04:04 PM

I dont know if/where/why it would be useful for the AI to be able to remember things between games, but it is possible.

Two possible applications:
- AI records how many times it has won/lost against a specific opponent and then gets weaker/stronger to match their skill
- AI randomly changes a few numbers in the unitstats table by a little amount and then saves the changes if it wins the game

At the moment I have it remembering how many games the AI has played:
1. Make a file called memory.ai in the Data\AI folder with this content:
g_gamecount = 0
2. Have cpu_manager.ai import memory.ai:
--memory
import ('memory.ai')
3. Add this function to cpu_manager.ai:
function CpuManager:__finalize()
   local log log = io.open( "Dowai_mod\\Data\\ai\\memory.ai" , "w" ) 
   log:write("g_gamecount = " .. g_gamecount) 
   log:close() 
end
4. Pop this into CpuManager:__init
g_gamecount = g_gamecount + 1
ailog("logout.txt","gamecount" .. g_gamecount)

Posted Image

#2 Quietdeath

Quietdeath
  • Members
  • 43 posts

Posted 02 February 2006 - 04:41 PM

An AI learning ability would be really cool and helpful. I also think the AI should use the full mapsight capability to its advantage.

#3 Zenoth

Zenoth

    title available

  • Members
  • 469 posts

Posted 02 February 2006 - 09:21 PM

Interesting, most interesting.

I can already foresee my IG Baneblade/Ogrin early tactics fail because the A.I knows how to counter it after a few games.

If possible then indeed it would be great to see in the mod.

#4 Malkor

Malkor

    Eternity

  • Members
  • 375 posts
  • Projects:Loladins of Legend.
  •  Inanely inane inanities!

Posted 02 February 2006 - 09:23 PM

If the AI could learn to not leave me alone teching for hours on end, then maybe I might not win so often :)_:huh:

*imagines a game after 5 all of the AI gang up on him in an FFA with workers in an effort to prevent his vehicle rush*

Edited by Malkor, 02 February 2006 - 09:24 PM.


#5 Finaldeath

Finaldeath
  • Project Team
  • 188 posts
  • Location:UK

Posted 03 February 2006 - 12:24 AM

Best opinion of the usefulness of this would be in strategy picking, or map stat saving. If they chose X strategy on Y map before, try Z strategy instead...

Learning? I doubt you'd be able too, not now, not in the future. RTS games are a bit too complex to set in motion a learning AI. Lots of algorithms or lots more data needed for that.

#6 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 03 February 2006 - 01:42 AM

not in the future.

I totally beg to differ. I can see when AI Processors become a thing that is by default installed on mobos or video cards. Like the Physics chip going in, AI development is moving along. Maybe in a few decades we *MIGHT* see Skynet-like consciousness.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#7 Malkor

Malkor

    Eternity

  • Members
  • 375 posts
  • Projects:Loladins of Legend.
  •  Inanely inane inanities!

Posted 03 February 2006 - 03:33 AM

Learning AI can already be done, I assure you. I intend to do it in HL2, although, that is not really comparable to an RTS (more complex, actually, given what I'm going to be having it turned into), it's not as much data as you might be lead to believe.

#8 Finaldeath

Finaldeath
  • Project Team
  • 188 posts
  • Location:UK

Posted 03 February 2006 - 03:40 AM

You think the game hasn't got better things to do then "learn" the AI?

I'm afraid, if you havn't studied it at all, even basic searches to find a best solution for a problem (using information gain, with an A* search usually) takes a better part of complexity that is well byond anything DOW is able to do.

Sure, you may see it in games, even other games currently (for example, FPS's do "learn" to a degree, and for finding paths - pathfinding - A* searches do this well. FPS's are not as complex however - its a point and shoot system for most of them), but not in Dawn of War, at least not unless DOW2 has some really advanced stuff.

I'd even say that sooner or later we could have processors fast enough to do it. Hell, it'd be fast enough to run several concurrent dawn of war engines in full game swing in the future, but the AI isn't usually considered that important to learn ;)

After all, more effort would be put into teaching it even how to start building units then would be made progress on other, more important human versus human areas of the game. If it learnt so it never made a mistake (taking into account the computer cheats) then it'd be no fun to play against and be unbeatable, to a degree.

Okay, I'm not trying ot get into a debate about this - in Dawn of War, persistant settings, while nice, and is a form of memory, is not a reliable way of learning, and no learning, from previous games nor from in-game real-time learning, is adequatly possible in an RTS game.

And this is, by far, one of the simpler ones (two resources, no gathering units, easy base building and no long drawn out research, no constant flying units or anti-air, or ships, and fast games), compared to ones with perhaps even just flying units or whatever.

Okay, so I might well have done badly in my AI exam this january, but it doesn't mean I don't know it isn't possible, in DOW, to have an adapative, or even learning from a large foundation, AI system. One that can remember some facts? possibly, but not to learn from them is all, not today anyway :p

#9 Malkor

Malkor

    Eternity

  • Members
  • 375 posts
  • Projects:Loladins of Legend.
  •  Inanely inane inanities!

Posted 03 February 2006 - 03:52 AM

Well I wasn't really referring to DoW. In honesty I think DOW is pretty badly coded as it is and will never get that far unless you rewrite a lot (A lot more than just AI).



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users