TIGSource Forums

Developer => Technical => Topic started by: Netherlords on August 27, 2013, 10:51:42 PM



Title: Using genetic algorithms to train the AI in a 4x strategy game
Post by: Netherlords on August 27, 2013, 10:51:42 PM
Hi,

My name is Peter Norberg and I've been developing indie games since 2009. The game we, my brother and I, are working on now is a 4x strategy game and we quickly decided to use an 'utility-based' AI since this is a type of AI that is suited for a very flexible environment.

Anyway, I decided to train the AI with the use of genetic algorithms and have summarised the experience in three articles on my blog:
Training an AI (http://www.risingempires.com/netherlords/?p=1048)
Training an AI - part 2 (http://www.risingempires.com/netherlords/?p=1097)
Training an AI - part 3 (http://www.risingempires.com/netherlords/?p=1131)
All code examples in part 3 is in java since the game is developed for Android. The result of my tests are, I believe, good but not as conclusive as I'd hoped. I hope you enjoy it, I know I enjoyed running these tests... :)


Title: Re: Using genetic algorithms to train the AI in a 4x strategy game
Post by: Crimsontide on August 29, 2013, 11:52:59 AM
Very interesting, keep posting updates.  I wish more strategy games would put time into their AI development, the last few I played (Civ V, Shogun 2, and XCom) had an AI that was laughably bad.


Title: Re: Using genetic algorithms to train the AI in a 4x strategy game
Post by: gornova on August 30, 2013, 05:55:52 AM
hi! do you use a library for GP like JGap ?


Title: Re: Using genetic algorithms to train the AI in a 4x strategy game
Post by: Netherlords on August 30, 2013, 06:06:51 AM
hi! do you use a library for GP like JGap ?
No, I've written all code myself.


Title: Re: Using genetic algorithms to train the AI in a 4x strategy game
Post by: gornova on August 30, 2013, 06:30:55 AM
I'd like to see (when you have time, of course) a class library of your code, to undestand better how organize a similar approach