Data Realms Fan Forums
http://forums.datarealms.com/

Area and Waypoint woes
http://forums.datarealms.com/viewtopic.php?f=73&t=14724
Page 1 of 1

Author:  Vattic [ Sun May 17, 2009 8:56 pm ]
Post subject:  Area and Waypoint woes

I have dummies spawning at one end of the map and they are set to go after the players brain. This works fine but I want to make it so that if the dummies fall down this pit I have they change their mind and go to a certain point. I have no problems with making them go to a certain point but I am having slowdown with the method for making their AI change.

As they fall down the pit they pass through an area, it currently checks if there are actors of the CPU team in that area and if there are it removes all current waypoint information, sets their AI mode to go to and tells them where to go. This all works fine but there is so much redundant re-pathing going on that it causes a FPS hit.

Is there any way I can make it only change each actors AI mode and waypoint information once and stop it repeating the same action for the same actors time and time again?

Cheers.

Author:  Grif [ Sun May 17, 2009 11:46 pm ]
Post subject:  Re: Area and Waypoint woes

have it set a local variable "haschanged = 1" whenever it changes, and then add an if to the original AI change statement for haschanged = 0.

EDIT well actually it'd be haschanged = nil since it wouldn't exist on teh actors

Author:  Vattic [ Mon May 18, 2009 12:53 am ]
Post subject:  Re: Area and Waypoint woes

Cheers for the reply.

So you have assign variables to actors? Or am I missing something?

Author:  Grif [ Mon May 18, 2009 1:53 am ]
Post subject:  Re: Area and Waypoint woes

Just add this line inside the part that changes the AI's waypoint:

local hasnewAI = 1;

And then add this if statement before the part that changes AI:

if hasnewAI = nil then

Author:  Vattic [ Mon May 18, 2009 2:44 am ]
Post subject:  Re: Area and Waypoint woes

It's sort of worked but now if an actor gets stuck inside said area the FPS still drops as with every call to UpdateActivity() it loops through all bots and for those inside the area it clears all waypoints and finds it a path to the second objective. It' all this redundant pathing that's the problem

Is there any way I can perform a change in AI for any actor who enters a specific area but only once per actor?

Author:  Grif [ Mon May 18, 2009 2:57 am ]
Post subject:  Re: Area and Waypoint woes

That's what that should accomplish.

As I've failed I now refer you to the people who actually know CC lua.

By refer you to I mean I'll wait here until they show up.

Author:  Vattic [ Mon May 18, 2009 3:49 am ]
Post subject:  Re: Area and Waypoint woes

Cheers all the same, I didn't and don't mean to sound ungrateful so I apologise if that's how I seemed.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/