News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Other: Castlevania 30th anniversary  (Read 31299 times)

nesrocks

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #60 on: May 22, 2017, 02:05:38 pm »
I had no idea about the mesen emulator and I'm sorry to hear there wasn't much interest on it. I'll be testing it asap!

bogaabogaa

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #61 on: May 22, 2017, 03:06:41 pm »
Hey macbee I did test your HDNES a little bit and I have to say you really had some neat ideas! Thanks for all the work you put into. The emulator feels unfinished and the community around it is dead  :'( (could not even find any  HDnes pack!) I was just toying with it to see how it works.

When people say horrible it is mostly a bad definition about what could be improved.
I am very new in this community and I have trouble finding the right guides ones in a while. Sometimes I do thing the most tedious way and I know there are different ways but could not make them work. Thats why I get grumpy very quick sometimes. But this not related to this Nestopia or HDNES. This is related to Romhacking.

About Tools:
When I do work on a tile-set I use Gimp. Use a 8x8 grid and make it snapping. Gimp does not allow a fast workflow with the tools I know. And when I work on a Tile-set I was always wishing for better tools.

Is there a  tool that enhances grid as a tile-layer-editor? May be with futures like: right click copy tile and left click past tile. Indexing tiles!! You could dump your tile-set you wish to edit save the tile-map. Then rearrange it edit/paint it to your likening and when loading the original tile-map it would be ready to be dumped back.

Guess how many hour I spend already arranging tiles.. and I am not the best puzzler..

« Last Edit: May 22, 2017, 03:12:31 pm by bogaabogaa »

nesrocks

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #62 on: May 22, 2017, 03:13:22 pm »
HDNes wasn't made by macbee, it was done by mkwong98.
For me HDNes is difficult to work with because it is slow, it sometimes crashes, the interface doesn't feel organized, etc...

For working with tiles I recommend pyxel edit. It is cheap, but it isn't free.

bogaabogaa

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #63 on: May 22, 2017, 03:29:50 pm »
MacBee said "I could never make it work properly" misinterpret that.. haha
I had crashes too. The sound emulation is bad and as I said it feels unfinished. It is on Git-hub but a one man project by mkwong98 and abandon since 2 years.

Thanks for the info   

SourMesen

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #64 on: May 22, 2017, 03:53:54 pm »
I spent some time working on dumping tiles over the weekend, but haven't really figured out the best way to do this yet.
Would it just make the most sense to keep the ordering identical to the original game's CHR tables and just generate a different picture for each palette?
That's what I'm doing at the moment (after having tried some other more complex solutions that didn't really work out too well).
e.g you play through a game normally, and Mesen will just record and save every combination of tile+palette used, with each different palette is saved in a separate file (Unused CHR tiles for a given palette combination are left blank)

Here's an example of what that gives playing CV3 & DD each for a few minutes: link
The PNG files could of course be rendered at any given scale, this is 1x.
I know nothing about graphic editing - would PNGs like these be usable? Would it be too hard to figure out what a tile is used for? Would you need to reorder the tiles in the PNGs to be able to work with them efficiently? Changing the PNG's layout means you'd have to change the tileset definition file as well (which would be pretty hard to do manually without some sort of tool)

For CHR RAM games, another approach to dumping the tiles would be needed since the tiles do not have a predetermined order.

To SourMesen:
Taking the opportunity I would like to say, I am fascinated with your emulator. You've done an impressive amount of work in an impressive amount of time! I would really love to see the tools for tileset generation in Mesen, and not without a reason. I have a set of 2x upscaled tiles for Castlevania from chinese complete edition mobile version. Personally I don't like the way the enemies were redrawn, but tastes differ, and it will be a pity if the tiles will remain unused.
I'd like to make a few requests, though.
1. Could you dump the tiles upscaled with some filter?
2. Could you implement a tile substitution mechanism somehow? The reason is that Castlevania often uses the same tiles for absolutely different objects (for example, the statue and the wall in stage 1; the moon and the Clock Tower in the final stage). In my hack I was checking if a certain tile gets displayed to trigger the substitution.
Thanks!
1) For filters, do you mean things like xBRZ and the like?  It'd be possible, but I'm unsure how well those would work at a tile-by-tile level, since the tiles around a given tile normally affect the borders of the tile when applying the filter to the entire screen at once.
2) Do you mean Castlevania reuses the exact same tile with the exact same palette colors, but in a different object?  If so, it'd be possible to have some way to specify conditions (e.g based on surrounding tiles) - but there is currently no way to do anything like this (afaik) with HDNes' format.  Maybe it would be better to create another format or alter the current one.

