Skip to content

In-game asset pack selection! - #717

Merged
ds-sloth merged 26 commits into
mainfrom
wip-asset-pack
Feb 23, 2024
Merged

ds-sloth merged 26 commits into
mainfrom
wip-asset-pack

Conversation

@ds-sloth

@ds-sloth ds-sloth commented Feb 6, 2024

Copy link
Copy Markdown
Collaborator

After a lot of discussion and design work, we have an implementation of in-game asset pack selection!

Scr_2024-02-06_17-14-00

How does it work?

Setup:

  • Extract your favorite asset packs to to assets/ inside your installation directory.
  • For non-portable installations, you may also extract them to ~/.PGE_Project/thextech/assets/ on Linux or C:\Users\<username>\.PGE_Project\thextech\assets\ on Windows.
  • IMPORTANT: to be recognized, your asset pack must include its ID in gameinfo.ini. We will add id="smbx" to the [game] section of SMBX's gameinfo.ini, and id="aod" to Adventure of Demo's gameinfo.ini.
  • Advanced: if you have two versions of the same asset pack, you should add version="..." to at least one of them. Otherwise, only one of them will be detected.
  • Asset packs stored directly to your thextech folder will still be loaded, but this location is deprecated and kept only to make migration easier. The game will internally treat them as having a blank asset pack ID.
  • You do NOT need to install an additional copy of your current asset pack unless you want to migrate your installation.

Use:

  • Hold the Select (Drop Item) button at the title screen to choose an asset pack. You may need to be patient, since the game will fully reload using the new asset pack.
  • Advanced: launch the engine with -c <asset-pack-id> or -c <asset-pack-id>/<asset-pack-version> to specify which asset pack you want to run from the command line, independent of install location.
  • Note for advanced users: launching the engine with -c <path-to-asset-pack> now requires the target asset pack to specify an ID, and you will need to migrate your user content to subdirectories with that ID.

Data management:

  • Now, you will see subdirectories for each asset pack in your worlds/ and settings/gamesaves/ folders (as well as the other folders).
  • You can place your episodes and find your other data here.
  • All data is shared between different versions of the same asset pack.
  • Why do I have two copies of my favorite asset pack? If you installed a pack to both your main thextech directory and to assets/, then it will be recognized as two separate asset packs. After you migrate all of your data to worlds/<id>/, battle/<id>/ and settings/gamesaves/<id>/, you may remove the original asset pack.

Review and testing

I believe that this feature is fully complete and polished, but there is always room for improvement. @Wohlstand, please review the code and make sure that it seems appropriate to you.

For usability testers, please start by confirming that the instructions above work well for your existing installation and everything works as you expect. Then, if you have the time, please try other installation types (portable, non-portable with assets installed in the same directory as the executable, non-portable with assets stored in your user directory). Thank you!

@ds-sloth ds-sloth added enhancement New quality-of-life feature or request (does not change gameplay) asset customization Issues related to custom graphics, sounds, asset packs etc. labels Feb 6, 2024
@ds-sloth
ds-sloth requested review from 0lhi and Wohlstand February 6, 2024 22:30
@ds-sloth ds-sloth self-assigned this Feb 6, 2024
@ChristianSilvermoon

ChristianSilvermoon commented Feb 7, 2024 •

Copy link
Copy Markdown

Okay so to sum up my experience and all questions/concerns...

Migration

Migration from the former 'mono-assets' system to this new asset pack system isn't overly complex, but does have a variety of steps

For the most part it appears that it's a matter of

  1. Create assets/PACK (whatever is appropriate for your legacy asset pack)
  2. Move graphics, sound, sounds.ini, music, music.ini, introset (if available), intro.lvl, outro.lvl, and very importantly gameinfo.ini to this new location
  3. Move the episodes and battle levels that came with the episode by default to assets/PACK/worlds and assets/PACK/battle respectively as well
  4. Move non-default episodes and battle levels to worlds/PACK and battle/PACK respectively
  5. Move all saves located under settings/gamesaves to settings/gamesaves/PACK
  6. Add id=PACK under the [main] key of assets/PACK/gameinfo.ini

While this process isn't complicated, it is a six step process that some users may incorrectly follow, leading to confusion when the game doesn't find their save data anymore.

I would recommend (although from past discussions this idea seems like it may not be desirable) providing an option to migrate automatically, setting the version key to "legacy" or "migrated"

If no built-in migration system is included, then either a seperate utiltiy or script, or (possibly the simplest option) the recommendation to download a fresh copy of the game and instructions on what to copy where from the old install

Concerns about MenuGFX2.png

