View unanswered posts | View active topics It is currently Mon May 25, 2020 4:34 pm

Reply to topic  [ 1 post ] 
 AI_GOTO optimation 
Author Message
User avatar

Joined: Wed May 20, 2009 3:10 pm
Posts: 366
Location: Ã…rhus, Denmark
Reply with quote
Post AI_GOTO optimation
I have a problem. I am currently making a gamemode which involves buildings producing units which automatically attacks the enemy. My problem is that the AIMODE_GOTO and AIMODE_BRAINHUNT lags horribly. My 250 fps drops to 10 for a sec when AIMODE_GOTO is set by lua. When i remove the AIMODE_GOTO from my code, the lag is completely gone.

Anybody got some smart tricks to avoid it. I don't think I've had the lag in skirmish defense and anyother mode where the enemy comes by dropships.

Here is the code where I use the AI_GOTO
function Battlegrounds:Teleport(from , to , actor)
   --Teleport the actor.
   actor.Pos = to;
   actor.Vel.Y = 0;
   --Make the actor glow for a while.
   --Create the teleportation effect for both teleporters in the set.
   local fxa = CreateAEmitter("Teleporter Effect A");
   fxa.Pos = from;
   local fxb = CreateAEmitter("Teleporter Effect B");
   fxb.Pos = to;
  actor.AIMode = Actor.AIMODE_GOTO;
  if actor.Team == 0 then
    actor:AddAISceneWaypoint(Vector(4128, 876));
    actor:AddAISceneWaypoint(Vector(120, 876));

Fri Feb 04, 2011 4:51 pm
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.010s | 13 Queries | GZIP : Off ]