Dumping capability in Mesen would be awesome, Sour. Echoing what nesrocks said, I've tried HDNES but not had... any luck at all with it.
I'd love to see kya's work here converted for use in Mesen. One of the first things I'd like to try myself is backporting some of Megaman The Wily Wars graphics to MM1-3 and 16-bit-ifying 4-6.
Yea, I took another look at HDNes a couple of days ago, and I'm not sure I really understand what most of the buttons are supposed to do in the tileset editor
Converting this tileset to Mesen would be nice (still need to add CHR RAM support for that to be possible), but it'd probably involve redoing a lot of image editing work.
And HD Megamans sounds pretty nice.

bogaabogaa

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #65 on: May 22, 2017, 08:05:49 pm »
Hey SourMesen here a badly made test sprite of your test CV3 test48.png. I could not get it to work http://imgur.com/LPcdIAz

Sure you could use this generated PNG files. But they are not optimal to work with. To answer your question. If you played the game a bit you may recognize the tiles most likely.
The arrangement is still tedious to work with. You can get around that if you know how to use tile editors properly  :happy: But most just don't

Some ideas and thought I had

If you would work with romhacking tools you get much better dump results. If you open the rom with tools like tilemolester or tilelayer pro you can view graphics very nicely (with a 16 tile wide screen). For sprites you like to have it 2-4 tiles wide and interleaved in case of CV3. (depends on arrangement) Here some examples: https://tinyurl.com/lnjmyjm

I wonder if it would be easier to dump the tiles as they are in the rom into a PNG. May be you could generate a table file with the right addressing to the PNG-tiles. When the addressing would look the same as in the rom.. Most-likely it won't work like that anyway.. but I post the idea. May be there is a way to do it like that. Not sure how good the idea is though

- You would be sure that you got everything and there would be no playing and dumping needed.
- Your HD file would be more compact

 

SourMesen

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #66 on: May 22, 2017, 08:22:49 pm »
If you would work with romhacking tools you get much better dump results. If you open the rom with tools like tilemolester or tilelayer pro you can view graphics very nicely (with a 16 tile wide screen). For sprites you like to have it 2-4 tiles wide and interleaved in case of CV3. (depends on arrangement) Here some examples: https://tinyurl.com/lnjmyjm
These tools essentially display the same thing as far as I can tell - it's just a matter of the number of columns used.  I guess an option to split sprite/background into 2 separate PNGs and an option to select the number of columns to use would be good? That way you could technically try a few different combinations and see what makes the most sense for a given game.

Quote from: bogaabogaa
I wonder if it would be easier to dump the tiles as they are in the rom into a PNG. May be you could generate a table file with the right addressing to the PNG-tiles. When the addressing would look the same as in the rom.
This isn't possible on the NES - the palette for the tiles is not stored in the tiles themselves, it's up to the game's code to set the right palette to be used for each tile.  So there is no way to know which palettes would be used for which tiles without playing through the game.

Quote from: bogaabogaa
Your HD file would be more compact
No matter the solution used, it should be easy to have a "minify" tool that would rebuild the PNG files to remove all unused blank spaces, to reduce the HD pack's total size before distribution.

nesrocks

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #67 on: May 22, 2017, 08:30:16 pm »
This isn't possible on the NES - the palette for the tiles is not stored in the tiles themselves, it's up to the game's code to set the right palette to be used for each tile.  So there is no way to know which palettes would be used for which tiles without playing through the game.
The other way around could be done then. Use a 4 color PNG that is compatible with how the nes handles colors, but this would be only for HD graphics, not for extra colors...

