Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

880190 Posts in 33024 Topics- by 24392 Members - Latest Member: mfroeschl

May 26, 2013, 12:05:31 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)(Was ANN) General AI solution for Sumerian Blood
Pages: 1 2 [3]
Print
Author Topic: (Was ANN) General AI solution for Sumerian Blood  (Read 1273 times)
Dacke
Level 10
*****


I have never been to Woodstock


View Profile
« Reply #30 on: May 03, 2012, 02:58:04 PM »

As mentioned before, it's hard to give good, general advice. AI is a big field with lots of techniques, algorithms and challenges. The correct approach for your game depends on your specific needs and your capabilities.

I still haven't gotten a clear idea of what you want from your AI. You mentioned earlier that you wanted complex/interesting behaviour. But your videos makes the fighting mechanics look very simple. This isn't a bad thing, but it limits the possibilities for "interesting" behaviour from your AI. My impression is that the fighting focuses on mechanical skill and fast reaction speeds (running, shooting, dodging). This kind of AI behaviour is well suited for a manually coded AI.

I imagine that you could get a competent AI by just handling a number of cases:
Code:
doAIMove() {
   // 1. Try to dodge enemy bullets
   for bullet in enemyBullets {
      if willHitMe(bullet) and canDodge(bullet) {
         moveToDodge(bullet)
         return
      }
   }
  
   // 2. Run away from enemy if you have to
   if enemyTooClose() {
      moveAwayFromEnemy()
      return
   }

   // 3. Shoot enemy if you can
   if enemyInRange() {
      shootAtEmeny()
      return
   }

   // 4. If all else fails, get to where you can shoot at the enemy
   moveToShootPosition()
   return
}

If you want a more interesting/skilled/advanced enemy, you just add more special cases or improve the methods. If you for example discover that it sucks at running away, you just have to improve the heuristic used in runAway(). Or if you want it to behave more cautiously when hurt, just add a special case for that.
Logged

vegan • socialist • atheist • humanist • liberal • FOSSer
programmer • feminist • animal rights activist • pacifist • teetotaller
PompiPompi
Level 10
*****



View Profile WWW
« Reply #31 on: May 04, 2012, 01:51:04 PM »

Well, even with simple gameplay, there are many ways to fight.
You can charge, you can hide behind obstacles, you can keep a certain distance\angle from the enemy, you can wait for the enemy to attack and then retaliate, you can spawn projectiles. And many others.
Not to mention that each character has it's own unique ability which makes the battle tactics different between each pair.
I am trying something simpler now, as was suggested to me by someone.
What I am doing now is basically:
Steering behaviour->Steering Behaviour Mixer->FSM->Action Scheduler
Basically I have steering behaviours. I can mix them with different factors with a mixer. I then can use the mixed steering behaviour in a state of an FSM. Each FSM is an "action" that is scheduled by a Action manager or scheduler.
I hard code the steering behaviours and different FSM state types. But I randomly generate mixers and FSM. Then I set the probability for each FSM\Action.
At first each action has the same probability, but as the AI plays against a player, I give a score to an Action based on how succesful it was. At the end of the match I update the probabilities according to the score.
This is how the AI "learns".
I can make it more complicated by having the AI generate new FSMs with time and try them out. But that's the basic idea.
The probabilities of each action are used by the scheduler to decide if to schedule the specific FSM.
Well, that is what I am trying tight now, I will see how it goes.
Logged


Kickstarter? no no no... it's Kicksucker...
Dacke
Level 10
*****


I have never been to Woodstock


View Profile
« Reply #32 on: May 04, 2012, 01:54:57 PM »

Good luck Smiley
Logged

vegan • socialist • atheist • humanist • liberal • FOSSer
programmer • feminist • animal rights activist • pacifist • teetotaller
Pages: 1 2 [3]
Print
Jump to:  

Theme orange-lt created by panic