News:

11 March 2016 - Forum Rules

Main Menu

Help with Mesen HD Pack features (?)

Started by imkrut, April 24, 2020, 02:07:11 PM

Previous topic - Next topic

imkrut

This is my second time messin' around with Mesen's HD Pack feature (first time was this Little Nemo patch https://www.romhacking.net/forum/index.php?topic=28358.0 ), lately I've been fooling around with some other games ( https://imgur.com/a/s3pnTFt
and https://imgur.com/a/S5LNqcc ) and I think it's a really infravalorated tool that could see much more use with a few QoL improvements

Now a couple of questions pop up, that would certainly make the process much more streamlined.

1) Is it possible to rearrange the tile bank (once the output files are done) so they make more sense/it's easier to edit them? (kinda like this https://imgur.com/a/JCZYxFo ) this is specially important because the tiles eventually start repeating themselves (despite being the same exact sprite/tile)

2) In line with the previous point, is it possible to "match" a cetain sprite with certain graphics so you don't have to find and replace them in every single output tile?

3) Is there a way to easily output the tiles for editing (was thinking of a "movie" replay for Mesen of someone playing "X" game, but I have no idea if there's a repository for such thing) other than playing the game from start to finish and trigger every action/animation?

4) Is there a tool that allows you to add more animation frames to an existing animation or animate a static tile? or even more, add "variants" of a certain static tile that randomly replaces (say a block tile A that is used 30 times in a scene, but add tile B and C so A, B and C are used 10 times each in the same way tile A would have been randomly)

5) A way to completely replace a "blank" background with either a tile or a big bitmap?

The same could be said regarding the "add music" feature (like MSU-1 way of using remastered audio for SNES games) this could be great if there was a way to streamline the process of adding them for non-coder savy people.

Any help, much appreciated

bogaabogaa

For the first two points. You need to know the hiris format and edit the lines by hand if you like to organize it. This is more work then editing the PNG files. It is impotent to output it properly in the first place. Since it is a text file it could be a good starter project to create a tool for it.

It could be a good idea to look at examples of other HDPacks to get a idea how they are organized.
https://forums.nesdev.com/viewtopic.php?t=17110

Mesen does have a manual to the format:
https://www.mesen.ca/docs/hdpacks.html

mkwong98 made a tool to organize some of the hiris. You can follow his posts as well as kya or SourMesen to find more infos.
Quote from: mkwong98 on July 19, 2018, 11:57:53 AM
...
I made this tool to make it:
https://drive.google.com/open?id=1TkP0EtBNeCrccZy7QgIfvJFAJuBRiOnU
...

Mesen can play back "movies" but I never used it so far. TAS org is the only page I know who collects replays. You may need to ask for people to create some for you.

Hires format does allow to mod nearby tiles and include a background image. A BG seems to be hard for most games. Metroid only has black backgrounds so it is a perfect game to use it. I did see that there are issues with the HDPack randering on Mesen.0.9.8. It works well with older versions. I don't think Mesen got updated as Sour is working on the SNES emulator.

The hires format is not perfect and had always issues around tile priority. It seems complicated to find solutions that work for every game.
If you have some 6502 ASM knowledge you should be able to write the proper value to the Sound registers of the NES so the OGG linked in your hiris should trigger. This is explained in a link above and you can view examples of existing project and patches.

Not sure how much this info will help you on progress since it is a lot to cover. Good luck
CV ROM DiscordServer
https://discord.gg/PvFgxRg

imkrut

Thank you very much, it does help, I am more of an artist so most of the technical/coding parts are hard for me to grasp, so I'll try to look into it.

I have looked into the manual, but unfortunately, it does not help much with the issues mentioned....the most it does write up is about framerange, but I don't quite grasp how it works....I've looked into Metroid HD to see how they made em', but no luck so far.

mkwong98

The hires file generated from Mesen is the most basic form and to use advance features, you need to edit that file.

1. As bogaabogaa says, I have a tool for organizing the tiles into objects. In Mesen, there is a tool called PPU viewer. If you hold shift and right click at the screen under the nametable viewer or the bottom screen under the sprite viewer, you can copy the information of all the tiles in there as well as the position of the tiles on the screen. In my tool, paste that into an object and delete the tiles which don't belongs. Once you have the HD replacement in a png file, import that file into my tool, highlight the tiles you want to replace and select the replacement from that png file. When finished, the tool can export a hires file.

2. There are a few special cases when handling replacements, not sure if this answer your question:
i) Same tile with the same palette is used at different situations and you want to map it to different HD replacement in each situation. In this case, you need to use conditions to distinguish them.
ii) Different tile but looks the same. In this case, edit the hires file to point them to the same HD replacement.
iii) Same tile with different palettes but you want the same replacement. In this case, there is an option to set a replacement as default for that tile.
iv) Same tile with palettes of different brightness. This happens a lot with fade-in and fade-out. In this case, point them to the same replacement and set the brightness in the hires file.

4. Frame range works by putting a number from looping sequence into each frame. Then this number can be used as conditions to select which replacement to use. So you can have the animation in higher frame rate by defining more replacement than the number of frames in the original animation. However, there is no way to sync the start of the animation to the start of the number sequence so it only works for looping animations. You can check out the moving platform in level 2 of my Donkey Kong HD pack.

5. You can replace with a bitmap. First you need a condition to define when the bitmap should be shown, secondly either the background tiles are transparent already or you have to map all the background tiles to a transparent replacement.

imkrut

Quote from: mkwong98 on April 28, 2020, 05:27:29 AM
The hires file generated from Mesen is the most basic form and to use advance features, you need to edit that file.

1. As bogaabogaa says, I have a tool for organizing the tiles into objects. In Mesen, there is a tool called PPU viewer. If you hold shift and right click at the screen under the nametable viewer or the bottom screen under the sprite viewer, you can copy the information of all the tiles in there as well as the position of the tiles on the screen. In my tool, paste that into an object and delete the tiles which don't belongs. Once you have the HD replacement in a png file, import that file into my tool, highlight the tiles you want to replace and select the replacement from that png file. When finished, the tool can export a hires file.


I remember fiddling with the app without much success. I tried again last night, but I couldn't really manage to do much with it (other than loading the rom and looking at the graphic tileset). Is there a tutorial somewhere on how to properly use it? maybe a video? seems a bit overwhelming for starters.

mkwong98


imkrut

That would be great!
Also, I made a huge writeup here ( https://www.reddit.com/r/emulation/comments/g7zcbq/mesens_snes_v040_has_been_released/fp1b7as/ ) about some things that IMO would be cool to implement (some are on the Mesen side of things, but others might already be possible with your tool) would love to hear what you think about em' if you have some time to spare!

lyonhrt

I think mkwong98 answered it best, he's done a great tool and definitely worth pursing in using it, it will allow you to do most of things that you have asked.

I can answer partially answer number (4)

Thankfully you can replace any tile even if its part of an animation with frame range, but still stuck with them looping, you can get past by making the last frame of an animation a high number so a long pause (though if sour added a stop so animation plays once, that would be handy), of course you need a lot of control, so if you were to change a 3 frame anim into a 6 frame for a sprite that is 4 by 4, you need to set condition(s) first so the repeated tiles in the sprite change on the correct frame, that it only plays when your pushing a key press so it doesn't show on any other sprites that you dont want it show.
I've done a few of these with some unreleased wip packs.


imkrut

Awesome!! I'll fiddle with it today for sure!