Free camera for Kuro no Kiseki CLE

Memory scanning, code injection, debugger internals and other gamemodding related discussion
amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Free camera for Kuro no Kiseki CLE

Post by amorrow28 »

I've writen a free camera script for Kuro no Kiseki. It is based on the [Link] v1.02 with fan translation. Thank you as always to Cyber for the original movement algorithm, which this time I had to adapt because there are no rotation angles to use. Thank you to Sunbeam for input. Thank you to misterwashimashi for extensive beta testing. Thank you to to Dhaos Collider for AOBs for lock player movement and camera zoom - please check out his table here!

UPDATES:
Version 1.4 - Updated for game version 1.1.0.
Version 1.3 - Updated for game version 1.0.3.
Version 1.2 - Force pause re-written, now more responsive and reliable. Camera zoom rewritten, also more responsive and reliable.
Version 1.1 - Force pause improvements. Now able to freeze cutscenes, prevent scene transitions and allows free cam function during cutscenes.
Version 1.0 - Initial full release

Kuro_freecam_v1.4.CT
(45.17 KiB) Downloaded 724 times
----- OLDER RELEASES -----
Kuro_freecam_v1.3.CT
(43.02 KiB) Downloaded 572 times
Kuro_freecam_v1.2.CT
(43.02 KiB) Downloaded 457 times
Kuro_freecam_v1.1.CT
(38.11 KiB) Downloaded 236 times
Kuro_freecam_v1.CT
(32.43 KiB) Downloaded 249 times
Features and how to use:
  • Force Pause Animation - F5 to turn on, F6 to turn off - this completely pauses the game! Check the box to enable before using.
  • Hide Interface - F7 to toggle. Everything disappears - interface, minimap, dialogue, menus, overlays, letterboxing, everything.
  • Control camera distance (zoom) - F4 to toggle. Press Home to zoom in, End to zoom out. Will remember your custom zoom value prior to cutscenes and restore the value after, IF you do not adjust the zoom during the cutscene itself.
  • Free camera - press 0 to activate. See instructions below on how to navigate.
  • Set Camera Min Z to Floor: There is a function that stops the camera from going any lower than waist-height. This changes the limit to just above the floor. For the best experience, also turn on No Clip.
  • No Clip - Objects will stop disappearing when they get too close to the camera.

Code: Select all

Free Camera Controls:

Hotkey : Num 0 (Toggle On/Off)

After activating the script player can use the following hotkeys:
W : Forward
S : Backward
A : Left
D : Right
R : Up
F : Down

Mouse control for tilt/pan!  (You can turn mouse support on and off with page up / page down keys while the script is active.)
I : Tilt Up
K : Tilt Down
L : Pan Right
J: Pan Left

F1 : Decrease Camera Speed (Press and Hold)
F2 : Double Camera Speed (Press and Hold)
F3 : Quadruple Camera Speed (Press and Hold)
My other free camera scripts: Trails of Cold Steel 1, Trails of Cold Steel 2, Trails of Cold Steel 3, Hajimari no Kiseki CLE, Kuro no Kiseki 2 CLE, Tokyo Xanadu eX+, Ys VIII: Lacrimosa of Dana, Atelier Ryza, Atelier Ryza 2.

----- ORIGINAL POST -----
Hi,

I'm hoping for some help. If anyone can do so, I would really appreciate it!

I've been trying to write a free camera script (flycam) for Kuro no Kiseki (currently v1.02 on Steam, Clouded Leopard Entertainment). I have located camera X,Y,Z coordinates, and successfully locked them by NOP'ing the write instructions. I have looked for hours and cannot find pitch, yaw and roll.

There are other values in the structure with XYZ. I think at least some of them are the rotation matrix used to aim the camera, because if I NOP the other 6 instructions along with write XYZ, the camera no longer rotates when the player moves. I can walk off screen without issue. However, as soon as I change a value (for example Z), the camera will re-aim itself to look at the player. I have tried tracing backwards to try to find the values used to calculate the rotation matrix, but I cannot find anything of use.

If anyone can help me, I would be thankful!!
Last edited by amorrow28 on Sat Mar 04, 2023 7:30 pm, edited 18 times in total.

User avatar
SunBeam
Administration
Administration
Posts: 4702
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 4285

Re: Need help with free camera (Kuro no Kiseki CLE)

Post by SunBeam »

amorrow28 wrote:
Fri Aug 05, 2022 3:40 am
However, as soon as I change a value (for example Z), the camera will re-aim itself to look at the player.
Then find out which function writes to camera-Z and see if you can manipulate that or just NOP it so it doesn't re-aim.

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Need help with free camera (Kuro no Kiseki CLE)

Post by amorrow28 »

Thank you SunBeam for the reply!

NOPing the writes to XYZ does indeed give me full control of XYZ, but the camera always changes rotation vectors when the player character moves. If I also NOP the other 6 values in the write function (the full function writes to 9 addresses), the camera is fully detached in that I can move the player character and the camera stays perfectly still. BUT if I move the camera by changing the values of XYZ, the camera will re-aim even though the rotation matrix values are locked, so the game is not reading _only_ from those numbers.

When I've written camera scripts for previous Falcom games, there was a camera structure that had pitch/yaw/roll, where NOPing the write instructions would allow me to write to the addresses and manipulate rotation vectors. I also had to NOP a CMP instruction (which presumably helped the game move the camera but did not seem to explicitly track the player). Falcom changed the game engine on me though, and I'm starting from scratch.

Tracing forward and backwards, I found values that change from -1 to +1 as the camera moves around the player (-1 at max X to +1 at min X, -1 at max Y to +1 at min Y, -1 at max Z to +1 at min Z) which would mathematically relate to the pitch/yaw, but directly changing those values lead to crazy distorted views. Maybe I could work backwards from the rotation matrices? But that still doesn't solve the problem that the camera will automatically re-aim when I move it. More importantly, I have reason to believe that the game is using Valve's Source engine (although I could be wrong!) which does use pitch/yaw/roll along with XYZ so I do think these values must be present somewhere, and if I can find them, I should be able to work backwards from there to fully detach the camera.

I would appreciate any more help / insights you or anyone could give me! Thank you.

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Need help with free camera (Kuro no Kiseki CLE)

Post by amorrow28 »

Ok never mind, I had an epiphany and have managed to move forward. I remembered that in researching how Z changes in relation to camera movement that there is a variable I had already found that dictated the distance from the character to the camera. I realized that there might not be a pitch / yaw, but instead two sets of XYZ instead - the camera and what it’s looking at. (Essentially I suspected that may not be bothering to store angles in memory, but instead is just doing math in real time.) Indeed, in the write function I found with 9 addresses where the first three addresses were camera XZY, the second three are camera target XZY (which defaults to the character but does not have to be the character)!

I’ve started work on adapting the lua script I have; so far I have the basics working and am testing. I’ll post the script when I get it working!
Last edited by amorrow28 on Sat Aug 06, 2022 6:46 pm, edited 1 time in total.

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Free camera for Kuro no Kiseki CLE

Post by amorrow28 »

I have posted a beta version (top post). It works. There is a lot of stutter because cheat engine has to write to two sets of coordinates, and the engine is refreshing too fast so it keeps adjusting the viewport (I think). It is still in beta, without all the nice features yet. If anyone can fix the stutter, I would be very grateful.

diver
Noobzor
Noobzor
Posts: 5
Joined: Sat Aug 06, 2022 10:38 am
Reputation: 0

Re: Free camera for Kuro no Kiseki CLE

Post by diver »

hello friend,can you make a Camera Tweak for Kuro no Kiseki like this

Thank you.

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Free camera for Kuro no Kiseki CLE

Post by amorrow28 »

diver wrote:
Sat Aug 06, 2022 10:56 am
hello friend,can you make a Camera Tweak for Kuro no Kiseki like this
[Link]
Thank you.
My script can already do that, just turn on the set minimum Z and no clip. You do not need to use free camera.

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Free camera for Kuro no Kiseki CLE

Post by amorrow28 »

I posted a new version (first post, above). I fixed my math, and the stutter is mostly gone! I clearly needed to have paid more attention during my high school trigonometry class... (I also now pause game execution briefly just to write values to memory, to prevent the game updating the camera before the script is done updating coordinates.)

Alex12345
What is cheating?
What is cheating?
Posts: 3
Joined: Sun Aug 07, 2022 4:11 am
Reputation: 0

Re: Free camera for Kuro no Kiseki CLE

Post by Alex12345 »

Hello,I have a question. Is version 1.0.2 unavailable? I only can use free camera in 1.0.2 version. And are you going to make UI hidden ?

misterwashimashi
Cheater
Cheater
Posts: 37
Joined: Sat Jul 23, 2022 12:52 pm
Reputation: 7

Re: Free camera for Kuro no Kiseki CLE

Post by misterwashimashi »

Hello man it's me again, I tried checking the "enable camera script" first and then pressing 0 as instructed, but I still can't move the camera somehow. Am I doing something wrong? Or does it require a newer version of ed9.exe?

I tried replying to your post on the other forum but the site keeps giving me an error saying that the theme may be out of date lmao

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Free camera for Kuro no Kiseki CLE

Post by amorrow28 »

Alex12345 wrote:
Sun Aug 07, 2022 4:15 am
Hello,I have a question. Is version 1.0.2 unavailable? I only can use free camera in 1.0.2 version. And are you going to make UI hidden ?
EDIT: I tested with the original 1.0.2 executable (Chinese language) and it works fine for me. Please try beta 3.

I’m using steam release 1.0.2 with fan translation patch. Try that version. If you want to play in Chinese, do not install the language files, try installing just the new executable. Although I think it should work with the base 1.0.2 version in Chinese since I found all the AOBs before installing the patch.
Last edited by amorrow28 on Sun Aug 07, 2022 10:41 pm, edited 1 time in total.

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Free camera for Kuro no Kiseki CLE

Post by amorrow28 »

misterwashimashi wrote:
Sun Aug 07, 2022 4:34 am
Hello man it's me again, I tried checking the "enable camera script" first and then pressing 0 as instructed, but I still can't move the camera somehow. Am I doing something wrong? Or does it require a newer version of ed9.exe?

I tried replying to your post on the other forum but the site keeps giving me an error saying that the theme may be out of date lmao
Try this to troubleshoot:

1. Check enable camera script
2. Check camera coordinates
3. move around in game until you see coordinates in cheat engine.
4. Check free camera
5. Try moving your character, the camera should not move
6. Try moving the camera. Remember, the mouse does not work and the keys are different from previous Falcom games. I did not use the same keys because the game is already using them.

misterwashimashi
Cheater
Cheater
Posts: 37
Joined: Sat Jul 23, 2022 12:52 pm
Reputation: 7

Re: Free camera for Kuro no Kiseki CLE

Post by misterwashimashi »

amorrow28 wrote:
Sun Aug 07, 2022 6:21 am
misterwashimashi wrote:
Sun Aug 07, 2022 4:34 am
Hello man it's me again, I tried checking the "enable camera script" first and then pressing 0 as instructed, but I still can't move the camera somehow. Am I doing something wrong? Or does it require a newer version of ed9.exe?

I tried replying to your post on the other forum but the site keeps giving me an error saying that the theme may be out of date lmao
Try this to troubleshoot:

1. Check enable camera script
2. Check camera coordinates
3. move around in game until you see coordinates in cheat engine.
4. Check free camera
5. Try moving your character, the camera should not move
6. Try moving the camera. Remember, the mouse does not work and the keys are different from previous Falcom games. I did not use the same keys because the game is already using them.
I followed steps 1 to 2, but the camera coordinates are not showing any values, just "??". I can't check its sub boxes either. Probably the reason why the camera is just stuck after I press 0 and unable to move even if I press the numpad buttons.

EDIT: Nvm I got it to work haha thanks man, I just need to start a new game so CE can recognize the coordinates. When I first tested I just loaded the save file on the final dungeon which is probably why CE can't recognize it at first. Another problem though, the FPS gets very low when I enter free camera mode, the beta version 1 is a bit smoother.

amorrow28
Expert Cheater
Expert Cheater
Posts: 81
Joined: Mon Jul 04, 2022 9:42 pm
Reputation: 46

Re: Free camera for Kuro no Kiseki CLE

Post by amorrow28 »

misterwashimashi wrote:
Sun Aug 07, 2022 7:33 am
I followed steps 1 to 2, but the camera coordinates are not showing any values, just "??". I can't check its sub boxes either. Probably the reason why the camera is just stuck after I press 0 and unable to move even if I press the numpad buttons.

EDIT: Nvm I got it to work haha thanks man, I just need to start a new game so CE can recognize the coordinates. When I first tested I just loaded the save file on the final dungeon which is probably why CE can't recognize it at first. Another problem though, the FPS gets very low when I enter free camera mode, the beta version 1 is a bit smoother.
I posted a new version, see if it fixes your FPS problems! I'm also not sure why you couldn't just load it in the final dungeon, it should load anywhere that the character can move around freely. (I don't know this for a fact though, since I haven't played this game at all. I've just spent 33 hours in front of Van's office in the first minute of the game... so I appreciate the bug reports!) Cyber's original code relied on the camera "status" to be found before starting the script or CE soft-locks, which is why there are two steps. Since I solved that problem, I realized I could combine them into a single step, and have the script patiently wait until the in-game camera values are found. Hopefully this solves the issue, let me know how it works.

Alex12345
What is cheating?
What is cheating?
Posts: 3
Joined: Sun Aug 07, 2022 4:11 am
Reputation: 0

Re: Free camera for Kuro no Kiseki CLE

Post by Alex12345 »

Hi, Bro. I have a request. Could you change the button :
PAGE UP KEY : Tilt Up
PAGE DOWN KEY : Tilt Down
END KEY : Pan Right
HOME KEY: Pan Left
It will be much more convenient

Post Reply

Who is online

Users browsing this forum: No registered users