• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
February 19, 2020, 03:59:56 pm

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen/RetroArch is recommended for playing/testing, pSX is recommended for debugging.


ASM Requests

Started by The Damned, October 29, 2014, 09:16:45 pm

Glain

...A camera hack would be interesting... hmm...

Xifanie

I personally haven't tested the camera instruction theory, but I think it wouldn't be enough and it would get reset after an ability's effect plays. You probably need to also toggle the flag controlling the angle state, otherwise "I'm at 30 degrees, but this flag says I'm not, so I better switch to 30 degrees".

My take would be a bit silly, scanning all the event instructions until EventEnd(), and overriding the very last camera instruction. Whoever, this would be far from perfect and you would need to somehow detect if an event is a battle. DarkScreen() is usually a good indicator of battles, but it's also used to make characters join. Thus, I think that DisplayConditions() in an event is the best indicator of a battle... either that or March(), but if you're going to force the camera to adjust, it's probably better to do it during a DarkScreen().

...and you'd also have to somehow make it compatible with your event skip hack.
  • Modding version: PSX
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

xjamxx

September 12, 2018, 09:27:24 am #222 Last Edit: September 12, 2018, 02:05:53 pm by xjamxx
Thanks xifanie (elric and nyzer too) ;), i was trying to find a good way to know when an event was or not a battle (nice tips).
DarkScreen and DisplayConditions --> 129 files have that
March --> 119 files


QuoteYou probably need to also toggle the flag controlling the angle state, otherwise "I'm at 30 degrees, but this flag says I'm not, so I better switch to 30 degrees".

Well that kills, at least for now, my idea to change to a higher angle (60 or so)

old, an issue with the editor i solved somehow: [spoiler]
I am stuck now, i know this has nothing to do with ASM requests but, i am using the event editor. I extracted the test.evt from original iso ('97 file), decompile and recompile the .evt file, but guess what ... the files differ...
certutil -hashfile test.evt md5 = d9ca0f79ee00c1398f02e45ff70b8673 (original)
certutil -hashfile test-1.evt md5 = 171544e48786030d5191ea450fa8af7f (rebuilt)

And checking with binary comparison there are a lot of blocks that differ, but my guess is that the evt editor is trashing "useless" event data. Each block in the original start with "D9 C1 36 FA 37" but the rebuilt "93 36 FA 37" (one byte less), plus fills with a lot of zeros at the end of each block.

I only want to to mod the camera instruction, not the entire structure of the event data, is this possible with that tool?

Sorry for being out of topic, if u think this should go here: http://ffhacktics.com/smf/index.php?topic=11675.0
Then just say it, and i will post it there, so this thread keeps clean.[/spoiler]
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

Glain

Yeah, what interests me about this is more the idea of having free rotation/zoom with the L and R buttons.  I think what is to be done with the camera at the start of the battle (if anything) would depend on where that leads me.

Ability effects do reset the camera zoom, but I think we can change the value it resets back to.  I ran into this when I was figuring out how to skip ability effects...  if you skip Galaxy Stop, for example, the camera would stay zoomed really far out, so I had to figure out how to reset the zoom.  That in turn led me to find some of the values controlling zoom and rotation, and through the debugger I was doing some pretty crazy things (zooming in ridiculously far, zooming out so far you could barely see the map), so allowing the player more control over zoom and rotation mid-battle could be interesting... and might finally provide an out for the scenario where you can't quite get the view you want in the middle of a battle.

I've also seen that a weird camera can cause ability effects to get messed up though, doing huge rotations that look really weird... so in theory we would want to avoid that as well.  Not sure how this would all pan out but it does at least seem interesting.


xjamxx

September 12, 2018, 10:46:09 am #224 Last Edit: September 12, 2018, 02:04:09 pm by xjamxx
i began modding by differential file comparison, it will take some time.

The idea of free rotation (we have some sort of step rotation around z axis, but not for x or y axis) and zoom, would be awesome, but i aim lower. The game has two states for zoom and angle, i was willing to have a asm patch that allow me to change those values, ex: close would be 100% and 30º, far would be 50% (33?) and (60º) plus setting initial values, cuz after 30 fights, is a pain to adjust camera manually in every battle...

OLD (i can delete it but if any want to see whole process):
[spoiler]
UPDATE:
mmm ... i modded the first battle with Delita still camera reset....
Offset(x00014000)
//Remove the previous line if you wish not to override the offset in CONFIG.INI.
Text(x000000D3)
//Remove the previous line if you wish text to compile directly after instructions.

{7C}()
ColorUnit(x00,x00,x04,-031,-031,+000,000)
ColorField(x04,-031,-031,+000,000)
Wait(00002)
UnitAnim(x80,x00,x0002,x00)
Camera(+00728,-00237,+01560,+00446,+04608,+00000,+04096,+00001)
WaitForInstruction(x04,x00)
{63}(rC9)
Reveal(060)
Camera(+00728,+00019,+00616,+00302,+04608,+00000,+04096,+00196)
Wait(00030)
ColorUnit(x00,x00,x04,+000,+000,+000,008)
ColorField(x04,+000,+000,+000,008)
WaitForInstruction(x04,x00)
{66}()
Wait(00030)
DisplayMessage(x10,x70,x0001,x80,x00,x00,+00000,-00014,-00004,x01)
WaitForInstruction(x01,x00)
Wait(00016)
March(x80,x00,000)
Wait(00016)
EventSpeed(x02)
CameraFusionStart()
Camera(+00504,+00019,+00840,+00510,+05120,+00000,+04096,+00064)
Camera(+00504,+00019,+00841,+00341,+05637,+00000,+02048,+00128)
CameraFusionEnd()
DarkScreen(x00,x01,012,064,x00,004)
WaitForInstruction(x36,x00)
DisplayConditions(x08,090)
WaitForInstruction(x38,x00)
WaitForInstruction(x04,x00)
Camera(+00504,+00019,+00840,+00341,+05632,+00000,+02048,+00004)
WaitForInstruction(x04,x00)
DisplayConditions(x00,060)
WaitForInstruction(x38,x00)
RemoveDarkScreen()
WaitForInstruction(x36,x00)
EventSpeed(x01)
EventEnd()



UPDATE 2:
It seems that one map has more than one event file, cuz in Delita turn there is another event for the camera...
[/spoiler]

UPDATE 3:
Well, i edited all event files (EVT_ 010 to 012) in test.evt for the first battle with Delita still camera reset in combat mode, so its clear that battle events are not there or at least they aren't sorted with text events. Now i don't have any clue where to look...
Video:[spoiler]
[/spoiler]
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

Glain

This patch changes what the camera zoom values are when you press L and R.

The values for both zoom-in and zoom-out are hardcoded in two places (each).  One place is for how far in/out the camera goes while zooming, and the other is where the camera stays after zooming.  That's for both zoom-out and zoom-in, so there are four variables total in this patch.  You'll probably want to make the zooming and fixed values for each set the same but you don't have to.


xjamxx

Thanks Glain,  ;)  i will test it asap.

A silly question if u recommend same values why zoom out have c00 and c01?
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

Elric

Quote from: xjamxx on September 12, 2018, 10:46:09 am
i began modding by differential file comparison, it will take some time.

The idea of free rotation (we have some sort of step rotation around z axis, but not for x or y axis) and zoom, would be awesome, but i aim lower. The game has two states for zoom and angle, i was willing to have a asm patch that allow me to change those values, ex: close would be 100% and 30º, far would be 50% (33?) and (60º) plus setting initial values, cuz after 30 fights, is a pain to adjust camera manually in every battle...

OLD (i can delete it but if any want to see whole process):
[spoiler]
UPDATE:
mmm ... i modded the first battle with Delita still camera reset....
Offset(x00014000)
//Remove the previous line if you wish not to override the offset in CONFIG.INI.
Text(x000000D3)
//Remove the previous line if you wish text to compile directly after instructions.

{7C}()
ColorUnit(x00,x00,x04,-031,-031,+000,000)
ColorField(x04,-031,-031,+000,000)
Wait(00002)
UnitAnim(x80,x00,x0002,x00)
Camera(+00728,-00237,+01560,+00446,+04608,+00000,+04096,+00001)
WaitForInstruction(x04,x00)
{63}(rC9)
Reveal(060)
Camera(+00728,+00019,+00616,+00302,+04608,+00000,+04096,+00196)
Wait(00030)
ColorUnit(x00,x00,x04,+000,+000,+000,008)
ColorField(x04,+000,+000,+000,008)
WaitForInstruction(x04,x00)
{66}()
Wait(00030)
DisplayMessage(x10,x70,x0001,x80,x00,x00,+00000,-00014,-00004,x01)
WaitForInstruction(x01,x00)
Wait(00016)
March(x80,x00,000)
Wait(00016)
EventSpeed(x02)
CameraFusionStart()
Camera(+00504,+00019,+00840,+00510,+05120,+00000,+04096,+00064)
Camera(+00504,+00019,+00841,+00341,+05637,+00000,+02048,+00128)
CameraFusionEnd()
DarkScreen(x00,x01,012,064,x00,004)
WaitForInstruction(x36,x00)
DisplayConditions(x08,090)
WaitForInstruction(x38,x00)
WaitForInstruction(x04,x00)
Camera(+00504,+00019,+00840,+00341,+05632,+00000,+02048,+00004)
WaitForInstruction(x04,x00)
DisplayConditions(x00,060)
WaitForInstruction(x38,x00)
RemoveDarkScreen()
WaitForInstruction(x36,x00)
EventSpeed(x01)
EventEnd()



UPDATE 2:
It seems that one map has more than one event file, cuz in Delita turn there is another event for the camera...
[/spoiler]

UPDATE 3:
Well, i edited all event files (EVT_ 010 to 012) in test.evt for the first battle with Delita still camera reset in combat mode, so its clear that battle events are not there or at least they aren't sorted with text events. Now i don't have any clue where to look...
Video:[spoiler]
[/spoiler]


Each event condition, like when someone talks mid battle, would have its own camera, yes. And yes, battles are in with the text only events. I've made over 250 custom events, and the camera is present in all of them, but you'd need to edit it in every battle event as well as their conditional events
  • Modding version: PSX
<@Angel> Teach a man to fish and he'll open up a fishery to compete against yours.


Journey of the Five Youtube ChannelThe Lion War Current Status
  
Jot5 Leader :: Eventer :: OtherTLW Leader :: Eventer :: Other

xjamxx

First, Glain I tried. a)flip values, and the zoom in and zoom out went anti-smooth b) try with 00F0 in zoom-out, and i could barely see the map.

Second, I don't think i am getting you Elric, all events are in test.evt or the are more files? cuz lets put the second video as an example:
a) 0- 15 sec it is controlled by EVT_010
b) 16- 57 sec i dont know what controls it...
c) 58- 72 sec it is controlled by EVT_011
d) 73- end sec controlled by player... (yet it still resets)
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

Elric

Every single event in the game is in test.evt.

  • Modding version: PSX
<@Angel> Teach a man to fish and he'll open up a fishery to compete against yours.


Journey of the Five Youtube ChannelThe Lion War Current Status
  
Jot5 Leader :: Eventer :: OtherTLW Leader :: Eventer :: Other

Glain

September 12, 2018, 04:57:59 pm #230 Last Edit: September 13, 2018, 08:52:44 am by Glain
Quote from: xjamxx on September 12, 2018, 04:16:42 pm
Thanks Glain,  ;)  i will test it asap.

A silly question if u recommend same values why zoom out have c00 and c01?


The comparison it's doing is whether the current zooming value is >= 0x0c01.  By contrast it checks for zooming value < 0x1000 when going the other way.  I guess it's so that the zooming will stop in the case of the value being exactly equal.  It's probably not a big deal either way.

EDIT:

Quote from: xjamxx on September 12, 2018, 04:16:42 pm
a) 0- 15 sec it is controlled by EVT_010
b) 16- 57 sec i dont know what controls it...
c) 58- 72 sec it is controlled by EVT_011
d) 73- end sec controlled by player... (yet it still resets)


For scenarios (b) and (d) it's the battle engine controlling the camera since the event has already played.

xjamxx

September 14, 2018, 10:34:01 am #231 Last Edit: September 14, 2018, 09:03:39 pm by xjamxx
I was sorting stuff, still not much progress, but remade your patch (though it uses weird syntax so current ASM wont read)


Still the initial values are not there so every time i enter a battle it resets...

Also there is a weird behaviour with the angle, bird view is only for map and not toons, plus some squares are not getting drawn...
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

Elric

Quote from: xjamxx on September 14, 2018, 10:34:01 am
Also there is a weird behaviour with the angle, bird view is only for map and not toons...



If you looked at a spritesheet for FFT, you'd see why this angle wont work
  • Modding version: PSX
<@Angel> Teach a man to fish and he'll open up a fishery to compete against yours.


Journey of the Five Youtube ChannelThe Lion War Current Status
  
Jot5 Leader :: Eventer :: OtherTLW Leader :: Eventer :: Other

Glain

Interesting routines/code:

Routine 0x8008e468 might be initializing the battle camera.  Particularly interesting:

8008e488: 3c04800c lui r4,0x800c
8008e48c: 24847ca0 addiu r4,r4,0x7ca0
8008e490: 34051000 ori r5,r0,0x1000
8008e494: 34061000 ori r6,r0,0x1000
8008e498: 0c010acb jal 0x80042b2c
8008e49c: 34071000 ori r7,r0,0x1000


Sets the camera zoom values to default zoomed-in value 0x1000.

Further in the same routine:

8008e4a0: 3c04800a lui r4,0x800a
8008e4a4: 24847784 addiu r4,r4,0x7784
8008e4a8: 3405012e ori r5,r0,0x012e
8008e4ac: 34060e00 ori r6,r0,0x0e00
8008e4b0: 0c010ac7 jal 0x80042b1c
8008e4b4: 00003821 addu r7,r0,r0


Copying some more values, including 0x12e which is what you listed as the default angle-in value.

Routine 0x8012dde8 is also playing with some camera values, including here:

8012dee4: 34021000 ori r2,r0,0x1000
8012dee8: ac620080 sw r2,0x0080(r3)

xjamxx

September 15, 2018, 05:26:19 pm #234 Last Edit: September 15, 2018, 09:10:04 pm by xjamxx
Thanks, you are awesome  ;).

The routine at 0x8008e468, is not initializing the battle camera at least for the zoom. Haven't try the angle.

But this code:34021000 ac620080
which can be found twice in the iso, the first occurrence is the one for initializing the battle camera (zoom only tested)

You really are top  :oops:

UPDATE:
Added to patch both angle (3 places not sure which is the key, all are near) and zoom:

Still there is an issue with r2 and l2, cuz a flag or smt like that make the game believe that the starting camera is always zoom in, so if u start with zoom out values, the first time u press r2 or l2 u won't notice anything.

Again, thanks for everything to Nyzer, Elric, Xifanie, special thanks to Glain (you really did it). I won't post anything else, at least about this camera hack, all credit goes to Glain (you found it plus you wrote the initial xml structure).

Now back to play my custom modded FFT, cya!
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

TheAvelon

I have a request. After messing around in FFTP I think this is an ASM quandary.

I'd like for Teleport's 100% success range to be MA/2 rounding down. A character with 15 MA can teleport 7 tiles and has a 90% success rate for teleporting 8 tiles.

It may be best to make it MA/2.5 or 3; but if this gets made I can tinker with the exact number from there. My hack's base is a TO style job growth change so pure mages will have higher base MA growth and I'm not sure yet what they're going to look like at level 99.

Then again a level 99 mage SHOULD be able to teleport halfway across the map.
  • Modding version: PSX & WotL
Truly, if there is evil in this world, it lies within the heart of mankind.

xjamxx

October 01, 2018, 12:16:14 pm #236 Last Edit: October 03, 2018, 08:58:55 am by xjamxx

Read following post.
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

Glain

Instead of, or in addition to, using MA Factor as a label (and actually i'd use .eqv if you want a constant... labels are for addresses), you could set it up as a variable at RAM 0x176C64 = BATTLE.BIN 0x10FC64.  Clever using 8/80 instead of 10/100 to gain space in the code, but then why not just do 1/10 and not shift at all?

It also might make sense to multiply by the variable then divide by 128 so you could effectively divide by something like 2.5...

xjamxx

October 01, 2018, 07:19:14 pm #238 Last Edit: October 03, 2018, 09:14:41 am by xjamxx
Quote from: Glain on October 01, 2018, 07:03:31 pm
use .eqv if you want a constant... labels are for addresses)
thanks didn't knew it
Quote from: Glain on October 01, 2018, 07:03:31 pm
you could set it up as a variable at RAM 0x176C64 = BATTLE.BIN 0x10FC64
I don't like using variable cuz i usually forget to change them at the .exe, yeah i know its not an excuse but i like asm entire block
Quote from: Glain on October 01, 2018, 07:03:31 pmbut then why not just do 1/10 and not shift at all?
I thought the same, but may be that would fk the RNG calculation? not sure, still haven't check RNG.
Quote from: Glain on October 01, 2018, 07:03:31 pmIt also might make sense to multiply by the variable then divide by 128 so you could effectively divide by something like 2.5...
Yeah but since the one who asked for this didn't tested I went back to another thing and stop this optimization.

UPDATE: here it goes if any1 wants it as Glain:

UPDATE 2: tested, as i fear it doesn't read MA, so it needs :more: hacking, with this should suffice for definitive version:
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

TheAvelon

Awesome! This is exactly what I was hoping for! Thanks muchly, I will figure out how to implement this and test it tomorrow. Been consumed all evening with another area of the patch I'm working on and didn't check the forums


You rock.
  • Modding version: PSX & WotL
Truly, if there is evil in this world, it lies within the heart of mankind.