Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,487,114
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-26-24 11:32 AM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests

Main - ROM Hacking - Need answers from those familiar with the combo dungeon system, with The Legend New thread | New reply


infidelity
Posted on 09-20-13 06:51 PM (rev. 2 of 09-20-13 06:54 PM) Link | Quote | ID: 154809


Fuzz Ball
Level: 66

Posts: 393/968
EXP: 2368058
Next: 93793

Since: 05-24-07

Last post: 958 days
Last view: 814 days
I apologize for starting another thread regarding Zelda, but I felt the thread name would attract hackers that havr delt with this setup.

To those who dont know, my entire outworld for zelda, im able to assign an individual 8x8 tile anywhere for every screen id, thus, removing thr outworlds combo system.

In my game, my outworld for both the light & dark world are complete.

Im now at the point of putting attention to the 9 dungeons. This is an aspect I have not begun to indulge in.

However, I had to for the dungeons that design the 2 secret rooms, (room with special item)(room with 2 stairs)

I manged to find the original routine that loads the tile construction for storage starting $6530ram.

Now, my rom is 2mb in size, and I do not have the room to go into vast creation for the dungeons like I did with my outworld. And if I use my 1 tile id represents an entire tsa block, that still limits me of only 00-3F individual rooms, and I need two sets of 00-FF rooms, since Levels 1-6 occupy 00-FF, and 7-9 occupy an additional 00-FF.

My question is, do dungeons have a combo system, can you manipulate it to place any kind of tsa anywhere? Suggestions on how to achieve this?

If I cant exploit it the way id like to, ill have to keep the original dungeon system as is, and just use snarfblams dungeon editor to make the changes.

Thanks for reading, and for any advice you can throw my way.

-infidelity

MiniCompute
Posted on 09-20-13 10:26 PM Link | Quote | ID: 154810


Bubble
Level: 66

Posts: 453/981
EXP: 2421466
Next: 40385

Since: 04-25-07

Last post: 489 days
Last view: 698 days
Let me ask you something your hack, and the way you have it...
Are you aiming to make this into gameboy based hack or snes/gba ?
Reason why I ask you, you werent really clear of what you wanted to zelda hack based about.

The normal for zelda dungeons is 8 including a final fortress one.
If I were you, leave that dungeon system alone or improve it without going to extreme.

I like somethings you've done so far, but somethings don't need a total overhaul.
Not unless the game itself is messed up to a certain degree.

Have you tried looking at how the oracle ages dungeon system ?
By the looks of it you could pull that off in your hack and that game was only 700kb ?

snarfblam
Posted on 09-20-13 11:50 PM Link | Quote | ID: 154811


Tektite
Level: 18

Posts: 54/54
EXP: 26412
Next: 3485

Since: 03-10-12

Last post: 3870 days
Last view: 2820 days
I can look into this if you want. The dungeon layout engine is very similar to that of the overworld, and I'm sure it can be greatly expanded (many more TSAs and columns, but increasing the number of screens would require relocating some data to new tables) without replacing the whole layout system. It shouldn't be too difficult. However, I'm a bit busy this weekend, and still getting situated with my new computer after the old one died on me. There may be someone else who is already more familiar or has more time to look at it, but when I have a chance, if this still needs to be addressed, I'd be happy to help.

infidelity
Posted on 09-21-13 02:03 PM (rev. 2 of 09-21-13 04:30 PM) Link | Quote | ID: 154816


Fuzz Ball
Level: 66

Posts: 394/968
EXP: 2368058
Next: 93793

Since: 05-24-07

Last post: 958 days
Last view: 814 days
Yeah im not going to increase the screen id amounts, im not going for a complete overhaul of the dungeons, but I would like to have freedom of how the floors look. Im also not looking to screw with the mechanics of the shutters and locked doors either.

Im confident in my thinking, for having levels 1-9 use the tile drawing routine, but having a cmp routine to determine which sets of combos to load for levels 1-9, making them all unique.

Thank you for reading!

Edit: I think I found a solution, ill post more about it when I can. :-)

infidelity
Posted on 09-23-13 02:07 PM Link | Quote | ID: 154821


Fuzz Ball
Level: 66

Posts: 396/968
EXP: 2368058
Next: 93793

Since: 05-24-07

Last post: 958 days
Last view: 814 days
Making good progress in having individual tsa blocks for some of the dungeons. This asm im writing up will only be for Levels 1-6, because all those combined levels reside within screen id's 00-7F. I do not have enough free space for Levels 7-9 to have their own individual tsa sets, so for those levels, I will be altering them with snarfblams dungeon editor.

