Author Topic: New Project  (Read 534 times)

Squall

  • Iron Claw
  • *
  • Posts: 408
    • View Profile
New Project
« on: August 11, 2017, 01:51:22 AM »
Hey guys, lets make a new project for FF5!

Its been around an year since I have coded something for FF5, so my hands kind of itching :)
If you have in mind an idea - please share and lets discuss it to form a new project.

Project specification:
- it should not be a hack, although I'm fairly good with the assembly;
- it will be a separate program for Windows, build from the scratch (so we own all the rights)
- it can be a tool, an editor, viewer, ...

So if you have something in mind - bring it on! :)

Jorgur

  • Moderator
  • *
  • Posts: 435
  • Gender: Male
    • View Profile
Re: New Project
« Reply #1 on: August 12, 2017, 08:07:00 AM »
I know I've said this before, but how about making the Viewer into an Editor?

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 216
  • Gender: Male
    • View Profile
    • My page
Re: New Project
« Reply #2 on: August 12, 2017, 10:39:00 AM »
I was thinking the same as Jorgur, why not creating an ultimate tool with all the info we have now?!
I had the intention of learning C# and import mine, but never got around it >.<

IIRC the viewer still misses a couple of options that my tool does have, like:
- Base stats table (HP, MP, Exp)
- Shop info
I'm the best in the universe! Just remember! [F-zero X]

Squall

  • Iron Claw
  • *
  • Posts: 408
    • View Profile
Re: New Project
« Reply #3 on: August 14, 2017, 02:43:01 AM »
Lets say we convert the Viewer into editor. What benefit we will get from it (compared with existing ones)? Personally I don't want to create 'yet another editor'. If we will do new editor it must have more options, to be easier to use, ...

Anyway IF you have a clear vision of how a new editor will look and what new features it will have, lets do it. Please share in details your vision, the layout of future editor. We can start with something and then upgrade/improve. What is your suggestion to start with?


samurai goroh

  • FF5 Hacker
  • *
  • Posts: 216
  • Gender: Male
    • View Profile
    • My page
Re: New Project
« Reply #4 on: August 14, 2017, 06:38:52 PM »
Something I'm not fond of the current viewer is that it tries to have all info in "one window". While is nice quickly jump from one tab to another it feels like sometimes the info is scattered and other times is clustered. Also, the tabs feel out of order.

One thing I forgot on the other post, not sure if it's used by others but my editor has the option to create a txt file with the info. While is kinda rudimentary I believe it can be a nice feature to incorporate, specially if you could combine it with filters like looking for specific attribute or similar (e.g. enemies weak to Petrify)...

Something that IMO screams a must have in order to have a new editor is the option to edit sprites (be it for characters, enemies, backgrounds, etc).

I'll try to come up with a mock-up because designing the GUI is in my opinion one of the most vital parts of a program, other than actually working as it should >.<

Lets say we convert the Viewer into editor. What benefit we will get from it (compared with existing ones)? Personally I don't want to create 'yet another editor'. If we will do new editor it must have more options, to be easier to use, ...

Anyway IF you have a clear vision of how a new editor will look and what new features it will have, lets do it. Please share in details your vision, the layout of future editor. We can start with something and then upgrade/improve. What is your suggestion to start with?
One obvious reason is to just depend on a single tool rather than using multiple ones. And as you mention, simpler tools will attract more people. There is no Read me nor Help section in the viewer and since it also handles the GBA version, some features are not present for the SNES and will throw an error rather than just being disabled...
I'm the best in the universe! Just remember! [F-zero X]

Squall

  • Iron Claw
  • *
  • Posts: 408
    • View Profile
Re: New Project
« Reply #5 on: August 15, 2017, 03:28:53 AM »
Quote
Something I'm not fond of the current viewer is that it tries to have all info in "one window"
Hehe that is a 'fault' by design. I like it that way - when I need an info, if I can get it just by moving my eyes - goal is achieved :D

Quote
While is nice quickly jump from one tab to another it feels like sometimes the info is scattered and other times is clustered. Also, the tabs feel out of order.
I know it feels that way ... My goal was to separate info in logical section (tab), and put all possible info there. So when you use it - sometimes it fills filled to to rim (because there is so much to show), sometimes it feels empty (because there is so little info)

Quote
Something that IMO screams a must have in order to have a new editor is the option to edit sprites (be it for characters, enemies, backgrounds, etc).
Indeed, in general graphic and music editing is a major whole and one of the reason for people not-willing to create a major mods for FF5.

Quote
IIRC the viewer still misses a couple of options that my tool does have, like:
- Base stats table (HP, MP, Exp)
- Shop info

Yeah and not just that - major thing like Character ... there is always more room to expand :D

Squall

  • Iron Claw
  • *
  • Posts: 408
    • View Profile
Re: New Project
« Reply #6 on: August 28, 2017, 01:46:55 AM »
I'm thinking to upgrade my CalcDMG project to next level - actually performing a whole battle vs selected monster, rather single hit. Something like arena - you choose who to battle and perform the battle.

I think I have the needed info except details around ATB system. So please write down every bit you know about ATB regardless how obvious it may seem!

Also although I was thinking not to upgrade any more the Viewer, after samurai goroh last post I'm seriously thinking of adding Character info, so please write down what do you think is essential part of that info.

Praetarius5018

  • Siren
  • *
  • Posts: 78
    • View Profile
Re: New Project
« Reply #7 on: August 28, 2017, 04:58:50 PM »
needed ticks before an action can be chosen:
120 - AGL
x2 for slow
x0.5 for fast
at least 1
then you need at least one more atb tick even for moves that should have 0 delay, read delay from 115DA0+ability id

that's all I have

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 216
  • Gender: Male
    • View Profile
    • My page
Re: New Project
« Reply #8 on: August 28, 2017, 08:52:34 PM »
First off, listing what is mentioned on the algorithm FAQ

Quote
SLOW - ATB takes twice as long to fill.
HASTE - ATB takes half as long to fill.
STOP - Timers associated with the target will not increase (ATB,...)
CONTROLLED - Monster's AI script is overridden. They will not follow any React scripts or Condition scripts and overrides being Flirted as well. When the controller's ATB fills up, they can make the monster issue one of the attacks that are listed under "Control" in the Monster Data section. The controller can choose who to target with the attack as well.

INITIATIVE:  Wielder begins the battle with their ATB full (always gets the first chance to act, used by Masamune)

Quote
---------------------
6.11) ATB CALCULATION
---------------------
1) Everyone's ATB is a measure between 0 and 255.
2) Initial values at the start of battle = ??
3) Eveyone's ATB increases at a constant rate (unlike FF6-9).
4) Once someone's ATB reaches 255, they can perform an action.
5) After performing an action, their ATB gets "reset" and is calculated as follows:

i)   Let N1 = 120 - Agility + (Equipment Weight/8). Minimum value = 1.
     For Monsters, use Speed instead of Agility, Equipment Weight = 0.
ii)  If they have Haste status, N1 = N1 / 2. Minimum value = 1.
iii) If they have Slow status, N1 = N1 * 2. Maximum value = 255.
     Note that Haste and Slow are mutually exclusive statuses. You can only have one or the other, but never both at the same time.
iv)  ATB = 255 - N1
In here, in point no. 4 the ATB is not increasing but actually decreasing as you can observe with the following memory addresses. When one of these address reaches 0, then the player/enemy will be able to perform their command:
Code: [Select]
7E3D7F XX          1st Player Timer Remaining Duration - ATB Gauge
7E3D8A XX          2nd Player Timer Remaining Duration - ATB Gauge
7E3D95 XX          3rd Player Timer Remaining Duration - ATB Gauge
7E3DA0 XX          4th Player Timer Remaining Duration - ATB Gauge
--------------------------------------------------------------------------------
7E3DAB XX          1st Enemy Timer Remaining Duration - ATB Gauge
7E3DB6 XX          2nd Enemy Timer Remaining Duration - ATB Gauge
7E3DC1 XX          3rd Enemy Timer Remaining Duration - ATB Gauge
7E3DCC XX          4th Enemy Timer Remaining Duration - ATB Gauge
7E3DD7 XX          5th Enemy Timer Remaining Duration - ATB Gauge
7E3DE2 XX          6th Enemy Timer Remaining Duration - ATB Gauge
7E3DED XX          7th Enemy Timer Remaining Duration - ATB Gauge
7E3DF8 XX          8th Enemy Timer Remaining Duration - ATB Gauge
Therefore, point no. 4 is actually 0 and not 255 (do to the counter decreasing and not increasing)

I would like to note something about the Agility here, every time a battle starts, your Agility may be off by +/- 1 point. This will cause that characters (or enemies) with close or same speed to attack in different order than how they would in other battles.

Quote
11.2) AI SCRIPT
This denotes a list of commands that the monster will follow during battle. After each command, the monster must wait until his ATB fills again before he can execute the next command. The exceptions are Change Target and Set Variable which do not take up any time. Also, commands executed due to React: occur immediately. Note that "Nothing" indicates that no action is taken that round, but the ATB must still fill up before executing the next command. Once the end of the list is reached, the AI goes to the beginning of the list and continues the cycle.

Note that the monster will not follow its AI script if it has Berserk, Charm or Controlled Status and will not execute any React: scripts if it has Stop, Paralyze or Sleep Status.
When a monster reacts, his ATB momentarily changes to 1, so in the next tick (frame) it can perform the reaction and then goes back to where its ATB bar was.


I would like to point out that there is some kind of glitch with the Berserker's ATB, first off their first turn works different (I never bothered to check how, so I can't be more specific here) and also it seems that when a Berserker dies & stays death for some time, when you revive him he will immediately will answer with an attack (as if the counter would still run after being death, instead of restarting from "0").
« Last Edit: August 29, 2017, 07:49:18 PM by samurai goroh »
I'm the best in the universe! Just remember! [F-zero X]

Squall

  • Iron Claw
  • *
  • Posts: 408
    • View Profile
Re: New Project
« Reply #9 on: August 29, 2017, 02:27:25 AM »
Woah, as usual - nothing is simple in FF5 :D Thank you very much Praetarius5018, samurai goroh!

samurai goroh, your notes are very very helpful! So ATB actually decrease value (the way timers work) and that makes sense because otherwise 120-AGL will mean your ATB punishes you for having high AGL. There are still few unknowns:
  • Initial value at the start of a battle. I had examine that code before, but I didn't find any initialization, so it looks kind of random. In other FFs (FF7 for example) ATB fills even after the battle is over, so if you wait on victory animations you can always start with full ATB. I wonder is something like this happens here ...
  • "Eveyone's ATB increases at a constant rate" - whats the rate? 1? Does haste/slow affect that rate?
  • What will happen if 2 or more participant end with ATB 0 at the same time?

Praetarius5018

  • Siren
  • *
  • Posts: 78
    • View Profile
Re: New Project
« Reply #10 on: August 29, 2017, 11:09:07 AM »
1. hmmm... now I want to know that, too.

2. if you have 30 AGL you need 90 ATB ticks, 90 AGL needs 30 ATB ticks
those ticks happen several times per second, slow/haste does not affect that anymore from here.
btw. haste and slow do affect the delay between action input and execution if > 1
though ticks still happen during animations

3. whoever "inputs" their move faster, for player top to bottom, gets to act/choose first; monster obviously need no decision time, so I think they similarly go by "position" (top name in in board in the bottom left).

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 216
  • Gender: Male
    • View Profile
    • My page
Re: New Project
« Reply #11 on: August 29, 2017, 11:38:06 PM »
There are still few unknowns:
  • Initial value at the start of a battle. I had examine that code before, but I didn't find any initialization, so it looks kind of random. In other FFs (FF7 for example) ATB fills even after the battle is over, so if you wait on victory animations you can always start with full ATB. I wonder is something like this happens here ...
  • "Eveyone's ATB increases at a constant rate" - whats the rate? 1? Does haste/slow affect that rate?
  • What will happen if 2 or more participant end with ATB 0 at the same time?
1. The initial ATB value is in fact the "120 - Agility" part (Of course, it will depend too on whether you get a Pre-emptive or Back Attack). For example, lets take Butz default stats which has an agility of 25, so 120-25 = 95. So it's expected that his ATB is either 95, 96 or 94 (due to the chance of +/- 1). Each time you end your turn, the ATB will go back to 95 and start decreasing from then

2. I'm not certain, but I'm positive that this is correct. Slow/Haste will change the initial (and current) ATB. So instead of having the 95 ATB, with haste you'll have 47 & with Slow you'll have 190.

3. When 2 or more characters end with the same initial ATB, and therefore reach 0 at the same time, I heard that there is a code that gets in charge of sorting this out using entropy (can't remember from where, but either from github or one of the many Japanese wiki sites)


I also have these other addresses, but I haven't played with them so I don't know exactly how they work. They are sort of controls for the ATB behavior.
Code: [Select]
(01=On, 40=?, 80=?)
7E3CFB XX          1st Player Timer Status flag - ATB Gauge
7E3D06 XX          2nd Player Timer Status flag - ATB Gauge
7E3D11 XX          3rd Player Timer Status flag - ATB Gauge
7E3D1C XX          4th Player Timer Status flag - ATB Gauge
--------------------------------------------------------------------------------
7E3D27 XX          1st Enemy Timer Status flag - ATB Gauge
7E3D32 XX          2nd Enemy Timer Status flag - ATB Gauge
7E3D3D XX          3rd Enemy Timer Status flag - ATB Gauge
7E3D48 XX          4th Enemy Timer Status flag - ATB Gauge
7E3D53 XX          5th Enemy Timer Status flag - ATB Gauge
7E3D5E XX          6th Enemy Timer Status flag - ATB Gauge
7E3D69 XX          7th Enemy Timer Status flag - ATB Gauge
7E3D74 XX          8th Enemy Timer Status flag - ATB Gauge
I'm the best in the universe! Just remember! [F-zero X]

Squall

  • Iron Claw
  • *
  • Posts: 408
    • View Profile
Re: New Project
« Reply #12 on: August 30, 2017, 08:35:47 AM »
2. if you have 30 AGL you need 90 ATB ticks, 90 AGL needs 30 ATB ticks
those ticks happen several times per second, slow/haste does not affect that anymore from here.
OK, so the ATB decrements with 1 each tick, right???

1. The initial ATB value is in fact the "120 - Agility" part (Of course, it will depend too on whether you get a Pre-emptive or Back Attack). For example, lets take Butz default stats which has an agility of 25, so 120-25 = 95. So it's expected that his ATB is either 95, 96 or 94 (due to the chance of +/- 1). Each time you end your turn, the ATB will go back to 95 and start decreasing from then
Are you sure? This is calculated when timer hit 0, but I'm not sure is that the case when the battle starts ...

Quote
I also have these other addresses, but I haven't played with them so I don't know exactly how they work. They are sort of controls for the ATB behavior.
Yeah there bunch of tables in memory connected with timers (ATB been one of them). According to LightPhenix research (just add +$A for Player 1):
Code: [Select]
3CF1 Status Flag 1 - On;  0 - Off; 80 - Ending
3D75 Timer Value
3DF9 Timer Initial Value
3E7D Creature List Counter A counter used to rotate through each creature in the list above
3E88 Process Ending Timer Flag Set when any creature's timer reached zero.  The code only handles ending one creature per status each frame.
3E93 Random Creature List A randomized list of each creature position (0-B), generated when battle starts at C2/1FD2
3E9F ???
3EB7 Creature Timer Ending Set to whichever creature number's timer is ending this frame
3EC2 ???
3ECE ???
3ED9 Timer Decrement Duration Certain timers do not decrement every frame.  These values are held in D1/2976
3EE4 Process Timer Flag Set when the decrement timer is zero; true when processing, false when not needed

Praetarius5018

  • Siren
  • *
  • Posts: 78
    • View Profile
Re: New Project
« Reply #13 on: August 30, 2017, 03:56:23 PM »
OK, so the ATB decrements with 1 each tick, right???
yes, also a "tick" takes about 3-5 frames usually for me

I just noted how "busted" the old status is; it drains stats every 5 ticks, so between two turns you go from normal to totally useless: -18 everything per turn if you had 30 AGL, ouch

Spindaboy

  • Guard Leader
  • *
  • Posts: 52
  • Gender: Male
  • I need more sleep.
    • View Profile
    • SyndROMe Hacking
Re: New Project
« Reply #14 on: August 30, 2017, 07:51:14 PM »
Oh goodness yes please make a full feature editor for FFV. I really want to make an FFV hack after my FF Postlude project and it would be incredibly helpful to have something akin to Pinkpuff's ff4kster. Please take it into consideration at least! :wink: