Developer Blog #4: Developing Camera Controls for a City-Builder.

In recent weeks we’ve taken to upgrading our in-game camera. Developing the controls, which enable the player to move, view and interact with their city, are fundamental to our game.

We want to build a system that feels fluid, and allows a player to easily watch over their growing city. We also want it to feel naturally cinematic, showing their creation in all it’s glory.

To start with, our previous camera movement system was ripped out and we got to work outlining the new camera requirements in a concept phase:

  • the camera should smoothly orbit the current focal point when rotating
  • the camera should move at a speed relevant to the zoom level
  • the zoom should be smooth and gently rotate towards the horizon when zooming in

To achieve our goals, the camera was split up into different objects; the top level camera object would move in 3D space (when using WASD) and rotate on its Y axis (when holding middle mouse button). The child camera object can only rotate around its X axis.

The camera movement was reworked to give it faster acceleration whilst maintaining smooth motion.

Next we made the camera send out a ray to find a focal point on the map; this is wherever the player is currently looking. This point is then selected as the orbital pivot, around which the camera rotates.

In reality, it’s quite a bit more complicated than outlined here, there are many pieces we can’t go into detail on, and a few hurdles we’ve overcome in making this system.

Next time we’ll be talking a bit more about the environment systems in the game, and how they work together to imitate a living, breathing world.

Thanks for reading, if you enjoyed this or want to find out more, head over to the Steam page and add Dynasty of the Sands to your Wishlist:

One Comment

  1. Alfonso Guarracino

    Looks really great! I am looking forward to seeing this project progress!

Leave a Comment

Your email address will not be published. Required fields are marked *