Jump to content


Photo

wakeup call to all AI coders !


9 replies to this topic

#1 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 04 October 2005 - 08:41 PM

I found that designerstrategy.ai takes priority to all other strategies and screws up all squad demand calculations. Here in cpu_manger.ai :

--always highest priority
	--self.designer_strategy = self:AddStrategy( "DesignerStrategy", 0 )

I was debugging demand code and found that it is screwed by designerstratgy.
Why is this running at all. What's the meaning to run it at all ????

I commented it and the games was running as intended. So why did Relic put it in ??? They made big efforts to fix their demand code but let designerstrategy screw it up as they did NOT update it too.

So to all coders : Why should it run at all ??? Just now it looks like a BIG mistake.

#2 Flenser

Flenser

    title available

  • Members
  • 316 posts
  • Location:Glasgow, Scotland
  • Projects:Dawn of War AI Skirmish

Posted 04 October 2005 - 09:19 PM

So to all coders : Why should it run at all ??? Just now it looks like a BIG mistake.

<{POST_SNAPBACK}>

Designerstrategy does nothing by default, so even though it theoretically takes priority, it does sod all. Unless something has changed in the AI code while I was away and Relic have made DS do something, you can ignore it.

I am intrigued though - how exactly did it screw demand code?

I think DS was used to force the AI to do particular things for testing purposes.

Flenser

Edited by Flenser, 04 October 2005 - 09:20 PM.


#3 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 04 October 2005 - 09:23 PM

Right, BUT designerstrategy is setting squad demand !!!

self:SetSquadDemand( unit_id, demand )


This has big influence on what squads are build ! I was adding debug code and was wondering why demand was not calculated as expected until I found that designerstrategy screwded it !!!

Edited by LarkinVB, 04 October 2005 - 09:26 PM.


#4 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 04 October 2005 - 10:01 PM

Good digging, Larkin! Should be extraordinarily interesting what happens when its disabled.

Btw.. Larkin.. can you explain why you thought it was screwing up the demand code? In what way: ie. AI was not building units it should to counter ones that were inbound as a major threat? Did it slow down unit production? This discovery is a big deal...

Edited by thudo, 04 October 2005 - 10:04 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!

#5 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 04 October 2005 - 10:18 PM

I disabled it and build was somewhat different. Not totally different (therefore none did detected it) but it has an influence. I ask myself what is the point to use it at all. Was it made for single player campaign ?

It uses stuff like

function DesignerStrategy:InWaypointProximity( pos )

	for i in self.waypoints do
  
  --check if there is any preference
  if self.waypoints[i] > 0 then
 	 local waypoint_pos = cpu_manager.terrain_analyzer:GetMarkerPositionByID( i )
 	 local proximity = cpu_manager.terrain_analyzer:GetMarkerProximityByID( i )
  
 	 --check within proximity
 	 if distance( waypoint_pos, pos ) <= proximity then
    return true
 	 end
  end  
	end

	return false

end

which isn't used anywhere else.

#6 Flenser

Flenser

    title available

  • Members
  • 316 posts
  • Location:Glasgow, Scotland
  • Projects:Dawn of War AI Skirmish

Posted 04 October 2005 - 11:05 PM

Although it does use

self:SetSquadDemand( unit_id, demand )
this does not affect demand in BuildBaseStrategy, only in DesignerStrategy. Demand in one will not affect demand in the other. As long as DesignerStrategy doesn't actually build anything then it will have no effect at all.

That said, DesignerStrategy does have

self:TryBuild( build_type )
but so far I have not seen it actually get here and build anything. I played for only 3 minutes, mind, but in that 3 minutes DesignerStrategy never once tried to build anything.

EDIT: I play with debug_view set to 0, and as you know that shows the various strategies and their plans on screen, updated regularly. "Designer Strategy: Normal" is always there (at the very top since it has top priority), but I have never once in hours of playing seen it have a plan of its own. If it were to ever get to that line above and try and build anything, it would be a BuildPlan of some kind, so I would see it appear under "Designer Strategy: Normal". I have never seen that happen.

It did, however, assess demand for the various units which uses up AI cycles, so we should disable it anyway.

Flenser

Edited by Flenser, 05 October 2005 - 07:44 AM.


#7 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 05 October 2005 - 07:56 AM

You are right Flenser. I had one drink too many yesterday :lol:

Edited by LarkinVB, 05 October 2005 - 07:57 AM.


#8 Flenser

Flenser

    title available

  • Members
  • 316 posts
  • Location:Glasgow, Scotland
  • Projects:Dawn of War AI Skirmish

Posted 05 October 2005 - 09:30 AM

You are right Flenser. I had one drink too many yesterday  :lol:

<{POST_SNAPBACK}>

I thought Oktoberfest was over? :D

Flenser

#9 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 05 October 2005 - 10:34 AM

I'm living at the opposite side of germany. We have Oktoberfest 365 days whenever we want :-)

Edited by LarkinVB, 05 October 2005 - 10:35 AM.


#10 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 06 October 2005 - 03:04 PM

Designerstrategy was actually used to create special SP behaviors in DoW at least.
-theBlind



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users