ORK Framework can also be used to create 2D games – learn what you need to consider when creating a 2D RPG.
While most tutorials here are based on a 3D RPG, you can use the same methods for 2D games. Since ORK’s core functionality is being the background system for role-playing games, most of the settings you’ll do are the same for 2D and 3D games.
There are some things to consider when dealing with 2D games – especially when you’re workgin in Unity’s 2D mode, i.e. your horizontal plane will be on the X-Y axes instead of the X-Z axes – this basically means that you’ll move on X and Y instead of X and Z (and Y for height changes).
There are some special settings you need to keep an eye on in 2D games.
This setting can be found in Game > Game Settings in the ORK Framework editor. The Raycast Type handles how raycasting is done by ORK.
Unity uses 2 different kinds of raycasts to find game objects in the scene – 2D and 3D raycasts. If you’re building a 2D game, you’ll usually use 2D colliders and 2D rigidbodies, i.e. you also need to use 2D raycasts or you wont be able to hit any game object. For this, you need to set the Raycast Type to either Only 2D, First 2D or First 3D.
The Horizontal Plane setting can be found all across ORK Framework, e.g. in the move detection settings of Move AIs. This setting defines on which plane the player moves on, i.e. either the X-Z (3D) or X-Y (2D) plane.
E.g. for the move AI’s move detection, the horizontal plane defines on which plane the angle for detection will be checked.
Ignore Height Distance
The Ignore Height Distance setting can be found all across ORK Framework, e.g. in the various range settings. If enabled, whatever check they’re used in (e.g. checking if a combatant is in use range of an ability) will ignore the distance on the height related axis, depending on the horizontal plane used by the check (e.g. the base setting in Game > Game Settings). Using X-Z (3D) will check the Y-axis, using X-Y (2D) checks the Z-axis.
In events (e.g. battle events animating an ability) you need to keep in mind that you’re only moving on the X and Y axes, not on X and Z (and Y for the height) as in 3D games.
Make sure to avoid rotations as much as possible. You’re working in 2D space and most likely use sprites – they’re not looking good when you rotate the camera to an angle where they’re basically just lines.
Don’t rotate your game objects or use the Look At Enemies node.
Again, keep in mind that you’ll move on the X and Y axes.
There are also some other things to consider when creating a 2D game.
ORK’s built-in player and camera controls are made for 3D games – while you can use some of them in some 2D games as well (e.g. the Top Down Border camera control), you will most likely need custom player/camera controls.
Make sure to disable the Turn Player to Event and Turn Event to Player settings in Event Interaction components.
When using 2D colliders/rigidbodies in your game, you’ll also need to use them on your interaction controller. Otherwise your 2D interactions can’t be recognized by a 3D interaction controller.