Register - Login
Views: 99792215
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 04:45:35 AM
Jul - General Game/ROM Hacking - level map formats New poll - New thread - New reply
Next newer thread | Next older thread
Aaendi
I'm an MRA. So what? I'm not afraid of saying it.
Level: 21


Posts: 3/80
EXP: 42982
For next: 6961

Since: 06-15-12


Since last post: 3.3 years
Last activity: 2.5 years

Posted on 06-16-12 03:02:57 AM Link | Quote
I'm interested in learning how level maps were stored in different games like SMW or Super Metriod, and what makes them different. Maximum level sizes? Does it use 8x8 or 16x16 BG tiles? What kind of compression does it use? What's the vram address? Stuff like that.
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 4840/5390
EXP: 29075297
For next: 259708

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 06-16-12 08:44:28 AM (last edited by Rena at 06-16-12 08:46:44 AM) Link | Quote
Post #4840 · Sat 120616 044428
2D games have two common types of level format:

Object based: Used in most platformers, including Super Mario Bros 1-3 and SMW. In memory, the level is a grid of (usually 16x16) tiles. When loading a level, the grid is cleared to an "empty" tile, then objects are "drawn" into it. The data specifies e.g. "3x1 block of coins at position 12,34", "16x3 floor at position 0,28", etc.
Usually the grid is divided into 16x16 "screens" or "pages", and object coordinates are local to a page, with a special object ID signalling to move to the next page.
Object format is typically something like TT XY WH, with object type 0 or FF signalling the end of the list, potentially some additional parameter bytes, and some special "pseudo-object" types which don't draw objects at all, but use their position/size values to set parameters such as warps. (Lunar Magic uses such pseudo-objects to do all sorts of interesting things such as load ExGFX and override time limits and starting positions.)
In SMW, object type 0 is a special type, used for most fixed-size objects; in place of the size byte is the "real" object type. (i.e. 00 XY TT) In some games, certain objects just don't have a size byte at all.
Super Mario Bros 2 has a couple of interesting variations: you can specify what tile to fill the grid with (so a cave might be filled with rock tiles and then carved out with "air" objects, rather than built from "rock" objects around an empty space) and object positions are relative to eachother.

Tile based: Simpler, but generally less efficient for games with large maps. The grid is simply stored in ROM and copied directly into RAM. Usually compressed in some manner. Used in most top-down games, such as Pokémon.

3D games are another can barrel of worms entirely, and much more complex. You'll want to learn about OpenGL and be capable of programming a simple 3D scene before you look at those...

____________________
Lunaria

Moon Bunny! :3
Level: 139


Posts: 4500/5754
EXP: 32051838
For next: 415607

Since: 07-28-07

Pronouns: she/her
From: pile of fluff

Since last post: 6 days
Last activity: 5 days

Posted on 06-16-12 02:29:36 PM Link | Quote
While one could argue that tile based is not as effective, I personally find that it makes room for more creative freedom. (Super Metroid is tile based, for example) Mostly since you just go all out with what you want to make. The downside is of course, as mentioned before, that it takes up more space.

This is why in general most Super Metroid hacks expands the ROM size by X number of banks.

____________________
The fun has been doubled!
Aaendi
I'm an MRA. So what? I'm not afraid of saying it.
Level: 21


Posts: 4/80
EXP: 42982
For next: 6961

Since: 06-15-12


Since last post: 3.3 years
Last activity: 2.5 years

Posted on 06-16-12 06:15:37 PM Link | Quote
Is that why Super Metroid uses a bigger ROM size than Super Mario World?

For games that use the object based scrolling, do they convert it into a tile map before the level starts, or do they convert one screen at a time as you scroll?
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 4842/5390
EXP: 29075297
For next: 259708

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 06-17-12 04:08:09 AM Link | Quote
Post #4842 · Sun 120617 000809
...one of many reasons.

Super Mario Bros might be one that converts on the fly? I don't know of any, but I haven't looked at it.
Originally posted by Lunaria
While one could argue that tile based is not as effective
Less efficient. It takes up more space. That's all.

____________________
Lunaria

Moon Bunny! :3
Level: 139


Posts: 4501/5754
EXP: 32051838
For next: 415607

Since: 07-28-07

Pronouns: she/her
From: pile of fluff

Since last post: 6 days
Last activity: 5 days

Posted on 06-17-12 07:42:01 AM Link | Quote
Ah, that was what I was trying to say, but it seems I used the wrong word. :derp:

____________________
The fun has been doubled!
Next newer thread | Next older thread
Jul - General Game/ROM Hacking - level map formats New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

25 database queries.
Query execution time: 0.084961 seconds
Script execution time: 0.017533 seconds
Total render time: 0.102494 seconds