October
22
2016

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).

Settings

There are some special settings you need to keep an eye on in 2D games.

Raycast Type

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 2DFirst 2D or First 3D.

Horizontal Plane

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 Y Distance

The Ignore Y 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 Y-axis.

In 3D games, this setting allows you to ignore the height difference for range checks. In 2D games this will be a problem, since you’re operating only on the X and Y axes, so be sure to disable the Ignore Y Distance settings.

Event System

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.

Camera Changes

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.

Rotations

Don’t rotate your game objects or use the Look At Enemies node.

Movement

Again, keep in mind that you’ll move on the X and Y axes.

General Information

There are also some other things to consider when creating a 2D game.

Custom Controls

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.

Event Interactions

Make sure to disable the Turn Player to Event and Turn Event to Player settings in Event Interaction components.

Interaction Controllers

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.