Primary Zelda Hacking
April 21, 2014, 09:25:30 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: There is now an official Primary Zelda Hacking Press!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Position/Tile-Specific Addresses, Map Obstacles  (Read 446 times)
Marky
Newcomer
*
Offline Offline

Posts: 20


View Profile
« on: July 13, 2012, 04:00:29 PM »

A few months ago, as part of another guide I wrote (ghetto chests) when I was looking into alternative ways of giving the player items, I discovered an address that I provided as part of that guide (0x0000CC99) which indicates which tile the player is standing on.  I'm not sure if anyone's looked into this area any further, but I just noticed something else, as well - the next address (0x0000CC9A) detects what type of tile the player is currently standing on, which could potentially be useful to some people.  For example, if you're using area ID 0, the the tile that reports the value 00 is a blank yellow tile, or tile 2A is the green tile with bouncing white flowers.

As a reminder to how these both work:

0x0000CC99 uses YX co-ordinates, meaning the first value is the Y co-ordinate and the second is the X-coordinate.
0x0000CC9A reports the tile ID that the player is currently standing on top of.

0x0000CC70 and 0x0000CC71 also keep track of more specific position values, I'm not exactly sure what the metric used is (by pixel maybe?) but CC70 determines precise Y co-ordinates and CC71 does the same for X-coordinates.  Also, if you're facing up/down, the following two addresses (~CC72/CC73) will read 01 and 06 respectively, whereas if you're facing left/right they will read 07 and 01.  I haven't yet figured out the significance of this, but I guess it could be useful.

Another thing I discovered while debugging is information about obstacles - places on the map that you cannot pass through.  0x0000CE00-FF through to 0x0000CE70-FF will tell you what you can and cannot walk through on that map.  The values I've found so far are:
00 - Passable
01 - 25% obstacle, bottom right corner is blocked
02 - 25% obstacle, bottom left corner is blocked
03 - Ledge that Link will jump over
04 - 25% obstacle, top right corner is blocked
05 - 50% obstacle, right half is blocked, left half is passable (used for cave/indoor exits) - Also used for horizontal ledges, if the next block is clear then Link will jump over the edge.
06/07 - 75% obstacle, top left corner is passable
08 - 25% obstacle, top left corner is blocked
09/0D - 75% obstacle, bottom left corner is passable
0A - 50% obstacle, left half is blocked, right half is passable (used for cave/indoor exits) - Also used for horizontal ledges, if the next block is clear then Link will jump over the edge.
0B - 75% obstacle, top right corner is passable
0C - 50% obstacle, top half is blocked, bottom half is passable (may work for ledges as well, have not tested as there are no preset tiles for north-facing ledges)
0E - 75% obstacle, bottom right corner is passable
0F - Obstacle
10 - Pitfall, Water (changing this value to 00 will NOT allow Link to walk over pitfalls or walk on water)
11/15/16 - Passable, cannot enter/exit to east/west (used for single-width vertical bridge)
12 - Passable, cannot enter/exit to west (used for left half of double-width vertical bridge)
13 - Passable, cannot enter/exit to east (used for right half of double-width vertical bridge)
18 - Stairs (not the exit kind, the kind that slows movement when you walk up/down them)
19 - Passable, cannot enter/exit to north/south (used for single-width horizontal bridge)
1A - Passable, cannot enter/exit to north (used for top half of double-width horizontal bridge)
1B - Passable, cannot enter/exit to south (used for bottom half of double-width horizontal bridge)

By changing these values, you could make an invisible maze, or block a player from leaving an area without having to change any map tiles.

That's all for now, but I'll keep messing around in the VBA Memory Viewer to see what else I can dredge up.
« Last Edit: July 14, 2012, 01:26:02 PM by Marky » Logged
Lin
ZOLE Creator
Administrator
Hero Member
*****
Online Online

Posts: 580



View Profile
« Reply #1 on: July 13, 2012, 09:27:09 PM »

The collision values in the RAM (Which are really CE00-CEFF) are bit-wise, meaning certain bits control the object's collisions. I noticed you missed the corner collisions, which is where single-bit values would work (eg. 4, 8, etc).
Logged
Marky
Newcomer
*
Offline Offline

Posts: 20


View Profile
« Reply #2 on: July 14, 2012, 01:18:26 PM »

Thanks Lin, I fixed up a couple of things in relation to the collision list.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!