Page 1 of 1

Spawn plugin

Posted: Fri Mar 16, 2018 7:48 pm
by click click boom
Could we have a revised spawn plugin?its rather frustrating when you’re attacking and you kill a defender after minutes of a fight but shoot and kill him in the air and the enemy respawns under you to just kill you. I find it highly unfair.

https://expirebox.com/download/eef5db53 ... 20ad4.html

Re: Spawn plugin

Posted: Mon Mar 19, 2018 2:42 pm
by click click boom
Any admins or LU council care to comment?

Re: Spawn plugin

Posted: Mon Mar 19, 2018 6:15 pm
by allejo
There's no custom spawning plug-in used on LU, it's just using bzfs' built-in spawn algorithm. The problem with moving this to a plugin is that plugins don't know the world so it'll likely spawn you inside objects. This isn't something LU can change, it'd have to happen with bzfs itself and I don't feel like it'd be a priority to change this aspect of bzfs at the moment.

I think you're just unlucky about other players spawning close to you :)

Re: Spawn plugin

Posted: Mon Mar 19, 2018 6:31 pm
by click click boom
it happens more often than not, and not just to me either obv. I understanding the complexity with the matter and I know a current plugin isn't used but I figured I would ask.

What I would expect from this plugin isn't a new spawn code but the plugin wouldn't allow an enemy tank to spawn within a certain proximity of another enemy tank. Not sure if this is even possible. So bzf would say tank spawns at "x" location and plugin would say no due to an enemy tank being at "x" location and being to close.

Thanks for the reply

Re: Spawn plugin

Posted: Mon Mar 19, 2018 6:50 pm
by allejo
The way bzfs and plugins interact simply put is the following:

bzfs chooses a safe spawn location so it doesn't spawn players inside objects or close to enemies.
bzfs says, "Hey plugins out there! This is where a player will spawn. Cool?"
A plugin can now say, "Sure!" OR "No! I don't like this position. Trust me and spawn the player at this position instead."
bzfs then says, "k. i trust you, plugin"

A plugin can't tell bzfs to "hey. no. calculate a new position."

bzfs is supposed to take enemy positions into account, but as seen, it's not perfect. And, it's not easy to replicate these unlucky spawns so debugging the process would require a lot of time and effort.

Re: Spawn plugin

Posted: Mon Mar 19, 2018 10:36 pm
by click click boom
ahhh ok. understood!. I thought if the plugin says "no" bzf would then try for a new spawn

Re: Spawn plugin

Posted: Tue Mar 20, 2018 3:45 am
by JeffM
allejo wrote: Mon Mar 19, 2018 6:50 pm A plugin can't tell bzfs to "hey. no. calculate a new position."
Except that it can, I put a function in just for that case.

BZF_API bool bz_getStandardSpawn ( int playerID, float pos[3], float *rot );

If you have at test for what you feel is an undesriable spawn, you could check the computed spawn, then if you don't like it, make a loop calling
bz_getStandardSpawn until one you like does get computed. That will take geometry into account.

The issue is not one of computing spawns, but one of knowing if a spawn is "good" or "bad". That knowledge is somewhat subjective and difficult for a computer to determine.

If for instance you wanted to ensure that no spawn was closer than 50 units to any other player, that is a trivial test to write, and could force BZFS to recompute spawns until that happens. Or compute 10 of them and use the one furthers from any players, stuff like that is easy.

Re: Spawn plugin

Posted: Tue Mar 20, 2018 4:08 am
by allejo
JeffM wrote: Tue Mar 20, 2018 3:45 am
allejo wrote: Mon Mar 19, 2018 6:50 pm A plugin can't tell bzfs to "hey. no. calculate a new position."
Except that it can, I put a function in just for that case.

BZF_API bool bz_getStandardSpawn ( int playerID, float pos[3], float *rot );
That's what I get for not reading headers :oops: Today I learned