Skip to content

Introduce peep animation (costume) objects #23328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Jan 9, 2025

Conversation

AaronVanGeffen
Copy link
Member

@AaronVanGeffen AaronVanGeffen commented Dec 5, 2024

This PR introduces peep animation (costume) objects to OpenRCT2, finishing a series of refactors that started with #21711. In essence, all sprite offsets for all peeps are moved from PeepAnimationData.cpp to objects. This includes all guest animations, as well as animations for all staff types. In the short run, this will allow players to make their own custom entertainer costumes.

To facilitate this, the Peep struct is extended with an AnimationObjectIndex property. The existing AnimationGroup is reworked to offset on a peep animation object instead. To populate both properties, an import step is added to the save file loading process. This automatically appends the relevant peep animation objects to existing saves, taking care to add entertainers based on what (vanilla) scenery group objects are selected in the save game. Obviously, this needs to be thoroughly tested.

Note for the curious/adventurous/testers
This PR depends on OpenRCT2/objects#357, which has a few to-dos left. Until we've made a new object release including the objects, you will need to add these objects to your test setup manually.

To do

  • 'Current costume' in staff window isn't showing until dropdown is opened
  • Order costume list in staff window alphabetically? (Taking language into account)
  • Disallow unchecking in-use peep animations in object selection window
  • Object selection: ensure at least one peep animations object is selected for each type
  • Make PeepAnimationsObject::_animationGroups private again
  • Retrieving available costumes using scripts still uses hardcoded costume lists
  • Un-break staff costume assignment using @Manticore-007's peep editor plugin
  • Feature request from @ZeeMaji: ignore particular objects in random placement
  • Add a way for scripts to access costume/object name strings
  • Increase object limit from 20 to 255
  • Address bug with inline sprite images
  • Fix painting balloons/hats/umbrellas (different image offsets -> use animation types instead)
  • Address hardcoded peep 'pickup' animation lengths in Guest/Staff windows (hanging animations)
  • Address hardcoded peep 'walking' animation lengths in Guest/Staff/Ride/Park windows (walking animations)
  • Increment plugin api version to signal availability of getCostumeStrings function
  • Remove old entertainer strings from en-GB.txt
  • Testing, loads of testing
  • Compact commit history before merging

@github-actions github-actions bot added the requires dependency Another change should be merged first. label Dec 5, 2024
@AaronVanGeffen AaronVanGeffen added this to the v0.4.18 milestone Dec 8, 2024
@Gymnasiast
Copy link
Member

Let’s get this bitch merged. I looked through the code and apart from dozens of comments that IMO just state the obvious, as well as one TODO, I didn’t see anything particularly nasty. If you could address the comment, rebase the PR I’ll take it for a spin.

@AaronVanGeffen
Copy link
Member Author

Thanks for the review. I believe I have addressed the comments. A changelog entry still needs to be added, but I'll wait for a bit so the branch doesn't conflict again.

Note to self: before merging, we should re-tag the object bundle release to include the latest set of translations.

@Gymnasiast
Copy link
Member

I did a quick test.

I have one thing: this changes the icon of the Entertainers in the Staff window to an astronaut, presumably because it’s the first available type. Would like to see the order changed so this defaults to a panda (RCT1) or an elephant (RCT2, OpenRCT2).

Apart from that, it looks good, though I would like to see this tested by the DKMP crowd.

@AaronVanGeffen
Copy link
Member Author

AaronVanGeffen commented Jan 9, 2025

I have one thing: this changes the icon of the Entertainers in the Staff window to an astronaut, presumably because it’s the first available type. Would like to see the order changed so this defaults to a panda (RCT1) or an elephant (RCT2, OpenRCT2).

Hmm, this was a deliberate change, though. The entertainers you mentioned can be omitted, after all. For legacy parks, I can make it such that the objects for panda/elephant/tiger entertainers are appended before the other entertainers. I think that would alleviate your concerns, right?

(For parks that are newly created through the scenario editor, only the panda/elephant/tiger entertainers are available by default, so that should be fine already.)

Apart from that, it looks good, though I would like to see this tested by the DKMP crowd.

Sure. I have asked @deurklink to test a build.

@Gymnasiast
Copy link
Member

Hmm, this was a deliberate change, though. The entertainers you mentioned can be omitted, after all. For legacy parks, I can make it such that the objects for panda/elephant/tiger entertainers are appended before the other entertainers. I think that would alleviate your concerns, right?

Certainly - I was just talking about existing parks. I think that is just a modification of one or two tables, correct?

@AaronVanGeffen
Copy link
Member Author

Certainly - I was just talking about existing parks. I think that is just a modification of one or two tables, correct?

Yes. That should be addressed by b83e99c then.

@deurklink
Copy link
Contributor

Aaron asked me to this this PR. I checked the guests in several of my parks and found nothing out of the ordinary. I also used the Peep Editor plugin beta to cycle through all the animations of a guest from all 4 angles, and they all seem to work fine. Did the same for a handyman, mechanic, security guard, and several of the entertainer costumes. Didn't see any animations that look weird or broken.

@Manticore-007
Copy link

I agree with Deurklink, I also gave the Peep Editor a spin, and didn't find anything that is broken. Looks good to me. I was a bit confused at first that the no costume option for entertainers was vanished. But Aaron reminded me that we agreed to remove this since it is now possible to edit guests. So the no costume option is obsolete.

@AaronVanGeffen AaronVanGeffen merged commit 89ae19e into OpenRCT2:develop Jan 9, 2025
21 checks passed
@AaronVanGeffen AaronVanGeffen deleted the peep-anim-objects branch January 9, 2025 21:11
@J-PIE-314
Copy link

The word "costumes" was mistyped when appending the changelog (26ea601).

Feature: [#23328] Introducing peep animation objects, enabling custom entertainer customes.

Gymnasiast added a commit that referenced this pull request Feb 1, 2025
- Feature: [#23328] Introducing peep animation objects, enabling custom entertainer costumes.
- Feature: [#23569] Add large diagonal flat to steep and dive loop track pieces.
- Improved: [#20683] Allow Giga Coaster cable lift to start after block brake section.
- Improved: [#23328] The costume list in the staff window is now ordered alphabetically.
- Improved: [#23540] The file browser now optionally shows a file size column.
- Improved: [#23640] Building sprite repository with command line can use images array of JSON parkobj.
- Improved: [#23660] The ‘special elements’ dropdown has been reorganised, now using multiple columns and separators.
- Improved: [#23730] Added optional button to toolbar to rotate view anti-clockwise.
- Change: [#23328] All RCT2 entertainer costumes are now available in legacy parks.
- Fix: [#1479] Incorrect values provided by the in game console “get location” command.
- Fix: [#21794] Lay-down coaster cars reverse on first frames of downwards corkscrew.
- Fix: [#23221] Track designs are saved with an incorrect ‘air’ time statistic.
- Fix: [#23368] Incorrect refund amount when deleting track pieces at or above 96m.
- Fix: [#23508] Simultaneous virtual floors shown for ride and footpath.
- Fix: [#23512] Holding brakes are skipped if they’re too close together.
- Fix: [#23581] [Plugin] Food/drink items given to guests have no consumption duration set.
- Fix: [#23591] “Install new track” button in Track Designs Manager is misaligned.
- Fix: [#23618] Can no longer build diagonal brakes & block brakes on Steeplechase, Inverted Lay-down, & Inverted Multi-Dim roller coasters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This issue/PR deserves a changelog entry. network version Network version needs updating - double check before merging! park file version Requires updating the park file version number plugin api version Plugin API version needs updating - double check before merging! testing required PR needs to be tested before it is merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants