Gettin’ to the Root of it all!
The driving force behind all the data in the kit is a simple Property List file named GameData.plist (seen on the left in the photo above). You’ll define all the non-visual data for your game here. How fast the player walks, how much damage a weapon does. How much XP killing an enemy rewards. Basically, all the nerdy details to make a fun, immersive RPG game.
From top to bottom, lets run down the Dictionaries in the root (main section) of the GameData.plist. The term “Dictionary” basically just means a grouping of properties. So for each dictionary you see above, you can unfold it to reveal more properties, including other dictionaries.
- Levels – this dictionary will contain all the levels for your game. You can include an unlimited number of levels, and each can be named anything you like. The kit already includes two levels, Grassland and Dungeon. So if you were to unfold the Levels dictionary, you would see these two sub-dictionaries below. Notice base names of these levels, match exactly the Grassland.sks file and Dungeon.sks files also included with the kit. This exact name match is what ties the level data to those particular SKS files (Scene Editor files, where your level is designed). Your individual levels will have sub-dictionaries for enemies, items level settings, and much more. Find out more about Levels here
- Class – this dictionary will contain all the dictionaries that define the various ways your player will look as they advance through the game. The kit includes a Peasant class to begin with. You can define as many different versions of your character as you want, or as little as one. So for example, the game might begin with the character using the Peasant class, but after they gain enough XP, they can be rewarded with an entirely different class. Or they could pick up an item, which rewards them with a new class. The data in these class dictionaries defines everything about the character, from how fast they walk, to what animations define their look. Find out more here
- Settings – this dictionary contains properties that (for the most part) affect the game on all levels. Find out more here.
- Projectiles – this dictionary contains sub-dictionaries which define the various weapons either the player or enemies will use in the game. The kit includes a Sword and Axe dictionary. You can add as many projectiles as you want. Projectiles can be rewarded to the player when they enter levels, defeat enemies, or pick up items in the level. Player classes can also define which projectile they start with. For example, the Peasant class notes a starting projectile of Sword. Find out more here.
- XP – This is an Array type property (arrays are similar to dictionary types, but define a specific order). Each array item will be a dictionary that defines the name for a particular level of XP, how much XP is required to get to the next level, and if there are any rewards for leveling up. In the gif below, you’ll see Item 0, defines a Name of Level 1, and a Max number of 99. So after the player has gotten 99 experience points (by killing enemies or acquiring items), they would advance to the next item (Item 1). The GUI screen, can display how much XP the player has, how much XP is needed to advance, as well as the Name for the current XP level. Find out more here.
- Inventory – the kit allows you to define an unlimited number of “attainable” items. For example a castle key might be lying on the ground in one of the levels. When the player contacts it, the key is removed from the scene, and optionally can be stored in inventory as a reward. You’ll define properties here for the icon of the inventory, whether you want to show how many of those same items the player has, where that running count appears relative to the icon, and also what font to use. Find out more here.
- Home – this is the first scene loaded when the app is launched. You’ll find a identically named Home.sks file in the kit (to visually design your scene) This scene could display buttons to get the game started or continue from where you left off. In the demo, the Home scene simply plays a short video and automatically advances to another scene named MainMenu. Note: you can create as many extra scenes for your app as you want. Find out more here
- MainMenu – Again, you’ll find an identically named MainMenu.sks file which will be used to visually layout your scene. This scene has three buttons. Each name matches one of the buttons listed in the screenshot below. Buttons can start the player at specific levels, specific places within the level, continue the game from the last saved point, clear game data, go to different menu scenes, etc. Find out more here
- ResetGameMenu – like Home and MainMenu this is another menu scene. This scene has a button to reset all data in the game. Find out more here
- ContinueMenu – like the previous menu scenes, this example contains example buttons that can be used to start a player back at a specific level but ONLY IF they’ve previously made it to that level. Find out more here
- Items – OFF – This dictionary can be renamed to Items, and used to save dictionaries for items that are the same on every level. For example, you might find that a basic pickup item like Coin, is the same every level. Instead of defining that on a per-level basis, you can use this dictionary in the Root. You’ll notice in the kit, when an empty dictionary or empty property isn’t being used, we simply rename it with the suffix ” – OFF”. This allows us to leave reminders of what properties are possible, but the code safely ignores key names it doesn’t recognize.
- Enemies – OFF – Exactly like the previous dictionary, but for enemies that are the same on multiple levels.