Terasology / LightAndShadow

Light & Shadow is an experimental game type set in a quirky Alice in Wonderland inspired setting
Apache License 2.0
8 stars 22 forks source link

Randomize player respawn location #85

Closed skaldarnar closed 3 years ago

skaldarnar commented 5 years ago

Follow up to #82

In https://github.com/Terasology/LightAndShadow/blob/master/src/main/java/org/terasology/ligthandshadow/componentsystem/controllers/PlayerDeathSystem.java#L45

Ideally, we should not be using the exact location of the base. That would mean when multiple players die, they always land on top of each other. Since the base is big enough, we could teleport to a random position on the base as in LASUtils.getTeleportDestination(team)) + Vec3(random(-1, 1), random(-1, 1), 0).

Again, here make sure that the players always face the opponent team's base. Maybe extract the above completely into a method and use it in the team selection logic as well.

ahv15 commented 3 years ago

@skaldarnar To solve this issue is anything additional needed other than randomizing the position for teleport, I am asking this because this seems pretty straightforward and yet nobody has implemented it yet?

ahv15 commented 3 years ago

I am guessing only the bounds should be checked so that they don't spawn outside the base.

skaldarnar commented 3 years ago

@ahv15 Yes, this is hopefully really as simple as you imagine it - just somebody has to take the time to do it :upside_down_face:

This would go well together with #86 as mentioned in the issue description.

ahv15 commented 3 years ago

ok sure then will work on it

ahv15 commented 3 years ago

Going to create a separate PR to solve the other issue too.

ahv15 commented 3 years ago

Or would it be best if I add another commit to this PR to fix that issue once I am done.