Jump to content
SAS_Storebror

Multiplayer: Detect "inactive" base

Recommended Posts

Hi guys,

 

I've been tinkering with this for a couple of days now:

Since our DServer is rather limited in terms of handling larger amounts of AI, I'm trying to disable as large portions as possible if there is nobody watching what AI would do anyway.

One big part would be if I could detect whether or not a player base (or a spawnpoint for that effect) actually has active player(s) on it or not.

With the "modifier add value" and "modifier set value" MCUs, in theory it should be easy to setup a counter in order to achieve this.

Each player spawning would cause the counter threshold to increase by one (modifier add value, index 1 = 1) and each player finishing his sortie would cause the counter itself to be increased (either by just targetting the counter, or by using modifier add value, index 0 = 1).

1st problem: For spawning players I have the spawnpoint's "on player spawn" event which I can target at the "modifier add value" MCU.

However... which event to use for player finishing their sortie? "On player killed"? Anything else seems unreasonable. But does "on player killed" really work if let's say a player just finishes the sortie without actually being killed? I don't think so.

2nd problem: Does this logic of counting one event against another, by raising the threshould using the "modifier add value" on index 1 vs. targetting the counter to increase it's actual value really work?

I remember that the whole "add/set value" modifier thing never worked as intended.

 

Does anyone have a clue and/or solution/hint/workaround for this idea?

 

:drinks:

Mike

Share this post


Link to post
Share on other sites

-S-

 

I've used somthing similar in RoF a long time ago.

 

Complex Triggers detecting all kinds of  'Player enters' and 'Player leaves' (spawn, enter, killed, exit, leave ...)

and triggering a selfmade up/down counter.

Whenever the counter increased the units were spawned and spawning was disabled (so only first increase spawnes).
Whenever it was 0 (area empty) all units despawned and spawning was enabled.

 

Maybe with the new counters it can be much shorter, as the counter logic itself took about 100 items.

 

Deci

Edited by JG4_Deciman
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for your reply Deci.

Complex Trigger... good call. Using the "Finished" Event together with names assigned to player planes seems to work at least partly.

I'll see where I can get using this approach.

 

Thanks again and Cheers!

:drinks:

Mike

Share this post


Link to post
Share on other sites

Unfortunately I'm still stuck on this.

You've mentioned a self-made up/down counter.

I've tried that with the "modifier add value" and "modifier set value" MCUs on a counter object, but can't seem to get reliable results.

Most of the times it works, but when many events happen in short time, the counter seems to run wild.

Do you have any good up/down counter group for me?

 

:drinks:

Mike

Share this post


Link to post
Share on other sites

Nevermind, figured it out myself.

Attached you can find a working up/down counter group, IMHO in the most simple way.

"IN+" increases the counter, "IN-" decreases it.

"0->1" output gets triggered when counter value goes from 0 to 1, "1->0" gets triggered when it gets back to 0 again.

Only thing is that the counter only works with positive numbers:

You must not decrease it when you didn't increase it before and you must not decrease it more times than you've increased it.

 

:drinks:

Mike

Up_Down_Counter_Version_1.zip

Edited by SAS_Storebror

Share this post


Link to post
Share on other sites

Here is my version...

 

Counter is fired by 'complex trigger' detecting enter, leave, finish (all alive ONLY), kill and spawn

 

On mission start the counter has to be installed (INIT Area)

and fires timers after detection.

 

ACTION Empty -> fired when area is empty (after installing, too)

ACTION First Entry -> 1st object entered

ACTION Further Entry -> next entries

ACTION Leave -> Object left area

 

On INIT the counter is set to 0 (of 100)

On first entry the counter is set to 99

Leaving increases counter by 1

Entering decreases counter by 1

So the counter can handle 99 objects (or more after changing 2 values)

 

Deci

 

 

 

 

Area.zip

Share this post


Link to post
Share on other sites

Storebror, for what you want you have to have an area which cover all the map. It means that your complex trigger will check all the map. So, it would cost you more ressources than you can use in a normal situation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...