News:

The forum has been updated to SMF (2.1.3)!
Please be patient as we work to polish up the place and update features as we can.

Main Menu

Anyone know how Golden Sun handles wall glancing and pathing in towns/dungeons?

Started by Triyence, 15, October, 2014, 01:16:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Daddy Poi's Oily Gorillas

QuoteFor the sake of this, let's only talk GS1. I'm just trying to figure out GS1's height map data.
Well, that's the only difference I've noticed with height stuff from GS1 and GS2 so far... so everything else /might/ be the same.(?)

Quote00FF0000
- 00 = Height tile 0?
- FF = Door event connector?
- 0000 = Tile index 0?
For the most part, correct. (But one should remember that the graphic tile index is not 16-bit, but 12-bit for GS1. - To the beginner, 12-bit would be three hex characters. (4-bits per hex character))

QuoteSo starting at 0x02011640:

0100A0BE
- 01 = you said: "? (Not sure if used or not?)"
Um, no, that was for GS2, not GS1... So if you're going GS1, ignore where I label the 8 flags. (AKA: 1-bit values. ; 01/02/04/08/10/20/40/80 represent where those bits are.)

Quote- 00 = no events?
- A0BE = Tile index 41150... what? Or is it 0xBE = tile index 190 and 0xA0 = some tile flags?
The A might be related to tile priority(?), but might need to double check some time.

Quote00000000: No data
00000400: Height = 4 * 8 = 32 pixels?
00080407: Height = 4 * 8 = 32 pixels? What is the other data?

It looks like there are only 23 collision tiles, is that correct?

I want to be able to "see" the collision data that is surrounding him.
Unfortunately, this happens to be one of the things I haven't done much research with.... But yes, there are 23 unique collision tiles.. (You can tell if you zero out the data and reload the room that the data after the last tile doesn't change, so it gives itself away.)

Think: 0x0202C000 + ([0x02010000 + (mapTile * 4) + 3] * 4)

^ One should write a LUA script to show that data on the screen. (The tile you are on, and the 8 surrounding tiles.)



Edit: It's coming to me....

0202C000 = Heightmap tile table (32-bit/entry)
0000000F = Tile type (There are only 16 tile types; each having their own function to calculate height.)
000000F0 = Unused? (Or unknown.)
0000FF00 = Arg 1
00FF0000 = Arg 2
FF000000 = Arg 3

