New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer not to spawn within 20 meters of enemy #512
Conversation
Pretty sure the projectile check isn't very robust either. I can't tell how many times I've spawned inside a cluster missile or killed people that way. Awesome PR though! |
Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
Btw some of the spawn issues that happen are due to that spectator mod, there is a bug with it that spawns you at an enemy team's spawn. Unsure who made the mod though |
I didn't have that issue but I had spectate-after-killcam disabled, whereas V3X had it enabled, and the bad spawns occured there a lot more often. |
On the V3X server I can consistently spawn in the enemy spawn, the bug is 100% reproduceable, I'll talk to faky |
Eh, even on Vanilla servers. An example would by Drydock, the little bridge part where the evac ship can spawn sometimes. I've had people spawn behind me a split second after spawning. There really shouldn't be a specific spawn location for teams, it should just rate them all and find the safest one. Maybe go for spawns near teammates that aren't too close to enemies primarily. |
I did something like that on my pvp server, if I get back to hosting I can experiment more. |
Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mfw I clicked the wrong box
Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also fix spawning near projectiles but I can't test
Btw what are the two |
I don't think there's a way to do that? Correct me if I'm wrong but I think this can get merged either way |
checking some other code, as far as i can tell, the second int team = player.GetTeam()
array<entity> nearbyEnemies = GetPlayerArrayEx( "any", TEAM_ANY, team, origin, radius ) My guess is that the first However, this assumption doesn't seem quite right if you use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Didnt test in-game
Some kid on the northstar chat screamed for this months ago and started an argument over the spawn mechanic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, can't hurt
I noticed the
IsSpawnpointValid
function checks for nearby projectiles, but not enemy players. Spawning next to enemies is common enough with a high player count, so this should alleviate the issue. I ran this for about 2 weeks before taking a break from hosting, and during that time, nearby enemy spawns would only occur when running out of valid spawns (eg. on Colony with a high player count, or on LF maps).Also parameterized the minimum distance into
minEnemyDist
, which is used for checking both projectile and enemy distances, and this has been increased from 600 to 1000 (which is about 20 meters by my calculations?)Formatting is screwed, I don't know what settings to use for squirrel with vim and they vary across files.