Jump to content
Sign in to follow this  
HateDread

Most Effective Way of Handling Proximity Task in MP?

Recommended Posts

Howdy all,

I'm just wondering what the most efficient way of handling tasks across all players is, in a COOP mission.

Currently, I have a trigger over the town of Mulladost that activates when any player enters it, setting PostIntroMulladostEntered to 1, while a script is set to waituntill {PostIntroMulladostEntered == 1}; so it does not continue untill the player is in the trigger. The variable is made public via publicvariable within the trigger, so all players instantly complete the task when only one player enters the trigger.

Is it better/less performance heavy to NOT use triggers at all? I could set a condition as Waituntill {(player distance MulladostMarker) < 50)}; for example, THEN continue with setting the objective as completed (although, after a public variable was set, again in the same way as mentioned above, so that all players then get a completed objective when only one does it).

I'm sorry that is so much to read.

So, again, which is the best option for a COOP - triggers, or using it all via the script, which will exist anyway, just either alongside the trigger, or standalone.

Cheers,

- HateDread.

Share this post


Link to post
Share on other sites

I doubt there is any real difference in performance in trigger vs waituntil. However, in your case, what you could do is to make the server only machine to run the check, instead of every client doing it.

Share this post


Link to post
Share on other sites

So all of the tasks can be run only on the server, but be set for each player? --Checks http://community.bistudio.com/wiki/createSimpleTask--

Hey, you're right! Awesome.

Also, regarding the code I entered, I can't seem to get it to work:

((player distance MulladostMarker) < 50)

It will never fire/return true, it seems, no matter where I stand. I can get it to work if MulladostMarker is the name of a game logic/location/object, etc, but not a marker. Is there a way to determine distance to a marker, for use via this script?

Share this post


Link to post
Share on other sites
player distance (getMarkerPos "MulladostMarker")

Share this post


Link to post
Share on other sites
So all of the tasks can be run only on the server, but be set for each player? --Checks http://community.bistudio.com/wiki/createSimpleTask--

Hey, you're right! Awesome.

There are many ways to do it, but I use this.

Nowadays, my missions usually only have couple of triggers, usually area triggers to fetch units in it. Everything, unit moving, "triggers", task add/update etc are decided by the server. Goal is to have only one machine to keep track of things and issue commands. It also eliminates overlapping, sync/status problems etc.

Share this post


Link to post
Share on other sites

Wow, looks sweet.

Few questions that'll save me cluttering that thread:

- Has the dedicated server requirement been removed?

- Does it handle JIP players well, if they tasks are slowly added in a COOP mission with a storyline - I.e. if Tasks 1-4 are done, out of 6 tasks, when a player joins in, will he instantly see tasks 1-4 done, and be up to task 5 with everyone else, or will he have to start from the start? (In the above example, imagine they were created one by one during the mission).

Other than that, looks sweet!

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  

×