Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battlefield Editing #11

Open
Glimmericious opened this issue Jan 30, 2018 · 2 comments
Open

Battlefield Editing #11

Glimmericious opened this issue Jan 30, 2018 · 2 comments

Comments

@Glimmericious
Copy link

The battlefields, as said on the SCHG, are done using two background layers - BG2 and BG3, with BG2 being the upper layer and BG3 being the lower layer. The walls are sprites drawn in after to create the '3D Battlefield' effect.

In the game's RAM, BG2 begins at 0600E000 and BG3 begins at 0600F000. The way the fields are set up is by numbering the tiles used on the ground. For instance, and using Green Hill Zone as an example, if we were to change the values 0600E600 from
image
to
image
then we could change this platform from
image
to
image
Which is all fine and dandy. The tile layouts of the maps are stored in the same exactly way they pop up in the RAM, too, so it's easy to find. For instance, the upper layer part of Green Hill Zone begins at 467478.
image

The issue with this, however, is how the game decides these platforms can be stood on. The walls aren't drawn in based on the position of the platforms or anything - I modified Green Hill Zone a bit to be sure - and the walls seem to be what make platforms able to be stood on. Without them, you just fall through any additions to the upper layer. I haven't the slightest idea how the game decides where to write in walls. As such, completely retooling maps is impossible right now.

You can totally fiddle with the tiles and make pretty elaborate texture hacks of already existing levels, though.

@Glimmericious
Copy link
Author

So, I did a little more checking around. The boundaries of the stages are set at the following places in the RAM:

Top Boundary: 03002B71
Right Boundary: 03002B75
Bottom Boundary: 03002B81
Left Boundary: 03002BD1

Modifying them does change the area of the map that you can control characters in, which is great.
image
I'm not sure where they are in the ROM yet, still looking for that.

06018400 is where the background color of maps is stored in the RAM.

030029C0 to 03002A5F seem to control what wall sprites are present.
image
The format of a wall looks like this:
image
The first one is the type of wall - in Emerald Coast, this alternates between two types of walls, while setting it to 00 just does some weird thing with the colors. Setting the first value high enough will make the wall completely disappear. The third value relates to the palette. The second and fourth, so far as I know, don't do anything.

03002A80 controls the placement of these sprites.
image
Each value has two variables. The first seems to control the placement, while the second controls the... orientation of the sprites? It looks like it controls how each sprite changes based on the player's location. Changing it match another wall's seems to make it rotate the same as it? It's really odd.

03002B90 to 03002BDF seems to control the size of the collision for walls.
image
It may be a bit hard to see, but I'm standing on the upper layer. The format of the wall works like this:
image
The second value is how far the wall extends to the right, the fourth is how far to the left it extends, the third is how far down, and the fourth is how far forward. That part is pretty straightforward. I have no idea how to apply wall sprites to the collision yet. I've tried to modify the 80 values and nothing happened, but unlike some other useless values, the game resets them to 80 when the map is loaded - I can only assume they do something, I just dunno what that something is.

I'll find the ROM values for everything some other time.

@LavenderTheGreat
Copy link

Once this progresses I should be able to work on implementing it in my move editor, but I need to know a few things:
A: How is width measured? In small tiles (Like the ones you added to the platform in greenhill) or in big tiles (Like the platforms in Emerald Beach)?
B: Collision needs more cracking, but I suppose I can go ahead without the wall sprites.
C: I suppose I also need to wait for phase to implement map tiles in SBHS too.
Once that is done I can probably do some stuff and make a make shift map editor and map image exporter (Latter is a big maybe).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants