20 users online: brickblock369, Cal-of-Gearva, CalHal,  Devazure, Evernn, Knetog, KungFuFurby, Lyfah, ModernKiwi, Nciktendo,  NopeContest, oyok, Ringo, Samie Zuccati, smwln, spooonsss, TheBourgyman, TOBEE_verr, underway, VinylHeart - Guests: 85 - Bots: 184
Users: 55,665 (2,411 active)
Latest user: lincolnic

The totally uninteresting, non-planned, most likely to get ignored thread in C3's history.

Also Known As Hacking the Harmony of Dissonance's Map

I wasn't even planning to show something this C3 but since there are people asking me to show something, I'll post this here just for kicks ang giggles.

So, as some people may know, I love Castlevania and I always wanted to do something related with the Map system found in the Metroidvania ones.

This began a week ago when my brother went to sleep, my mother was sleeping in the living room and my father was sleeping in his room, so there was no available place (aside of the bathroom) to play Smash. So I decided to play some Harmony of Dissonance.

While playing I decided to mess around with VBA's tools, more specifically the Map viewer and the Tile viewer. At first I was like "oh, k" but then I opened the map.
And damn I wasn't expecting this.
When I saw the Map for the first time, I thought it was made of premade graphics, as any other thing in the game, but actually it is drawn by code. I thought it was interesting and decided to check frame by frame to see the drawing proccess in action (because it happens really fast)

Interesting, right?

When I saw this, the first thing I thought was "There has to be some kind of table in the ROM that dictates how the map is drawn" and... I wasn't that away from reality, really.

Let me show you, the actual Harmony of Dissonance's Map tables (Shown in YY-CHR because it's easier to see what's going on, Address 0DAD94 btw)

(Note: YY-CHR has to be in 1bpp AND in vertical pattern to be able to see the tables like this)
As you can see, the tables kind of look like the map itself, however it is rotated and reflected. Just to show how the tables are like the map itself, I rotated, reflected and stretched it to show how it is just the map itself.

Yep, that's the map.

Now returning to the tables as they appear in YY-CHR
You're probably asking yourself "Why I'm still reading this?" or "What's up with the four things below/at the right of the big table"
The answer to the second question is, those things are actually 4 little tables that say how the castle's walls are going to be drawn, let me show you the result of throwing random data at it.

See, I just made the Map show entrances where there's nothing but walls in the actual game.

Now that we've messed up the map, let's see how the thing actually works, shall we?

First, let's tackle the big one.
A square of the map is represented in the table as a 8*2 bunch of booleans, so there are 4 squares in a 8*8 tile as viewed in YY-CHR.

Here you are looking at the first 3 squares of the map.

The ones in red.

Now let's see the data of just one square.

So... probably you're asking yourself "...and?"

Well, this:


This is what I've been able to find from that little square above.
Let me explain a little more.

2= Visible with Map 2
1= Visible with Map 1 
S= Saveroom* 
T= Teleport in Castle A** 
t= Teleport in Castle B*** 
?= Unused?**** 
A= Area Identifier
X= Unknown*****

*Draws the room red
**Draws the room yellow when viewing Castle A's Map
***Draws the room yellow when viewing Castle B's Map
****Silences the Room when entered
*****It seems like those bits are used to identify each room individually but I don't know why (doesn't seem to change anything if I modify them)

Now some small tidbits of info:
1.- If 2 and 1 are both activated, the room is not shown until you get Map 3 (or you just discover it, of course)
2.- If T and t are both activated, the room is drawn yellow in Castle A's Map, Castle B's Map and Castle A + B's Map
3.- The music of the room is related to the Area identifier

And this are the possible combinations you can set for the Area identifier and the Area each belongs to.

0000= Entrance
0001= Marble Corridor
0010= Shrine of the Apostates
0011= Castle Top Floor
0100= Skeleton Cave
0101= Luminous Cavern
0111= Sky Walkway
1000= Clock Tower
1001= Castle Treasury
1010= Room of Illusion
1011= The Wailing Way
1100= Chapel of Dissonance
1101= Unused* 
1110= Unused** 
1111= Unused*** 

*Doesn't load Layer graphics first entered
**Room loads horribly wrong first entered, corrupts some sprite graphics
***Decisive Battle [Aka the boss music] plays as the room music

And that's pretty much it for the big table, it is pretty simple.
The complicated ones are the small ones.
Oh yeah, you are in for some weirdness here.

There, Each table dictates how the walls are going to be drawn for each similar colored line.
Every 8*8 tile has the information for 16 squares, since each square uses 4 bits for the wall data, however, this data only works for the left wall and the ceiling, so if you want to draw the right wall and the floor, it has to be set in the squares at the right and below the square, like this.


The Tables work something like this.

And in the map itself the selected area of the image above would be:

Those walls.

Now, here are the possible combinations for the 4 bits.
0000= No walls
0001= Left Wall
0010= Left Wall (With exit)
0011= Left Wall
0100= Ceiling
0101= Left Wall + Ceiling
0110= Left Wall (Exit) + Ceiling
0111= Left Wall + Ceiling
1000= Ceiling (With exit)
1001= Left Wall + Ceiling (Exit)
1010= Left Wall (Exit) + Ceiling (Exit)
1011= Left Wall + Ceiling (Exit)
1100= Ceiling
1101= Left Wall + Ceiling
1111= Left Wall + Ceiling

As you can see, there are a lot of repeated outcomes.

So, is it possible to create something out of this?


Please note that this only modifies the Map, The "Levels" themselves stay the same, and since I can't really search for that data, I guess those will stay the same for the rest of eternity.

Final note: The Sorrow games (Aria and Dawn) use the same system for their respective maps.

Thanks for reading and sorry to bore you to death.
Since nobody cares about Castlevania anymore *tear*
I do pixels sometimes
Oh god, i really LOVE Harmony of Dissonance, this Game is so distinct from other Castlevania series, it makes me feel good, and Juste is like Alucard. Good luck with this project sir, You have my support for this.
It'd be really awesome if this somehow ended in someone making an editor for HoD and/or Aria/Dawn of Sorrow.