A number of episodes in the past have shipped custom sets of assets intended to overwrite the original game's core assets; for multiple reasons we're trying to avoid that particular setup now.

Many of these include a custom intro.lvl or MenuGFX2.png that won't be seen in the event things are simply copied to the episode directory...

I am also unsure if outro.lvl placed in the episode directory would be detected and used by the game.

Some do not include any custom MenuGFX2.png at all, leading to either a missing logo, or a logo that looks identical to another asset pack.

Suggestion

I think it's important that the id be visible somewhere, at least during selection. I know it may not be the most visually appealing, but in the event that two different packs have the same MenuGFX2.png it can become difficult to tell them apart, leading to user frustration. It can be somewhere unobtrusive ideally.

I am concerned that such asset packs are a very real possibility. It should probably be suggested that it is bad practice to re-use the logo unless it's a pack variant with a unique version number, but for users simply converting older episodes with assets to asset packs, I cannot honestly see that not being an issue for someone at some point with no other indicator.

For episode directories containing a MenuGFX2.png I think it would be nice if the logo changed when the episode was selected, but I could also understand if this poses an issue on lower-spec platforms

I suggest displaying the id string because it should always be unique and should not be localized.

Conclusion

The new system feels perfect to me, with the exception of the concern I have ^^

This is a very nice and substantial upgrade over the old way of doing things and makes things more flexible for Linux/UNIX packaging formats, and easier for users to switch out packs without having to restart the game or maintain multiple copies of the game.

@ds-sloth

ds-sloth commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator Author

Hi, thanks a ton for this review. We (the core team) discussed your concern about MenuGFX2 seriously, and want to suggest that:

  • In general, a packed game that does not change the title logo should probably be converted into an episode instead of an asset pack
  • If a converter wants a packed game to become an asset pack, they should update MenuGFX2.png manually, or specify a different logo image at [android] logo = "graphics/...".
  • But, we could possibly add a show-id flag to the [game] section, which would force the pack's ID to be shown on the selection screen. Do you think that would be necessary?

Separately, I'll note: we got a suggestion on Matrix to animate the left/right transition between asset packs in the selection screen. I'll try to do this soon.

@ChristianSilvermoon

Copy link
Copy Markdown

Hi, thanks a ton for this review. We (the core team) discussed your concern about MenuGFX2 seriously, and want to suggest that:

* In general, a packed game that does not change the title logo should probably be converted into an episode instead of an asset pack

* If a converter wants a packed game to become an asset pack, they should update `MenuGFX2.png` manually, or specify a different logo image at `[android] logo = "graphics/..."`.

* But, we could possibly add a `show-id` flag to the `[game]` section, which would force the pack's ID to be shown on the selection screen. Do you think that would be necessary?

Separately, I'll note: we got a suggestion on Matrix to animate the left/right transition between asset packs in the selection screen. I'll try to do this soon.

That's probably fair enough... the new animation is a very welcome improvement and I'm loving it, personally ^^

I'd like it as a setting just in case, personally, but the recommendations are good.

@ds-sloth

ds-sloth commented Feb 9, 2024

Copy link
Copy Markdown
Collaborator Author

I added a [main] show-id = 1 flag for gameinfo.ini. Can you please confirm that it works as expected for your content?

As a side note, I also revised the animation when a logo is overridden to make the logo fade in/out (instead of having it suddenly change as it moves up and down).

@ChristianSilvermoon

Copy link
Copy Markdown

This works, I suppose, but I honestly don't understand why this shouldn't be a global setting, and editing gameinfo.ini per pack to add that when they're in .ISO format or other formats like that is going to by a lot more difficult and time consuming.

May I ask what the opposition to having it be a global setting is?

@ds-sloth

Copy link
Copy Markdown
Collaborator Author

I think we must have a slightly different understanding of what the role of asset packs is. In my opinion, asset packs are not like episodes; there's an expectation that the person creating them knows what they are doing. If a person creates an ISO asset pack with a non-unique logo, and doesn't set show-id, I think that is a defective asset pack and you should complain to the person who created it.

We are already planning to add code to Moondust Maintainer to allow converting packed games into episodes; we can definitely add the ability to set the ID, and the ability to enable show-id, when we are doing so. Since ISO-creation software is somewhat rare, adding these checks to Maintainer should be quite effective.

I definitely wouldn't want this to be a global setting, simply because we're trying to limit those as much as possible to avoid too much clutter in the Config Update.

@ChristianSilvermoon

Copy link
Copy Markdown