My asm routine for loading the tiles, is the same method for when I load tsa blocks in my caves, 1 tile id represents an entire tsa block. I ran into a complication, because I have to jump around within ram for storing the tiles in the correct addresses, but I realized once my low byte passes 00, I have to inc my high byte, but, the asm wikl revert back to a lower address, meaning I have to dec the high byte address. This has become troublesome, and taking up too much code. I came up with a new idea that will work, I just need time today to write up the routine.

Trax
Posted on 09-29-13 05:09 AM Link | Quote | ID: 154863


Yellow Stalfos
Level: 71

Posts: 1134/1145
EXP: 3035802
Next: 131312

Since: 07-06-07
From: Québec

Last post: 3627 days
Last view: 2879 days
Maybe I'm stating the obvious, but here's the original system's data for secret passages (offsets are for PRG0):


163B4: Column Data for Underground Passages (2 * 10 = 20 bytes)

04 04 00 01 00 00 00 00 00 00 00 00 01 00 04 04 Passage Room
04 04 00 01 00 00 00 03 03 03 03 02 03 03 04 04 Item Room

----

163D4: Column Definitions for Underground Passages (22 bytes)

Same Byte Format

.... xxxx Tile Code
.x.. .... Tile is Repeated Once
x... .... Start of a Column Definition

0 = Black (top of stairs)
1 = Stairs
2 = Black (blocked)
3 = Bricks
C = Black (walkable)

82 43 43 43 02 0C 43 Column 0
80 41 41 41 41 43 Column 1
82 43 42 0C 01 41 43 Column 2
82 43 42 0C 03 02 0C 43 Column 3
82 43 43 43 43 43 Column 4


The compression scheme is similar to the Overworld's, with a possibly lower compression ratio. Other than that, normal dungeon rooms are 7 TSAs high instead of 11, and have 12 columns instead of 16, so you have to start your PPU writing head at a specific offset, both for vertical and horizontal adjustments.


never-obsolete
Posted on 09-29-13 06:36 AM (rev. 2 of 09-29-13 06:40 AM) Link | Quote | ID: 154864


Rat
Level: 24

Posts: 90/96
EXP: 74495
Next: 3630

Since: 02-22-07
From: Phoenix, AZ

Last post: 2596 days
Last view: 2596 days
Just a few questions so I can get an idea of how your system works.

-Do you compress your TSA at all? If i understand correctly, your map data would have something like:


00 04 08 0C ...
...
...


which would be expanded to something like this:


[nataddr=$2100] | 00 01 | 04 05 | 08 09 | 0C 0D | ...
[nataddr=$2120] | 02 03 | 06 07 | 0A 0B | 0E 0F | ...


in which case, you wouldn't have any data to compress. Or do you actually define each metatile (4 tiles + 1 att)?

-Is this where the $3F limit comes from since IDs 01, 02, 03, 05, 06, 07, etc wouldn't be as useful because of overlap?

-What is a combo? Sorry, I'm not too familiar with how the original map system works. Replacing it was the first thing I did when I messed around with LoZ.

infidelity
Posted on 09-29-13 02:52 PM (rev. 3 of 09-29-13 03:36 PM) Link | Quote | ID: 154865


Fuzz Ball
Level: 66

Posts: 400/968
EXP: 2368058
Next: 93793

Since: 05-24-07

Last post: 958 days
Last view: 814 days
Its been a few days since ive updated this, so ill try to explain what I did.

I have two 4000 byte banks, that house my new drawing routines for all the dungeons in the game.

Level 1-6 reside within $F8010.
Level 7-9 reside within $AC010.

My tile routines are for the areas within the outter walls. I do not have enough free PRG-ROM to have individual tiles for an entire dungeon room. I was more focused on the areas within the outter walls, where Link moves around. This now gives me the freedom to setup the floors any way id like, so I can new paths, puzzles, etc.

What I did was, at $6C80ram, I set a write breakpoint on that address, that is where the first tile is inserted. When the breakpoint kicked in, I looked to find out where the asm was that allowed for the drawing routine.

From that origin, I perform a bankswap to the appropiate bank depending on the current level loaded within $10.

Within each bank, I have the 00-7F screen id's load an individual 53 byte table, the table includes tile id's. When the first tile is loaded, (ex, B0), it will get stored, I then inc the value of B0 to B1, then store it, inc the value of B1 to B2, then store it, inc the value of B2 to B3, then store it, and thats it, I just repeat the sequence over and over until the last tsa blocl is designed, then I go back to the original bank.

I contacted snarfblam and gave him all my documentation on what I did, so I can have the freedom to design the new dungeon layouts within my level editor he originaly designed for me.

