• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 19, 2024, 10:00:30 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Miluda, a simple world map instruction de/constructor

Started by Satoh, September 04, 2017, 11:30:46 pm

Satoh

Ok, so, all this really does is convert a set of world map instructions in hexadecimal to a readable format.
It has some error checking, but it's probably not the best.

Ideally you would only input properly formatted instructions in and it will convert it to something you can read a little easier.
It also has an instruction formatter, which will guide you through what information is needed for an instruction, and generate the instruction when it has all the info it needs.

It will NOT read the wldcore.bin instruction header or calculate space and offsets for you, you're still better off using a spreadsheet for that for now...
but now you can at least check your work on what you're adding to the spreadsheet to ensure that it is good code.

This is currently a very young version of this project, and time permitting, I may expand and update it. Until then, its one slightly smaller hassle than you had before, if you do story mods.


I'm sure I haven't thought of EVERY possible user error or flawed code entry, but, as far as I've tested, I've worked out all the breakages from proper code entry. Please let me know if you get some huge error.

Everything is hard coded for now, but I may add a config file for customized text output later.
Coded for .NET 3.5, hopefully by now you all have that... unlike 4.6.7 which I had to install a few days ago and was a pain.

EDIT: Just making sure I uploaded the correct release.
  • Modding version: PSX

Elric

  • Modding version: PSX

Angel

It may seem minor to you, but tools for story mods are so very welcome. Thank you for this.
  • Modding version: PSX
* Angel should quit being a lazy bitch
<@Elric> I agree to that as well

nyanyame nyanyajuu nyanyado no nyarabide nyakunyaku inyanyaku nyanyahan nyanyadai nyannyaku nyarabete nyaganyagame
At the end of the day, are we not all trapped inside lemons?

Xifanie

Going with your current format, I'd probably go with something like (with let's say Gariland):
[indent=2]IF Var 0x006D == 0x0000 && Var 0x006E == 0x0001 THEN Text 0x0000
IF Var 0x022F == 0x0000 && Var 0x006E == 0x0001 THEN DrawPath 0x06 - 0x18
IF Var 0x0218 == 0x0000 && Var 0x006E == 0x0001 THEN DrawLocation 0x18
IF Var 0x022D == 0x0000 && Var 0x006E == 0x0001 THEN DrawPath 0x18 - 0x02
IF Var 0x0202 == 0x0000 && Var 0x006E == 0x0001 THEN DrawLocation 0x02
IF Var 0x006E == 0x0001 THEN LoadEvent 0x000D (0x0002)[/indent]

Even better would be with variable, paths, and location name customization:
[indent=2]IF Var "Call Worldmap Message" == 0x0000 && Var "Storyline Progression" == 0x0001 THEN Text 0x0000
IF Var "Gariland <-> Mandalia Path" == 0x0000 && Var "Storyline Progression" == 0x0001 THEN DrawPath "Gariland" -> "Mandalia Plains"
IF Var "Mandalia Plains" == 0x0000 && Var "Storyline Progression" == 0x0001 THEN DrawLocation "Mandalia Plains"
IF Var "Igros Castle - Mandalia Plains" == 0x0000 && Var "Storyline Progression" == 0x0001 THEN DrawPath "Mandalia Plains" -> "Igros Castle"
IF Var "Igros Castle" == 0x0000 && Var "Storyline Progression" == 0x0001 THEN DrawLocation "Igros Castle"
IF Var "Storyline Progression" == 0x0001 THEN LoadEvent 0x000D (0x0002)[/indent]

Although at that point it might be better to have one per line:
[indent=2]Var "Call Worldmap Message" == 0x0000
Var "Storyline Progression" == 0x0001
Text 0x0000
---
Var "Gariland <-> Mandalia Path" == 0x0000
Var "Storyline Progression" == 0x0001
DrawPath "Gariland" -> "Mandalia Plains"
---
IF Var "Mandalia Plains" == 0x0000
Var "Storyline Progression" == 0x0001
DrawLocation "Mandalia Plains"
---
Var "Igros Castle - Mandalia Plains" == 0x0000
Var "Storyline Progression" == 0x0001
DrawPath "Mandalia Plains" -> "Igros Castle"
---
Var "Igros Castle" == 0x0000
Var "Storyline Progression" == 0x0001
DrawLocation "Igros Castle"
---
Var "Storyline Progression" == 0x0001
LoadEvent 0x000D (0x0002)[/indent]

Of course, with the option to edit sets or individual lines.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Satoh

That's certainly something I'd like it to do in the future, and I'm continually trying to think through the efficient process of linking all the instructions together intelligently, such that one instruction knows what the previous instruction just did, for linking multiple conditions...

But right now its simply a dumb text parser based on an admittedly messy dictionary setup.
A prototype at best, but one that was more or less usable for smaller things.

I did notice something I forgot to check for in the current r0 release... I didn't check that information typed into those comboboxes at the bottom were proper numbers... so... be responsible and don't just start typing sentences in there for now?

I'm currently working on a more intelligent set of classes to (hopefully) be able to do something more meaningful with the actual WLDCORE...
That said, I can't guarantee I'll succeed, or that I'll be able to show that off anytime soon if I do.
It'll take a while, and the way the WLDCORE headers work is... not what I would consider optimal.
The instruction header is in two stages, which you, Xifanie, are probably aware of...
The first stage is 44 shorts, one for each location in the game, each leading to a point in the second stage of the header. That second stage is a collection of more offsets, each leading to the start of a full map instruction... the list appears to be terminated with a 0x0000 null short...
However, as there is no point in the header structure that actually lists how long any of these lists or instructions are, its a but of a mess trying to confirm those lengths.

If I parse that header iteratively, I'd have to continually be checking that each short I read isn't overlapping somewhere else, just to determine if I've actually reached the end or not...

Which in non-programming/reverse engineering terms, is a pain in the rear.

tl;dr version:
I'm working on it =p

EDIT:
Well I have it all read into a class structure now at least... coded myself into a corner as to how to make it alterable though...
  • Modding version: PSX