Realtime camera location monitor for demo editors


Codewalker

 

Posted

Update: Codewalker made a better version of this tool. It allows you to speed up the camera movement while in F2 look mode. Scroll a few posts down for his version.

As you probably know, you can now press F2 while playing a demo and you can get a floating camera, allowing you to fly anywhere in the zone.

The problem is, if you find a particularly interesting sight, you have no way of knowing what your current camera location is.

So, I made a tiny (28KB) program to fix this. It should "just work". If it doesn't seem to do anything, try running it as Administrator.

As soon as you open it, it will start monitoring for the COH process. Once it finds it, it will display the camera location for both the Live and the Beta clients.

This works while running the game normally, too, but remember they are the CAMERA coordinates, not your CHARACTER, so the numbers will not exactly match the /loc command.



It has two controls: a checkbox that makes it stay always on top (if COH is running full screen this will not work; run it in a window) and a scroll bar to control the speed of updates. When the scrollbar is all the way to the right, it updates once every second. When it's all the way to the left, it updates 10 times per second.



Note that I threw this together in literally 10 minutes, so it hasn't been tested much. As far as I know, it works.

The PYR is not accessible this easily, but a simple workaround is to take two POS measurements (one for where you want the camera to go, another for where you want the camera to be looking at) and calculate the PYR for that facing, using my crowdscript or something else.

If you have a memory scanner such as Cheat Engine, you don't need this tool. Just enter the addresses 012DB334,012DB338,012DB33C for the live client; 012DF1F4,012DF1F8,012DF1FC for the beta client. All value types are floats.


www.SaveCOH.com: Calls to Action and Events Calendar
This is what 3700 heroes in a single zone looks like.
Thanks to @EnsonsDeath for the GVE code that made me VIP again!

 

Posted

Also of note. If you position yourself with the arrow keys this won't work. At least from my experience, the camera only works with WASD.



Clicking on the linked image above will take you off the City of Heroes site. However, the guides will be linked back here.

 

Posted

Quote:
Originally Posted by Ironik View Post
You're a magicman.

I don't even know where that second screenshot is.
Looks to be Kallisti Warf, the new zone that was coming soonish.


@Oathbound & @Oathbound Too

 

Posted

So, uhhhh, Leandro...

I hate to be "that guy", but you did ask me about this, and I told you I'd look into it, and that I had something special planned.

It turned out to be a lot of work, mostly because the demorecord free camera implementation changed significantly between I23 live and I24 beta, and I wanted to support certain features on both -- one of which turned out to not even exist in I23 (until now). Since it was such an ordeal, I'm going to go ahead and post it anyway.

So here you go, COH Cameraman 1.0, no-sleep-till-testing release:

Download!
And some screenshots:




Yes, that slider does exactly what you think it does... Lets you speed up the sluggish demo camera all the way to Ludicrous Speed! Told you that you'd like it.

You can use ALT+C as a keyboard shortcut for the "Copy camera position/facing in demorecord format" button.


 

Posted

Awesome job, CW. I did think of scanning for pointers to the global camera position to see where it was being modified and try to speed up the movement, but it was more of a "maybe by next week" thing. Love how you saved me all that trouble.

The only thing I'd add is a demorecord equivalent, so people can save their camera movement to a file. Just write (ms since last update) CAM POS x z y\n0 CAM PYR p y r\n to a file on every update tick.


www.SaveCOH.com: Calls to Action and Events Calendar
This is what 3700 heroes in a single zone looks like.
Thanks to @EnsonsDeath for the GVE code that made me VIP again!

 

Posted

Quote:
Originally Posted by Leandro View Post
Awesome job, CW. I did think of scanning for pointers to the global camera position to see where it was being modified and try to speed up the movement, but it was more of a "maybe by next week" thing. Love how you saved me all that trouble.
Thanks, figuring out all the matrix math to come up with sane PYR values was interesting. There's still a few edge cases where roll flips over to -0 at some angles, but it's just a display issue and the numbers should work fine in demo files.

Fun fact, you can tell how much the feature was refined in between Issue 23 and 24 by doing this test:

1. Play a demo with the Issue 23 client and hit F2 to enable freelook. Turn the camera straight up. Notice how it won't let you go past a 90 degree angle, and also how the camera gimbal-locks around the Y axis when the pitch is high.

2. Do the same thing with the Issue 24 client. Notice how you can now pitch all the way around continuously, and also how much smoother and more natural the control feels at high angles.

The old behavior is probably a lot more in line with PYR representation used in demorecords, but the new method definitely feels a lot better for zooming around a zone. That does mean that there are a few obscure camera angles and moves you can do that can't be cleanly represented in a demo, but Cameraman takes the transform matrix and generates a PYR that's as close as it can get.

Quote:
Originally Posted by Leandro View Post
The only thing I'd add is a demorecord equivalent, so people can save their camera movement to a file. Just write (ms since last update) CAM POS x z y\n0 CAM PYR p y r\n to a file on every update tick.
That's a really good idea, and shouldn't be too hard to implement. A "flight path recorder" of sorts.

I'm thinking leave the program's sample rate where it is on the main screen, and allow the user to configure a save rate for the output file. So if you set it to save 1 camera location per second, it would still gather 10 per second and average them together before saving to reduce jitter. Kind of a user-configurable path smoothing.


 

Posted

Quote:
Originally Posted by Codewalker View Post
So here you go, COH Cameraman 1.0, no-sleep-till-testing release:

Updated the above link to version 1.01, a minor release which fixes the controls not showing up on Windows XP, fixes the background color on XP to match the controls if they would have showed up, and also fixes one of the icon resolutions having bad transparency.


 

Posted

Quote:
Originally Posted by Codewalker View Post
Yes, that slider does exactly what you think it does... Lets you speed up the sluggish demo camera all the way to Ludicrous Speed! Told you that you'd like it.
Ooh, freaking awesome!


Blue
American Steele: 50 BS/Inv
Nightfall: 50 DDD
Sable Slayer: 50 DM/Rgn
Fortune's Shadow: 50 Dark/Psi
WinterStrike: 47 Ice/Dev
Quantum Well: 43 Inv/EM
Twilit Destiny: 43 MA/DA
Red
Shadowslip: 50 DDC
Final Rest: 50 MA/Rgn
Abyssal Frost: 50 Ice/Dark
Golden Ember: 50 SM/FA

 

Posted

Okay this right here, is freaking awesome!

I have a ton of things to do now...

Thank you so much Leandro and Codewalker. Frees up a lot of ideas I had previously but couldn't get it like I wanted to. C'mon computer parts, get here already!!


Blue
American Steele: 50 BS/Inv
Nightfall: 50 DDD
Sable Slayer: 50 DM/Rgn
Fortune's Shadow: 50 Dark/Psi
WinterStrike: 47 Ice/Dev
Quantum Well: 43 Inv/EM
Twilit Destiny: 43 MA/DA
Red
Shadowslip: 50 DDC
Final Rest: 50 MA/Rgn
Abyssal Frost: 50 Ice/Dark
Golden Ember: 50 SM/FA

 

Posted

That's some awesome stuff guys. Looks like I may have a few more years of CoH fun even after the servers are shut down.

Leo do you have a site where one could download more of your nifty tools for working with demos?


V-Tronix - Angry Angels
V-Tron Elec/EM - V-Tron X EM/EA

To Build a Better Hero #53098 [Newly edited and looking for Feedback] - Renegade Robots: V-Tron's Task Force # - A Summer Song and A Winters Tail #104106