Author Topic: [FF7] Programing Toolkit - ff7tk  (Read 15421 times)

sithlord48

  • *
  • Posts: 1632
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
[FF7] Programing Toolkit - ff7tk
« on: 2012-03-23 14:37:35 »
      Today i am happy to announce that FF7tk is now ready to have its first release.


      FF7tk WTF is that ???

      allow me to explain as some of you may know myself and a few others (vegeta_ss4,eslava) have been working on a toolkit for working with data from ff7. this toolkit will (eventually) cover ALL of the stuff needed to work with ff7 files. (everything from save data  to model info). this toolkit is written in C++ and Requires Qt (but this will make any programs you make cross platform,you can use any lang for your program that is qt supported).its under the GPLv3(so if you change it we want to see your code!) Programmers are encouraged to provide requests for objects, or info about things they already know.

      What is currently included. (
complete list)

Currently there are only a few objects that deal mostly with stuff needed for black chocobo (as it is now build using FF7tk). but all the text data returned will be translated for you already (working on how to getting the translations used per class instead of per application , but the strings are done already)





static_data classes included
  • FF7Save -class for working with save files
  • FF7Item -data class that know all about items (and icons)
  • FF7Materia - data class that know all about materias(and icons)
  • FF7Location - data class that know all about field location data
  • FF7Text - data class for converting text to/from ff7 format to your lang.
  • FF7Char - data class that contains info about characters in ff7(and icons)
  • FF7Achievements - class for working with achievements.dat from 2012 and 2013 releases
  • SaveIcon - class for decoding psx save icons- Written by Myst6re
Utilities Include:
  • LGP - Object for working with LGP archives
  • LZS -  Object for working with LZS archives
Widgets (gui objects) Included:
  • ItemPreview - Show item data (only need its id)
  • ItemSelector - Widget for selected Items for your inventory
  • ItemList - inventory management widget
  • DialogPreivew -show prevew of the ff7 text dialog (or change its colors)
  • SlotPreview - Show Slot Preview using Description data (or show psx save info)
  • SlotSelect - Dialog for Selecting a Save Slot to view
  • MateriaEditor - View/Edit A Selected Materia
  • CharEditor - View/Edit a Character(wip)
  • OptionsWidget - View/Set All Game Options
  • DoubleCheckBox - 1 Label 2 Checkboxes.
  • PHSListWidget - Manage Visible/Locked PHS Entries
  • MenuListWidget - Manage Visible/Locked Menu Entries
  • ChocoEditor - Edit a Chocobos Data
  • ChocoboLabel - Stable Preview Widget. 
  • ChocoboManager  - Manage your Chocobs Easily
  • MetaDataCreator - Convert old saves to FF7 2012 Cloud Saves


Where is this going???
as i said currently most of the items are focused on save game stuff. but eventually we are planing to include EVERYTHING needed to provide a High Level toolkit for easy creation of cross platform tool for working with and modifing ff7

Where can i get it?

You can Get it Here
Documentation is here

The toolkit includes a small demo program so you can view the widgets. you only need qt to build the included demo program.

Good Idea How can i help?
help us code , provide info on formats, give us your exsisting code so we can port to Qt, etc. these are all ways you (the person already making an ff7 specific app) can help.i would love to see all of qhimm embrace this and have us not duplicate work on these tools ever again.[/list][/list]
« Last Edit: 2022-08-06 13:24:30 by sithlord48 »

Vegeta_Ss4

  • *
  • Posts: 40
  • Dark Wizard of the Savegame
    • View Profile
    • Black Chocobo
Re: [RELEASE] FF7tk
« Reply #1 on: 2012-03-23 15:06:48 »
I think this will write a very important page in the ff7 devel. I'm glad to be part of this so promising project, and you will have me coding side by side as always.

I encourage all the community to help and form part of this project. One of the more promising goal is to been able to dev universal global toolkit that embrace all the scenarios.

Welcome FF7tk Toolkit!

obesebear

  • *
  • Posts: 1389
    • View Profile
Re: [RELEASE] FF7tk
« Reply #2 on: 2012-03-23 16:07:54 »
I like it and thoroughly encourage this.

Dark_Ansem

  • *
  • Posts: 319
    • View Profile
Re: [RELEASE] FF7tk
« Reply #3 on: 2012-03-26 16:54:00 »
I like this and I hope that, for the model editing, you join up with Borde, the author of kimera, in order to improve on the features of that mod :D
maybe this can join as well with the new versions of WallMarket and Proud cloud the author is working on?

sithlord48

  • *
  • Posts: 1632
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #4 on: 2012-03-26 17:22:42 »
i would love it if those people who know about certain parts can work with us to create a toolkit we can all use.

Dark_Ansem

  • *
  • Posts: 319
    • View Profile
Re: [RELEASE] FF7tk
« Reply #5 on: 2012-03-26 17:24:05 »
AFAIK they're both very busy, but one can try....

sithlord48

  • *
  • Posts: 1632
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #6 on: 2012-07-03 18:32:27 »
THIS POST NEEDS LINKS FIXED!

While Work on this project has been slowed down a bit there is still progress being made. For some objects we are waiting for Qt 5.0 to come out so that we can use some of the newer features. For older objects there will only need to have small update to build with Qt 5.0. ( this is basicly Done already and it all works under Qt5 currently)

Some FF7Tk Related News:
  Updated: CharEditor, mostly completed.needs the layout optimized before i am ready to use it in black chocobo.(its to large)
  Updated: All Static Data Classes Have Been updated.
  New: ChocoboEditor Widget to Edit your Chocobo Stable.

Some Data on the Objects of Use: (start of Documentation)

SEE GITHUB WIKI FOR  DOCS (still being created)

Please Note: Requirements for items only count the files from the Tk that need inclusion in your project. All objects require Assorted Items from the Qt Toolkit.

FF7Text - Convert Text To/ From FF7 Format

FF7Save - The Core Object for Working with FF7 Save Games.

Requirements for use:
FF7Save_Const.h  - All consts placed here
FF7Save_Types.h  - All Custom Types for this class here.
FF7Text.h  - Text Conversion Object

Loading and Saving Functions

bool  loadFile(const QString &fileName)
bool saveFile(const QString &fileName)
Load or Save fileName (type is auto detected)

bool exportPC(const QString &fileName)
bool exportVMC(const QString &fileName)
bool exportDEX(const QString &fileName)
bool exportVGS(const QString &fileName)
Export data as that type to fileName , all 15 slots

bool exportPSX(int s,const QString &fileName)
Exports Slot s to raw PSX format file name fileName.  (even if more then one data block)

bool exportCharacter(int s,int char_num,QString fileName)
Exports Character from slot s in character slot char_num to fileName

bool importCharacter(int s,int char_num,QByteArray new_char)
Imports new_char (raw 132 byte array) to slot s in character slot char_num.

All Above Functions Return 0 if Fails to load/save fileName

void importPSX(int s,const QString &fileName)
void importPSV(int s,const QString &fileName)

Imports data from fileName to slot s

