The DC/RTS Controller is designed to act as either a Dungeon Crawler or RTS System, meaning that the way the camera acts is in a bird’s eye, top down view. Such that in a Dungeon Crawler there is usually only one active controllable object, but in an RTS you usually have many controllable objects.
The present features of the camera allow you to move it around in various ways. Such as, with the W, A, S, and D keys you can move it’s location forward, left, backward or right. With the Q, and E keys the camera’s rotation will pivot around counter-clockwise or clockwise, zooming in and out with the mouse wheel is also supported. A toggle key: Space Bar by default has also been implemented to allow for activation of the camera to move toward a selected controllable object if it isn’t near it, as well as make the camera follow that object.
This package comes with individual class object handlers to allow you to sort between the various objects: ControlObjHandler, CreatureHandler, and NPCHandler. With these you can attach the handler to a specific object to be able to receive and execute desired behavior, whether it’s controllable, a creature or an interactive npc.
In terms of the ControlObjHandler, they’re the main focus, the main player or player units. The behavior that they contain when you toggle them with a mouse click first selects the single unit if it isn’t selected. From there any mouse click on anything besides another Control Object will toggle that unit to move to that location, such that a light indicator Selection Toggle appears at the location of where you clicked momentarily. While a Control Object is toggled and if you press the toggle key: Space Bar by default, the camera will snap to, and follow that selected unit. At that point the behvaior of Q and E also changes, such that it’ll rotate around the selected unit counter-clockwise or clockwise upon being pressed.
As of version 1.3, a multiple object selection system has been added to the RTS side of this Controller. This allows you to select and be able to control more than one ControlObjHandler at a time. You’re able to select the objects by either dragging your mouse and drawing a box around the objects, or adding them in one at a time by using the Add Additional Key: Left Alt by default. Once they’re selected you can move them by selecting a location to move them to with the Left Mouse Button.
Version 1.4, it’s purpose is mainly about the GridGenerator, which this generates grid squares a long the xz plane, taking into account a min and max slope value. To determine a slope, within this current version, the sloped object must be parallel with either the x or z axis.
Version 1.5 introduces the PathFinder class which utilizes the GridGenerator class from version 1.4. It uses the A* path finding algorithm for determining the best path between an initial GridSquare and final GridSquare, it can also take in a Unity3D Transform Object for reference on who to send the calculated path tiles to once the path has been calculated. The PathFinder also calculates the path in a separate thread for increased performance.
Version 1.6 implements the Grid Object Creation System. This system also utilizes the GridGenerator class from version 1.4. It contains the class object: Object Creation GUI Controller that is attached to the Main Camera. From this script you are able to set the attributes that make up your Grid Object Creation System: Rows, Columns, The Main Grid Generator that is used, The Icons (Default: 50×50 pixels) that make up the Grid Objects to build, The Time Values for how long it will take to build one of the Grid Objects, The Unity3D Prefab objects that contain the GridObject script that represents the individual Grid Objects, The Unity3D Layer to ignore when building a Grid Object, The Creation Method that is used (Either: Master or Observer) and finally the Material that is used to draw the GridSquare objects bellow the Grid Object.