bogaabogaa

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #68 on: May 23, 2017, 02:35:38 am »
My ideas that I trow in would be a totally different attempt to do this. Lot's of extra work. Mesen is right you get basically something worse since you don't have palettes. I think it is not worth to have the sprites displaying in tow columns format. It may not display right most of the time anyway and it could get in the way when you have sprites of a remake that would fit over otherwise!
« Last Edit: May 23, 2017, 02:55:42 am by bogaabogaa »

kya

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #69 on: May 23, 2017, 03:17:16 am »
Quote
1) For filters, do you mean things like xBRZ and the like?  It'd be possible, but I'm unsure how well those would work at a tile-by-tile level, since the tiles around a given tile normally affect the
borders of the tile when applying the filter to the entire screen at once.

Let the tiles have stitches, no problem. They will be just templates to edit.

Quote
2) Do you mean Castlevania reuses the exact same tile with the exact same palette colors, but in a different object?

Exactly.

Quote
If so, it'd be possible to have some way to specify conditions (e.g based on surrounding tiles)

That would be great! Nametable replacements on the fly. If a certain character sequence is detected in a nametable, replace it with another one.
Or even a wilder dream - if a certain rectangle of characters is detected, replace it with another one.

And another condition for sprites - if a certain trigger sprite is already rendered (visible to the top and to the left of the current), replace current sprite with another one.

Quote
- but there is currently no way to do anything like this (afaik) with HDNes' format.  Maybe it would be better to create another format or alter the current one.

The most convinient for me would be a plain text file where original and replacement rectangles are separated by empty lines.
For example, to replace a 2x2 circle made from a tile 255 with a rectangle I do this:
00FFFF00
FF0000FF
FF0000FF
00FFFF00

FFFFFFFF
FF0000FF
FF0000FF
FFFFFFFF

Quote
I spent some time working on dumping tiles over the weekend, but haven't really figured out the best way to do this yet.
Would it just make the most sense to keep the ordering identical to the original game's CHR tables and just generate a different picture for each palette?

Now someone wake me up! I'm dreaming about how I would like to see the dumping tool made (the major expansion of what I did to that FCEUX).

