multitheftauto / mtasa-resources

This project maintains a list of up-to-date resources that come with Multi Theft Auto.
https://multitheftauto.com
MIT License
151 stars 151 forks source link

hay: fixed #346 Hay doesn't reset #420

Closed Dark-Dragon closed 1 year ago

Dark-Dragon commented 1 year ago

The hay gamemode will now start a new round 15 seconds after a player reaches the top, as requested in #346 .

Feedback appreciated, specifically about the following:

jlillis commented 1 year ago
* Is 15 seconds good?

I'd say 10 is a good default, but might as well make it a resource setting.

* Pickup is no longer a minigun, so do we even need to toggle the "fire" control for the winner?

Maybe the pickup should be a minigun?

* Do we want to put effort into having a set number of rounds play out before a gamemode vote starts?

When I refactored deathmatch I used mapcycler to handle changing the map/mode at the end of the round (if it was running). Not sure if you can do that here since the hay resource does not use maps - the version I was working on was going to.

Dark-Dragon commented 1 year ago

We can re-add the minigun, I'm not opposed to the idea. If it was originally removed because it would leave the gamemode in an unplayable state for everyone else, then this would be a good moment to add it back.

However if we add the minigun back, I'd say 10 and even 15 seconds to wreak havoc with it seems a little short. We can definitely turn it into a setting, but I'd argue we would need to default to at least ~30 seconds. Still not nearly enough to get to the ground level, but at least you should be able to kill some of your competitors, as you make your way back down. Otherwise I just don't think it's going to feel very rewarding.

Thoughts?

Dark-Dragon commented 1 year ago

I've changed the time to 10 seconds and left everything else as is for now. With @MegadreamsBE working on redoing the entire gamemode it probably wouldn't make sense to make more changes just for the meantime. We can argue about the minigun as they get closer to completion of their overhaul.

One issue I've been running into is, that sometimes when starting a new round the gamemode will kill the player as if they left the playing field. I spend some time trying to figure out why, but was unable to pinpoint the problem. Even assuming spawnPlayer resets the position to 0 0 0 for a moment it shouldn't trigger the onColShapeLeave event, as 0 0 0 is within that col shape.

jlillis commented 1 year ago

One issue I've been running into is, that sometimes when starting a new round the gamemode will kill the player as if they left the playing field. I spend some time trying to figure out why, but was unable to pinpoint the problem. Even assuming spawnPlayer resets the position to 0 0 0 for a moment it shouldn't trigger the onColShapeLeave event, as 0 0 0 is within that col shape.

Could this possibly be from players falling through the map, as if they hadn't loaded that area of the map yet? Since they are re-spawned right away I'm willing to ignore this bug for now to get this fix merged.

Dark-Dragon commented 1 year ago

Could this possibly be from players falling through the map, as if they hadn't loaded that area of the map yet?

It's hard to imagine. The resource creates a colCircle and uses the onColShapeLeave event to kill players. From my understanding a colCircle should extend infinitely up and down, so there should never be a case where players are too far up or down, and I don't see how the player could ever be considered outside of that col shape if they start within, end within and any position in-between the start and end point is also within the col shape.

One noteworthy thing is that when the resource starts it creates this col circle with a delay of 1 second, so that makes me think that this exact thing might have been a problem before, at least on resource start. From my testing respawning after dying to the col circle never seemed to result in another immediate death after spawn.

The only other thing I could see causing this would be player position extrapolation. If for some reason the server considered a position change from the player at the moment of spawn as movement that needs to be extrapolated to compensate for any delays, then it would make sense that the col circle wants to kill them, if the extrapolated position extends to outside of the col circle.

jlillis commented 1 year ago

I think for now we'll consider the spawn issue something that will get taken care of in @MegadreamsBE's rewrite and get this merged. I can't reproduce it very often and don't think it's worth going further down the rabbit hole if it's all getting rewritten anyway.