ddnet icon indicating copy to clipboard operation
ddnet copied to clipboard

implement tuning values for elasticity

Open AssassinTee opened this issue 2 years ago • 22 comments

implements ground_elasticity_x and ground_elasticity_y

Similar to https://github.com/teeworlds/teeworlds/pull/3136

~closes #5124~ implements the player bouncing part of this. Doesn't effect projectiles!

can be followed up by #5313 with a "slimey block", see here

Checklist

  • [x] Tested the change ingame
  • [ ] ~Provided screenshots if it is a visual change~ NO VISUALS
  • [x] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [x] Considered possible null pointers and out of bounds array indexing
  • [x] Changed no physics that affect existing maps
  • [ ] Tested the change with ASan+UBSan or valgrind's memcheck (optional)

AssassinTee avatar Jun 12 '22 12:06 AssassinTee

Cool, looks like we're getting fancy new physics :)

def- avatar Jun 12 '22 12:06 def-

new tunings should be added to the end of the list, or you fix the code where we use hard coded tuning indexes.

C0D3D3V avatar Jun 12 '22 12:06 C0D3D3V

I think we should also add a version check in CGameContext::SendTuningParams (similar to the other version checks). Deen will hopefully clarify what the next version will be :) (or you break out of the pattern and check for the current version)

C0D3D3V avatar Jun 12 '22 13:06 C0D3D3V

I think we should also add a version check in CGameContext::SendTuningParams (similar to the other version checks). Deen will hopefully clarify what the next version will be :) (or you break out of the pattern and check for the current version)

Can you elaborate? I would set a paramter like VERSION_DDNET_ELASTICITY_TUNE = 17000 (to a yet not existing new version of DDNet)

AssassinTee avatar Jun 12 '22 14:06 AssassinTee

@def- Do you want to release 16.2 or jump to 17? I would be fine with 16.2, to consider is that we have some major changes like the changed input handling...

@AssassinTee yes that would be the way... the question is only if you should use 16020 or 17000

C0D3D3V avatar Jun 12 '22 15:06 C0D3D3V

@C0D3D3V older clients can't handle elasticity at all, they would get prediction errors. I suggest doing a major break to 17000 for this

AssassinTee avatar Jun 12 '22 16:06 AssassinTee

@C0D3D3V do I need to upgrade the Client Version in this PR, too?

AssassinTee avatar Jun 13 '22 06:06 AssassinTee

No deen releases new versions.

C0D3D3V avatar Jun 13 '22 09:06 C0D3D3V

16.2 is fine.

def- avatar Jun 13 '22 12:06 def-

bors r+

def- avatar Jun 13 '22 16:06 def-

bors r-

heinrich5991 avatar Jun 13 '22 16:06 heinrich5991

Canceled.

bors[bot] avatar Jun 13 '22 16:06 bors[bot]

@heinrich5991 I forgot why we canceled the merge. Do you remember? What is missing?

Ah I think it was because of the missing clamp for the valid elasticity range. But that was added, so I think it is ready for another review.

C0D3D3V avatar Jul 06 '22 18:07 C0D3D3V

@C0D3D3V @heinrich5991 I noticed one problem with this but this may be out of scope: you don't always get your doublejump back, this is inconsistent! The reason is that you are only touching the ground in a subtick and not in the tick before or after the touch. I would say, that this is out of scope for this issue and also changing this would change physics.

The workaround would be adding a flag to MoveBox and setting the jump values accordingly

AssassinTee avatar Jul 07 '22 08:07 AssassinTee

If a mapper would like to force refill of dj, he could add a jump refill tile.

C0D3D3V avatar Jul 07 '22 09:07 C0D3D3V

Ah, I'd actually like to make this in-scope, so that we don't have a physics change due to this later on.

heinrich5991 avatar Jul 07 '22 10:07 heinrich5991

What do others think?

heinrich5991 avatar Jul 07 '22 10:07 heinrich5991

Fine by me.

Chairn avatar Jul 07 '22 10:07 Chairn

Do we even want that the dj refills? I guess that way you could increase your jump hight with every bounce? I did not test yet the physic...

But on the other hand side, if you do not want to refill the jump you could also give the player 0 jumps

C0D3D3V avatar Jul 07 '22 10:07 C0D3D3V

Do we even want that the dj refills? I guess that way you could increase your jump hight with every bounce? I did not test yet the physic...

If we don't want them, it should be consistent that we don't get it.

heinrich5991 avatar Jul 07 '22 11:07 heinrich5991

Status: There's still an unaddressed review comment.

heinrich5991 avatar Sep 14 '22 17:09 heinrich5991

Status: There's still an unaddressed review comment.

I somehow missed this reviews, I already got the code for this, it just needs to be integrated! :) One side note: The sub-tick refill is only for slime blocks, since you can touch normal blocks in a subtick between ticks without getting your jump back and this is standard behaviour. In race we call this an edge-bug. My goal is not changing default physics at all

AssassinTee avatar Sep 15 '22 06:09 AssassinTee

Status: There's still an unaddressed review comment. Do you still want to work on this? @AssassinTee

heinrich5991 avatar Jul 24 '23 19:07 heinrich5991

If we don't want them, it should be consistent that we don't get it.

I discussed this issue with heinrich a bit more in detail in discord, but here are the keynotes: You get the jump back based on ticks, but you can skip a ground-touch in a subtick by bouncing off of the block between two ticks, so I added a check, if you hit the ground in between in order to give the jump back (default behavior). You can't accelerate in stupid ways with it, because if you jump your speed is set to the ground or airjump speed (it's not additive).

ElasticityGraphic

Why do you only give the jump back, if the elasiticy > 0? Because I want to keep the subtick bug that is present in the current version.

AssassinTee avatar Jul 28 '23 12:07 AssassinTee

Thanks for your persistence!

heinrich5991 avatar Jul 28 '23 13:07 heinrich5991