Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2017-05-10 22:07:58

Maniac379
Member
Registered: 2015-01-15
Post 75/121

[Guide] Pokecrystal Disassembly vs Hex Editing

Introduction
I have been messing around with ROM hacks for the past couple years but never really made any large hack worth sharing (yet!).  Starting out I learned a lot about hex editing/scripting from Miksy91 and was reluctant to switch to pokecrystal disassembly after having worked so much in hex.  I have since switched over with much help from Ragni.  I wanted to share my comparisons to the two processes from the viewpoint of many who would be reluctant to change.


tl:dr
Once you go past the desire to edit what a Pokemon learns when it levels up or how it evolves, especially getting into scripting, you WILL want to use pokecrystal.


Setting Up
This is the first hurdle that everyone has with getting into disassembly.  Thankfully this great video, made for pokered, will show you how to set up pokecrystal.  Substitute pokecrystal for pokered and it should be doable within 30 min.  The argument could be made that it would take longer to find all of the hex editing programs that are available.

https://github.com/pret/pokecrystal
https://www.youtube.com/watch?v=fYytG7IUUWg


Ease of Use
This is the real hurdle with pokecrystal disassembly and actually I’m going to break it down in the same manner that I learned how to use it.  With the hex editing programs that are really self-explanatory so I guess they have the edge.  The reality is after 30 min of using Cygwin and knowing commands, it is just as easy to use!  A huge pro with using pokecrystal is that by making commits, and properly labeling them, you have easily available backups and edits to use and share.  With hex editing you would have to manually back up your ROMS and if something was going wrong it would be less intuitive to share changes.  You can also easily revert to a previous commit if you are working on something and want to start over.

When you open Cygwin you may or may not be in the right directory, I noticed that the file path seems to be a little different than what my computer would use. 
My computer says the file patch is: D:\Games\Program Files\Cygwin\home\maniac379\pokecrystal

To change to that directory, I would type in either:
cd /cygdrive/d/Games/Program\ Files/Cygwin/home/maniac379/pokecrystal
or
cd d:/Games/Program\ Files/Cygwin/home/maniac379/pokecrystal

git status
//Shows what files have been changed, added, or removed since last commit
make
//Compiles the ROM, you won’t see your changes in game until you do this
git add –A
//Adds all of your files in the directory so that anything changed will be commit
git commit –m “text”
//Replace “text” with “Your actual notes” to describe your commit
git push
//Pushes your commit to GitHub

git reset –hard ###
//Replace ### with the commit code on GitHub to reset to that commit state

Another benefit without having to worry about backups is that disassembly allows you to create branch paths to work on changes that may not be fleshed out enough to add directly to your main branch of changes.


Level Up Moves Editing: OneGSEdit EvoMove Editor vs pokecrystal/data/evos_attacks
These two methods for editing are pretty similar.  It would depend on whether you prefer working with drop down menus or a word editor.  However, if you change a Pokemon/move, then using the hex editor would not let you visualize that new Pokemon/move – it would still show it as the old Pokemon/move.


Trainer Editing: OneGSCTrainer vs pokecrystal/trainers/trainers
This has the same pros and cons as level up move editing.  I have not yet done it, but I believe it would be easier to add trainers to pokecrystal as you would just add them and they would simply work.  Working with OneGSCTrainer would not be likely to accommodate the new trainer in the interface.


Wild Pokemon Editing: GSC Wild Pokemon Editor vs pokecrystal/data/wild/all files
I would argue that it is easier to edit in disassembly than using GSC Wild Pokemon Editor.  The reason for this is that GSC Wild Pokemon Editor has manual drop down menus for each locations’ 3-day cycle.  With pokecrystal you can copy and paste the wild mons in any section.  Unlike the previous two sections, this which would likely cut down the amount of overall work you are doing.  The real key here is that pokecrystal allows you to easily add wild mons to a new map by simply typing it in the same structure as existing maps.  Using GSC Wild Pokemon Editor, you would have to go out of the program and into a specific table of the hex code to add wild mons to a map that did not have them previously.


