News:

11 March 2016 - Forum Rules

Main Menu

How to edit Levels using hex?

Started by Doodle_Dangernoodle, April 29, 2018, 11:25:43 AM

Previous topic - Next topic

Doodle_Dangernoodle

I am trying to edit Journey to Silius for the Terminator Project I am working on with Pacnsacdave to edit levels for it, but since there is a lack of Utilities for JTS, I feel that the only option is to edit levels via the hex editor in FCEUX. Is there a highlighting tool or something that highlights what tiles are on screen at a given time? If not, how would I edit the levels? Here's the layout of the first level:

KingMike

The Name Table tells you the (8x8) tilemap in VRAM.

As to how/if level data would be stored in RAM/ROM, sorry the hex editor is not magic. It can't tell what RAM is used for level data. Fortunately the NES RAM is small enough you can maybe eyeball it for changes (I think newer versions of FCEUX even flash colors of changing RAM values. So if you scroll (in the game) and you see a big block of stuff changing in RAM that is a sign it might be screen data.) if you can't do it the more scientific way of disassembling code.
"My watch says 30 chickens" Google, 2018

Squall_FF8

Quote from: PasthorRothers on April 29, 2018, 11:25:43 AM
but since there is a lack of Utilities for JTS, I feel that the only option is to edit levels via the hex editor in FCEUX
That is the worst possible option.

The best will be if you (or somebody else) create custom tool for that game. Obviously some knowledge on the game is required.

The other option is to contact the author of https://www.romhacking.net/utilities/967/ He is trying to make universal level editor and so far have incorporated so many games even from different platforms. His initial goal was NES games, so I think your project is exactly what the target is. He is very open to suggestions so maybe your game will be next in his list to add  :thumbsup:
Welcome to the FF5 Den: https://discord.gg/AUqDF85

Psyklax

#3
While I haven't specifically tried to edit levels (due to lack of interest) I know how I would do it for NES games.

In FCEUX I'd set a write breakpoint for the part of the nametable that will be changed, and see where the game got that info from. Then I'd change what I find to see what does what. As for using a hex editor to edit the levels, sure, that's the old school way, but as Squall said, an actual editor with a GUI would be a better option, especially if you're going to make a whole new pack of levels.

I think I'll test out my theory soon and see how it goes. :) But if that utility mentioned above lets you provide details about any game and then edit levels, that would be awesome, far better than an editor that only edits, say, Super Mario Bros (or JTS for that matter).

EDIT: that CadEditor looks pretty cool. I do, however, think it'd be better to have a system where you can add the games yourself based on your own hacking knowledge. This is fine if you're a total n00b who just wants to have fun making new levels for a popular game, but if you're someone like me who could do it with a hex editor but just doesn't want to spend the time, a more flexible one would be good. I wouldn't want to have to say "please mister, can you add support for Obscure Famicom Game?" :)

Doodle_Dangernoodle

Squall_FF8 The thing is, I have been talking with him, but he has only done RAF World (The Japanese version of Journey to Silius) And the rom I want to edit is the US version.

Squall_FF8

Quote from: PasthorRothers on April 30, 2018, 03:22:20 PM
Squall_FF8 The thing is, I have been talking with him, but he has only done RAF World (The Japanese version of Journey to Silius) And the rom I want to edit is the US version.
Well, that is great. In my experience the data between versions is 100% the same (exception text/graphic containing the specific language).

I'm really not familiar with the CadEditor but, it is using some kind of configurations. For each game it should have things like starting address of a level. So you can get that address from there. Goto that address in J version and copy at least 5 bytes. Then go in the US version and try to find that sequence. If there are multiple occurrence in US, then copy more bytes. Repeat that until you pinpoint only 1 address.
Now that you know the starting address, try to figure out how long is a level (in bytes). Go to CadEditor and change the bottom-rightmost tile in J version. Try to find that change in the ROM. Pretty much changed tile address - initial address is your length or close to it.
After you know the initial address and length - change design on the level in J version. Then copy Length bytes to US version, starting in initial address.

It is also possible to trick CadEditor: change the address in the configuration to contain US version, then load the US version. (needs testing)
Welcome to the FF5 Den: https://discord.gg/AUqDF85

Doodle_Dangernoodle

So this is what pops up but I don't know what goes in each slot. It just keeps giving me this error:

Squall_FF8

In "ROM file name" you link your ROM (J).
In "Config file name" you should choose the right config. According to the tool thread it has 1000+ configurations, so you need to find the one that matches the J version (since you said he has only the J one).

As for the error I can't say is it because something went wrong or you lack the right .net version... Does it work OK with other ROMs listed in the util?
Welcome to the FF5 Den: https://discord.gg/AUqDF85

PolishedTurd

CadEditor is a cool tool, but it needs everything just right in order to work. It looks as if you clicked Open without having a config file or ROM file selected, so the application doesn't know what to open.

For the config file name, go to the folder in CadEditor called settings_raf_world, then choose Settings_RafWorld-1.cs. For the ROM file, navigate to where your RafWorld ROM is. Then click Open.

Squall_FF8 has some great insight here. You should be able to change the level geometry in CadEditor for the Japanese version of the ROM, then paste your modified data back into the US version.

There is also a user named lancuster who has made several config files for CadEditor. Perhaps you could enlist his help, so you can edit the US version directly.


Doodle_Dangernoodle

Okay, but now it shows this error: "Object Reference not set to an instance of an object"

DavidtheIdeaMan

Glad to see that you took my advice in getting help,hope you keep getting help. :)

PolishedTurd

For the first level, the big block data begins at 0x20. A screen is 8x8 big blocks, so if your hex editor is set to display 16 bytes wide, one row on the screen is half a row in the hex editor.

But you don't need to use a hex editor! I have tried opening Journey to Silius in the CadEditor, using the settings for RAF World, and it works! Lucky you, the level data is in exactly the same place for both games, so you should be able to get it to work.


Squall_FF8

Quote from: PolishedTurd on May 02, 2018, 08:07:35 AM
But you don't need to use a hex editor! I have tried opening Journey to Silius in the CadEditor, using the settings for RAF World, and it works! Lucky you, the level data is in exactly the same place for both games, so you should be able to get it to work.
Good job @PolishedTurd  :thumbsup:

It seems @PasthorRothers got quite lucky! Good luck with editing the levels now  :beer:
Welcome to the FF5 Den: https://discord.gg/AUqDF85

Doodle_Dangernoodle

Quote from: PolishedTurd on May 01, 2018, 08:43:54 AM
CadEditor is a cool tool, but it needs everything just right in order to work. It looks as if you clicked Open without having a config file or ROM file selected, so the application doesn't know what to open.

For the config file name, go to the folder in CadEditor called settings_raf_world, then choose Settings_RafWorld-1.cs. For the ROM file, navigate to where your RafWorld ROM is. Then click Open.

Squall_FF8 has some great insight here. You should be able to change the level geometry in CadEditor for the Japanese version of the ROM, then paste your modified data back into the US version.

There is also a user named lancuster who has made several config files for CadEditor. Perhaps you could enlist his help, so you can edit the US version directly.
I did exactly what you said, but it still gives me an error. This tool is either broken, or I am just incredibly dumb  :P

DavidtheIdeaMan