Skip to content

Conversation

@JeodC
Copy link

@JeodC JeodC commented Apr 19, 2025

This pull request is a care package that does the following:

  • Adds game_change reimplementation (Deltarune launcher works)
  • Adds controller rumble, configurable in json (on/off and intensity)
  • Allows extensions to be enabled/disabled in json (some ports need extensions to work)
  • Moves platform stubs to new stubs folder and files for better organization
  • Stubs video_open and for now tells game that video ended immediately (verified with VHR which has a .mp4 logo file)

@JeodC JeodC force-pushed the rumble branch 20 times, most recently from 56a24da to 2d231a1 Compare April 24, 2025 12:14
JeodC added 4 commits April 24, 2025 08:15
This is necessary for at least one GMS port (Victory Heat Rally)
Immediately return that the video ended

Tidy up
@JeodC JeodC changed the title Add controller vibration Care package: game_change, rumble, allow extensions if needed, tidy stubs Apr 24, 2025
@JeodC JeodC requested review from JohnnyonFlame and cdeletre April 24, 2025 12:39
Copy link
Collaborator

@cdeletre cdeletre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only minor remarks, with my CPP knowledge I don't see anything wrong.


uint16_t left_motor = (uint16_t)(left * MAX_RUMBLE_F);
uint16_t right_motor = (uint16_t)(right * MAX_RUMBLE_F);
int duration_ms = (left_motor || right_motor) ? 10000 : 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10000 ms is 10 s
It seems a bit mucho ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GameMaker doesn't pass a duration in its arguments, instead handing control to the developer to explicitly turn rumble off. Therefore we need to pass a duration to SDL in its place, but since we don't know how long a developer may want rumble to last, I went with a larger threshold opting for safety. I think if a dev has rumble lasting longer than a few seconds they're insane, but you never know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for the explanation. That's what I suspected :)

@JohnnyonFlame
Copy link
Collaborator

I am rebasing, squashing and reviewing the patches, will give a heads up soon.

@JeodC
Copy link
Author

JeodC commented Apr 25, 2025

Cherry picked into upstream

@JeodC JeodC closed this Apr 25, 2025
@JeodC JeodC deleted the rumble branch April 25, 2025 02:32
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.

3 participants