• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Third Person Camera Panning over Terrain

Status
Not open for further replies.
Level 3
Joined
Jan 20, 2020
Messages
48
Hey all,

Messing around with the Reforged editor, experimenting and planning out a map I'd like to make.

I'm getting caught up with camera motion over rolling terrain; my map has lots of hills and valleys, and when my third person camera follows my unit, it can't seem to keep up in terms of elevation. It always seems to be too high in a valley or too low on a hill.

I've tried using pans with Set Camera Field - Height Offset, and also I've tried Pan Camera with Interpolated Height; but both of them can't seem to keep up with the terrain the way that camera objects could in the SC2 editor which allowed you to disable camera collision ect.

I notice Blizz added the nifty feature to get a Z elevation with the GUI of a unit; but there doesn't seem to be a way to lock the camera to my unit's Z.

Are there any new GUI features that have been added, or any methods you can recommend to resolve this? Would prefer to stick to GUI because I'm illiterate otherwise and really don't have the time to learn this scripting, I have no experience with it. Thanks!
 
Level 9
Joined
Jul 30, 2018
Messages
445
It's a pain in the butt. Lately I've been looking into the camera thingies a bit and the Blizzard's system is not that simple. Here someone has done a smooth Z tracking and just look at how much code there is.

Though if you are not a perfectionist, native GetLocationZ takes location whichLocation returns real gets you far enough is most cases. Problems rise mostly with units, because units don't actually have a Z coordinate (height), because Warcraft 3 doesn't use a real 3D world, but it's actually 2D flat surface projected in 3D space (or something like that). That's why units can't go under bridges, for example. A bit like how the original Doom wasn't actually a 3D world either, but just looked like it and that's why you couldn't have two levels above each other there either.

They did say Reforged would bring with it a new (or updated/modified) camera system, so we'll see if there are some changes.
 
Level 3
Joined
Jan 20, 2020
Messages
48
Tha
It's a pain in the butt. Lately I've been looking into the camera thingies a bit and the Blizzard's system is not that simple. Here someone has done a smooth Z tracking and just look at how much code there is.

Though if you are not a perfectionist, native GetLocationZ takes location whichLocation returns real gets you far enough is most cases. Problems rise mostly with units, because units don't actually have a Z coordinate (height), because Warcraft 3 doesn't use a real 3D world, but it's actually 2D flat surface projected in 3D space (or something like that). That's why units can't go under bridges, for example. A bit like how the original Doom wasn't actually a 3D world either, but just looked like it and that's why you couldn't have two levels above each other there either.

They did say Reforged would bring with it a new (or updated/modified) camera system, so we'll see if there are some changes.

Thanks for the info. That's such a shame that they seemingly haven't incorporated this stuff yet into the gui, especially since the models look really nice up close.

They are also missing a gui method to disable the UI the way you could in SC2 editor, and event - keyboard entry commands other than arrow keys. Such a pain in the ass
 
Level 9
Joined
Jul 30, 2018
Messages
445
Well, to be honest, the JASS functions look a bit intimidating at first, but they are quite easy to incorporate to GUI, once one takes a little time to understand what all the words mean.

For example, that one can easily be used in GUI:
  • Actions
    • Set Location = (Center of (Playable map area))
    • Custom script: set udg_CamHeight = GetLocationZ(udg_Location)
    • Camera - Set Player 1 (Red)'s camera Height Offset to CamHeight over 0.00 seconds
Although, I do agree, that it would be a bit more user-friendly to simply add GUI-equivalents of all the natives. Especially those UI things, as you mentioned, can get a bit tricky even in JASS.
 
Level 3
Joined
Jan 20, 2020
Messages
48
Well, to be honest, the JASS functions look a bit intimidating at first, but they are quite easy to incorporate to GUI, once one takes a little time to understand what all the words mean.

For example, that one can easily be used in GUI:
  • Actions
    • Set Location = (Center of (Playable map area))
    • Custom script: set udg_CamHeight = GetLocationZ(udg_Location)
    • Camera - Set Player 1 (Red)'s camera Height Offset to CamHeight over 0.00 seconds
Although, I do agree, that it would be a bit more user-friendly to simply add GUI-equivalents of all the natives. Especially those UI things, as you mentioned, can get a bit tricky even in JASS.

you can't do the camera height this way, the initial Z of the camera seems to be variable depending on the terrain ect. I tried this, it would make the camera height really high up in the air. The camera's initial Z isn't the same as the elevation of the terrain. Plus, as it pans over the terrain, the camera's elevation changes on its own for hills and valleys, but not enough for following a unit around in third person. I'm really annoyed at blizz because all of this was solved in SC2 trigger editor
 
Level 9
Joined
Jul 30, 2018
Messages
445
I tried this, it would make the camera height really high up in the air. The camera's initial Z isn't the same as the elevation of the terrain.

Oh. Well, just another thing point out how complicated the Blizz's system is. I just assumed it would work that way.

Have you tried this one?
JASS:
//Toadcop's Method:
function SetCameraZ takes real z returns nothing
    set z = GetCameraField(CAMERA_FIELD_ZOFFSET)+z-GetCameraTargetPositionZ()
    call SetCameraField(CAMERA_FIELD_ZOFFSET,z,- 0.01)
    call SetCameraField(CAMERA_FIELD_ZOFFSET,z,0.01)
endfunction
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
//Toadcop's Method:
CornyBleakBactrian-size_restricted.gif
 
Status
Not open for further replies.
Top