Jump to content


Photo

v1.0 comments


12 replies to this topic

#1 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 15 February 2005 - 10:57 AM

1.

 --random turrets for choosen LP
 	 if num_turrets < math.random( 2,4 ) then

This is bad as it will eventually max all points to 4. Remember that this function will be called multiple times so num_turrets for a single LP can be 2 at first but 4 later on.

2. attackplan.ai

self.num_units = math.random(5,9)

Very bad as it will force the AI to gather 9!!! units at times to attack. This is sheer madness and will decrease AI efficiency. Yes, I tested this too. Set self.num_units = 9 and play. Default was 4 so if you think you have to tweak this do it in a sensible way like rand(4,6).


3.

 --LarkinVB build turrets at base facing enemy
	if cpu_manager:IsTurret( self.item_id ) and at_base == true then 
	
  tmp_pos.x = tmp_pos.x + cpu_manager:GetBias(self.build_pos.x, bias.x)
  tmp_pos.x = tmp_pos.x + cpu_manager:GetBias(self.build_pos.x, bias.x)
  tmp_pos.y = tmp_pos.y + cpu_manager:GetBias(self.build_pos.y, bias.z)
  tmp_pos.y = tmp_pos.y + cpu_manager:GetBias(self.build_pos.y, bias.z)
  
  bias = base_pos
 	 
	end

Double entries here. If this is really what you want (not my idea) change it in GetBias()


There is more which I don't like. I already mentioned most of it but its like talking to brick wall with the standard answer "I tested and its awsome so I will keep my changes".

Perhaps its better to release my own AI mod someday. Sad you can't load two different mods for two teams so you can compare them by letting them fight each other. All we have now is very subjective playtesting.

But go ahead, its your mod, Thudo.

#2 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 15 February 2005 - 03:42 PM

There is more which I don't like. I already mentioned most of it but its like talking to brick wall with the standard answer "I tested and its awsome so I will keep my changes".

Perhaps its better to release my own AI mod someday. Sad you can't load two different mods for two teams so you can compare them by letting them fight each other. All we have now is very subjective playtesting.

But go ahead, its your mod, Thudo.

<{POST_SNAPBACK}>

I think we are better together than seperated, although sometimes I do think that thudo should be poked with a stick and told that unlike previous projects, he has a team trying to work with him.
Posted Image

#3 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 15 February 2005 - 03:49 PM

Also, if you want the bits of code fixed then please give file names/function names
Posted Image

#4 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 15 February 2005 - 03:57 PM

I would prefer to stay together as a team but Thudos turretmania as well as other excessive changes (initial buildorder, number of atttack units) are hard to accept.

On the other hand : his enthusiasm is encouraging. As long as I can make my own changes while playing my games its ok.

I see minor problems though on the relicnews forum as we can't speak with one voice while commenting the mod.

#5 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 15 February 2005 - 06:22 PM

I'm glad I submitted my changes to the scrutiny of my peers. :)

No no your right Larkin.. We're all leaders on this team with noone subservient to another. Yes I do have a cavalier-like attitude regarding this project. I know I'm a little turret-centric sometimes but not to the demise of the offense. I always keep the fact that turrets are only a presence and NOT the way to victory.

I agree with this being wrong (now that I look at it):

--random turrets for choosen LP
  if num_turrets < math.random( 2,4 ) then

I'd like to get your opinions on how to make the AI randomly build a # of turrets at a location rather than a fixed #. It would add variability. I agree that the above doesn't work well as the AI seems to want to build up to 4 turrets per LP instead of randomizing it between 2 and 4.

As for:

self.num_units = math.random(5,9)

Agree as well.. 8-9 is a little high.. we need to keep it between 4-6.

So perhaps then:

self.num_units = rand( 4,6 )

As for for the final one..

 --LarkinVB build turrets at base facing enemy
if cpu_manager:IsTurret( self.item_id ) and at_base == true then

 tmp_pos.x = tmp_pos.x + cpu_manager:GetBias(self.build_pos.x, bias.x)
 tmp_pos.x = tmp_pos.x + cpu_manager:GetBias(self.build_pos.x, bias.x)
 tmp_pos.y = tmp_pos.y + cpu_manager:GetBias(self.build_pos.y, bias.z)
 tmp_pos.y = tmp_pos.y + cpu_manager:GetBias(self.build_pos.y, bias.z)
 
 bias = base_pos
 
end
I find this works just fine. No issues with it. However, if we can optimize it then super!

I am totally open to suggestions hence the reason I submitted my changelog. I want to be receptive to all your ideas and have been. I suppose I could be more and thats sometimes I need to work on instead of being the "solo artist".

I'll be releasing our goals accomplished/future objectives list and see where we're going and how to get there.

I don't want to displace anyone - its was never my intention.

I want your input - its too valuable to me. We're all stronger together than apart and as a team we'll knock the socks off the global DoW community. ;)

Edited by thudo, 15 February 2005 - 06:23 PM.

Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#6 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 15 February 2005 - 09:12 PM

Here is my suggestion for the AI to build fixed 2 to 3 turrets near LPs

--find the closest listen post I own to enemy within path and use it as defense point for turrets
function CpuManager:FindClosestLP2Enemy()

   local closest_p = nil
   local best_distance = 0
   local enemy = cpu_manager:FindFurthestEnemyPlayer()
   dbAssert( enemy ~= nil )
	
   local from_pos = enemy:GetStartingPosition()

   local base_distance = cpu_manager.terrain_analyzer:GetPathingDistance( from_pos, self.cpu_player:GetStartingPosition() )

   for strat_ai in resource_manager:GetUnlockedStrategicPointAIs() do
	
   if strat_ai:Owner() == cpu_manager.player_id and strat_ai:HasListeningPost() then
  
   local strat_pos = strat_ai:GetEntity():GetPosition()
   dbAssert( strat_pos ~= nil )
   
   local cur_distance = cpu_manager.terrain_analyzer:GetPathingDistance( from_pos, strat_pos )
   
   --no building behind base or within threat range
   if cur_distance ~= -1 and cur_distance < base_distance and not 
 	 cpu_manager.terrain_analyzer:HasThreat( strat_pos, 20 ) then
 	 
 	 local num_turrets = 0
 	 
 	 for build_channel in build_manager:GetBuildChannelAIs() do
      
      if self:IsTurret( build_channel:GetBlueprintID() ) and 
      distance_sqr(build_channel:GetEntity():GetPosition(), strat_pos) < 300 then
      
      num_turrets = num_turrets + 1
      end
      
 	 end
 	 
 	 --random turrets for choosen LP
 	 --set fixed seed for consistant randoms per LP
 	 math.randomseed( strat_pos.x*strat_pos.y*self.player_id )

 	 if num_turrets < math.random( 2,3 ) then
      
      --determine best distance 	 
      if closest_p == nil or cur_distance < best_distance then
      
      best_distance = cur_distance
      closest_p = strat_pos

      end
      
 	 end
   end
   
   end
   end
	
   --reset seed to original one
   math.randomseed( os.time()*self.player_id )

   return closest_p
end

Its a trick I used with my game Titans of Steel to force a consistant random number as I tweak the seed to a fixed number resulting in consistant following random numbers. Afterwards I reset the seed with the OS time to give random non consistant results.

#7 quiet_man

quiet_man
  • Members
  • 33 posts

Posted 15 February 2005 - 09:44 PM

it is very good that we have different opinions in the team
Our target must be to create a interesting AI, not to create a "perfect" one.

;)

So indeed I expect us as next step to implement a system to include different AIs
Currently I don't understand to much about the scripts, but I think it is possible with DoW.

lets start with the "thudo" and "LarkinVB" AIs :)


quiet_man

Edited by quiet_man, 15 February 2005 - 10:09 PM.


#8 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 15 February 2005 - 11:09 PM

I say its not possible, and I do understand the scripts.
Posted Image

#9 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 15 February 2005 - 11:32 PM

I suggest defined testing conditions (map/race X at start pos Y) so we won't talk about different things. It seems that start position/race is important on successfull advance in build tree.

#10 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 16 February 2005 - 12:02 AM

Agreed. Need a little consistency as my results (maybe skewed due to the stupid Enhancement mod) are obviously different that yours as about 100% of the time an armoury is built thus all the techtrees are researched UNLESS defeated early.

I send ya a template to test with Larkin.. Goodnight! Its only 7pm here! heheh
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#11 quiet_man

quiet_man
  • Members
  • 33 posts

Posted 17 February 2005 - 12:15 AM

I say its not possible, and I do understand the scripts.

<{POST_SNAPBACK}>


hmm,
I'm looking at AttackStrategy.ai and the different variables: attack_rating, stop_attack_rating, min_units, ...

can we set random values at game start?
can we include random "delta" that changes the values during game?

can we make the AI play slightly different every game and also change behaviour during the game? No real "character" but it would add to the game.

I'm just working into lua, "Corsix's Guide for Newbie Modders" is pretty ... "light" :umad: to start with

quiet_man

#12 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 21 February 2005 - 05:46 PM

Thudo: Is there anything you want to be done before our v1.0 release? The crowds are getting inpatient.
Posted Image

#13 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 22 February 2005 - 05:32 AM

Gimme 1-2 days as the little one is coming home! Also have time off work so I can make write ups. Love the work and theory everyone is coming up with for scripts down the road! Thanx all!
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users