Author Topic: .  (Read 3421 times)

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« on: 2011-12-09 16:26:01 »
.
« Last Edit: 2015-11-16 07:21:22 by Jenova's Witness »

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: Looking for some low level tools, and advice.
« Reply #1 on: 2011-12-09 22:15:56 »
Are you referring to this?

Gemini provides the source code, albeit without much documentation. But how much use it'll be is another matter. From what I can remember, his libraries abstract the process of reinserting files into blank sectors and overwriting the FF7-specific YAMADA.BIN, and maybe handling FF7's LZW-compressed data. I would be surprised if much of that was relevant to SaGa frontier. And even if it were, it wouldn't really let you do an awful lot - uncompressing data doesn't reverse-engineer it.

As for the basic idea behind your editor, check my thread 'A New Modding Paradigm', where I suggest we move to distributing low-level libraries that abstract data handling, and work with high-level scripting languages to build editors that exchange data in XML-like formats.

As for which language to learn... well, it depends what you want to *do*. Also, without wanting to sound condescending, do be aware that C and C++ are not actually the same language (though most C code will be valid C++).
« Last Edit: 2011-12-09 22:18:18 by Bosola »

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #2 on: 2011-12-10 18:01:57 »
.
« Last Edit: 2015-11-16 07:21:32 by Jenova's Witness »

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: Looking for some low level tools, and advice.
« Reply #3 on: 2011-12-10 19:22:00 »
No, that's not it.  I thought Gemini coded a few tools in C for quickly inserting and extracting files from a disk image.  Maybe I was thinking of Valendian (and Vagrant Story).

I'm not sure if you're aware of what you actually need to perform the tasks you want. Gemini's libraries, as far as I recall, just find blank sectors and update the LBA+Size tables dotted around FF7 discs in known locations. These aren't going to help with a different game.

Quote
I don't think we need even that much, for a static data table editor.  We just need a tool that can decompress the disk image, another that can navigate around the directories in the game files, one that opens the correct game files, and one last one which writes the modified static data tables to the correct addresses.  There's no need to read game files to extract the data tables, when we can just use a data table in a plain text file as our generic starting point.  And that data table could be modified if, say, you're keeping track of changes over different versions of, say, a hardtype patch.

I don't quite understand your objection. Nor am I quite sure what you mean by 'data table'. Do you mean a dictionary with key-value pairs?

Quote
The other important thing is the patch format.  It doesn't matter that the patches are compressed, since we can put them in compressed archives, but each patch - which I assume will just be static data tables - must have meta data which identifies where that static data table is loaded in the editor, the path to the correct game file, and the address in the game file where it will be written.

Wouldn't it be better if the lookups were handled by the tools themselves? Making patches build-specific sounds like a bad idea.

Quote
Also, I there could be low-to-mid level scripts/tools which alter relevant settings in the game editor as related changes to the game are made.  Like, if you rename the spell Fire 2 to Fira in the text editor, then the name of the ability Fire 2 in the editor will appear as Fira.  It should make it easier to keep track of your changes.

Wouldn't it be easier just to abstract the binary data completely? Building scripts to badger your editors into recognizing changes in other parts of the game will prove a rather brittle solution, and one very difficult to maintain.
Quote
I know that, but I also know that learning C will make learning C++, and other languages, much easier.

I'd advise against it. C is rather procedural, and doesn't have a lot in common with the object-orientated paradigms of modern languages. There's a real risk that when you work with other languages, you'll still be trying to write in a procedural fashion (some call this 'writing FORTRAN in Java'). This could harm you in the long run.

Quote
Not to mention that C is, if what I hear is true, a good enough language for a newb trying to make such low level tools.

Almost all languages give you byte-level IO manipulation, if that's your concern.

Another thing: I can't articulate why, but it feels as though you're thinking of editors that manipulate binary data at a high-level. That is, you expect your enemy editor to move bytes around. Call it a hunch. If that's a case, I'd suggest reading about concepts like abstraction and encapsulation. It'll save you a lot of pain in the long run.
 
