Skip to content

Conversation

@mickski56
Copy link

@mickski56 mickski56 commented Sep 11, 2023

An issue with using an analog controller with the game as is, is that if you hold the controller at a constant non zero position an angular acceleration is applied every time the ship update function is run. Resulting in an ever increasing rate of turn.

This pull request addresses that by introducing a turn rate target (which can be thought of as a measure of the desired rate of turn). This is compared to the current rate of turn and a positive or negative angular acceleration is applied according to the result. This results in being able to hold a constant radius turn by keeping the control at a constant angle.

The pow() in the turn rate target calculation is just introducing a little non linear response to the input Removed as unnecessary

Cures the "balancing an egg" thing too.

@phoboslab phoboslab closed this in 38159b4 Apr 26, 2025
@phoboslab
Copy link
Owner

phoboslab commented Apr 26, 2025

Thanks for this PR and continually refining it!

I finally took a look today and implemented your idea. I also added a menu option to configure the analog response curve, because the linear behavior still felt a bit too wobbly for me.

@mickski56
Copy link
Author

Good to see the project receiving updates. Keep it up. Thanks.

tjrileywisc added a commit to tjrileywisc/wipeout-rewrite that referenced this pull request Jun 22, 2025
* clear weapon_target in ship_init (fixes phoboslab#141)

* clear `expected` state in `input_bind` so remapped controls actually work (fixes phoboslab#132)

* `vec3_is_on_face` angle value test updated to match original code.

* remove erroneous division by 64 in `magnitude` calculation for nose collision
this makes ship nose swing back out toward center of track again (noticeably)

* remove erroneous division by 16 in `magnitude` calculation (wing collision)
this restores the behavior of ship rolling on wing collision with side of track
there may still be other code to tweak as this seems more sensitive than PSX behavior

* use reciprocal multiply as seen in many other lines of rewrite

* another place where angle comparison to 30000 was converted differently

* angular z component computation did not match original source DYNAM.C

* 2 * pi, I also messed up

* scale face normal contribution consistently in floor collision code

* reimplement camera shake

* mistake, messed up roll

* LONG/SHORT_SHAKE -> CAMERA_SHAKE_LONG/SHORT

* fix indentation

* adjust face->normal scaling constant for collision with floor

* another fixed point scaling issue?

* restore original attract mode/demo behavior

With a very small reordering, the original PSX demo behavior is restored (countdown at starting line). Gets rid of the need for the "FIXME" part in the ship loop as well.

* Adjust scaling values in ship to ship collision code

* Update QOA lib

* Add menu option for screen shake

* Allow A_MENU_START for highscore entry; close phoboslab#133

* Better analog controls; thanks @mickski56; close phoboslab#77

* add wipegame.exe to .gitignore

* Use sdl2-config for L_FLAGS_SDL

Additional flags passed by 'sdl2-config --libs' fix an undefined reference to WinMain that prevents the target from successfully linking.

* Correct L_FLAGS_SOKOL for MSYS2

libdl and libasound don't exist on Windows. The Sokol build needs gdi32 and ole32 to successfully link.

* Remove unnecessary MSYS define

'__MSYS__' is pre-defined by the MSYS2 environment's toolchains, and should NOT be defined for MINGW32/64, UCRT64, etc.

* Rename client com file for consistency with server com

* Tidy up tests a little

* Address some minor warnings

* Remove unused param

* Add unit tests

* Move away from custom network structs

* Add test for connecting client and too many clients

* Account for forgetting to init client array somehow

* Remove header

* Forward declare server info type

* Grab server address in discovery loop

* Fix data (server index)

* Comment this out for now

* Send and receive connect status on client side

---------

Co-authored-by: jnmartin84 <[email protected]>
Co-authored-by: Dominic Szablewski <[email protected]>
Co-authored-by: J.Ingram <[email protected]>
tjrileywisc added a commit to tjrileywisc/wipeout-rewrite that referenced this pull request Jun 22, 2025
* clear weapon_target in ship_init (fixes phoboslab#141)

* clear `expected` state in `input_bind` so remapped controls actually work (fixes phoboslab#132)

* `vec3_is_on_face` angle value test updated to match original code.

* remove erroneous division by 64 in `magnitude` calculation for nose collision
this makes ship nose swing back out toward center of track again (noticeably)

* remove erroneous division by 16 in `magnitude` calculation (wing collision)
this restores the behavior of ship rolling on wing collision with side of track
there may still be other code to tweak as this seems more sensitive than PSX behavior

* use reciprocal multiply as seen in many other lines of rewrite

* another place where angle comparison to 30000 was converted differently

* angular z component computation did not match original source DYNAM.C

* 2 * pi, I also messed up

* scale face normal contribution consistently in floor collision code

* reimplement camera shake

* mistake, messed up roll

* LONG/SHORT_SHAKE -> CAMERA_SHAKE_LONG/SHORT

* fix indentation

* adjust face->normal scaling constant for collision with floor

* another fixed point scaling issue?

* restore original attract mode/demo behavior

With a very small reordering, the original PSX demo behavior is restored (countdown at starting line). Gets rid of the need for the "FIXME" part in the ship loop as well.

* Adjust scaling values in ship to ship collision code

* Update QOA lib

* Add menu option for screen shake

* Allow A_MENU_START for highscore entry; close phoboslab#133

* Better analog controls; thanks @mickski56; close phoboslab#77

* add wipegame.exe to .gitignore

* Use sdl2-config for L_FLAGS_SDL

Additional flags passed by 'sdl2-config --libs' fix an undefined reference to WinMain that prevents the target from successfully linking.

* Correct L_FLAGS_SOKOL for MSYS2

libdl and libasound don't exist on Windows. The Sokol build needs gdi32 and ole32 to successfully link.

* Remove unnecessary MSYS define

'__MSYS__' is pre-defined by the MSYS2 environment's toolchains, and should NOT be defined for MINGW32/64, UCRT64, etc.

* Add controller vibration support

---------

Co-authored-by: jnmartin84 <[email protected]>
Co-authored-by: Dominic Szablewski <[email protected]>
Co-authored-by: J.Ingram <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants