2D RPG Engine

2D RPG Engine

By Daniel Hogberg

Application Description

The iPhone is a unique platform. The limited system resources and unique input mechanisms necessitate applications which are designed with the platform and its users in mind. Role-playing games are typically vary large games which are played for many hours. They can be the most complicated game genre. In order to fit an RPG onto the iPhone platform it has to be simple and enjoyable in small bursts. An RPG presented in an episodic fashion is palatable to the iPhone market, as each episode can be priced at the under $5.00 price point in which most games reside. This application represents a basic engine on top of which an episodic RPG can be created. It is designed such that content creation is simple and fast, which lends itself to the episodic format.

The view in which the player will spend most of his time is known as the overworld. In this mode, the player is given a roughly top-down perspective onto the world. The world is divided into small maps and the player can move around these maps and interact with object in them. All player interactions are handled by single touches. The default action performed on a touch is a simple move action. Tapping the screen results in the player character walking towards that particular location in the world. The player may keep his finger on the screen and move it around in order to alter the player characters destination in-transit. Tapping an interactable object when close enough to it interacts with that object. When a sign is tapped an image representing the sign appears with the text on the sign. When the player taps an enemy combat begins. Furthermore, the player may move to other areas of the world by moving the player character into teleport tiles, which may be at the end of paths or in doorways.

All overworld content is stored in a combination of files. The levels themselves are stored in TMX format tilemaps. The information regarding are stored in plists. The plist corresponding to a map has the same name as the map. The tile images themselves are named in each TMX file. The status of the player is stored in yet another plist. When a new area is loaded the status of the player is written out to another plist. When the game is loaded it checks to see if the modified plist exists, and if not, it loads the original. In a commercial application of this engine this would need to be replaced by a UI for choosing whether the player wants to continue his game or not.

When a player taps an enemy, it initiates battle mode. In battle mode, all combatants are defined as either being friendly or not friendly. In combat, each combatant takes turns attacking another combatant until either all the friendlies or all the enemies are killed. When it is the player’s turn, he taps an enemy to attack him. The attack does damage which reduces the enemy’s number of hitpoints. Each combatant’s hitpoints are displayed underneath their sprite. The green triangle indicates whose turn it is.

Features:

  • Saving and loading of content.
  • Easy content creation.
  • Multiples areas and tilemaps
  • Turn-based combat
  • Naked sprite. (Sorry about that)

Apple Frameworks Used

  • Core Foundation
  • Core Graphics
  • OpenGLES
  • QuartzCore

Third Party Libraries Used

Screenshots

The player's starting position.

The player's starting position.

Tap to move.

Tap to move.

An area with a different tileset.

An area with a different tileset.

Reading a sign.

Reading a sign.

Combat mode.

Combat mode.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: