Game Development Community

Freeing Up the Camera

by Matt Cabanag · in RTS Starter Kit · 04/20/2005 (4:43 am) · 13 replies

Hello,

I just bought the RTS starter kit. I have to say, even with all the work that's already been done, it is still quite daunting to think about finishing a complete RTS with this. There's just a huge pile of things to be done, not least of which is freeing up the camera.

I'd like to be able to look at the battlefeild from all sides and angles, but this warcraftish camera just won't budge. :/ Is it possible to replace the RTS camera with the 'vanilla' Torque camera? What scripts or engine source files do I need to modify? How do I set my camera free?

#1
04/20/2005 (7:07 am)
Can you explain more in depth what you are talking about? The camera already allows for panning, zooming, and pitch control, and in the Resources section is a mod that allows for 360 degree rotation as well.
#2
04/20/2005 (11:28 pm)
Oh I don't want anything too fancy. I just want the freedom of a camera that can look towards any direction. :} The only camera related thread I saw in the resources board was this one. So I made this thread. I'm a bit blind and stupider than the average Torque user. >_< Can you point me to that mod please?
#3
04/21/2005 (4:51 am)
I'm still not getting what you mean here by "can look towards any direction".

Are you talking about using a "first person" camera without a first person? in other words, a camera like the free-flying one in the fps starter kit demo, when you detach the camera?

The main problem with this is that for performance, the RTSCamera is actually all client side, and designed for the best management of RTS Units--which implies a "looking down" camera mode.

You can use the Advanced Camera resource and play around with the modes it provides, but realize that the RTS-SK kit itself is designed for RTS games, and you may not have all of the capability of an FPS in this style game.
#4
04/21/2005 (5:08 am)
Yes Stephen, a detached, go-anywhere, look-anywhere camera is precisely what I mean. This is more or less the same kind of camera that's been used by the Total War games and now Imperial Glory (except you can't really look at the sun or the sky and your camera's range is restricted by a certain radius from your units). :}

Thanks for pointing me to the Advanced Camera resource. It looks like it could be handy in the future, but I really don't need all that fancy stuff right now. Is it possible to replace the RTS camera with the default camera from the FPS Starter Kit? Does it still exist in the RTS Starter Kit?
#5
04/21/2005 (5:20 am)
Quite honestly, I don't know. I haven't looked at all at using a free form camera in an RTS game, because a free-form camera is actually going to break a lot of assumptions:

--we get away with low poly units and buildings because the camera is never going to be able to look at them from an extreme closeup.
--with a camera that always has the terrain in view, you can use the drag-select design easily. With one that won't be guaranteed to have terrain in view, you may have issues.
--currently, the screen coordinates to 3-D world coordinates projection can rely on the assumption that at the worst you will always collide the mouse with the terrain. With a free form camera, this won't be the case, and you'll have to re-write the selection scripts at a minimum, and probably more.

That's just off the top of my head--there are probably a LOT more underlying functionality modules that will be affected by allowing a free-form camera that you are going to run into. The RTSCamera (and cams in all other RTS games) are constrained for reasons that may not be obviously apparent at all times--and I'm positive that even in Total War, the camera has carefully designed constraints that fit into their design assumptions.
#6
04/21/2005 (6:30 am)
About the selection scripts: I don't think they work by translating coordinates based on mouse contact on the terrain. I've put a unit on a hill, increased the pitch to the maximum angle and selected it without a hitch. I didn't touch any of the terrain at all. :} Mind you, this is still using the RTS Camera.

From this point of view, I think camera restrictions were applied to 3D RTS's as an effort to replicate some aspect of traditonal 2D RTS's. (ie it isn't a technical issue tied to the engine) In the Total War games, they tried to replicate fog of war by restricting the roaming range of the camera based on its distance from the player's units.

In our RTS Starter Kit, they stopped us from turning left/right as if it was 2D. This is the bare minimum of what I'd like to do. If anyone can help me in this respect, I would be forever greatful. Although it'd be even nicer if someone could find a way to give full freedom to the camera. :}

Of course, I'll try to do this in my own time too and I'll post back here if I have any kind of success. Might take a while though. >_<
#7
04/21/2005 (7:02 am)
No, but if there was not a unit there, then when you click with the mouse, it would assume that there is terrain beneath it (there -is- terrain beneath it, so it returns a collision with terrain, which is important for the drag-select capability).

As I said, there is already a resource for having camera yaw in the RTS-SK--look in the resources section.

Also, RTSCamera is derived from Camera, and the base class should still be there--just create a "Camera" instead of an RTSCamera, and go from there.

You will probably need to use a GameConnection as well, instead of an RTSConnection--which is going to mean that you will not have the normal RTS functionality for this particular connection. Alternatively, you could re-implement all of the functionality that the Camera provides within the RTSCamera, but I've already talked about the reasons why that may not be your best plan.
#8
04/21/2005 (11:07 am)
I'm not sure it's as bad as that, Stephen... Just make change the bits that say new RTSCamera to Camera and hope for the best. Starter.fps has good examples here. ;)
#9
04/21/2005 (11:10 am)
@Ben: Hehe..you wrote it, so I'll bow to your wisdom--but I still think he's going to have a lot of territory to cover :)
#10
04/21/2005 (4:48 pm)
I certainly do. There's a ton of things in the resources section; none of which are hit by the search key "RTS Camera". :} And using the keyword "Camera" gets far too many hits than I care to wade through. I guess what I'm trying to say is: can you please give me a link to that camera resource that allows me to turn the camera left and right? :} I'm a bit blind and stupider than the average Torque user. >_<
#12
04/21/2005 (5:21 pm)
Lol they must've moved it here from the resources section then. >_< thanks stephen.
#13
04/21/2005 (5:27 pm)
That was my bad I guess--I assumed that it was in there, but it looks like it never got "polished up for resource release", and put over there.

Sorry!

P.S: Make sure you read (and apply) the entire thread--it actually didn't get polished up, so the thread is a work in progress to the end!