Skip to content
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

Add painting objects + convert vanilla paintings into objects #445

Open
wants to merge 114 commits into
base: develop/3.0.0
Choose a base branch
from

Conversation

Arceveti
Copy link
Collaborator

@Arceveti Arceveti commented Jul 6, 2022

This makes paintings into objects. Vanilla paintings were previously a set of geolayout commands in the level geo, plus 6 specific floor types per painting.

Benefits of paintings being objects (and other painting improvements part of this PR):

  • You no longer need 6 specific floor types in the level geometry for each painting, so all the painting warp surface types are now freed up.
  • Only one entrance warp node is now needed per painting, as opposed to 3 in vanilla.
  • Painting warps now use the regular WARP_NODE command instead of an extra PAINTING_WARP_NODE command.
  • Paintings are no longer restricted to 45 warps.
  • Multiple paintings can now be near each other without breaking.
  • Paintings can now be rotated at any angle.
  • Paintings can now be moved around dynamically and can still be entered while moving.
  • You no longer need to have a separate painting geolayout command for each room combination that has it loaded.
  • Ripple effects are now accurate to Mario's position rather than being limited to specific quarters of the painting.
  • The painting entrance/exit cutscene no longer randomly breaks like it does in vanilla (hopefully).
  • Less information is required for custom Painting structs.
  • SAVE_FLAG_DDD_MOVED_BACK is no longer needed.
  • WDW water level detection is now relative to the painting itself instead of Mario's absolute height in the world.
  • Paintings now have the same UVs when rippling and stationary instead of noticeably snapping into place around the edges.
  • Custom painting shapes are now slightly easier to make as neighboring triangle data for each vertex is obtained dynamically rather than from a hardcoded list.

To create a custom painting:

  1. Create a new PaintingImage struct for your painting. These include pointers to your texture data, texture count/size, how ripples are triggered, how the painting is displayed, and the size of the painting. In vanilla levels these are stored in painting.inc.c files.
  2. Add a painting image ID to the PaintingImageIDs enum in paintings.h. The current name format is "PAINTING_ID_[level]_[destination]" but it can be whatever you want.
  3. Add a pointer to the PaintingImage in sPaintings in paintings.c, corresponding to your painting image ID.
  4. Add a painting object in the level script. Use the painting image ID for bparam1, and the warp node ID for bparam2.
  5. Add a WARP_NODE with the same ID. This is the same as how doors and other warp objects work.

See vanilla paintings (castle_inside, hmc, ttm) for examples (paintings.inc.c, script.c).

TODO before merge:

  • Documentation/instructions in paintings.c or paintings.h
  • Prevent ripple source position from scaling with object scale

@Arceveti Arceveti requested a review from Mr-Wiseguy as a code owner July 6, 2022 01:57
@axollyon
Copy link
Collaborator

axollyon commented Jul 6, 2022

poggggg

@Arceveti Arceveti requested a review from thecozies July 6, 2022 02:39
@Arceveti Arceveti added this to the 2.1 milestone Jul 6, 2022
@Arceveti Arceveti added the enhancement New feature or request label Jul 6, 2022
README.md Outdated Show resolved Hide resolved
@thecozies thecozies requested a review from axollyon July 15, 2022 20:50
@Arceveti Arceveti linked an issue Jul 17, 2022 that may be closed by this pull request
src/game/camera.c Outdated Show resolved Hide resolved
src/game/paintings.c Outdated Show resolved Hide resolved
src/game/paintings.c Outdated Show resolved Hide resolved
src/game/paintings.c Show resolved Hide resolved
src/game/sound_init.c Outdated Show resolved Hide resolved
@gheskett gheskett modified the milestone: 2.1 Jul 21, 2022
@gheskett gheskett modified the milestones: 2.1, 3.0 Jun 7, 2023
@gheskett gheskett changed the base branch from develop/2.1.0 to develop/3.0.0 September 27, 2023 02:09
@Reonu
Copy link
Contributor

Reonu commented Mar 29, 2024

don't let this die :(

@Arceveti Arceveti changed the base branch from develop/3.0.0 to develop/2.3.0 March 30, 2024 22:17
@gheskett gheskett changed the base branch from develop/2.3.0 to develop/2.4.0 July 4, 2024 07:13
@gheskett
Copy link
Collaborator

gheskett commented Jul 4, 2024

Repointing to 3.0 since this revolves around ASCII and seg2 cleanup (DO NOT PULL IN LATEST 2.4 TO THIS BRANCH PLEASE!!!)

@gheskett gheskett changed the base branch from develop/2.4.0 to develop/3.0.0 July 4, 2024 07:15
@FrijolesYQueso
Copy link

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement painting objects
6 participants