Jump to content
Sign in to follow this  
Tiskahar

How to use units created with createAgent

Recommended Posts

Hey guys,

I'm trying to find a way to save on resources, and someone recommended looking at Agents. In particular, the kind created by the createAgent command. They don't seem to have much in the way of AI, but I can't even get them to move. Has anyone had any success with agents? Everything I look up that talks about them uses the createUnit command, thus they are full units, not agents.

Tiskahar

Share this post


Link to post
Share on other sites

It is true that createAgent saves on fps. It's because createAgent creates AI that is "frozen". So, no calculations have to be done for that particular agent.

You can not have the same thing with createAgent as with createUnit.

Share this post


Link to post
Share on other sites

hmm.. That makes sense given what I've seen from the engine, but not the advice I was given. Thanks for the reply.

Share this post


Link to post
Share on other sites

Depending on what you want to achieve there's more to gain using enablesimulation false and hideobject true on units that are outside of the viewing distance and similar stuff, strongly depends on the type of mission though.

Share this post


Link to post
Share on other sites

That's an interesting thought. I discovered that I can get agents to play animations, but if I wanted anything near full movement I would have to go through and write a full movement and pathfinding routine and tie those all to the animations. I think that would be more expensive than its worth. I'm still not completely giving up as this was recommended by a senior BIS programmer, but until they provide more information I'll put it on the back burner.

What I've been doing up to this point was spawning and deleting units as players come in and out of range. It can cause a few jitters as I'm spawning in ~100 units at a time, but it keeps the total AI count down. I wonder how enablesimulation false will play in. Thanks, man.

Share this post


Link to post
Share on other sites

You can also use fps to make a dynamic sleep between spawning individual units to prevent the game from halting when spawning huge amounts of objects/units,

have a look here.

This basically eliminated all fps drops during spawn events in my own scripts.

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×