Camera moves

For AI and campaign script related discussions and questions
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Camera moves

Post by aubergine » 22 Dec 2012, 17:34

Thought I'd split camera-related wish list out in to separate thread for easier discussion...

Camera has following properties (as far as I can tell):

* x, y, z = point location of camera
* roll = like tilting your head
* zoom = focal length of lens

The camera also has a target, what it's looking at:

* x, y, z = point location of what the camera is looking at

Full list of properties: cameraX, cameraY, cameraZ, cameraRoll, cameraZoom, viewX, viewY, viewZ

I really struggle to read C++ code so if that's wrong or I've missed anything please let me know.

So far, the simplest way I can think of to get all desired camera effects is with the following functions and events:

cameraTansition( propertyName, newValue[, duration] ); // duration defaults to 0

Allows each property to be transitioned independently. If attempt is made to transition a property that's already being transitioned, new transition replaces old transition.

eventCameraMove( x, y, z, roll ) // triggered when camera moves (x, y, z, roll), throttled to 1 trigger per 200 ms

eventCameraTransitionEnd( propertyName, currentValue ) // triggers when transition ends

watch( gameObject, propertyName ); // watch a property of a game object (most commonly a droid)

eventWatched( gameObject, propertyName, newValue[, oldValue] ) // triggered when propertyName of the watched object changes (x, y, z, health, roll, etc...)

The bit I'm least sure about is the eventWatched(), I'm not sure what events there are for gameObjects, but assume there is some system already in place in the C++ code for watching properties.

Also, getTileHeight(x, y) would be required.

With those functions and events, the rest can be done in JS using fairly basic and performant code. I should be able to create all these camera effects (and more): https://warzone.atlassian.net/wiki/disp ... Camera+API
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Camera moves

Post by milo christiansen » 07 Jan 2013, 18:14

Can you say "in game cut-senes"?

Cool idea.
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Camera moves

Post by aubergine » 12 Jan 2013, 18:34

Also needed:

lockCamera(true/false)

Enable or disable human player's ability to move the camera. So during scripted camera moves, eg. as part of a campaign mission briefing, the player couldn't move cam.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Camera moves

Post by Goth Zagog-Thou » 12 Jan 2013, 18:38

I've been asking for this feature for two years. ;) My approach was more like Star Trek Armada 2, where it could be done in the map editor, visually, without guesswork.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Camera moves

Post by aubergine » 12 Jan 2013, 19:31

Well, once we get GUI functions in JS API, we'd be able to implement a cut-scene editor direct in the game! But first we need the basic functions.

Also, we'd need the functions listed above to do some scripted camera moves in campaign missions, etc., but where we'd have dynamic values in the code based on current game state. (we could still build bulk of the moves in a GUI, then just edit the resultant JS to put dynamic bits in).
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: Camera moves

Post by Emdek » 13 Jan 2013, 00:58

aubergine, I'm not sure that everything should be built-in in game engine, even if done entirely by scripting and being optional, it's just rendering engine. :-)
For sure it makes sense to be able to quickly preview such thing using game engine but I'm not sure if adding editing support into it is wise solution, too much very different tools implemented in that way may end up with not really user friendly UI.
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Camera moves

Post by aubergine » 13 Jan 2013, 06:08

Once JS API gets functions for GUI, nutters like me will be creating map editors, mission editors, cutscene editors and all sorts of other stuff, bundled as challenge maps :)

In any case, we could do with some fine grained control over the camera regardless.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Camera moves

Post by Rman Virgil » 13 Jan 2013, 13:34

aubergine wrote:....

In any case, we could do with some fine grained control over the camera regardless.
It's a PITA, & very time consuming, to make decent WZ Machinima of any length with the current camera controls. Especially with the so called "War Cam".
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3775
Joined: 03 Aug 2006, 19:39

Re: Camera moves

Post by Per » 13 Jan 2013, 14:15

Rman Virgil wrote:It's a PITA, & very time consuming, to make decent WZ Machinima of any length with the current camera controls. Especially with the so called "War Cam".
So how would a person interested in making machinima want camera controls? The best I can come up with would be to unlock the camera in-game, record its movements, save movements as a file, then replay the file in the campaign. Or perhaps it would be better to record this in a map editor...

User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Camera moves

Post by Rman Virgil » 13 Jan 2013, 17:33

Rman Virgil wrote:It's a PITA, & very time consuming, to make decent WZ Machinima of any length with the current camera controls. Especially with the so called "War Cam".
Per wrote: So how would a person interested in making machinima want camera controls? The best I can come up with would be to unlock the camera in-game, record its movements, save movements as a file, then replay the file in the campaign. Or perhaps it would be better to record this in a map editor...
In the spirit of a short youtube vid is worth more than a bunch of text description...

This vid covers some basic camera controls for making machinima in Second Life that would also apply to WZ or any game really, I think.

http://www.youtube.com/watch?v=KD_PZ9SmqTM

There are links for other related vids.

Doing the recording itself with an external screen-vid capture prog hasn't really been a prob.

I do however recall a Bungie strat game from 1997, with one of the very first 3D game engines, where you could film on the fly within the game itself (no external app needed) and then playback these movies whenever you wanted. The game was called "Myth". I still have it but have never looked to see how they did it. The camera controls were good - like explained in the above youtube vid.

