Aller au contenu

Photo

How do we get roaming to work?... SOLVED


10 réponses à ce sujet

#1
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
Okay it seems that ROAM_DISTANCE doesn't do what creature_core thinks it does:

            float fRoamDistance = GetLocalFloat(OBJECT_SELF,"ROAM_DISTANCE");
            if ( fRoamDistance > 25.0f )
            {
                location lRoamLocation = Location(GetArea(OBJECT_SELF),GetPosition(OBJECT_SELF),0.0f);

                SetRoamLocation(OBJECT_SELF,lRoamLocation);
                SetRoamRadius(OBJECT_SELF,fRoamDistance);
            }


That is from creature_core. I can confirm that the functions are being called, but the creature just stands there doing idle animations. Am I missing something? How are we suppose to make something wander around randomly?

I see there is a system in sys_ambient_h where we can get a creature to walk a waypoint path, but I just want my mobs to wander randomly when they are spawned.

Modifié par FalloutBoy, 15 décembre 2009 - 07:18 .


#2
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
Set AMBIENT_MOVE_PATTERN to 5. For more details and more advance behaviors check out sys_ambient_h. Don't bother with ROAM_DISTANCE. That is probably deprecated.

Thanks FalloutBoy, you're the greatest! B)

#3
georage

georage
  • Members
  • 247 messages
For those wondering, in the creature's variables, set:



Ambient_System_State to 1

Ambient_Move_Pattern to 5 (10 feet) or 6 (30 feet)



And they will roam.



Plenty of info here ... http://social.biowar...bient_behaviour



And you are the greatest FalloutBoy!








#4
Craig Graff

Craig Graff
  • Members
  • 608 messages
SetRoamLocation and SetRoamDistance are not deprecated as added too late to be incorporated into the core scripts. We will likely be switching over to use these functions in some future version of the engine.

If you want to use them on your custom creatures, use EVENT_TYPE_ROAM_DIST_EXCEEDED.

Modifié par Craig Graff, 15 décembre 2009 - 03:53 .


#5
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
Thanks geo and Chris.



Going off on a tangent here... never in a million years would I have found that page on the wiki. I might have searched for "roam" or "wander" but I would not have found it. Even "ambient behaviors" doesn't even find it.






#6
georage

georage
  • Members
  • 247 messages
Yeah, the wiki search function is really bad.

#7
BryanDerksen

BryanDerksen
  • BioWare Employees
  • 273 messages
You can help the search function along in specific cases like this by creating redirect pages from obvious search terms to the places where the relevant information is actually hidden. Or perhaps in a case like this where there might be multiple different things you want to accomplish (an ambiently meandering background creature vs. a monster that won't chase you too far from the spot its guarding for example) you might throw together a quick page with links to the different things an editor might want to do.



As a side note, I think I was responsible for causing those roam distance functions to be added relatively late in development. I filed a fun bug where I would go fight the bandits in Lothering and then lead them back into the town where they caused no end of trouble for the dialogues and triggers there. :)

#8
Georg Zoeller

Georg Zoeller
  • Members
  • 188 messages
Roaming != Ambient behavior.

Roaming distance defines the distance from the orignal spawn location that a creature is allowed to move for any reason before triggering an event that can force it to retreat back.


Gabriel and I added roam distance to replace the old, expensive scripted system (rubberband_h) for some select areas with something more universal, lightweight and engine driven.

It's the preferred way of implementing roaming/rubberbanding since it is actually able to stop creatures that have a command executing in their queue (as opposed the the scripted version that will only reevaluate distance once a command, such as 'move to target' has finished).

Note: Roam distance needs to be set larger than a creatures perception range in order to be 'armed' and working. This is to prevent creatures from getting caught in a bad state.

Modifié par Georg Zoeller, 16 décembre 2009 - 09:08 .


#9
georage

georage
  • Members
  • 247 messages
Speaking of rubberbanding, what is the reason for it? It seems to activate on player death, but if it is "expensive" why even have it? the player is going to restart anyway ... so why care if the creature returns to his spawn location?



Does it fire in other places besides player death?



Also, it looks odd when a pack of wolves are eating you and as soon as you die they do a 360 and scamper back to a spot. Seems like the killer would exult, rejoice or loot, not do a 360.

#10
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
Thanks for the clarification. Now that I know what they do I will probably use both systems.

According to creature_core, roam distance must be strictly greater than 25.0 or else it is ignored.

georage, setting a roam distance is optional and defaults to off for all the creatures I've looked at.


#11
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages

georage wrote...

Speaking of rubberbanding, what is the reason for it? It seems to activate on player death, but if it is "expensive" why even have it? the player is going to restart anyway ... so why care if the creature returns to his spawn location?


Georage - just as an example, I have an area with nuetral NPC's, merchants and what not, which join a fight. After the fight, I want them all to go back to certain places, and restart their ambient behviour. I use the rubberband system to get them back 'home'. 

I am also using the rubberband system to help NPC's recover from AOE attacks prior to their going hostile, or being issued some other kind of command.

So - in a nutshell, i've found some very useful implementations for rubbderband.

Note - for what I am doing, I don't think ROAM would work - too many specific shifts & placements, but having read this thread, I do plan to use it where it fits ;-)