Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Stuck on learning machines :/


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 SurfingNerd   Members   -  Reputation: 139

Like
0Likes
Like

Posted 21 August 2013 - 03:45 AM

Hello, 

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.



Sponsor:

#2 Paradigm Shifter   Crossbones+   -  Reputation: 5440

Like
0Likes
Like

Posted 21 August 2013 - 03:55 AM

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, 21 August 2013 - 04:01 AM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#3 SurfingNerd   Members   -  Reputation: 139

Like
0Likes
Like

Posted 21 August 2013 - 05:06 AM

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

 

EDIT

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, 23 August 2013 - 05:28 AM.


#4 wodinoneeye   Members   -  Reputation: 878

Like
0Likes
Like

Posted 25 August 2013 - 08:12 PM

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.


--------------------------------------------Ratings are Opinion, not Fact




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS