Pages

Friday, February 17, 2012

XNA Game: RPG Elements


    The projects that I have talked about so far have been ones that I worked on in the past. Today I will talk about a project I am currently working on. It is called "RPG Elements" and is the third major iteration of an RPG game engine that I have worked on for just over a year, although this iteration was rewritten pretty much from scratch in about a month. Through building and rebuilding this engine I have created many interesting features and today I will talk about the most fundamental, and leave some of the more advanced features for another time.

    My goal for this project was to design a tool that could create a game with minimal effort required by the designer. I identified that most of effort is spent in designing the levels so I wanted to make this as simple and intuitive as possible. In previous iterations I had tried making a variety of different editors but I found this to be a lot of extra work. In this iteration I took a different approach, I designed the engine so that all of the data can be edited while playing the game using a console. My biggest surprise was that this console was very easy to implement because of the data structures I had used for storing my data. Then to make editing easier I added shortcuts and hot-keys for common console commands to make editing quick and intuitive.
A Logo Graphic I Designed

    To demonstrate this I will explain step by step the creation of a level. First the user types in the console "newmap" and the dimensions of the tile map. Then they draw background tiles on the map using the player as the cursor. Then, in the console they type "addmapobject" and the name of the object, such as tree or house. The player can then grab onto this object, walk around and drop it where they want.

    In this style of the game, the player walks around a virtual world and interacts with objects. These interactions are known as events. An event is composed of a set of actions that are executed sequentially. There are many different types of event actions, such as teleporting the player to another map, displaying a dialog box, asking the user for some kind of input, etc. Event actions have flow control in the form of "if" statements and loops and multiple events can also execute in parallel. As a result, events are implemented almost like a mini scripting language. Common events, like doorways that teleport the character between maps, have been designed to be especially easy to create since they are so commonly used.

    With these two fundamental features I can design most of what I need for my game, and my more advanced features are typically composed of or supplement these features.

    At this point my engine is in a fairly complete state and I am in the process of using it to create a game. In a future blog entry I may talk specifically about this game, in addition to some advanced features, but it is still in the very early stages.

No comments:

Post a Comment