I play the game with a PPU Viewer window active. The emulator displays both PPU banks (three banks in case of MMC5 8x16 sprites) scaled up using the current scaler. Every tile gets displayed in a palette last used for its rendering (that's what my modified FCEUX does). I may override this setting and use a fixed palette for a bank. I may specify 8x8 or 8x16 layout for each bank. There is a dump button in a PPU Viewer window. Every time I press it, a dump of all the banks is made using the current settings for each bank (8x8 or 8x16, dynamic or fixed palette) and the scaler.

This leaves the question - how to do the replacement for CHR-RAM games. I don't know how it was done (or supposed to be done) in HDNES. In my hack I'm simply checking the contents of the original tile (the address in a PPU, the character and the attrubute bits). Maybe it is better (albeit somewhat slower), to check the actual NES colors of an original tile. This way it will be possible to support fade in/fade out and color emphasizing effects.


« Last Edit: May 23, 2017, 04:14:10 am by kya »

SourMesen

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #70 on: May 23, 2017, 07:55:38 pm »
Use a 4 color PNG that is compatible with how the nes handles colors, but this would be only for HD graphics, not for extra colors...
4-color graphics at 4x scale will still look pretty bad in most cases, imo (especially since 1 of the 4 colors is the background color and shared across the entire screen) - there's only so much you can do with more pixels when you're so limited by the colors you can use.

Or even a wilder dream - if a certain rectangle of characters is detected, replace it with another one.
Allowing for user-defined shapes like that would be pretty complex, and slow.  Just being able to add a condition based on adjacent tile(s) (up/down/left/right) should be good enough for most cases, shouldn't it?
In the first place, reusing the same tile with the exact same palette in 2 different objects is probably not something that is excessively frequent, I'd imagine..

I play the game with a PPU Viewer window active. The emulator displays both PPU banks (three banks in case of MMC5 8x16 sprites) scaled up using the current scaler. Every tile gets displayed in a palette last used for its rendering (that's what my modified FCEUX does). I may override this setting and use a fixed palette for a bank. I may specify 8x8 or 8x16 layout for each bank. There is a dump button in a PPU Viewer window. Every time I press it, a dump of all the banks is made using the current settings for each bank (8x8 or 8x16, dynamic or fixed palette) and the scaler.
Is there a benefit to doing all of this manually vs having it done automatically for you, though?  What I've been slowly implementing essentially does all of this for you, and while excluding all the unused tile+palette combinations. Doing it manually means you might miss some tiles, or end up wasting time creating tiles in HD using a palette that is not ever used in the actual game.  This is especially true for CHR ROM games.  For CHR RAM, how to present the tiles in the PNG files might be a bit more complex, though - so having a manual way to do this might make more sense (but I'd still prefer an automatic approach if I can think up one that works well for most CHR RAM games).

This leaves the question - how to do the replacement for CHR-RAM games. I don't know how it was done (or supposed to be done) in HDNES.
I'm fairly certain HDNes just compares the original tile's 16 bytes to the data stored in the HD pack definition file (it contains all 16 bytes in decimal format for CHR RAM games, I believe).  It just compares those 16 bytes on the fly and checks if a matching tile exists - essentially the same as checking the tile number in CHR ROM games, except instead of having a 4-byte key (the tile number), you end up with a 16-byte one (the tile itself)

mkwong98

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #71 on: May 24, 2017, 12:39:18 pm »
Good work! I'm happy to see someone interested in HD Packs.

kya

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #72 on: May 24, 2017, 03:39:42 pm »
to SourMesen:

Quote
Just being able to add a condition based on adjacent tile(s) (up/down/left/right) should be good enough for most cases, shouldn't it?

Yes. Such a condition would allow me to do all the necessary tile replacements, except one: in stages 16 (a bridge guarded by bats) and 17 (clock tower) NES uses the same tile for bricks. Mobile phone version uses different tiles. I was able to reproduce the mobile version behavior in my patch, because my condition is "meet a trigger tile at least once, and all the tiles until the end of the frame will be taken from an alternate tileset". But it is perfectly acceptable to use the same set of bricks for both stages.

Quote
In the first place, reusing the same tile with the exact same palette in 2 different objects is probably not something that is excessively frequent, I'd imagine..

Even once is enough. Meet such a tile (for example a brick in the center of the moon), and the expirience will be flawed.

Quote
Is there a benefit to doing all of this manually vs having it done automatically for you, though?
...
For CHR RAM, how to present the tiles in the PNG files might be a bit more complex

That is why I ask to do a dump manually - I'd like to be able to choose the arrangement. 8x16 presentation is better for 8x16 sprites, and 8x8 - for bg tiles and 8x8 sprites.
And I'd prefer all the tiles from a PPU viewer window to go into one PNG. But that's just me. Others may have other preferences.

Quote
HDNes just compares the original tile's 16 bytes to the data stored in the HD pack definition file (it contains all 16 bytes in decimal format for CHR RAM games, I believe)
Does it check the palette? Can one tile with different palettes be replaced with different tiles?

to mkwong98:

Greetings! Glad to see a person, who pioneered the tile replacement in a NES emulator.

mkwong98

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #73 on: May 25, 2017, 10:28:44 am »
Does it check the palette? Can one tile with different palettes be replaced with different tiles?
Yes, it does. You can supply different tiles for different palettes and select one of them as the default.

bogaabogaa

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #74 on: May 25, 2017, 06:34:03 pm »
I am happy to try a new mesen emulator when it is out. The last thing I tried was to put the dumped PNG folder into my mesen ../HdPacks directory. I know it is build for HDNes :D
And I don't know much about HDnes Packs in general. It would be awesome to see this up-scaled CV3 sprites in action that i got. Let me know when there is stuff to beta-test. I am a fan of the automated dumping. It saves time and may be errors of missing stuff.

SourMesen

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #75 on: May 25, 2017, 11:01:43 pm »
That is why I ask to do a dump manually - I'd like to be able to choose the arrangement. 8x16 presentation is better for 8x16 sprites, and 8x8 - for bg tiles and 8x8 sprites.
And I'd prefer all the tiles from a PPU viewer window to go into one PNG. But that's just me. Others may have other preferences.
I'm still working on this, but at the moment I have something that's starting to look pretty decent.
It keeps the tiles together as they are in the CHR banks (so groups of 256 tiles in a 16x16 grid), only shows tiles that are actually used for a given palette, and it works for CHR ROM & RAM.
Since the tiles are used with multiple palettes, it repeats the same bank into multiple PNG files, in order of usage frequency (first PNG contains the most frequently used tiles, in their most frequently seen palette).
It can also dump the tiles in either the 8x8 or 8x16 display modes.
All of this still has no UI, though - will need to create one to be select some options (e.g which scale to use, whether to use 8x8 or 8x16 for a given set of 256 tiles), etc.

I am happy to try a new mesen emulator when it is out. The last thing I tried was to put the dumped PNG folder into my mesen ../HdPacks directory. I know it is build for HDNes :D
And I don't know much about HDnes Packs in general. It would be awesome to see this up-scaled CV3 sprites in action that i got. Let me know when there is stuff to beta-test. I am a fan of the automated dumping. It saves time and may be errors of missing stuff.
The HD packs need a "hires.txt" file to define which tile in the PNG replaces, so it won't work by just putting the PNG file there - creating the hires.txt files by hand is pretty complex, though.

I'll probably have something decent finished at some point within the next few weeks.

kya

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #76 on: May 26, 2017, 03:23:26 am »
Quote
It keeps the tiles together as they are in the CHR banks (so groups of 256 tiles in a 16x16 grid), only shows tiles that are actually used for a given palette, and it works for CHR ROM & RAM.
Since the tiles are used with multiple palettes, it repeats the same bank into multiple PNG files, in order of usage frequency (first PNG contains the most frequently used tiles, in their most frequently seen palette). It can also dump the tiles in either the 8x8 or 8x16 display modes.

Perfect! Waiting for it.

Btw, I remembered another place in Castlevania, where the same tiles with the same palette are used for different objects. Cavern walls in stage 10 and mountains in stage 11. So, a global trigger-like condition I described earlier would still be welcome.
« Last Edit: May 28, 2017, 07:59:28 am by kya »

SourMesen

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #77 on: May 28, 2017, 08:15:06 pm »
I've fixed some issues with 8x16 sprites in HD packs and implemented support for CHR RAM games.

To test a bit, I captured the start of CV1 and then manually edited the PNG files that were generated with the tiles found in your CV1 mod.
It didn't take too much time (the layout that gets generated automatically was almost identical to the layout used in your tileset)

And it works:
screenshot 1
screenshot 2

For CHR RAM games, the tile matching is done by checking all 16 bytes of the tile + its palette.  Still haven't implemented any conditions, etc.
There's still a good bit of work to get done, but it's slowly getting there.

Satoshi_Matrix

  • Full Member
  • ***
  • Posts: 228
  • Retro & Contemporary Gamer
    • View Profile
    • Retro & Contemporary Gaming Archives
Re: Other: Castlevania 30th anniversary
« Reply #78 on: May 28, 2017, 09:08:04 pm »
This is really cool, but I really hope someone can adapt this to work with an actual NES so it can be played on the real hardware on an oldschool CRT.

Obviously the NES isn't capable of the degree of shading going on with this skin hack, but the general colors for background tiles and sprites could be used to improve the look considerably.

By the end of the NES's lifespan, incredible looking games such as Shatterhand showed that moody, 16-bit like backgrounds were indeed possible on the NES through use of color matching and selective dithering. Even flatshading with the right colors would go a long way. The original Castlevania is very orange, making it rather cartoony. Change that and I think the whole game would look better.

I hope someone makes an actual NES version, not just a PC emulator only one.

bogaabogaa

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Other: Castlevania 30th anniversary
« Reply #79 on: May 29, 2017, 09:22:09 pm »
How should this work on a NES? Do you mean having a special card like Everdrive with the right chips and programs on it to do the swapping somehow?
May be retro-pie will run mesen one day for this. Everything else sounds like insane amount of work.
I will be happy when I see graphic-packs been made. To make a graphic-pack you need to dedicate lots and lots of time and love to get something good and we all know there are not to many people out there doing this kind of work.