Jump to content


Photo

Execution Error...


6 replies to this topic

#1 ArkhanTheBlack

ArkhanTheBlack

    title available

  • Members
  • 814 posts

Posted 22 September 2005 - 01:24 AM

While playing around with the AI code, I got an execution error in the skirmishplan.ai file. It's not in any way related to my own changes, because I didn't even touched this code file. :)

As I understood the situation, a jump squad tried to retreat and got as retreat position a null pointer (NIL). Therefore the distance function which should have measured the distance between the current position and the retreat position crashed.

AI trace:
AI1002 10028 Skirmish Plan - Retreat
AI1002 10028 Skirmish - Avoid Enemies
AI1002 10028 Skirmish - Avoid Enemies
AI1002 10028 Jump
AI1002 10028 GetJumpPosition
AI1002 10028 Squad position = <-49.0:9.0:-123.0>
AI1002 10028 Plan state name is Retreating
AI1002 10028 Squad is going to position = nil
AI1002 10028 Assertion failed at utility.ai, line 106

Code part:

function SkirmishPlan:GetJumpPosition( squad_ai, last_pos )

aipushtrace("GetJumpPosition")

local squad_pos = squad_ai:GetPosition()
aitrace("Squad position = "..vec2str( squad_pos ))
local jump_dist = squad_ai:GetJumpDistance()
local variant = 15
local target = Vector3f()
local name = ( self:GetState() )
aitrace("Plan state name is "..name)
if name == "Heading to skirmish location" then
target = self.skirmish_attack_pos
else
target = self.retreat_pos
end

aitrace("Squad is going to position = "..vec2str( target ))

local dist_to_target = math.sqrt( distance_sqr( squad_pos, target ) ) <==== ERROR


I've included a nil check, and set the target position as source position if it's NIL again. But this is only an enmergency solution. I think the price question is why was the retreat position NIL? I saw that Flenser edited the file. Maybe he has an idea what could have caused the problem.
Debugging the skirmishplan.ai file wasn't really on my to-do list, but if you need help I can have a look, too of course. Although I want to finish the rework of the building orders, first...

#2 ArkhanTheBlack

ArkhanTheBlack

    title available

  • Members
  • 814 posts

Posted 22 September 2005 - 05:43 AM

While playing water_station map from the community map pack, I got two times in a row a crash to desktop. I can also remember that I got this crash on battle marshes after I reloaded a game a few days ago.
The crashs occurs while unlocking a ressource from the skirmish plan. Therefore the error is again related to the skirmishplan.ai file, though the crash occurs in one of the unlock functions that is called by it.

AITrace:
AI1001 17044 Starting AI Think...
AI1001 17044 Req: 228.54925537109 | Pow: 2618.1352539063 | Pop: 0
AI1001 17044 defendplan: reseting state for tactic
AI1001 17044 can't find strategic point to build a post on
AI1001 17044 can't find strategic point to build a post on
AI1001 17044 Skirmish Plan
AI1001 17044 I have this many units in the Plan 0
AI1001 17044 I need this many units in the Plan 4
AI1001 17044 found suitable locked squad
AI1001 17044 forcing release of eldar_squad_fire_prism from plan
AI1001 17044 forcing unlock of eldar_squad_fire_prism from plan


It might be possible that this error is related to the first error, too. The code of the skirmishplan seems a bit unstable. Any ideas?!

BTW, it occured two times with the fire prism and one time on battle marshes with a falcon grav tank. Maybe it's somehow related to the eldar jump tanks?!

Edited by ArkhanTheBlack, 22 September 2005 - 05:52 AM.


#3 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 September 2005 - 02:39 PM

The AI Execution error you're reporting has been noted before - I've seen it but its rare. It has something to do when Eldar jumpable vehicles land in an area they shouldn't and the AI cannot handle the new position. Its a complex issue as it occurs on odd designed maps like 4p_BiffyPeril with high areas here and there. On regular low-landish maps its usually minimized. You'll likely never see the error on totally flat maps with open spaces. :)
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#4 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 23 September 2005 - 09:41 AM

I checked the skirmish code and there are some problems with position vectors like self.retreat_pos. We can fix this for WA.

#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 23 September 2005 - 01:18 PM

Errr.. Larkin/Flenser? :laugh:
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 Flenser

Flenser

    title available

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

Posted 23 September 2005 - 03:32 PM

Errr.. Larkin/Flenser? :laugh:

<{POST_SNAPBACK}>

Larkin, I suspect.

Yup - there are a few places in the code where vectors are not handled properly resulting in NIL values sometimes - I think it is where variables are not initialled as = vector3f(). There may also be some cases where an IsValid() test should be used just in case the skirmish unit has been destroyed. My bad.

Flenser

#7 Malkor

Malkor

    Eternity

  • Members
  • 375 posts
  • Projects:Loladins of Legend.
  •  Inanely inane inanities!

Posted 23 September 2005 - 07:12 PM

That might explain those very rare crashes I sometimes get..



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users