Author Topic: ai in pseudo code  (Read 10302 times)

Offline BinaryDragon

  • Member
  • Salutes: 3
    • [CURE]
    • 30 
    • 36
    • 45 
    • View Profile
ai in pseudo code
« on: April 07, 2016, 10:12:18 am »
had a glass of wine trying to write an ai with pseudo code

Starting with a check on the hull since it is the most vital component

if (hull = down) then
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////THIS IS WHEN NOT TO >>NOT TO<< REPAIR THE BROKEN HULL/////////////////////
   ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
   //This case is when the AI would not run to try and save a broken hull:
   // If the AI can deal deadly damage with a gun, due to enemy armor down, gun type and distance to gun - go for the killing blow
         

if (can_ai_deal_deadly_damage_with_gun = true) and (is_enemy_armor_down = true ) and (is_ai_closest_engineer_to_gun = true)  then

// Tell the AI to shoot the gun until the target gets armor back up, dies or fly our of arc obviously using the fastest path avaliable to get to the gun
 -> AI.SHOOT.GUN until (TARGET.ARMOR = UP) or (TARGET.ARC <> ) or (TARGET = DEAD)
else
 -> AI.REPAIR.HULL until (HULL.BROKEN = FALSE)


are there any other times an engineer should not repair a broken hull ?



   



 






Offline BinaryDragon

  • Member
  • Salutes: 3
    • [CURE]
    • 30 
    • 36
    • 45 
    • View Profile
Re: ai in pseudo code
« Reply #1 on: April 07, 2016, 01:11:01 pm »
thats what it is like when I get drunk trying to do something. Complete failure, while i do it I have fun.

then I wake up not being drunk and see what I have done, not being able to modify my own comments....

that moment I treasure
« Last Edit: April 07, 2016, 01:13:51 pm by BinaryDragon »

Offline BinaryDragon

  • Member
  • Salutes: 3
    • [CURE]
    • 30 
    • 36
    • 45 
    • View Profile
Re: ai in pseudo code
« Reply #2 on: April 07, 2016, 02:45:17 pm »
 I started to wonder why I made that abomination in my original post, and I guess what I want to do is learn to engineer. I think to myself there must be a "perfect" algorithm to engineering, cause things have certain priority. I think it would be possible to program an engineer that would do the job, at least very close to perfect. But that would mean that they would be better than far the most of the human players. Functioning in game like such an ai would be cool though

Offline BinaryDragon

  • Member
  • Salutes: 3
    • [CURE]
    • 30 
    • 36
    • 45 
    • View Profile
Re: ai in pseudo code
« Reply #3 on: April 07, 2016, 05:17:48 pm »
should have named this thread "pseudo code for human engineer" - not ai, this was a mistake.

Offline ramjamslam

  • CA Mod
  • Salutes: 63
    • [SAC]
    • 35 
    • 45
    • 38 
    • View Profile
Re: ai in pseudo code
« Reply #4 on: April 08, 2016, 06:34:07 pm »
how about this:

if hull_down:
    check_balloon()
    check_engines()
    while guns_even_slightly_damaged:
        repair_guns()
    double_check_balloon()
    see_how_hull_is_doing()

Offline BuggDoubt

  • Member
  • Salutes: 0
    • [FIRE]
    • 13 
    • 19
    • View Profile
Re: ai in pseudo code
« Reply #5 on: April 28, 2016, 12:48:58 am »
if.player[engineer]=2 > you.are.gunner GOTO [pew.pew.pew]