Jump to content
  • Advertisement
Sign in to follow this  

Stuck on learning machines :/

This topic is 2150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


i am working on a roundbased medieval RPG.


I tried to achieve an AI, where i dont need to implement how to use each skill, for 2 reasons:

- i want to use the AI to verify that the implementation of a new character/skill is still balanced. (i do this with statistical analysis of the results of AI games)

- hardcoding that is pretty hard in decision finding: f.e. : You got a healer that can attack. You have a near to death enemy, and a near to death ally. What you gonna do ? heal your ally, or kill the enemy ??


The AI KI i wrote is some kind of "Future prediction AI", like the common implementations of chess.

The AI works really fine, it has just 1 Problem: highly CPU consumption.


Letz assume a 5 vs 5 Battle.

In this case, i have to go 10 action into the future to have the outgoing of 1 round predicted.

In Chess, you will have with 10 actions 5 rounds predicted.


And thats the problem: i need at least ~ 5 rounds to successfully forecast the effect of "over time effects" like poison, heal over time, or simple the disadvantage of a blind effect within 5 rounds.


Currently it seems impossible to predict the outgoing of just 1 round in a 5vs5 situation: too many possibilitis in the decision tree.

RAM consumption is also a hard limit.


i began to study neural networks at university to solve that problem,  but i am still far away from a solution, 

and i read that with ANN even such a simple game like chess (Full Observable, continous, not many possibilities) are really really hard to do with ANN.


So maybe you can tell me another ideas how to solve that problem.

Share this post

Link to post
Share on other sites

Use Monte Carlo methods (i.e. random simulation).


If you have 3 choices each round start with equal probability to choose each action. Simulate a large number of matches (over multiple rounds), store the statistics for the expected result. (Score could perhaps be d * damagedealt - h * healthlost where d, h are constants to weight how good doing damage is compared to losing health).


Tweak the probabilities to choose the actions, simulate again, get more statistics.


After a while the best distribution for choosing actions should end up with the highest expected results.


That's the basic idea anyway and works well for AI where making a full decision tree is impractical.


EDIT: You can also add state to the simulation, e.g. choosing different tactic distributions depending upon the actor state, e.g. have an "unharmed" state where you choose only aggressive actions, whereas if you are in "near death" state you weight run away or heal much higher.

Edited by Paradigm Shifter

Share this post

Link to post
Share on other sites

thank you, 

i dit not fully understand your explaination, but heres a simular plan i have so far:


its about to "remember" a calculated tactic , instead to make a fully future prediction, from a  stored DB.


So i have at first to classifiy "the situation", because every situation is really unique.



I have to cluster over "simulary" situations. i even thought about to let the clustering neural networks do, because they seem very good at clustering.

But at first i have to complete my studies on university for that, its REALLY hard stuff...


i think i have at first to cluster every x vs y situation, and then build subclastes of that:


1 vs 1

1 vs 2

1 vs 3

2 vs 1



Subcluster example for the example 1 vs 1:

damaged healer vs Full Life Tank that is affected by poison.



maybe i get benefits when i cluster the "chars-in-battle situation" at first:

so "damaged Healer" is a cluster as well the "Full Life Tank affected by poison".


The good thing: its designed as Client/server  game, so i can store to big tactic DB near to the server.

Client only would be problem, when the games needs to deliver a 10GB Tactic DB biggrin.png



i have done some calculations on this idea, and i think now, that the memory is fairly too much. there are too many possibilities:

i calculated that i would need ~ 5000 clusters of a chartype, that would lead in a 5vs5 scenario into ~ 6.49E+36 possible combinations of those.

i have got an idea to solve this with neural networks, check this out

Edited by SurfingNerd

Share this post

Link to post
Share on other sites

Some kind of culling operations are required for your analysis  (ie-  why include 'cure poison' action possibility being considered  if the previous/predecessor situation wasnt 'got poisoned'


You might also do simplification combining/merging  'like' effects to minimize possible factors being considered (after all you are looking for the crossover point threshhold of  enemy Hitpoints and the death/incapacitated line of the target while trying to hold up your own above that threshold simultaneously.


Poison over time largely has the same effect as a bleeding wound 'over time'   doesnt it (unless you are in a MUCH more complicated game mechanics where all kinds of actions are differently effceted by different attack methods etc...


Even so there is probably some significant simplification  (you dont think these chess programs simply do move combinatorics looking for checkmate do you ??)


Unfortunately Chess is a rather simple game and coming up with the culling logic/evaluation equations for YOUR games mechancs may be the very hard part.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!