Actually Bungie has made it's Myth games available as free downloads so anybody can see for themselves - camera controls and internal machinima making capability - here:

http://halo.bungie.net/news/Blog.aspx?mode=tags&tag=31

And a good little history on Bungie's "Myth" games:

http://www.rtsguru.com/game/397/article ... Games.html

(Also remember being impressed by Bungie's implementation of formations in "Myth"....)

=========>

And to get a sense of what has been done the last few years with real time strategy game based machinima, here is a movie theatre with 58 such machinima movies:

http://www.vandhaal.elpea.net/theatrertsmovies.html

Then there is the grandaddy of all things machinima with a global network that reaches 262 Million gamers viewing in excess of 2.6 Billion vids in Dec. 2012 alone:

http://www.machinima.com/

Be cool to eventually get some intrigueing WZ machinima plugged into this network.
.
Last edited by Rman Virgil on 13 Jan 2013, 22:37, edited 2 times in total.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.

User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: Camera moves

Post by Emdek » 13 Jan 2013, 18:07

aubergine wrote:Once JS API gets functions for GUI, nutters like me will be creating map editors, mission editors, cutscene editors and all sorts of other stuff, bundled as challenge maps :)
I'm afraid that this could be like opening Pandora's box. :-D
Especially if we won't have proper (and secure) infrastructure and guidelines done first, to not end up with too different and potentially incompatible solutions (that would be really very big freedom). :-)
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Camera moves

Post by aubergine » 13 Jan 2013, 23:13

@Rman - that's exactly the sort of thing I want to do with my Camera API.

So at the start of that video, for example, they're using Arc to move the camera around the subject in an arc while tracking the subject.

Image

The arc track shot is already implemented -- you see it at the end of a game when the scores are shown, with camera arcing around your base.

The functions I specified in the opening post would allow a script to implement all these moves and more. (Actually, I think we'd need one additional function for arch shots, I'll need to have a think about what that would look like).

And then, with some GUI functions (eg. ability to add buttons or keyboard shortcuts, etc) an interface could be created just like what's in that first video link Rman posted.

Some stuff will need farming off to C++ to ensure smooth moves, but the overall control of the camera should be scriptable. Thus, a camera script would be able to record it's own commands (simply by hooking to the JS API functions and storing them in an object, then dump that out as JSON so it can be edited or included in other scripts).

@Emdek: I don't see how it's opening pandoras box, or how it could cause security issues.

WZ already has a camera, and it clearly has controls to move that camera around (some great functions already exposed by the JS API - thanks Per!).

What I'm asking for is some "lower level" functions. What I mean by "lower level" in this context is "more fundamental basics". The current functions exposed by JS API are great for many purposes, but too macroscopic and automated for more fine grained control of the camera.

Having something that records the camera in-game and dumps to file is useful in some respect, but you are limited to what the game provides and there will always be something that it doesn't provide. Forcing the game engine to try and implement all kinds of camera moves for the sake of our small minority that want to use it to create videos / cutscenes / etc., would just make the game nasty for everyone else.

However, if some more fine-grained camera control functions are exposed by JS API, and there are already plans to expose some GUI functionality (buttons, etc) as mentioned elsewhere by Per, scripters using nothing more than a text editor and some basic JS skills can create a wide array of great camera tricks that can be loaded in as and when needed.

Then, people like Rman and others can do what was shown in that video Rman posted above. If that GUI is lacking in some way, anyone with JS knowledge and a text editor can contribute to making it better and adding new features.

But, specifically, because it's done in JS, the camera moves can be applied in-game, for example during campaign missions. A scripter might still use the GUI interface to generate the raw camera move data (the instructions passed to the JS API + timestamps) and then edit that JSON object to their specific needs, eg. to fine tune or apply an existing camera sequence to a different subject or location on the map.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Camera moves

Post by aubergine » 14 Jan 2013, 02:07

Note: I'm having a re-ponder about the requested functions. Will post details in a bit.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Camera moves

Post by Rman Virgil » 14 Jan 2013, 03:08

.

When you engage Drive Mode the camera attatches to the unit and for as much as you can maneuver the unit so goes the camera. I find myself using this method to get some interesting footage (using both air & ground units) but being that controling the unit in this mode is difficult you have to really think out what your after, plan your unit maneuver by careful waypointing, slowing the game speed down, and then in post processing of your footage, editing the herky jerky lack of steady cam gyro and bringing up the speed all the way up to normal. I'm hoping that with finer camera control I can get this type footage without messing with this tedious Drive Mode technique.
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Camera moves

Post by aubergine » 14 Jan 2013, 03:56

@Rman: I also use drive mode on occasion, and it's particularly nightmarish when VTOLs tilt sideways to change direction -- you get camera whiplash!

My re-ponder is including 'easing' -- not quite steadycam, but steadier-cam. So when something changes, the cam doesn't instantly react, it gradually eases in to the reaction for a more fluid movement. The result is you don't get whiplash.

My ultimate goal would be to get a timeline on-screen, so you could add actions and transitions, for example camera moves, giving droids actions, playing sounds, etc. With the ability to set droid x,y,z directly, plus the wide range of existing JS API features, you'd be able to record your gameplay and camera moves to flesh out the timeline, then go back and edit it (albeit with some obvious side effects that are easy to understand and adapt to in practice, but difficult to explain here in text).
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

Post Reply