Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Using genetic algorithms to 'train' my AI  (Read 2655 times)
0 Members and 1 Guest are viewing this topic.
Offline Netherlords

Junior Member


Medals: 1



« Posted 2013-08-01 15:17:39 »

Hi,
 
My name is Peter Norberg and I've previously written about my game AI in this thread: AI in a turn based strategy game. It's been a while since my last update and due to this I thought it would be best to start a new thread. But there's been a lot done on the AI and it's now quite developed and able to do most of the needed actions as well as simple diplomacy.
 
Now I've just started to see if I can 'train' the AI by using genetic algorithms. I'm not sure if this will be a success or not. At my blog, Words from the Netherlords, I've described how I intend to do it and my intention is to write down my conclusions when I'm finished with it, good or bad...
 
Rising Empires uses an utility-based AI which depending on the sitiuation and its free resources can make multiple decisions each turn.
 
All thoughts on the subject are welcome!

'Words from the Netherlords' - News and updates about Rising Empires…
Offline zngga
« Reply #1 - Posted 2013-08-01 18:16:05 »

http://znggasworld.blogspot.com/2013/07/intriguing.html

Once you have a system that can develop good AI's you can incorporate it into the game, have the AI learn with the Player and become better at defeating / defending against the Player as the game goes on.

My code never has bugs... it just develops unexpected features!
Offline Netherlords

Junior Member


Medals: 1



« Reply #2 - Posted 2013-08-07 18:10:11 »

The first results and comments on my trials have now been added to the blog. I've tried to improve the Human and Greenskin races and at least the Greenskins show some promising improvements. I intend to fine tune my algorithms a bit (I hope I remember to add the code in my next update) and try two of the other races as well.
 
This is very fun! Smiley

'Words from the Netherlords' - News and updates about Rising Empires…
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #3 - Posted 2013-08-08 01:34:04 »

Crap, this is gold. I probably will try a bit of my own spin of it. I didn't have time to read the entire blog post, but the idea itself brought this to my head (aka, Idk if this is what you already did). You make the game, and have people play it. You make the enemy ai start with 2 actions. Attacking, and defending. They attack, and see how much damage occurred. The first time will be the baseline. That will be what they remember, and compare all other attacks to. Anyways, after that, they take damage while defending. Again, that will be a baseline. After that initial data, they will shake stuff up every generation. Like maybe spin before they attack, or whatever. But, here is the catch. If they die in a battle, and did not pass on their skill to the next generation, that skill will be lost. Similar to 'Survival of the fittest.' So, after about 40 generations, they will get more and more advanced in their attacks, and defenses. And the other catch, is once their current stats are 150% of the original data, they will be a new species, and that bar where it is a new species rises in that species. So the first division of species will be set at 150%. Next, 200%. Until it gets to the maximum attack range.

Thanks for giving me the idea! I might try this myself, but my hands are kind of full at the moment.
Keep up the good work! Grin

Offline Netherlords

Junior Member


Medals: 1



« Reply #4 - Posted 2013-08-27 16:57:41 »

Thanks wesley.laferriere. Remember that you need to randomly test new skills and in what order to use them for the AI to develop. It might be that the spin before the attack won't be effective and then it won't be used, but it might also be that the spin is only effective in combination with another special attack and for that to evolve you must mutate randomly, i.e. test new crazy stuff. Most times it won't be anything good but once in a while a new interesting attack will evolve.

I've completed the third part of my tests to see if I can improve my AI with the help of genetic algorithms. If you're interested it can (as usual) be found at my blog. Training the Elf and Ende races didn't give as good results as did the Greenskins...

'Words from the Netherlords' - News and updates about Rising Empires…
Offline EmanP

Junior Member


Projects: 2
Exp: 3 years


Satisfaction never guaranteed.


« Reply #5 - Posted 2013-10-02 20:36:56 »

Be careful with this adaptive AI, if it's not flexible enough, it may find a suitable method that becomes repetitive to the player over time!
Try to keep the player from taking advantage of it, you don't want the player to lose several times so the AI loses it's good strategies so that the player can have an easy epic win to upload to youtube and brag.
Also if you decide to have the AI save results, make sure it doesn't take a chunk of memory.

And be aware that having an adaptive AI means that players may have to become extremely adaptive, or may just brute-force their moves from a lack of it's understanding- You can help this by using 'inequalities', choices that cannot be compared to each other, e.g. apple + orange.

Signed- EmanP
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (27 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!