Things like shutters, bombable walls, doors, enemies, bosses, im not screwing with, im leaving all of those features the same.

Also palettes will be left alone, no individual palettes for individual tsa's.

Thank you both, never-obsolete & Trax, for reading and commenting. I extremely appreciate it!

Trax
Posted on 09-29-13 04:24 PM Link | Quote | ID: 154866


Yellow Stalfos
Level: 71

Posts: 1135/1145
EXP: 3035802
Next: 131312

Since: 07-06-07
From: Québec

Last post: 3627 days
Last view: 2879 days
I think what Infidelity means by combo is what I call a column. The original engine uses predefined columns of 11 tiles high (7 for dungeon columns), assembled from left to right for each screen ID. This way a screen takes only 16 bytes (12 bytes for dungeon screens) of ROM/RAM space...

This system is quite efficient in term of compression, but it makes level design very tedious, as you have to juggle between columns to create the screens in "jigsaw puzzle" style assembly...

One of the things that comes to mind immediately when using the free tile layout like Infidelity uses, is compression. Without any, an entire map (assuming all screens are unique) cannot fit into a 4000 byte ROM bank. The total comes to:

B * 10 * 8 * 10 = 5800. Not even close.

I'm actually curious about how Infidelity does his magic. Some time ago, I made some raw calculations using the original Overworld to see what kind of compression ratio we could achieve with a simple RLE compression scheme, and the results where quite interesting. I used the original 7C unique screens (screens 7C to 7F are not defined), with B0 bytes in uncompressed form, for a total of 5540 bytes. Here's the results after the number crunching:

Total Size : 1E06 (7686)
Average Size : 3D (61)
Total Saved : 373A (14138) (63%)
Average Saved : 72 (114) (65%)


never-obsolete
Posted on 09-29-13 08:33 PM Link | Quote | ID: 154869


Rat
Level: 24

Posts: 91/96
EXP: 74495
Next: 3630

Since: 02-22-07
From: Phoenix, AZ

Last post: 2596 days
Last view: 2596 days
I can't really think of a way to further reduce rom usage, other than to apply some sort of compression, as Trax suggested. With LZSS, I was able to compress the overworld to $294E bytes. Not as good as Trax's numbers, but my overworld had a lot more detail then the original.


The system I used works like this:

I have tables that define metatiles (TSA). Each table has 256 metatiles and is $440 in size: 4 bytes defining each tile used and 2 bits for the attribute. The attributes are bit packed, hence the $40.

Screens are free to use any metatile set they want, there's another table that defines which one they use. Screens are also compressed using LZSS. So what happens is:

-decompress map from rom to ram @ $687E (this previously held some tables that I no longer needed with the new map system)
-check for any special metatiles that need to be altered based on triggered events (bombable walls, burnable bushes, etc)
-expand the metatile IDs into raw tile IDs and store to tilemap (ram @ $6530)
-let the game draw the screen from the tilemap like it normally would

The metatile tables seem large at first, but with the amount of screens LoZ has, the savings quickly add up. The "DX" version I was working on only needed two of these tables.

Here's a visual to better illustrate my system. Also shows the savings (or lack of) with a few types of compression. img1 img2

Chaobomr
Posted on 09-29-13 09:10 PM (rev. 2 of 09-29-13 09:11 PM) Link | Quote | ID: 154871


Buster Beetle
Banned: Spammer takeover?
Level: 45

Posts: 138/467
EXP: 638797
Next: 21367

Since: 05-07-13
From: The dirty south

Last post: 3480 days
Last view: 3478 days
Anything on working the health system like in Zelda Automap? (Sorry if this question's out of context, so to speak)

____________________
Sorry for the stupidity. That jerk will be dealt with in the most insane way possible.

infidelity
Posted on 09-30-13 01:46 AM Link | Quote | ID: 154876


Fuzz Ball
Level: 66

Posts: 401/968
EXP: 2368058
Next: 93793

Since: 05-24-07

Last post: 958 days
Last view: 814 days
My outworld uses 4 sets of 00-7F screen id's. 1st set is my upper half of my light world. 2nd set is my lower half of my light world, 3rd set is my upper half of my dark world, 4th set is my lower half of my dark world.

The outworld tiles use no compression. Each screen id for the outworld, im able to assign individual 8x8 tiles anywhere.

How im able to accomplish this, is I have my rom running mmc5 with prg-rom maxed to 1mb.

I also rewrote the palette asm, so I can assign individual palettes to a 16x16 tsa block.

Main - ROM Hacking - Need answers from those familiar with the combo dungeon system, with The Legend New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.025 seconds. (342KB of memory used)
MySQL - queries: 92, rows: 123/124, time: 0.017 seconds.