supertuxkart / stk-code

The code base of supertuxkart
Other
4.49k stars 1.06k forks source link

Arena sides in soccer mode are very bouncy #1367

Closed sanderd17 closed 10 years ago

sanderd17 commented 10 years ago

When the ball hits one of the side panes in soccer mode. It's so bouncy that the ball flies over and back a few times, until it disappears out of the arena.

The sides aren't bouncy for the cart, or for the bowling balls though,

deveee commented 10 years ago

Edges of the soccer field are bouncy because it was hard to manually move ball from the edge. Soccer ball could move long time near the edge even if you wanted to move it to other direction (to the center or goal).

We should probably check if ball disappears from the arena or add invisible walls...

sanderd17 commented 10 years ago

I mean very bouncy as in worse-than-flubber bouncy. If the ball hits the sides, it flies to the opposite side of the arena without any chance to stop it. After which it hits a new side pane, and flies over the arena at even a harder speed.

Adding walls won't work. It will just keep going over and back then. I think someone just misplaced a comma.

The problem could also be solved without bounciness though. You can have the white lines as in real soccer. If the ball is out, only the opponent of the one who touched it can hit the ball the first time.

deveee commented 10 years ago

When bouncy edges were added, soccer ball had parameter mass=100.0. Now it has mass=20.0. I didn't check it, but this may be the reason.

Bouncy edges were added in this commit: b4832697c25e36cbf7cd421aaa68b6032f7dad59

If soccer ball mass can be changed in different arenas, the power of bounce should depend on it.

deveee commented 10 years ago

Should be fixed in 99ce91dc46f2acf20d61cd7318e420db17ac9865.

It's still possible to bounce the ball out of soccer field, but lower strength of the edges wouldn't have a sense... Now it works fine with different soccer balls (I checked the mass between 1.0 and 100.0).

I will probably add invisible walls there.