Romhacking.net

Romhacking => Personal Projects => Topic started by: Aclectico on August 09, 2018, 12:28:12 am

Title: NES Metroid HD Pack
Post by: Aclectico on August 09, 2018, 12:28:12 am
**A new pack version (V 1.2 Custom Edition) is available as of 11/21/18**

An overview video is available here: https://www.youtube.com/watch?v=JSrMIrbi4B4

A video showing how to adjust level layout is here: https://www.youtube.com/watch?v=VnEgGEjZdmE

An HD pack is now available for the NES game, Metroid. This pack replaces graphics, sound effects, and music. It is a hack that builds upon many prior hacks and it uses Metroid mOTHER as a base (available at: https://www.romhacking.net/hacks/1988/). Credit should go to the original authors for work done on prior hacks.

The pack includes, but it not limited to, some of the features detailed below. Many of these features are carryover from prior hacks that have previously been developed for Metroid. Items denoted with an asterisk are brand new features that have been created exclusively for the Mesen pack.

•   Increased resolution**
•   Scrolling backgrounds**
•   Updated sound effects and music**
•   File resources for alternate sound and graphics**
•   New title and ending screen**
•   Minimap
•   Animated environments
•   Beam stacking
•   Saving
•   Full health on startup

Players must use a new version of the Mesen emulator that was released on August 5, 2018 (version 0.9.6 is available at: https://www.mesen.ca/#Downloads). Older versions of the Mesen emulator will not work properly.

The README contains details the work performed by each author below that helped make the HD pack possible:
KYA, Sour, dACE, snarfblam, Infinity's End, DemickXII, Psyklax, Maximum Potion, VariaZim, WIP, Exaelart, Riklaionel, elgwen, strugglepoo, Luminist, Jorge Fuentes, Patricio Herrera, kottpower, PikaXRichMixer, and Rundas45.

***HD Pack Download (Version 1.2 Custom Edition): http://bit.ly/Metroid_HD

*Note: This is merely a mod and the download will not work all by itself. The pack must be used with a USA Metroid ROM that has a SHA-1 checksum of ecf39ec5a33e6a6f832f03e8ffc61c5d53f4f90b or it will not operate correctly.

#New for Version 1.2#
   -Altered the structure and appearance of the transition room between “blue” and “gold” Brinstar (inspiration was taken from Retroid by ProjectXVIII).
   -Altered the appearance of the "blue" statue room in Brinstar.
      *Note: If you prefer the old "grey" Brinstar transition room and "blue" Brinstar statue room, they are still available in the "AlternateLevelDesign" folder (look for a file called "mmm.ips").
   -Altered the structure of the Ridley boss fight room.
   -Modified art for armored Samus, some environment elements (various brick tiles), and some enemies (Zebs and Lava-Dragons).
   -Various bug fixes.
   -Made minor modification to lava animation.

(https://drive.google.com/uc?export=download&id=1XSs7O4FQtnEHRIiL11jcN2A8sFTcKSJ8)
(https://drive.google.com/uc?export=download&id=1I15Wdt-c97jVf87sEWSFzjhgUjWdUvP2)
(https://drive.google.com/uc?export=download&id=13nGeT92cRu4mWQ1hD4cdV8zvuF14DvZj)
(https://drive.google.com/uc?export=download&id=1441ewsAb_KwaQvzR38lZ_IKGSTB9vDEF)
(https://drive.google.com/uc?export=download&id=1qflBPVoYNMqSN_ab-L5cpzzEXgqsGfpp)
Title: Re: NES Metroid HD Pack
Post by: Sinis on August 09, 2018, 02:21:49 pm
I've been waiting for someone to do this.  Simply awesome  :beer:
Title: Re: NES Metroid HD Pack
Post by: Sephirous on August 10, 2018, 12:42:27 am
Holy Crap!  :crazy:

Someone did it!!!!

After seeing Castlevania Redone I just knew there were going to be more projects, Which means the possibilities are endless.

I have always wanted to see the first game as it was shown in the cut scenes in Super Metroid and now it looks like anything is possible!

I mean think about it, Startropics, Zelda, Castlevania II And III, The Final Fantasy Trilogy maybe one day get the FFIII Origins version we got jipped. The Lolo Games, The Mega Man Games. I don't know exactly how this process is done and I am sure it's very time consuming but this is just so awesome!! WOW!  :crazy: :crazy:

Metroid - Rogue Dawn 16 Bit  :crazy:

I can't wait to try this out.  :thumbsup: :thumbsup: :thumbsup:
Title: Re: NES Metroid HD Pack
Post by: Aclectico on August 10, 2018, 01:40:41 am
Just a note on troubleshooting for everyone, the pack must be used with a ROM that has a SHA-1 checksum of ecf39ec5a33e6a6f832f03e8ffc61c5d53f4f90b. If the checksum does not match exactly, the pack will not operate correctly. If you are encountering issues, I would check this first. Happy gaming!
Title: Re: NES Metroid HD Pack
Post by: Ghaleonh41 on August 11, 2018, 11:28:09 am
Wow! This looks great so far! Can't wait to test it out!

I'll be following this with great interest!
Title: Re: NES Metroid HD Pack
Post by: lyonhrt on August 12, 2018, 08:13:20 am
Just had to log in to say very impressive pack, love how you've used the advanced features and very polished, kudos to your work.

...makes me wonder if i should work on a new pack (have a few test packs)..or see if my old hdnes super mario is worth updating :huh:
Title: Re: NES Metroid HD Pack
Post by: Aclectico on August 12, 2018, 12:02:46 pm
It's good to hear from a fellow Mesen/HDNes pack developer. I'd say go for it. And thanks for the kind words on the Metroid pack. I'm very thankful for the work Sour, KYA, and the other hackers did that helped make this possible. I'd say the final product was a nice group effort.
Title: Re: NES Metroid HD Pack
Post by: lexluthermiester on August 12, 2018, 09:08:38 pm
@Aclectico Gotta hand it to you, this is damn cool! Well done, well done indeed!
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on August 13, 2018, 01:33:58 am
Well done! :thumbsup:
I only played Super Metroid and Metroid Fusion and never play this one. Time to pick up the controller!

BTW, do you use any tool when working with the HD tiles?
Title: Re: NES Metroid HD Pack
Post by: Aclectico on August 13, 2018, 07:11:47 am
The sprites were edited in Photoshop CS6. Other programs used include Audacity, Notepad, Lunar IPS, and the "HD Pack Builder" feature on the Mesen NES Emulator.

August 13, 2018, 12:39:06 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
After a little feedback from the pack's initial release, I am thinking of making some updates and minor changes. One aspect I'd be interested to hear thoughts on is music. I was considering the following replacements:

-Ending theme: https://www.youtube.com/watch?v=E4OVX8fgwzg (although, I'd have to do some trimming and editing to make it fit).

-Brinstar: I think the track is very nice in the current pack. I also think the author of the YouTube video did a very good job. But, some seem to feel as though it is too far removed from a 16-bit style. Having said that, I haven't found a good alternative yet. There is this, but I'm not sure it's quite right (a bit too cheery): https://www.youtube.com/watch?v=uYelkNUT3HI. I'm open to suggestions.

-Title screen: Again, the track in the current pack is very nice. But, I've heard some say it is too far removed. Do others feel the same way?

-Escape theme: I like the current escape theme in the pack. However, there are some that are very attached to the NES melody. This is a possibility: https://www.youtube.com/watch?v=94xTBvgMhZw&t=142s (although, just the first part would be used if a lot of people also like the NES melody)

Of course, all of these considerations would depend on the YouTube authors having no issues with this.
Title: Re: NES Metroid HD Pack
Post by: Sephirous on August 13, 2018, 07:20:22 pm
I just finished recording a personal soundtrack, I remastered the Zero Mission Soundtrack and enhanced the already existing sound effects to prevent the sounds from being drowned out.

The music may be GBA Music but it works very nicely. :crazy:
Title: Re: NES Metroid HD Pack
Post by: DavidtheIdeaMan on August 13, 2018, 07:23:42 pm
Oh really Sephirous,that sounds cool. :)
Title: Re: NES Metroid HD Pack
Post by: Aclectico on August 14, 2018, 06:11:28 am
That sounds interesting. I'll reach out to you with a follow up via messages.
Title: Re: NES Metroid HD Pack
Post by: ShadowOne333 on August 14, 2018, 11:16:27 am
Can't wait to see how Ridley and Kraid look with these new texture pack :^}
Title: Re: NES Metroid HD Pack
Post by: vhr2121 on August 14, 2018, 02:04:44 pm
Man, I tried this HD pack and I LOVED it! Sure there were a few things here and there, but overall this is AWESOME! I'm already making videos of this. Hopefully I can complete it ASAP because it is THAT good.
Title: Re: NES Metroid HD Pack
Post by: Kallisto on August 14, 2018, 03:49:04 pm
I'm really shocked this was even possible for NES games in general, it opens up a lot of possibilities for future NES projects.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on August 15, 2018, 11:18:57 am
Thanks to everyone for the compliments :) I'm happy people seem to be enjoying it.

August 18, 2018, 03:51:36 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
A new version is in progress and it will include the following:

-Various bug fixes
-Alternate music for a couple of areas
-Enhanced art for a small number of the background tiles
-Improved Samus model and run animation

Below is a work in progress example of the updated Samus run animation:

Before
(https://drive.google.com/uc?export=download&id=1Iq2SStyvWDB7qbzNMDFR3iwndPobCUwa)

After
(https://drive.google.com/uc?export=download&id=1t32Biy6sX8VH-xX_oNoCPl4E7GmG724T)
Title: Re: NES Metroid HD Pack
Post by: cartridge_rom on August 18, 2018, 06:41:24 pm
great is a lot of work with that aesthetics and graphics for a 16 bit console ;), but for a special single emulator :(
it is planned to adapt this title to a ROM for MegaDrive, it would be possible in the future

Thank you :thumbsup:
Title: Re: NES Metroid HD Pack
Post by: Midna on August 19, 2018, 02:58:44 am
"hey could you take this game that was designed for one system and reprogram it for another with completely different hardware? that's something you can do in a couple of weeks, right? like i'm sure it doesn't take literal years or anything"
Title: Re: NES Metroid HD Pack
Post by: Shade Aurion on August 19, 2018, 01:07:24 pm
This looks great. I want to jump in a play it but I think i'll wait for at least the first round of fixes. I'll def be bookmarking this though. Great work <3
Title: Re: NES Metroid HD Pack
Post by: Sephirous on August 19, 2018, 03:39:02 pm
I like the new Samus, She looks more like she's running rather than skipping.

Looks more like the Super Metroid Samus and that is always good.  :thumbsup:
Title: Re: NES Metroid HD Pack
Post by: Aclectico on August 24, 2018, 11:55:47 am
I've had a few requests for screenshot comparisons. Below is a compilation of different versions of the starting area in Brinstar. The Metroid: HD screenshot is from a development version that is not quite ready for public release.

(https://drive.google.com/uc?export=download&id=1uGx24E4NIfgY-eD5zhkPyQwWu9BPKuNO)



Title: Re: NES Metroid HD Pack
Post by: Sephirous on August 29, 2018, 12:09:43 pm
I have an idea/request.

Speaking of the Opening Scene in Super Metroid.
How about the idea of using the Mother Brain from the cut scene for the Mother Brain Battle?  :crazy:

(https://i.imgur.com/tL8t0bb.jpg)
Title: Re: NES Metroid HD Pack
Post by: Aclectico on August 30, 2018, 08:34:53 am
Initially, that was the original plan. In general, I prefer Super graphics vs. Zero graphics because the former tends to be a little less cartoony.

In most cases, this was fine because the SNES has a slightly higher resolution than the GBA anyway (256x224 vs. 240x160 for these games). As a result, remastering the higher resolution graphics would lead to less distortion. But, the final boss was a special case because it takes up a lot more space on the GBA screen than on the SNES. Without scaling anything, placing the two versions of the boss side by side will show that the SNES version is roughly half the size of the GBA version. So, this was a rare case where the GBA version won out.

I agree with you though. I do like the SNES version better. But, the stars didn't quite align for that variant.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on September 11, 2018, 01:57:57 pm
Version 1.1 of this hack is now available. It is called Metroid: HD Custom Edition V 1.1. There are a lot more resources that are now available for users to customize the mod. Keep in mind that the latest version did modify the .ips file. As a result, older Mesen save states will not carry over from the last pack version (but game saves should carry over). An overview video is available here: https://www.youtube.com/watch?v=JSrMIrbi4B4.

#New for Version 1.1#
-Adjusted run animation and character sprites for both the armored suit and "Zero Suit."
-Modified art for some environment tiles.
-Various bug fixes.
-New character templates are available in the alternate graphics folder.
-Rebalanced sound.
-Modified sound effects for runnning and jumping.
-New sound effect for lava damage.
-New music is available in the alternate music folder.
   *Note: Different music has been implemented for the areas indicated below. If you prefer variants from the prior revision of this pack, they are still be available in the alternate music folder.
      -Norfair
      -Evacuate Theme
      -Credits
Title: Re: NES Metroid HD Pack
Post by: lexluthermiester on September 12, 2018, 10:43:48 pm
Having a problem with this patch. Using the right ROM, but Mesen keeps saying that it's not the correct ROM. Are we sure the patch works right?
Title: Re: NES Metroid HD Pack
Post by: Aclectico on September 13, 2018, 02:55:08 am
Is the error unique to this version? In other words, did an older version work but this one does not? If so, try navigating to file, then open the game directly (rather than through the center save state box).

The most common cause I've heard of for this error in general is when a ROM is used that does not have a SHA-1 checksum of ecf39ec5a33e6a6f832f03e8ffc61c5d53f4f90b (the pack is a bit picky due to the sound hacks in the .ips file). Another common cause is trying to install the "UnZipMeFirstMetroidHD_V1_1.zip" file rather than the "MetroidHD.zip" file.

There is a setup video at https://www.youtube.com/watch?v=iMBNTRN_IyQ&t=340s. I am hoping this may assist in identifying where your issue may be. Let me know if that helps.

Also, keep in mind Mesen save states from the older pack will not transfer over to the newer pack (which is why the center box I mentioned at the start of this post may be the cause). To adjust the lava and jumping sounds, the .ips file in the pack needed to be changed. One unfortunate side effect of this is that it made save states nontransferable between versions. With that said, your normal game saves should still work fine.
Title: Re: NES Metroid HD Pack
Post by: lexluthermiester on September 13, 2018, 07:43:35 pm
Is the error unique to this version? In other words, did an older version work but this one does not? If so, try navigating to file, then open the game directly (rather than through the center save state box).

The most common cause I've heard of for this error in general is when a ROM is used that does not have a SHA-1 checksum of ecf39ec5a33e6a6f832f03e8ffc61c5d53f4f90b (the pack is a bit picky due to the sound hacks in the .ips file). Another common cause is trying to install the "UnZipMeFirstMetroidHD_V1_1.zip" file rather than the "MetroidHD.zip" file.

There is a setup video at https://www.youtube.com/watch?v=iMBNTRN_IyQ&t=340s. I am hoping this may assist in identifying where your issue may be. Let me know if that helps.

Also, keep in mind Mesen save states from the older pack will not transfer over to the newer pack (which is why the center box I mentioned at the start of this post may be the cause). To adjust the lava and jumping sounds, the .ips file in the pack needed to be changed. One unfortunate side effect of this is that it made save states nontransferable between versions. With that said, your normal game saves should still work fine.
SHA-1 matches and the correct zip was used. I don't have the older version. Got a link?
Title: Re: NES Metroid HD Pack
Post by: Aclectico on September 13, 2018, 08:19:33 pm
That's really odd. This is the first I have heard of someone having an issue by following the exact process of the "how to" video and also having a checksum that is good. Do you have the latest version of Mesen?

There are a couple of other things you can try out. First, you could attempt manual installation. To do this, follow the process below (it's a little more complicated):

-Create a folder called "HdPacks" in the same location as the Mesen.exe file.
-Inside that folder, create another folder with a name that is identical to your ROM.
-Download the HD pack and unzip it somewhere.
-If you browse inside what you just unzipped, you will find another zip file (a zip within a zip).
-Unzip that second zip somewhere and move all of the contents to that folder you created that matches the name of your ROM.
-When finished, you should have a folder inside your HdPacks folder that has a name identical to your ROM. Inside that should be many .ogg files and .png files.
-Try starting the game and see if it works.

If that fails, you could also try manually patching the ROM you have with the Metroid mOTHER .ips file using Lunar IPS (Metorid mOTHER is available at https://www.romhacking.net/hacks/1988/). Try following the manual install process above with the patched ROM instead. If it boots up, congratulations - you are halfway there. From here, all you need to do is find the hires.txt file inside the HDPack. Use ctrl+find. There should be two areas where a checksum is listed (ecf39ec5a33e6a6f832f03e8ffc61c5d53f4f90b). If you replace that existing value with 607b429388c1652f3194dfe599e6355dd7d59967 the sound should now be working.

Lastly, you could also try Retroarch as well since the newest cores that are available have a version of Mesen compatible with the pack.

Hoping something sticks here. Let me know if any of this works.
Title: Re: NES Metroid HD Pack
Post by: haxSon on September 14, 2018, 03:46:21 am
I have both versions within Mesen... When I tried to install the newest pack, Mesen gave me that error... so I renamed the Metroid ROM which is stored in a separate folder than the original, and then I was able to install the new version.
Title: Re: NES Metroid HD Pack
Post by: Sephirous on September 14, 2018, 06:17:28 pm
I had the same problem at first then found a work around.

Mesen can be picky with it's auto installation.

The fail safe way to install the game is to manually copy the unzipped folder into the HDPacks folder inside the main directory.
Then install the MMM ISP patch into the Rom and all should work perfectly.

Having Mesen automatically install the Packs seems to have bugs in it and I wouldn't trust anything that does the job for me. I'd rather manually install stuff so if it goes wrong I know I am at fault and can troubleshoot the problem versus being in the dark.

Hope this helps.  :thumbsup:
Title: Re: NES Metroid HD Pack
Post by: frozenLake on September 15, 2018, 01:20:43 pm
In regards to having to duplicate the same images multiple times, It is possible to instead edit the hires.txt, to load tiles from named files, in whatever order you want, potentially multiple times.

Also, the fact that the alternate graphics only includes the sprites for changing Samus somewhat saddens me. But I figure that anything else would be coming in future versions, so I'm not too upset.

(Still, I would love to be able to swap out the backgrounds with something less repetitive, like how the GBA metroid games do.)
Title: Re: NES Metroid HD Pack
Post by: Aclectico on September 22, 2018, 02:35:23 pm
Thanks to everyone for some of the feedback on the installation process. I know the auto install process is relatively new for Mesen, so some of the bugs may be worked out in future releases. For anyone interested, a newer version of Mesen is now available at https://www.mesen.ca/#Downloads (version 0.9.7).

Also, as far as the pack itself goes - I hadn't really considered backgrounds. I may have to give that some thought.

In any case, the possibility of future versions may also depend on a few things. Additional versions with more content may be released in the future. But, if that happened, it would most likely not be for a while.

At this time, I would say that the largest opportunity for improvement that continues to bother me relates to the number of frames used for the running animation. So far, this has been the largest shortcoming of the pack. Currently, three frames are used for running. If this was increased to five, I think it may result in a significant aesthetic improvement. If anyone happens to figure out a way to pull off something like this, feel free to send me a message.
Title: Re: NES Metroid HD Pack
Post by: lexluthermiester on September 23, 2018, 04:50:25 am
Tried the manual install and all works well. This should be refereed to as the preferred method of installation as the auto install refuses to work no matter what is done. Thank's for the help and input everyone. Really enjoying this mod!
Title: Re: NES Metroid HD Pack
Post by: azul120 on October 14, 2018, 01:23:59 pm
Nice. I'm impressed you didn't even use a mapper converter.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on November 21, 2018, 03:21:12 pm
Version 1.2 of this hack is now available. Keep in mind that the latest version did modify the .ips file. As a result, older Mesen save states will not carry over from the last pack version (but game saves should carry over).

Graphics were refined for a large number of environment tiles. One example is shown below.
(https://drive.google.com/uc?export=download&id=1LPSapBYTGA0vK9wUx49NVVF8NXwRSuvo)

In addition, the latest version also features new layouts for a few rooms. For the Ridley boss fight, the layout of the Metroid mOTHER hack made the boss fight a little too easy. So, the layout has been changed back to default.

A video showing how to customize level layout yourself is here (the process uses Editroid): https://www.youtube.com/watch?v=VnEgGEjZdmE

#New for Version 1.2#
   -Altered the structure and appearance of the transition room between “blue” and “gold” Brinstar (inspiration was taken from Retroid by ProjectXVIII).
   -Altered the appearance of the "blue" statue room in Brinstar.
      *Note: If you prefer the old "grey" Brinstar transition room and "blue" Brinstar statue room, they are still available in the "AlternateLevelDesign" folder (look for a file called "mmm.ips").
   -Altered the structure of the Ridley boss fight room.
   -Modified art for armored Samus, some environment elements (various brick tiles), and some enemies (Zebs and Lava-Dragons).
   -Various bug fixes.
   -Made minor modification to lava animation.
Title: Re: NES Metroid HD Pack
Post by: lexluthermiester on November 25, 2018, 03:01:25 am
Version 1.2 of this hack is now available. Keep in mind that the latest version did modify the .ips file. As a result, older Mesen save states will not carry over from the last pack version (but game saves should carry over).
Downloaded and trying it out. Will let you know how it goes.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on November 28, 2018, 03:47:27 pm
Thanks- If anyone happens to notice a regression feel free to let me know and I'd be happy to look into a fix.
Title: Re: NES Metroid HD Pack
Post by: lexluthermiester on December 03, 2018, 02:46:05 am
This has been a very fun project. No issues yet, and I've been trying to glitch it up. Very cool!
Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 14, 2019, 02:37:03 pm
If anyone is interested in contributing (I would be happy to credit), I have a couple of rough drafts of running and jumping graphics that I feel are improvements over the current state. So far, a working implementation method has eluded me.

For running, three frames are used in the current state. If the ROM can be hacked to accommodate the five shown in the prototype, I feel it would result in a significant improvement. For jumping, the game shares part of the run animation in the bottom-front section of Samus. The bottom-rear is unique to jumping. If the game can be adjusted so that the bottom-front can be separated from running, it would allow for much more creative freedom. The current graphics represent substantial effort to conform to this shared graphic limitation. However, I do think jumping still looks a little awkward. I mentioned my desire for improved running in the past. However, I thought it may be helpful to also show a rough draft this time.

Desired Running Animation:
(https://drive.google.com/uc?export=download&id=1urYpaqoyEl2yn5DwpQChR0SzQeRl0TQI)

Current Running Animation:
(https://drive.google.com/uc?export=download&id=1uzUifre11fDVQwboT7gXh6iA4wR05Eui)

Desired Jumping Graphic:
(https://drive.google.com/uc?export=download&id=1Kyk8oFvpQGYSqslvWQ6LimrIaKkIZhjh)

Current Jumping Graphic:
(https://drive.google.com/uc?export=download&id=1Hkwqpc_gHY07dNhvxOfiJkfO9TREs5DJ)
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on January 15, 2019, 10:39:30 am
Have you tried using conditions to check for bottom-rear sprites to distinguish between jumping and running?
Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 15, 2019, 03:29:50 pm
I haven't. Conditions are used quite a bit in the Metroid: HD pack for inserting backgrounds. However, I am unfamiliar with using them for this particular purpose. In fact, I have been told that conditions can be used to simplify things (like when the same tile is used in multiple areas). However, I didn't discover this until the pack was already mostly finished. As a result, there are many graphics that are duplicated for each area. In short, there are probably many advanced features that could have made life a lot easier.

In any case, I did just check the documentation on Mesen's main website:

https://www.mesen.ca/docs/hdpacks.html#using-conditions

The syntax isn't quite clear to me. Is this something you have done in the past? I am familiar with instructing Mesen to look for a tile or sprite in a specific area. However, do you know the proper command to instruct Mesen to look for a particular tile anywhere on the screen (perhaps using the img index command)? If so, are you also familiar with the proper command to trigger a tile adjacent to the tile meeting the condition to then be transformed into a custom graphic that does not exist else ware in the game (like the front of Samus's feet in a jumping pose)?
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on January 15, 2019, 11:32:55 pm
Check this out:
https://www.mesen.ca/docs/hdpacks.html#lt-condition-gt-tag (https://www.mesen.ca/docs/hdpacks.html#lt-condition-gt-tag)

You can use "spriteNearby" to do that.

I use it in my Double Dragon II title screen test. The "II" is made of sprites and many of them are repeated. I use condition to check the horizontal and vertical distance between a sprite and the unique sprite at the corner of the "II" and uniquely identify each of the repeated sprites. This means I'm not constrained by the repeated sprites when creating the HD version of the "II".

I use "tileNearby" in my Donkey Kong pack. The game use a series of flat tiles with height of 1 to 8 to represent a slop and simply reverse the order of the tiles when the slop changes from going up to going down. With 4X resolution, this will not look smooth so I have 2 HD versions for each of the tiles and use conditions to work out the direction of the slop.

Be aware a "spriteNearby"/"tileNearby" condition involves 2 tiles and both of them must be on screen in order to function. So a large object scrolling into the screen will have problems. You will need to consider the scroll direction and use tiles within the same column if the object scrolls in horizontally or use tiles within the same row if the object scrolls in vertically.

One fun use of "tileNearby" is that you can use it to identify the blank background tiles around a background object and expand the replacement graphics into those blank tiles.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 16, 2019, 11:35:19 am
I examined the Donkey Kong pack - I'm impressed. It seems to use conditions almost exclusively and there are over one thousand of them  :o

For the Metroid pack, I fear it may be difficult to implement conditions based on the player sprite since the player inputs will not be predictable (I'm hoping I'm wrong). I have some notes below that I think may be helpful to reference:

  *Syntax from Mesen's website:
  <condition>[name - text], [conditionType - text], [x value - integer], [y value - integer], [tile data], [palette data - hex]
  <tile>[img index - integer], [tile data], [palette data], [x - integer], [y - integer], [brightness - 0.0 to 1.0], [default tile - Y or N]

  *Tile Information from the game (Power Suit in Brinstar):
  Samus rear jumping tiles that can be referenced: 519,FF161927 or 520,FF161927
  Samus upper and lower leg that needs to change to custom tile when jumping: 546,FF161927 and 562,FF161927

  *Name of custom .png files that can be used to replace front jumping leg: "SamusCustomJumpUpper.png" and "SamusCustomJumpLower.png"

When the Mesen website mentions the "current tile" in the description for "spriteNearby" is that referencing the sprite the player is controlling? If so, I attempted a couple of conditions below. My attempt below is trying to tell Mesen to look for tile 519,FF161927 within 32 pixels of the sprite the player is controlling. If the first condition is met, how would one instruct Mesen to then replace tiles 546,FF161927 and 562,FF161927 with the custom tiles "SamusCustomJumpUpper.png" and "SamusCustomJumpLower.png"? I have an example below. However, it must be incorrect as this command seems to break the pack if it is implemented in the hires.txt file.

*Example WIP:

#Custom Jump
<condition>SamusCustomJump1,spriteNearby,32,32,519,FF161927
<condition>SamusCustomJump2,spriteNearby,-32,-32,519,FF161927
[SamusCustomJump1]<tile>SamusCustomJumpUpper.png,546,FF161927,0,0,1,N
[SamusCustomJump1]<tile>SamusCustomJumpLower.png,562,FF161927,0,0,1,N
[SamusCustomJump2]<tile>SamusCustomJumpUpper.png,546,FF161927,0,0,1,N
[SamusCustomJump2]<tile>SamusCustomJumpLower.png,562,FF161927,0,0,1,N

Also, one more question - Is it possible to have a replacement graphic extend beyond the area of a target tile to be replaced? I just noticed more room than eight pixels is needed in the rear bottom of Samus when jumping to make a good looking graphic. Thanks.
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on January 17, 2019, 11:57:27 am
The current tile is the one that the system is rendering. So lets say the image index of SamusCustomJumpUpper.png is 1 and SamusCustomJumpLower.png is 2, Samus tiles face right in the ROM and 546(B) and 562(D) are the front tiles and 519(A) and 520(C) are the rear jumping tiles in the following arrangement:
AB
CD

<condition>CheckForTileA,spriteNearby,-8,0,519,FF161927
<condition>CheckForTileC,spriteNearby,-8,0,520,FF161927
[CheckForTileA]<tile>1,546,FF161927,0,0,1,N
[CheckForTileC]<tile>2,562,FF161927,0,0,1,N

So when rendering tile 546, the emulator finds the line with condition "CheckForTileA". The condition tells the emulator to check if a sprite 519 is located 8 pixels to the left of tile 546 (the current tile). If the sprite 519 is found then it will use SamusCustomJumpUpper.png

Unfortunately you cannot extend the replacement for sprite tiles, you can only do that for background tiles because the background tiles cover the whole screen but sprite tiles don't.

I use a tool to generate the conditions so they are pretty easy to work with.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 17, 2019, 01:33:38 pm
Thank you for the feedback. I believe I understand. Below are a few screenshots that may be helpful.

Samus Diagram
(https://drive.google.com/uc?export=download&id=1Tw2p9SJVB9lliviYcwdqaZu27czAf2MQ)

Hires.txt Screenshot
(https://drive.google.com/uc?export=download&id=1SG1wZwg_i6jPihEOV7inQ1AiO8aLJy3c)

SamusCustomJumpUpper.png
(https://drive.google.com/uc?export=download&id=1ObKT87kFZQSypjqieuX6dze9MfkxE6GI)

SamusCustomJumpLower.png
(https://drive.google.com/uc?export=download&id=1I8bGBkl9dkBMaUm_b9bzciIdwLuDzT9D)

Using the instructions you provided I created the following condition and placed it at the very end of the hires.txt file. I tried a few different values for the x and y entries.

#Custom Jump
<condition>CheckForTileA,spriteNearby,-8,0,519,FF161927
<condition>CheckForTileC,spriteNearby,-16,-8,520,FF161927
[CheckForTileA]<tile>303,546,FF161927,0,0,1,N
[CheckForTileC]<tile>304,562,FF161927,0,0,1,N

However, it does not seem to have an effect. Perhaps the tile information I have listed is in error? Would 303 and 304 be listed if there were 302 image tags listed before in the hires.txt file?

Also, that is too bad that a replacement tile cannot be larger. That will be a problem. However, if the spriteNearby command is successful, it may be possible to still work around this limitation.

BTW, I'm using Mesen 9.6 to generate tile information as there is a little bug in 9.7 (right clicking currently creates hex values but conditions still only work with numeric tile values).
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on January 17, 2019, 08:44:45 pm
You have to place those lines above the lines for walking, otherwise the lines for walking will have higher priority and always get rendered as those don't need to check for conditions. So basically the emulator will stop looking further down as soon as it finds one that matches the one it is trying to render and in this case it is the walking version.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 18, 2019, 01:11:55 pm
Thank you. Moving the command up between the image tags and tile tags seemed to do the trick. The conditions below look to mostly work (there still does seem to be some type of issue with the "waist" commands.)

<img>SamusPowerJumpFrontHead.png
<img>SamusPowerJumpFrontWaist.png
<img>SamusPowerJumpFrontFeet.png
<img>SamusPowerJumpFrontFeetBlank.png
<img>SamusPowerJumpBackHead.png
<img>SamusPowerJumpBackWaist.png
<img>SamusPowerJumpBackFeet.png
<img>SamusPowerJumpBackFeetBlank.png

#Custom Jump
<condition>SamusPowerJumpFrontHead,spriteNearby,8,16,519,FF161927
<condition>SamusPowerJumpFrontWaist,spriteNearby,8,8,519,FF161927
<condition>SamusPowerJumpFrontFeet,spriteNearby,8,0,519,FF161927
<condition>SamusPowerJumpFrontFeetBlank,spriteNearby,8,-8,519,FF161927
<condition>SamusPowerJumpBackHead,spriteNearby,8,16,520,FF161927
<condition>SamusPowerJumpBackWaist,spriteNearby,8,8,520,FF161927
<condition>SamusPowerJumpBackFeet,spriteNearby,8,0,520,FF161927
<condition>SamusPowerJumpBackFeetBlank,spriteNearby,-8,0,519,FF161927
[SamusPowerJumpFrontHead]<tile>302,512,FF161927,0,0,1,N
[SamusPowerJumpFrontWaist]<tile>303,577,FF161927,0,0,1,N
[SamusPowerJumpFrontFeet]<tile>304,546,FF161927,0,0,1,N
[SamusPowerJumpFrontFeetBlank]<tile>305,562,FF161927,0,0,1,N
[SamusPowerJumpBackHead]<tile>306,513,FF161927,0,0,1,N
[SamusPowerJumpBackWaist]<tile>307,576,FF161927,0,0,1,N
[SamusPowerJumpBackFeet]<tile>308,519,FF161927,0,0,1,N
[SamusPowerJumpBackFeetBlank]<tile>309,520,FF161927,0,0,1,N

Regardless of the "waist" command issues, it still looks like the rule that Mesen cannot insert a replacement graphic larger than the target graphic may be a deal breaking issue for this strategy anyway. Below represents an effort to squeeze Samus into the available player squares.

(https://drive.google.com/uc?export=download&id=1NAr5xkqIcfEI4Jx6Mb_F_mluW2w-LZZz)

In my opinion, crunching the legs into the available space makes the animation look a bit jarring since the sizing is noticeably different. Maybe it's just me, but playing with these changes makes the game feel worse than before. It's like the legs of Samus inexplicably transformed into the legs of a six year old child.
Ideal Jumping Graphic:
(https://drive.google.com/uc?export=download&id=1Kyk8oFvpQGYSqslvWQ6LimrIaKkIZhjh)

Alternatives that come to mind are as follows:

-Hack the ROM to add a new square below the bottom-rear of the player sprite (the front has sufficient space). Then, incorporate the change into the .ips file included in the pack.
-Hack the ROM to simply move the rear foot square (520,FF161927) so that it is now directly underneath Samus rather than out to the side. This would also need to be incorporated into the .ips file.
   *This is not ideal as it would remove some of the customization options available to the player (like playing with 8 bit graphics but 16 bit sound)
-Find some type of workaround using additional conditions in Mesen.
   *As a sidenote, I did attempt changing the x and y coordinates of the very last command in hopes it would move the block. Unfortunately, it seems to move the graphic within the fixed block rather than move the block itself.
-Throw hands up in frustration, walk away, and go out for bubble tea instead.

If anyone has the technical knowledge to pursue any of these alternatives, I would be happy to incorporate into the master pack :) For now, it appears I may be stumped again.
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on January 20, 2019, 10:48:15 am
I think the legs of her jumping pose while aiming up in Super Metroid is more compact. Would that fit?
Title: Re: NES Metroid HD Pack
Post by: SourMesen on January 20, 2019, 09:19:56 pm
As is, I can't think of any way to get this done with conditions alone, unfortunately.
Allowing replacement tiles to be bigger than their original versions, while probably not impossible, would probably be rather tricky to get right (when considering sprite priority, draw order, etc.) and would either be limited to overflowing in a specific direction (e.g right and bottom), or would require additional syntax to specify how the oversized replacement would align itself over the original tile, etc.

With the way the code is right now, it probably wouldn't be simple to implement.  Since the pixel replacement process is done pixel by pixel, rather than tile by tile, it makes it harder to draw outside the bounds of the original tile.

I'll keep it in mind for now, and maybe I'll come up with an easy solution eventually!
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on January 20, 2019, 10:03:45 pm
May be add a pass through OAM before rendering and if a sprite in OAM with matching tile data and palette data is found then add an OAM entry into a separate HD pack OAM with the same priority and flip but with x and y offset from that sprite. When rendering with HD pack, read the HD pack OAM too. The line can be something like this:
<ExSprite>[img index], [tile data], [palette data],


 

Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 21, 2019, 05:35:55 pm
@mkwong98, thanks for the suggestion on Samus looking up. I did check that out. While it helps, I do think it still looks a little odd. I can't quite put my finger on it. Maybe part of the issue is the small number of frames. Since Samus becomes condensed into a small number of tiles so quickly with the "conditions" strategy, the change between running and jumping isn't very smooth. So, the answer may lie in either adding frame animations so that it isn't quite so jarring (or extending beyond the available tiles so that the difference between running and jumping isn't so drastic to begin with).
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on January 23, 2019, 11:19:56 am
I think which leg is the front leg also contributes to the problem. Facing left, the left leg is in front in the frames before the desired frame and it is the right leg in the desired frame. The animation may look less odd if the frames have the same leg in front.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 24, 2019, 03:56:30 pm
That is a good observation. I will try to fiddle with it a bit and see if adjusting that helps.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on January 31, 2019, 04:11:37 pm
**Update**

I have a new art example below and I am making efforts to implement it in the game. I did notice an obvious problem with the mid-section. However, I received some advice from mkwong98 that may allow me to overcome this limitation. I hope to have a working prototype soon.

Desired jump art:
(https://drive.google.com/uc?export=download&id=1m9w9jCvKc_1g53a5XqkVZ1ipyNhsrFgY)

Current in-game rendering of jump art (failure for now):
(https://drive.google.com/uc?export=download&id=1wOR2L7vl32KkwMJuMvmzL6zJSddD-dT5)
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 10, 2019, 12:38:23 am
**Update #2**

I inserted a little over 5,000 new condition lines in the hires.txt file, and now have a working prototype for jumping that I believe is less awkward looking - Thank you mkwong98!

I think it is very close. But, I have hopes that one aspect of the new animation can be still be improved.

When jumping, the game briefly flashes one frame that happens to be shared with the running animation before it shows the new jump art that has been created. Before, this was not a big deal as the shared frame shown was very similar to the frame that followed shortly after. Samus is shown with the rear leg facing outward. However, this shared frame is now more noticeable because it is so different from the new art that has been created. I was hoping I could replace this intermediary frame using the same "spriteNearby" method mentioned by mkwong98. However, there appears to be no unique tiles in this intermediary frame. Perhaps there is another solution using memoryChecks? I am open to ideas. I think it could still look acceptable if the intermediary frame shares a frame with running. However, it would probably look better to use the frame where the legs of Samus are closer together. Illustrations are available below.

(https://drive.google.com/uc?export=download&id=1tmJsyzWgYHIGGzbsNNoc8p7miY--J0ef)

(https://drive.google.com/uc?export=download&id=1LcA8XoxkfGNHK0aUOP-hz9pPWoJsiIDX)

**WIP Pack removed**
Title: Re: NES Metroid HD Pack
Post by: darthvaderx on February 11, 2019, 10:13:50 pm
The Brinstar theme track included in the WIP HD pack is worse than the 1.2 version (just in my opinion).
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on February 12, 2019, 05:52:32 am
Good work! I'm surprised by the number of conditions required to change that animation.  :o
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 12, 2019, 09:13:16 am
@darthvaderx - Thanks for the honest feedback. You may be surprised to learn I'm actually a little relieved to hear that. I had a few requests for music that was a little more 16-bit-esque for that area. I think the new version fits that criteria. But, after listening to it a few more times, I don't think the trade off is worth it in this case. I experimented and went back and forth a few times. I changed the default music back to what was in place before and I updated the WIP pack. I'll still include the 16-bit-esque version. But, I think it will be best to keep it in the "AlternateArtAndMusic" folder instead. I'll also make sure to do this when the stable version of 1.3 is released as well.

@mkwong98 - I was also surprised at the number of conditions (thanks again for your assistance by the way). One was needed for every tile, every suit, every color (missiles on/off plus blue), every area, and every aiming direction. The combinations added up quickly. There may have been a better way to have done it, but it works. Thankfully, Microsoft Excel and the "find/replace" function in Notepad helped keep things relatively manageable.
Title: Re: NES Metroid HD Pack
Post by: Mugi on February 12, 2019, 09:43:16 am
for your issue with replacing the last missing frame, i would propably approach this by trying to look for a "jump" byte that shows whether or not samus is jumping, and condition the sprite change based on that in order to only have it happen during jumps..

i share your pain with the stuff... i conditioned all the 8 robot suits to change color in shatterhand.... it was a number of conditions i really did not want to write lol.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 12, 2019, 08:41:04 pm
@Mugi - Thanks for your thoughts on the "jump" byte strategy. It seems like a reasonable solution to pursue. But, I must admit I am not quite sure how to execute. Creating conditions based on tiles hasn't been too bad as the PPU viewer in Mesen clearly shows tile information when right clicking and navigating to "copy tile (HD Pack Format)".

However, it sounds like this would be a little different. Do you believe the strategy you mentioned would require a memoryCheck function? If so, do you think you could point me in the right direction? Do you think the event viewer in Mesen the best place to start searching for a usable "jump" byte?

BTW, I checked out your Shatterhand pack and I really like what's done so far. The note in your hires.txt file that said the following made me smile:

"conditionals for stage select screen, caution! might be dangerous to mental sanity, do not edit"
Title: Re: NES Metroid HD Pack
Post by: kya on February 13, 2019, 12:46:01 am
I've had some spare time lately, so I've decided to check out Samus running animation.
The result is here:

https://yadi.sk/d/CgBByv-y0vrXqw

Just unzip it over your 1.2 version pack.
Note that your mmm.ips and hires.txt will be overwritten.
The animation itself is quite badly scaled, but it's just a template for you to work on (if you choose to).
There are some other glitches to it:
1) Samus "backfacing" elbow does not get rendered. Unfortunately, there's no placeholder for it, so it should be removed from the png frames.
2) When running and shooting occasionally Samus torso gets shifted. This may be corrected by shifting all running frames 4 pixels left (revealing  parts of the hidden elbow),
but that removes a toe of Samus "front" leg.
3) samus-leg-**.png frames do not stitch well to her shooting and "up-shooting" trunk.
 
The animation is done for only one initial suit. If you find it acceptable, you may add condtions for the other suits by changing palettes in the <tile> tags.
 
I've also replaced the "prejumping" frame in mmm.ips, as you have requested,
although I'm not sure your changes to jumping will merge well with the attached code.

Note that after applying the mmm.ips the original Samus animation is totally broken, do not attempt to run the patched game without the HD Pack.

Check out the "SamusNotJumping" condition in hires.txt, maybe it will help you with your work on jumping.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 13, 2019, 12:22:24 pm
@kya thank you once again! Your skills continually impress me. You were able to add frames AND fix the jumping issue that just recently came up!

After changing a few numbers in your hires.txt file, I was able to merge your conditions with the most recent version. The only thing it didn't seem to play nice with was some previously made level layout changes since version 1.2. But, I am going to attempt something that may still allow everything to work together (fingers crossed).

In any case, below is a quick illustration. It seems your changes allow for 10 frames. But, I think 5 may be a sufficient improvement since the most recent stable version only uses 3. For the illustration below, I simply used the 5 I had on hand and inserted them twice so it added up to the 10 you have coded in the hires.txt file.

The only question I have at the moment is - can the sound of the footsteps be changed so that they occur at a slower rate (or can the run frames increase in speed)? When looking at the running animation, it seems like it is not quite in sync with the sound of footsteps. If not, I suppose I could delete the footstep sound entirely as it is relatively subtle (although, that would not be ideal).

before:
(https://drive.google.com/uc?export=download&id=1rOh6StqLrWtunhyu3y5REqjknT7jsfm7)

now:
(https://drive.google.com/uc?export=download&id=1qH-N2gGTEQ8YsVAKGA1_PtVINUQ5n5h6)

gameplay:
(https://drive.google.com/uc?export=download&id=19ZykUPW-Oa2vbHb5r86SVaalnFVho6qi)
Title: Re: NES Metroid HD Pack
Post by: kya on February 14, 2019, 05:56:32 am
The animation rate and the number of frames are now controlled entirely by hires.txt. You may make as many frames as you wish and set their rate.
An example is attached below:
https://yadi.sk/d/V5nkHKuyLsvmqA

There you have 5 different frames. Each frame is being displayed for a period of 5 video fields:
<condition>frame3,frameRange,25,20
<condition>frame2,frameRange,25,15
<condition>frame1,frameRange,25,10
<condition>frame0,frameRange,25,5

If you want to make the running animation faster, you change the numbers. For example to make each frame last 4 video fields, you write:
<condition>frame3,frameRange,20,16
<condition>frame2,frameRange,20,12
<condition>frame1,frameRange,20,8
<condition>frame0,frameRange,20,4
In the above example the entire animation cycle of 5 frames will last for 4*5 = 20 video fields.

You may make Samus run even faster like this:
<condition>frame3,frameRange,15,12
<condition>frame2,frameRange,15,9
<condition>frame1,frameRange,15,6
<condition>frame0,frameRange,15,3
But to my taste this is ridiculously fast.

I have not tried it yet, but I think I'm able to modify the footstep sound rate via mmm.ips
You may set up the desired animation rate via hires.txt, and then I'll try to adjust the sound.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 14, 2019, 08:42:56 pm
@kya - Excellent - I tried a couple of different speeds and the option with 5 video fields seems right (the first one you mentioned). If the footsteps can match I think we might have a winner.

BTW - looking over your work that resulted in the final solution for running was very interesting. I was surprised to see you modified the .ips file so that the game running in the background would freeze the running animation entirely (so that Mesen could do all the work with running frames via the HD pack). But, it does make sense as you seem to have frozen the frame with the most tiles available to edit (allowing for maximum creative freedom) - very resourceful.

It will take some time to create frames and duplicate the conditions for all of the different suits and areas - so it may be a while before everything is complete. But, this is promising and I am very optimistic. Thanks again.
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on February 14, 2019, 10:27:44 pm
Good job! :thumbsup: This is a very interesting way of doing it.

Currently you cannot match the footsteps because you have no control of which frame of the running animation is being shown first. I posted a feature request to Mesen for an advance of version of frameRange which can start and reset with conditions but I'm not sure how difficult it is for Sour to implement.
Title: Re: NES Metroid HD Pack
Post by: Shade Aurion on February 15, 2019, 01:52:14 am
This is coming along nicely! This will be one of the greats guys. I can't wait to see it completed <3
Even what is available now is amazing but the potential for the future, especially after seeing that running animation is very promising
Title: Re: NES Metroid HD Pack
Post by: kya on February 15, 2019, 03:33:05 am
To adjust footsteps delay while running Mesen, invoke its memory viewer (Ctrl-M). Go (Ctrl-G) to adress CD33. The default delay value is 09. Change it to the value you like. Then invoke Mesen debugger (Ctrl-D), choose menu item File->Save ROM as...
Extract the new ips patch using Lunar IPS "Create IPS patch" button.
Do not forget that the value is in hexadecimal, so 09+1=0A, 09+2=0B, ..., 09+6=0F, 09+7=10.
By the way, to my taste 10 is good enough, about twice as sparse as the original.

As for the frame I've chosen to freeze - all the three running frames hold enough bytes to define the new animation.
That exact frame wasn't used anywhere except running, so it was the least invasive.

Concerning the resettable frame counter, there is a problem to it. Imagine two red skeletons in Castlevania. They have a two frame collapsing animation. I want to replace it with four frames. I hit one skeleton, he starts to collapse, the frame counter gets reset and starts counting. While the first skeleton is collapsing, I hit the second skeleton. The frame counter resets again. First skeleton's collapsing animation starts from the beginning, which is not what I want. Ideally there should be multiple frame counters. But even in that case I do not know, how to tie a specific counter to a specific skeleton.
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on February 15, 2019, 05:13:56 am
Concerning the resettable frame counter, there is a problem to it. Imagine two red skeletons in Castlevania. They have a two frame collapsing animation. I want to replace it with four frames. I hit one skeleton, he starts to collapse, the frame counter gets reset and starts counting. While the first skeleton is collapsing, I hit the second skeleton. The frame counter resets again. First skeleton's collapsing animation starts from the beginning, which is not what I want. Ideally there should be multiple frame counters. But even in that case I do not know, how to tie a specific counter to a specific skeleton.
You are right, it only works for animations which do not have multiple instances on screen at the same time.
Title: Re: NES Metroid HD Pack
Post by: Mugi on February 15, 2019, 10:32:59 am
@Mugi - Thanks for your thoughts on the "jump" byte strategy. It seems like a reasonable solution to pursue. But, I must admit I am not quite sure how to execute. Creating conditions based on tiles hasn't been too bad as the PPU viewer in Mesen clearly shows tile information when right clicking and navigating to "copy tile (HD Pack Format)".

However, it sounds like this would be a little different. Do you believe the strategy you mentioned would require a memoryCheck function? If so, do you think you could point me in the right direction? Do you think the event viewer in Mesen the best place to start searching for a usable "jump" byte?

BTW, I checked out your Shatterhand pack and I really like what's done so far. The note in your hires.txt file that said the following made me smile:

"conditionals for stage select screen, caution! might be dangerous to mental sanity, do not edit"

yeah as you can see from my shatterhand project, i use a lot of memorycheck and memorycheckconstant in it to do things based on set bits.
depending on what you're doing it can be an extrmely effective way to condition stuff, but it seems that you solved your issue already so i guess all is good. :P

and yeah, there's some whitty remarks in that file. as you see i have completely written it by hand instead of using a template spit out by mesen, so it's been a long series of typing conditions @.@

the stage selection conditions comment is there for a reason, if you read through that, you'll see why i left it there.
Title: Re: NES Metroid HD Pack
Post by: SourMesen on February 19, 2019, 10:39:19 am
Whoops, haven't been following this thread as much as I should have been.
I'm amazed at how good the animation looks now!

.. I'm also amazed that Mesen doesn't die from having that many conditions setup :p

If you've noticed patterns that often get repeated in terms of conditions that could be reduced by some additional HD Pack functionality, let me know and I'll see what I can do (or if there's anything else related to HD packs, really)
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 19, 2019, 03:46:08 pm
@SourMesen - good to hear from you, and thank you for the kind words on the animation. So far, the hires.txt file for Metroid: HD contains 29,873 lines of code (and counting) and it hasn't broken yet.... Knock on wood.

The Power Suit and Varia Suit are done and the "Zero Suits" are next to be done. I'm sure I could be more concise in the way I'm laying the conditions out, and there may be some unneeded ones in there too, but it seems to be working.

I did notice one issue that can be seen in the picture below. When obtaining items, the original graphics that are replaced by the HD pack still cast a "shadow" over the items. It seems to occur in many areas where graphics overlap (this also occurs when the player enters the area of the HUD). It's not a huge deal, but it is noticeable. I'm not sure if this could be addressed with conditions or if an adjustment would need to be made with Mesen. Aside from that, I am surprised how well the emulator is handling everything.

(https://drive.google.com/uc?export=download&id=1PeT9pW2Sx98f-ydZQ-N51XiDzv5S-PD8)
Title: Re: NES Metroid HD Pack
Post by: Mugi on February 20, 2019, 06:25:34 am
It's so nice to see that "the man" himself is interested enough to follow this stuff up.
I have to say that i was expecting mesen to choke on the hires.txt much earlier than it does too.
although the bottleneck you fixed from mesen during one of our conversations in the github issues seemed to greatly help on this matter too.

as far as this particular project goes, im greatly interested of exactly how large this thing grows to be at the end (it's already double the size of mine lol.)

as for the shadow, i have to say i have no idea how metroid works, but from the looks of that picture alone, it looks like it's just drawing a black sprite there maybe.
try making it do that while you're recording a hdpack and see if it captures a new sprite. (this kind of stuff is why i requested the feature of keeping HDpack active during HDpack recording to begin with, i hunted some random hard to trigger sprites for an eternity in shatterhand.)
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 21, 2019, 02:52:26 pm
@Mugi- I tried re-recording sprites and it didn't seem to affect anything unfortunately. It's kind of odd as the shadow moves with the player and only shows up in some areas.

Moving over the HUD makes it a little easier to see. It's a silhouette of what the player sprite looks like before applying the pack. I believe this has been how the pack has behaved from the beginning. However, it was less noticeable before because the "HD" legs fairly closely matched the leg position of the original. However, since the jumping animation is drastically different from the original now, the "silhouette" effect that occurs on items and in the HUD is more noticeable.

This is just a shot in the dark, but perhaps it has something to do with how Mesen handles background/foreground priority.
Title: Re: NES Metroid HD Pack
Post by: Mugi on February 21, 2019, 03:22:13 pm
does your new texture have transparent area where the black leg appears or how does that work.

if it's not a sprite, the other thing that came to my mind is the whole sprite contour thing.
in my shatterhand pack, i masked the stage selection screen stuff into transparent tiles, and the new ones are drawn into the background,
but i had to turn off the sprite contours from the hires.txt for this to work because the transparent tiles were drawing garbage over the background
graphic.

if you dont have that enabled, try it out and see if that improves anything.

just throw a
<options>disableContours
to the beginning of the file
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 21, 2019, 04:01:32 pm
Thanks for the idea. Yes - the pack contains tiles are transparent where the black leg is showing (or anywhere other parts of the silhouette show depending on where the player is positioned). I did give the contours option a shot and it seems to be the same. Must be something else causing the silhouette....

As a sidenote, I just tried it out on Mesen rev 0.9.5 (I removed the background conditions first) based on a hunch that somehow implementing the custom backgrounds caused the issue. Unfortunately, it looks like that rev without custom backgrounds has the silhouette as well. So, dead end there too...
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on February 21, 2019, 10:14:03 pm
Did you check the PPU viewer for a black sprite? Also you can change the shape of the leg by adding/removing a few pixels in the rom to see if the black leg changes too. If it changes and you don't find any black sprite then it is a bug with the emulator.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 22, 2019, 10:15:49 am
@mkwong98, thanks for the idea. The .ips file has been modified to do exactly what you suggested and it seemed to do the trick.

Up until recently, I wanted to ensure the base graphics remained unchanged so that it would be relatively easy for users to implement 8-bit graphics with custom music if they wanted (just delete a few conditions). But, since the latest running solution breaks the 8-bit graphics anyway, I just realized it's now a moot point.

To make 8-bit graphics with custom music still relatively easy to implement, the best alternative may be to simply include a pre-compiled "8-bit" zip file in the download. This shouldn't be too difficult. It'll be added to the "to-do" list after "zero suit" running graphics are finished.
Title: Re: NES Metroid HD Pack
Post by: SourMesen on February 24, 2019, 12:39:20 pm
Sorry for the late reply (been rather engrossed in a "little" side project that has been taking every single minute of my spare time for the past 2 weeks :p)

Am I understanding properly that the black leg showing up is likely a bug in the replacement logic?  e.g making the original leg transparent in the ROM makes the leg go away in the HD version? If so, I'll add it to my list of things to check before the next release (I was originally planning on releasing 0.9.8 a couple of weeks ago, but got sidetracked by said side project, might be a few more weeks before I get around to releasing it, so I can investigate this before doing that)
Title: Re: NES Metroid HD Pack
Post by: Aclectico on February 24, 2019, 02:09:37 pm
@SourMesen, I'm still not sure if it should be considered an emulator bug or a quirk in how Metroid renders certain elements (such as items and the HUD). In any case, you are correct that the black leg shows up until the .ips file is modified so that the original leg is completely transparent. For this pack, it's not a huge deal as the .ips workaround is sufficient to generate satisfactory results. With that said, I'm not sure if other games are affected or if other HD pack authors would be interested in a fix. If you do plan to investigate, you may find the WIP pack down below useful (just run to the left after starting and it's noticeable right away with the morph ball).

WIP Pack 2_24_19: http://bit.ly/MetroidHDWIP02_24_19

Looking forward to the upcoming release of Mesen 0.9.8 :)
Title: Re: NES Metroid HD Pack
Post by: mkwong98 on February 26, 2019, 10:00:50 pm
I have a look at Mesen and I think the problem happens when sprites overlap and they have different background priority. When that happens Mesen will render that area by rendering sprites with background priority first, then render the background tile and finally render sprites with higher render priority. However these priority checks use the original ROM pixel instead of the HD replacement. In this game, the leg has background priority and has higher render priority than the item sprite. So Mesen renders the leg first, which is transparent in the HD replacement but Mesen looks at the original ROM pixel and thinks it is solid. Then it renders the background tile, which is also transparent, and finally Mesen finds that the item sprite has lower render priority than the leg and does not render it, because it thinks the higher render priority leg sprite is already rendered there. So Mesen does not render anything and leaves a leg shape void.
Title: Re: NES Metroid HD Pack
Post by: kya on March 12, 2019, 07:21:41 am
Fortunately, Metroid minimap hack author (snarfblam) has included a thoroughly commented source code into the zip. This allowed me to fulfill Aclectico's request and turn this static minimap into an automap*. The IPS patch is here (just replace the one in the HD Pack with this one):

https://yadi.sk/d/FSoNCmLDEJT2Tw

The code is ugly and scarcely tested. You are welcome to report bugs.

-----
*I haven't had this specific kind of fun since mid 90s, when I made resident DOS map viewers for Eye of The Beholder I and II.
Title: Re: NES Metroid HD Pack
Post by: Aclectico on March 12, 2019, 02:45:52 pm
Excellent - This is great because this type of map won't spoil the entire game for new users. But, it will keep track of where players have been. It shouldn't be too difficult to merge this with the master. Thank you!

As far as an update goes - alternate graphics are currently in process (the main game is now complete with all new running animations - but not yet fully bug tested).

Adding frames to the running animation caused a bit of a domino effect as it required many updates in other areas (but, I think it will be worth it). Since the new running method does make adding custom graphics more cumbersome, the current plan to make up for that shortcoming is to include zip files in the download that are pre-assembled with alternate graphics. All a player will have to do is delete the current pack and install a different zip file. It will take quite a bit of time to implement this. But - it should make things much easier for users to take advantage of alternate templated graphics. At this time, I am thinking two or three different packs to choose from that relate to the appearance of Samus. We will see...