Because of this, and because I don't think you want to add 'handling GUIs in ANSI C' to your list of things to learn, I'd suggest you work in an expressive, object-orientated language with a wealth of rapid-development GUI frameworks. Might I suggest Python?
« Last Edit: 2011-12-10 19:45:47 by Bosola »

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #4 on: 2011-12-10 19:53:46 »
.
« Last Edit: 2015-11-16 07:21:43 by Jenova's Witness »

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: Looking for some low level tools, and advice.
« Reply #5 on: 2011-12-10 22:31:42 »
Let's say version 1.0 doesn't have support for editing the ability data table.  Let us further suppose that version 1.1 adds support for the ability data table.

...

Hah, you're right.  You only need meta data for identifying the different data tables.  Like, <table type="static" name="ability_data"></table>.  The editor will then look up where to write this particular table to.

Even better - your friends can start releasing mods for the US release of SGF whilst you're still developing support for the JP version (which has different lookups), but will still be able to apply their American mods to the Japanese release later on, letting the latest version of the editor worry about the different addresses.

Quote
Again, newbie non-programmer at work, beware of falling "WTF?" blocks.  Yeah, you're right, I just like the simplicity of plain text.  You don't have to worry about getting your xml right.

It feels like you could really gain a lot by learning some OOP and functional-programming concepts. There isn't space for a full explanation here, but let me give you an analogy.

You run a restaraunt called Restaurant.exe. In your kitchen you have lots of different chefs - the peelers, who peel; the choppers, who chop; and the fryers, who, uh, fry. Above them all you have the master chefs who manage the production of each particular dish.

Let's say your master chef want to add another dish to the menu - tomato soup. He tells the peeler to peel tomatoes, the chopper to chop them and the fryer to finally fry them. But he doesn't want to go into the nitty gritty of telling them *how*. He shouldn't really need to tell the peeler how to peel tomatoes - the peeler should understand peeling in general, and then apply that technique to whatever ingredient the masterchef specifies. And if new peeling techniques come into play, that's something only the peeler (and the programmer maintaining him) really needs to know about. What should really happen is that the peeling code stays with the peeler, and the chef just passes him a message 'Peel tomatoes / carrots / onions, pronto'.

In OOP terms, the master chef is abstracted from the process of peeling, and the peeler is encapsulated - his actions aren't to be directed by anyone else. When writing the master chef's code, we don't have to be able to remember everything there is to know about peeling. When writing peeling code, we don't have to worry about context - just write something that can handle any vegetable. This makes our code for each chef very readable and maintainable.

Thus with chefs, thus with programs. Your enemy editor section shouldn't have to worry about the addresses of each creature's data - it should just have to pass a message to the actual ISO handler. This way, if it turns out you screwed the addresses up, need to support a new release (eg PAL UK) or discover a better way of compressing the data, you don't have to update each and every one of your editors - just the ISO handling component.

There are other benefits to OOP too (like modelling data and associated actions together as 'objects'), but I think abstraction and encapsulation are the ones you'll find most immediately useful.

Quote
That's good to know.  I was told by other people to learn Scheme, Common Lisp, and Perl.

Odd languages to choose. I'd stick to C++ or maybe even Java if you're getting the low level experience elsewhere.

Quote
More newbness - I meant C is good for writing simple command line tools which can be used to do more advanced things with a scripting language.

So are most languages. And pretty much everything lets you put functions in a library and call them in later programs. Besides, object-orientated programming does this 'scripting' intrinsically (think of the master chef 'scripting' the peeler, chopper and fryer).
« Last Edit: 2011-12-12 20:53:45 by Bosola »

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #6 on: 2011-12-12 20:45:54 »
.
« Last Edit: 2015-11-16 07:21:53 by Jenova's Witness »