Generalized AI

Ideas and implementation

Discussion about the game and its default mods.
Post Reply
vrkomarov
Posts: 9
Joined: Mon Jul 23, 2012 4:04 pm

Generalized AI

Post by vrkomarov »

Hi everyone. I'm trying to make an AI that will work with all modes. Currently have a working implementation, that works with ra, cnc and d2k mods. Tests were carried out mainly on the cnc mod so it works best in it.
In ra mod are problems in the operation of aircraft units and ships (mainly because I almost did not work with ra mod). Now I'm looking for the best way to fix it. Also plans to make ai more strategic.
While the principles of all mods are almost the same, make a fully general controller for all mods are unlikely to succeed (for example, because a support power works everywhere in different ways etc). So in the future I think it is reasonable to make a general class for all mods and in each of them, only override additional functionality.
Here I propose to discuss the ideas and choose the best way for a good AI architecture.
My repository here https://github.com/VrKomarov/OpenRA

User avatar
zypres1
Posts: 277
Joined: Mon Oct 24, 2011 8:22 pm

Post by zypres1 »

Wow. Things are happening with AI. Sweet.
All the AI devs should team up, this way we do not end up with only one dev, and we have a finished product, not just new AI development all the time.

Have you spoken with Valkyrie? Could you team up? What are your differences than his code?

Thank you for making AI, I hope you can get all the help you need on IRC..

vrkomarov
Posts: 9
Joined: Mon Jul 23, 2012 4:04 pm

Post by vrkomarov »

No while i don't speaking with Valkyrie. His code is strongly tied to RA mod. I'm trying to write a generic code. At least at this stage. In the future will still have to do some things more specifically. Plus I use a finite state machine for the squads of units and fuzzy logic in some cases.

Matt
Posts: 1146
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

vrkomarov wrote: No while i don't speaking with Valkyrie. His code is strongly tied to RA mod. I'm trying to write a generic code. At least at this stage. In the future will still have to do some things more specifically. Plus I use a finite state machine for the squads of units and fuzzy logic in some cases.
Your general approach to unit handling is a big plus (Valkyries code crashes with d2k and cnc) and it is very resource friendly. I tried 8 bots fighting each other in d2k which is very spammy, but your AI is using the path finder more seldom which removes the CPU lag spikes. It is also very robust. I experienced no crashes. One thing: you added a binary https://github.com/VrKomarov/OpenRA/blo ... ibrary.dll Where does it come from and is it also Open Source?

vrkomarov
Posts: 9
Joined: Mon Jul 23, 2012 4:04 pm

Post by vrkomarov »

Thanks for the nice review. Yes FuzzyLogicLibrary.dll is open source (GPLv2). I took it from here http://sourceforge.net/projects/fuzzynet/

Matt
Posts: 1146
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

I think you can send https://github.com/OpenRA/OpenRA/pulls already because you are fixing https://github.com/OpenRA/OpenRA/issues/2186

Planes will work better with the AI when https://github.com/OpenRA/OpenRA/issues/2035 is implemented.

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

We'll need to clarify with the fuzzynet author whether their licensing terms are GPL2 only, or GPL2+. We've got a problem combining it with openra if it's 2 only, since we're 3+.

vrkomarov
Posts: 9
Joined: Mon Jul 23, 2012 4:04 pm

Post by vrkomarov »

chrisf wrote: We'll need to clarify with the fuzzynet author whether their licensing terms are GPL2 only, or GPL2+. We've got a problem combining it with openra if it's 2 only, since we're 3+.
I will try to contact with the fuzzynet author.

vrkomarov
Posts: 9
Joined: Mon Jul 23, 2012 4:04 pm

Post by vrkomarov »

Author said that on his part there are no restrictions and library can be used under any license.

User avatar
zypres1
Posts: 277
Joined: Mon Oct 24, 2011 8:22 pm

Post by zypres1 »

Sweet. Thank you vrkomarov and Mailander...

Please also explane how the AI works, what is different from earlier hackAI, betaAI and simmilar?

Matt
Posts: 1146
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

This fuzzy logic thing makes it quite easily readable: https://github.com/VrKomarov/OpenRA/tre ... Mods.RA/AI

As far as I understand and observed it: the decision when to attack is more dynamic. If the enemy is on low health: get 'em no matter what. If you have a lot units in your base: throw them at the enemy, but if you own health is low: retreat the units (it will however not repair them).

vrkomarov
Posts: 9
Joined: Mon Jul 23, 2012 4:04 pm

Post by vrkomarov »

I'm a little fix logic for air units in RA mod. Helicopters work fine (so far), but the planes returned to base badly. Problem in the choice of landing sites.

Post Reply