Role: Game Programmer
Completed: Cpl Wallace Donegan Game Programmer
Start Date: 4/19/2018 20:15
End Date: 4/26/2018 17:06
The script RTSCameraController needs to be corrected. The functions that allow the camera to pan with the mouse have been commented out and arent functional. Also the script references axis's that do not exist on the project at this time. "PanSpeedBoost" and "Zoom" are referenced but arent to be found.
We need to make corrections to this script in order to get it functioning as intended. While you are making corrections there are functions you need to implement as well.
- a,s,d,w to move the camera
- mouse to edge the screen to move the camera
- the scroll wheel to zoom in and out
- q and e to rotate the camera
The Main camera holds the RTSCamera script, on that component are Private Serialized Fields (not public properties, I will not use public unless absolutely necessary) these values can be modified in the editor.
@Jono The camera climbs with the mountain because it is raycasting the terrain and maintaining a zoom height above ground. This is typical behavior in most RTS games I've played but if a change needs to be made the designers can figure that out and I will correct it.
There should be no problems modifying any of the values, they are base values I set based on a typical scene's scale. I made the script as ... plain as simple ... as I could. I would have commented more but I felt the names of the variables and their locations within there respected region tags were fairly clear and more comments would only have muddled the code.
EDIT: If the Range attributes in the Private Sertialzied Fields needs to be updated that is completely fine, those values are there to limit the sliders so they are manageable, ie. you move the mouse 1 px and the value changed by 1000. That would make it difficult to use. The range is set to mitigate that. If it needs to be adjusted for the project a few times that change should be seen as fine-tuning for the overall whereas adjusting the slider is for map specific tuning. Basically, when finished with the project these ranges should represent the minimum and maximum height required across the entire map set. (This info can later be used for other performance tunings when nearing the end.)
Edit: As for the dramatic change in elevation, perhaps I can add a Lerp to smooth the effect, I didn't actually test it on a real piece of terrain as all the work I've have done previously is corrupt in the last build I retrieved form MCU. I started from scratch with a flat piece of terrain.
1. Added a dedicated Instructions region within the script for details on how to use it.
2. Broke out some logic form the main update function to better segment the different parts and functionality.
3. Added the ability to drag with the middle mouse button to rotate the camera. Additional settings for the speed of that interaction can be adjusted in the editor.
EDIT: I just updated the script, increases all the maximums to what I really feel are extreme values, Hopefully, this is sufficient.
On a side, no whatever map you are working with is simply huge and highly recommend it be a candidate for the largest of the maps.
Also, to note, When using Unity's physics system if things are scaled dramatically out of normal proportions it has a noticeable performance hit on the engine. A Human is roughly 2 meters tall, that is 2 unity units. An effort should be made to keep things close to actual scale in relation to one another to avoid issues with the physics. (Sorry its a side rant I know but it is important. I was under the impression that an object's scale doesn't matter in regards to physics but I was proven to be wrong in that assumption and want to avoid seeing Armament fall into that same trap.)
I will remove the ranges for now so you can play with it freely, but please keep in mind some of the values take very little change to have drastic game-breaking effects.
I'll update this thread when i have it uploaded
As to my process of creating the default settings, please view this screencap.
The cubes use the same texture in order to visualize the size of scale. The smallest cube is 1 meter, the next above it is 2 meters, and the third is 4 meters. The middle cube most accurately represents the size of a human height and values were tuned to feel comfortable at that scale based on that.