Move Editing: GSC Attack Editor vs multiple files
This would be one of the few pokecrystal edits that I would say is more work than pokecrystal.  The reason for this is solely because in pokecrystal you have to go to multiple different files (Guide: https://hax.iimarckus.org/topic/7045/).  Oftentimes a changed move will pop up in certain files that only pertain to some moves and cause make errors.  In this case it is helpful to have windows search through pokecrystal files for all instances of that error term or move name.  The advantage with editing moves in pokecrystal is that once you change a move, it will show as changed in the code.  Additionally if you want to create your own effect or animation it would be much more intuitive to do this in pokecrystal as it is basically comparing looking at a programming language versus having to translate hex to a programming language to edit.  It saves a large step in the process and you don’t have to worry about repointing to free space or shifting tables in pokecrystal because it will simply work.


Map Editing: JohtoMap vs Crowdmap+pokecrystal/maps/all files
You might think that map editing would be easier using the JohtoMap but actually pokecrystal has its own equivalent program.  Crowdmap (https://github.com/yenatch/crowdmap) is the most common available solution and works essentially the same as JohtoMap.  The only slight downside is that the program is not perfect and changes more in the map files than it needs to.  It is suggested to only really use it to visualize/edit the maps.  If adding a map in Crowdmap, follow this guide (http://creativiii.com/guide-pokecrystal-disassembly/) to the tee.  Ragni has python scripts available to avoid Crowdmap all together by providing a visual representation and then editing the files in hex.  This would be the only hex editing that you would do in pokecrystal.  Pokecrystal and JohtoMap are really pretty even, the huge difference is in scripting – which even with scripting plug-ins, JohtoMap is much slower.

Crowdmap commands:
python crowdmap/server.py 8000
//Crowdmap is now usable in browser at:
Ctrl+C
//Closes out of script


Scripting Editing: Hex vs Disassembly
This is the type of editing that really highlights the differences between the two methods and the advantages of pokecrystal.  I have been referring to programs as hex editors even though they do not usually even show hex code, they have interfaces.  Scripting in hex does not.  Sure there is pksv add-on for JohtoMap but it is inconsistent from my experience.  Scripting in hex almost always involves finding free space at the end of the ROM bank and repointing existing scripts.  Scripting in disassembly involves simply adding it in to the proper map.asm file.  Scripting in a hex editor requires you to actually read hex code and either memorize what everything is, or translate hex to commands.  For things like calling other scripts you would need to know their offsets every time.  In disassembly you do not need to translate, you can simply type out the commands and each script has a name that you can call it by rather than an offset number.  There is really no comparison between the two methods, disassembly is much faster and easier to script with.


Editing Anything Else
When it comes down to it.  If you want to edit anything else in hex, you cannot (exceptions to this).  There are only so many hex editing programs and they do not do everything.  You want to add running shoes?  Sure that has been discovered how to do in hex.  It is also known how to do that in disassembly.  When it comes down to it, if you want to do something new in the game, it is much easier to figure out in disassembly.  Simple as that.

Last edited by Maniac379 (2017-05-10 22:14:29)


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

#2 2017-05-13 21:36:27

Miksy91
Member
Registered: 2010-10-16
Post 2,311/2,339

Re: [Guide] Pokecrystal Disassembly vs Hex Editing

Disassembly editing indeed allows doing lots of things more easily than by hex editing the changes, or by using a game-specific editor for the job. The game-specific tools we have aren't after all "intelligent" (like the compiler used with pokecrystal). They just serve generally the purpose of not having to work with the data with a hex editor which is not a comfortable way to view it.


But I'll totally share your point of view here. I'm also a little bit "sour" of not having the possiblity of using disassembly for Dark Energy. I have some ideas I'd like to implement which are "hard problems" even with disassembly. I feel I have some workarounds for these which either way require some asm hacking, but these workarounds should at least be human-doable by editing a rom file with a hex editor (and another hex editor with asm routine viewing possibility ("GB ASM Editor")).
And yet to mention the fact that it's "great" having to re-write text to translate it into proper English by not having enough free space for the text to write in place of the original text data.

Other than those problems, haven't had much trouble editing a rom file straight. But I've really gotten used to it (= G/S/C hacking) after doing it for several years. If you don't have much experience, there are lots of tricks and pitfalls you may fall into if you try doing something fancy by straight rom file hacking. Especially when some game-specific editors are buggy, but you feel like you want to use them anyhow.

So I also suggest definitely disassembly instead of the old-school way of doing rom hacking. Knowing how to do the latter one really helps with disassembly though.

Last edited by Miksy91 (2017-05-13 21:41:04)

Offline

Board footer

Powered by FluxBB