I think we must have a slightly different understanding of what the role of asset packs is. In my opinion, asset packs are not like episodes; there's an expectation that the person creating them knows what they are doing. If a person creates an ISO asset pack with a non-unique logo, and doesn't set show-id, I think that is a defective asset pack and you should complain to the person who created it.

We are already planning to add code to Moondust Maintainer to allow converting packed games into episodes; we can definitely add the ability to set the ID, and the ability to enable show-id, when we are doing so. Since ISO-creation software is somewhat rare, adding these checks to Maintainer should be quite effective.

I definitely wouldn't want this to be a global setting, simply because we're trying to limit those as much as possible to avoid too much clutter in the Config Update.

I think we the same understanding as to their role, just different concerns.
I think the solution of having show-id in gameinfo.ini is probably good enough in this case, you're right.

@ds-sloth

Copy link
Copy Markdown
Collaborator Author

I'm glad! Anything else you'd like me to revise before we call this feature "done"? (I think Wohlstand and 0lhi still need to approve it as well.)

@ChristianSilvermoon

Copy link
Copy Markdown

I'm glad! Anything else you'd like me to revise before we call this feature "done"? (I think Wohlstand and 0lhi still need to approve it as well.)

I think it's perfect, although, I've noticed for some reason the Lowser's Conquest logo does not seem to animate... wonder what could cause that? 🤔
Scr_2024-02-10_05-29-57.webm

Oh, I guess GitHub won't embed webms? Shame on me for trying to be nice about file sizes I guess XD

@ds-sloth

Copy link
Copy Markdown
Collaborator Author

That's correct; since Lowser's conquest's logo is not actually MenuGFX2, it would fail to animate correctly at resolutions lower than 800x600. You can check out a7ee0bb to see if you like, this was fixed in 597f0d2.

@ChristianSilvermoon

Copy link
Copy Markdown

That's correct; since Lowser's conquest's logo is not actually MenuGFX2, it would fail to animate correctly at resolutions lower than 800x600. You can check out a7ee0bb to see if you like, this was fixed in 597f0d2.

But isn't that 1280x720? Or does it not count because of the intro.lvl ?

@ds-sloth

Copy link
Copy Markdown
Collaborator Author

Yes, you're right, it seems that 1280x720 was the only resolution that animated perfectly. Here's what 800x600 looked like, and lower resolutions are even worse (due to intro.lvl being exceptionally poorly optimized for multires).

OLD SCREENSHOTS:

Yes, the menu graphics are provided by intro.lvl and NOT present in MenuGFX2.png.

In general, if the logo is overridden, I don't think it's safe to assume that the override logo is present in the menu screen at the same location as MenuGFX2 would normally be, so I'm happy with using the fade animation instead of the "slide" animation.

@ChristianSilvermoon

ChristianSilvermoon commented Feb 12, 2024 •

Copy link
Copy Markdown

In general, if the logo is overridden, I don't think it's safe to assume that the override logo is present in the menu screen at the same location as MenuGFX2 would normally be, so I'm happy with using the fade animation instead of the "slide" animation.

Ah, I see, that makes sense

Comment thread src/main/asset_pack.cpp Resolved
Comment thread src/main/asset_pack.cpp Resolved
@ds-sloth ds-sloth added this to the Version 1.3.7 milestone Feb 20, 2024
Comment thread src/main/asset_pack.cpp Resolved
Comment thread src/main/asset_pack.h Outdated

bool operator==(const AssetPack_t& o) const
{
return this == &o;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you sure this works? Or I miss something... I would add a comparison with every field by field, and return false when any is not equal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was being used in a single place to delete an asset pack from the list by identity. I moved the logic to the calling site instead for clarity.

@Wohlstand Wohlstand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, I finished the review, and seems everything is fine for me. I did a small fix by myself. Other things I'll probably tweak soon. I need to update some on Haiku and other platforms. We should start the move away from ~/.PGE_Project/thextech into ~/.thextech (with keeping use old if old directory exists do don't ruin everything).

@ds-sloth
ds-sloth merged commit a45499a into main Feb 23, 2024
@ChristianSilvermoon

Copy link
Copy Markdown

Okay, I finished the review, and seems everything is fine for me. I did a small fix by myself. Other things I'll probably tweak soon. I need to update some on Haiku and other platforms. We should start the move away from ~/.PGE_Project/thextech into ~/.thextech (with keeping use old if old directory exists do don't ruin everything).

please consider $XDG_DATA_HOME/thextech instead, defaulting to ~/.local/share/thextech

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

asset customization Issues related to custom graphics, sounds, asset packs etc. enhancement New quality-of-life feature or request (does not change gameplay)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants