Recording camera (and mouse?) position in replays

Recording camera (and mouse?) position in replays

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Recording camera (and mouse?) position in replays

Post by Dragon45 »

Request: Record position of player's camera (and maybe mouse) position, mode, rotation angle, etc, so that if i have say, Player 1 selected, and I press some key, it basically shows me everything he sees and everything he was looking at and doing until i press the key again and toggle it off. In other words, it would hijack your camera and bind to whatever that player was doing.

Maybe even something for keypresses, that outputs something showing what the player was pressing at any given point in time? ;)


http://spring.clan-sy.com/phpbb/viewtop ... 82&start=0
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Would be hard since it would require transferring that data to the other computers in first place.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

That doesn't matter when it's only getting recorded in a local replay. Camera, cursor, etc information could be stored in a seperate file for each replay.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Yeah but that wouldn't let you see the movements of a player that isn't the one who uploaded the replay. You'd probably want to use that to see how your opponent is playing, not how you did. Also it'd probably need a mention of the running lua widgets since otherwise it'd look pretty weird when the player clicks on empty areas.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

Still it's a fun idea, the Black and White games had this to.
Maybe it could be implemented (if anybody ever thinks it's important enough to implement) by treating the camera as a unit, then the camera position could be updated like any first person controlled unit. Might even allow the camera to be targeted (and killed)? :-)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

KDR_11k wrote:Yeah but that wouldn't let you see the movements of a player that isn't the one who uploaded the replay. You'd probably want to use that to see how your opponent is playing, not how you did. Also it'd probably need a mention of the running lua widgets since otherwise it'd look pretty weird when the player clicks on empty areas.
Hmm right. That sounds like a huge increase of traffic.
ironized
Posts: 172
Joined: 25 Jun 2007, 06:33

Post by ironized »

could it be done so you can at least see the players build que?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Um, you can see all queued orders of all units the same way you would if you're playing yourself (hold shift with the unit selected).
User avatar
theHive
Posts: 124
Joined: 13 May 2007, 06:54

Re: Recording camera (and mouse?) position in replays

Post by theHive »

Dragon45 wrote:Request: Record position of player's camera (and maybe mouse) position, mode, rotation angle, etc,
You only need to note the points where the corners of the screen intersect the ground, like the box drawn in for where your screen is

and the mouse would just be the point the mouse intersects with the ground

all of it is simple raytracing, and the code is already there, just needs to be put to use
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

That's more data and less accurate than just taking the camera position and direction. Also the mouse will not always point at the ground and dealing with 2d coordinates is pretty easy anyway.

The problem is that it has to be updated very often since it's unsynced code and will run more often than 30 times per second (which is the rate the synced code updates at).
User avatar
theHive
Posts: 124
Joined: 13 May 2007, 06:54

Post by theHive »

KDR_11k wrote:That's more data and less accurate than just taking the camera position and direction. Also the mouse will not always point at the ground and dealing with 2d coordinates is pretty easy anyway.

The problem is that it has to be updated very often since it's unsynced code and will run more often than 30 times per second (which is the rate the synced code updates at).
Yeah, for the mouse i meant 2d coordinates, where the ray for the mouse intersects the ground.

You wouldn't need it to be every single update in the replay, for the screen you could have it update every second or other arbitrary time period (I'd make it more often for the mouse though).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

What makes you think it's a good idea to use the coordinate where the mouse intersects the ground when you can just store the screen coordinate? The mouse won't always intersect with the ground but it will always be on the screen (excluding windowed mode but you can handle that, too). Saves you one ray cast, gives you a smaller value range and causes less issues.

Updating the screen and mouse asynchronously is pointless because then you'll see the mouse click on things the camera doesn't show which makes it just as useless. Besides, sending a set of 2d coordinates and adding a camera matrix isn't that much of a difference.
User avatar
theHive
Posts: 124
Joined: 13 May 2007, 06:54

Post by theHive »

Alright, whatever. No doubt you have more experience in this than me :-)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I don't see the logic behind this either.
Post Reply

Return to “Feature Requests”