Tile types:
0 = Flat ground ... height is Arg 1
1 = Left/Right stairs (Arg 1 and Arg 2 used - Basically a linear function.)
2 = Up/Down stairs  (Arg 1 and Arg 2 used - Basically a linear function.)
3
4 = \| slanted wall
5 =
6
7 = Pillar? (Based on data at 0802EDC4) (Not an index to Arg 1/Arg2/Arg3, but... (value * (Arg 2 - Arg 1))
8 = Left half of tile's height is Arg 1, right half is Arg 2.
9 = Top half of tile's height is Arg 1, bottom half is Arg 2.
A = Based on data at 0802EEC4 [X<<4 + Y] Note: Both X and Y should be 0x0 to 0xF of tile. ; And table is index to which of Arg 1, Arg 2, or Arg 3.
B = Based on data at 0802EEC4 [X<<4 - Y + 0xF]
C = Based on data at 0802EEC4 [Y<<4 + X]
D = Based on data at 0802EEC4 [Y<<4 - X + 0xF]
E = Bottom half = Arg 3 ; Top left corner = Arg 1 ; Top right corner = Arg 2
F = Top half = Arg 1 ; Bottom left corner = Arg 2 ; Bottom right corner = Arg 3


A to D may be for slanted walls.... Basically where the slant could fit in a rectangular 8x16 box or something... Interesting way of doing it, I must say...
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Triyence

Still looking at this stuff. I think I understand how the height map roughly works in Golden Sun, but I'm a little confused as to how the data is stored for something like a bridge:



Mainly since you can go under the bridge and over the bridge, how does Golden Sun handle this situation? I'm trying to imagine what the height map looks like for this particular section.

Daddy Poi's Oily Gorillas

Oohh! Thanks for bringing this up!

A quick look up of GS2... Looking at Yallam.... You know how there are three graphic layers? Well, there are also three heightmap layers as well.

1st layer = Original PC heightmap
2nd layer = Secondary PC heightmap when needed (B/c of bridges)
3rd layer = For objects (pillars/crates/etc.) you can move... (Although, it might be possible that the NPC data selects which heightmap to use... Not sure???)

And with that... More data becoming known?
Code (Tilemap data) Select

00003000 = (Only researched for GS2 so far.) 2-bit value that somehow tells which heightmap to switch to? (Used before you get to the bridge itself.)
0000C000 = Might have to do with priority somehow?
FF000000 = GS1: Height data; GS2: Special tilescript flags.
01000000 = (GS2) PC has access to two 2 height layers... bridges and stuff... ? (Maybe????) Actual purpose currently unknown. (Seems to be used at the bridge, but not necessarily at tiles that change heightmaps.)


020322EC = Felix RAM data...(If looking at GS1, you can still look at Isaac's RAM data by following the pointer at 02030014.... Yes, there are 8 pointers for each of the PCs there... in both games. Pointers after that are for the rest of the NPCs.)
0203230E = Felix's current heightmap index. (0-2... not sure if it is ever 2.)

That's mostly what I've seen so far... there may be a few questionable things, though... (Like that  01000000 flag)... Maybe I should look into this further.... (And I may check GS1 out later... the point with why I do GS2 first, usually... is because so much has already been documented on a lot of stuff.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Triyence

Interesting finds Fox. Any ideas on how the game is changing those heightmap indexes? I'm thinking there could be a couple possible ways:


  • Height map index is determined by your z-coordinate
  • Height map index is determined by specific tiles

Any thoughts?

Daddy Poi's Oily Gorillas

QuoteHeight map index is determined by specific tiles
That one is correct. I'll give a visual. Do note those numbers colored in visual are 2-bit, not 4-bit... in-case coloring them like that makes it seem so...

Basically...
0 = Does nothing?
1 = Changes height layer index to 0
2 = Changes height layer index to 1
3 = Changes height layer index to 2
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Triyence

Hey Fox, this is an odd request but can you tell me everything you know about the collision data for the highlighted tile (the pot):



I have been assuming that it was just a 16x16 collision tile with a single height map value of 16.

Daddy Poi's Oily Gorillas

QuoteI have been assuming that it was just a 16x16 collision tile with a single height map value of 16.
Basically, it is like a mini-pillar. (Using type 0x7.) (And not limited to jars, so the two things directly above are also using the pillar type.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Triyence

Ah ha! I figured my assumption was wrong. I'm guessing that when it's a pillar type it uses NPC style collision detection. Meaning that it uses a circle with probably a radius of 8 there. You can actually see it if you attempt to go in between the objects.

Thanks for finding that out.

Daddy Poi's Oily Gorillas

As far as GS2 is concerned with the pillar-type tile... (It is probably the same in GS1 as well.) A radius number isn't used, the tile is literally mapped out.



(^GS2 addresses)

Oh, and you are welcome!
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Triyence

That is very interesting because I think it goes against what Atrius said about the collision system where it tries to deflect at +22.5°, -22.5°, +45°, -45°. If the characters 8px radius circle is directly underneath that tile according to those angles it shouldn't be possible to glance, but in the game it does.

Daddy Poi's Oily Gorillas

Hmm? I dunno? Unless there's some misunderstanding somewhere?

-Pillar tiles use the 16x16 table to define which pixels are at which height.
-PCs/NPCs/Objects .... using a radius/arc thing to determine where to walk.... perhaps I need to check the documentation and document some things if I've forgotten anything.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Atrius (He/Him)

It was my mistake, the game also attempts deflection at +67.5 and -67.5 degrees as well.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]