Jump to content


Photo

Tip on aitrace


3 replies to this topic

#1 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 25 January 2005 - 08:12 PM

Insert ailog() here in utility.ai :

function aitrace( msg )

	profile_start("aitrace")

	for i = 0, stack_trace_num-1 do
  msg = ("   "..msg)
	end

	table.insert(tracing, msg)

	local txt = cpu_manager.cpu_player:GetGameTime().." "..msg
	ailog("d:\\aitrace.txt", txt)
	
	profile_end("aitrace")
	
end

and you will get nice AI tracing with time. Eldars not building will display

"still waiting to begin building ..." from buildplan.ai

There is something rotten here ! Need to trace more to see why its not building.

Edited by LarkinVB, 25 January 2005 - 08:13 PM.


#2 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 27 January 2005 - 04:12 AM

I'll give that a shot - I've never myself needed a timeline record of the events and I just do a text-search down the list to see where around the time of events stopping I want to focus on. Still.. useful shiet for anyone needing to find exact times of AI failure. :cool:
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#3 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 18 February 2005 - 07:39 AM

I strongly advise to add this for debugging in plan.ai

function Plan:SetState( statename, state )
dbAssert( state ~= nil )
self.state = state
self.statename = statename
req = resource_manager:GetResourceAmount():Get( ResourceAmount.RT_Requisition )
pow = resource_manager:GetResourceAmount():Get( ResourceAmount.RT_Power )
ailog("d:\\b"..player_id..".log", statename)
ailog("d:\\b"..player_id..".log","at "..cpu_manager.cpu_player:GetGameTime().." r "..tostring(req).." p "..tostring(pow) )
end

It will creat one file for each AI clearly showing what it is doing and how much resources/power there is. Output looks like this

AI1003 Wanting to build: space_marine_squad_scout
AI1003 at 0 r 1000 p 100
AI1003 Wanting to build: space_marine_squad_servitor
AI1003 at 0 r 1000 p 100
AI1003 Wanting to build: space_marine_barracks
AI1003 at 0 r 1000 p 100
AI1003 Building a space_marine_generator
AI1003 at 12 r 1002.75 p 100
AI1003 Building a space_marine_squad_scout
AI1003 at 12 r 912.75 p 100
AI1003 Capturing flag
AI1003 at 112 r 772.75 p 100
AI1003 Building a space_marine_squad_scout
AI1003 at 132 r 687.75 p 100
AI1003 Capturing flag
AI1003 at 232 r 712.75 p 100
AI1003 Building a space_marine_squad_servitor
AI1003 at 252 r 642.75 p 100



#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 18 February 2005 - 08:06 AM

Nice.. that seperation of AIs + included timefactor would be critical to debugging multi-AI games! Thanks bud!
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