void clearSlot(int s)
clears data in slot s (fills with 0's)
void copySlot(int s)
saves slot s into a buffer

void pasteSlot(int s)
pastes save stored in buffer to slot s

void newGame(int s,QString fileName="")
Puts default Save in slot s  if no fileName is provided.
if a fileName is provided it MUST BE PSX Format data.

void newGamePlus(int s,QString CharFileName,QString fileName="")
Creates a new Game + in slot s. exports cait/ vincent to CharFileName.
if no fileName is provided will use default save to make the new game +
if a fileName is provided it will be used to create the new game + it MUST BE PSX Format.

File Info Functions (the headers code says it all)

int lenFile(void);//Return File length.
int lenFileHeader(void);//Return File Header length
int lenFileFooter(void);//Return File Footer length
int lenCoreSave(void);//Return Slot length (data portion)
int lenSlotHeader(void);//Return slot header length
int lenSlotFooter(void);//Return slot footer length
int lenSlot(void);//Return Slot length
int numberOfSlots(void);//Return number of slots in the file_footer_dex
QString type(void);// Returns the file type loaded.
bool isFF7(int s);//valid ff7 slot?
bool isPAL(int s);//PAL SLOT?
bool isNTSC(int s);//NTSC SLOT??
bool isJPN(int s);//is a Japanese File
QString region(int s);// region string of slot s
//Set Needed Info Stuffs
void setType(QString);//allows for slot change.
void setRegion(int s ,QString region);
QByteArray slot_header(int s); //return slot header.
quint8 psxBlockType(int s);//mask of psx slot (used by index)
quint8 psxBlockNext(int s);// if using more then one block return location of next block
quint8 psxBlockSize(int s);//how many blocks save uses.
void fix_pc_bytemask(int s);// update so last slot is shown selected on load (must be public to set to currently viewed slot).

FF7Char - Info About Characters.
FF7Item - Info About FF7 Items
« Last Edit: 2014-07-30 15:53:01 by sithlord48 »

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #7 on: 2012-07-03 18:48:06 »
.
« Last Edit: 2015-11-16 10:03:36 by Jenova's Witness »

sithlord48

  • *
  • Posts: 1632
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #8 on: 2012-07-03 19:27:29 »
Thank you for doing this, and doing it right.

Request:
*Instructions on adding your PPA to my sources

*Instructions for linux newbs on what to git clone, and a list of sudo apt-get commands to get all the required dependencies.

add my ppa in (*)buntu thread about there here:
http://forums.qhimm.com/index.php?topic=11928.msg165409#msg165409

instructions.. well i don't use git. and  to build the FF7tk you neeed the source (link in first post above) and extract it
then for programs you can install them easily with the following command
Code: (run in terminal) [Select]
sudo apt-get install build-essential qtcreator

after you install you just have to open the .pro file in Qt Creator and build the Program.

Also, I noticed you're using qt.  Are you sure that's a good idea for something as simple as a game editing program (though editing FF7 isn't exactly simple).
  Do you think it may be a better idea to use something smaller, like, say, Phoenix, or GTK?
No i think Qt is perfect for this project. it has more os support then either of those toolkits mentioned.None of those toolkits run on phones,linux, windows, mac os Qt does. above i said something about not having to dupilcate work if you have to recode to make it work on an os or a device your redoing work. also unlike GTK, QT looks good on more then just Gnome.

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #9 on: 2012-07-03 20:17:07 »
.
« Last Edit: 2015-11-16 10:03:23 by Jenova's Witness »

sithlord48

  • *
  • Posts: 1632
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #10 on: 2012-07-03 20:26:11 »
i've been coding w/ Qt for quite some time, in my code i rarely run into a problem with Qt itself , also that is over 2 years old. and most of it only either applies to windows or items i don't use or wouldn't need to use.

luksy

  • *
  • Posts: 375
    • View Profile
Re: [RELEASE] FF7tk
« Reply #11 on: 2012-07-04 02:54:32 »
I've started rewriting the file twiddling code I used for touphScript, here's what I have so far

https://dl.dropbox.com/u/3227870/libs.7z

I haven't finished most of it yet, dunno if any of it is useful to you but just in case.

One suggestion: as I'm sure you know, the ingame text has subtle differences depending on where it's used - the meaning of the opcodes can change (e.g. 0xEA in scene.bin), unavailable ops (e.g. tab in world map) - so FF7Text will probably need to provide other functions (or be subclassed).

Although I support it all in touphScript if you want to have a look, the code is pretty awful (hence the rewrite).

I'm happy to help out either way.

Borde

  • *
  • Posts: 891
    • View Profile
Re: [RELEASE] FF7tk
« Reply #12 on: 2012-07-04 20:36:18 »
Nice idea sithlord48. Had this been done earlier, I'm sure we would have avoided some headaches. I don't feel like rewritting my code anymore, though. I've got some ported to C though. I can post it if you're interested.

sithlord48

  • *
  • Posts: 1632
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #13 on: 2012-07-05 20:05:09 »
@luksy , i currently only know about text in the save format , but FF7Text can easily be subclassed or modified to have different versions. , thank you for the 7z stuff i will work in porting as soon as i get a chance.

@ Borde, i should have done this much eariler. but it started out as a rewrite of BC and then i realized that we could use a proper kit so i figured its best to start with what i knew about.  i will take what ever code you wish to provide(in c or not), credit will be given of course, and when im done what ever i end up with will be gpled