PDA

View Full Version : RPG woes



code_glitch
21-11-2009, 08:59 PM
I've only just started in SDL and am working off the standard SDL untis supplied with FPC 2.2.4. Anyway, as a starter I made a few pointless apps that worked and wrote myself a few management procedures and shortcuts which made my life a whole lot easier.

Anyway, as the first decent sized project I was thinking of making a 2d tile based RPG along the lines of Pokemon. Now, that may seem childish and pointless but I found it had just about everyhting I thought an RPG should have and would be easily customisable once built to make an entirely new game.

I got as far as getting a person to walk on a map and being able to load and play map-specific music without a hitch. The only problem I have is not to do with the code directly, but instead its to do with: where do I start? Does anyone out there have any idea on how to make an efficient storyline and interaction framework/system? I've been trying all week to no avail and it's been driving me up the wall.

Any help would be much appreciated.

dazappa
21-11-2009, 09:21 PM
I've only just started in SDL and am working off the standard SDL untis supplied with FPC 2.2.4. Anyway, as a starter I made a few pointless apps that worked and wrote myself a few management procedures and shortcuts which made my life a whole lot easier.

Anyway, as the first decent sized project I was thinking of making a 2d tile based RPG along the lines of Pokemon. Now, that may seem childish and pointless but I found it had just about everyhting I thought an RPG should have and would be easily customisable once built to make an entirely new game.

I got as far as getting a person to walk on a map and being able to load and play map-specific music without a hitch. The only problem I have is not to do with the code directly, but instead its to do with: where do I start? Does anyone out there have any idea on how to make an efficient storyline and interaction framework/system? I've been trying all week to no avail and it's been driving me up the wall.

Any help would be much appreciated.

What do you mean where do you start? You've already started, and map loading and player moving are two very important features of a game. (Although from your description I can't tell if you've added a complete map system in, or if it's a temporary hard-coded map) :)

As for making an "efficient" storyline, I have no idea. How is a storyline efficient? If you mean just writing a storyline, then obviously you'll have to create one or ask someone to help you. For interaction, you should be thinking of enemies, quests, dialog, and inventory.

Another thing you could add to go along with quests is a cutscene system, but that'll probably be a bit more challenging.

code_glitch
21-11-2009, 10:03 PM
the maps are loaded from map files on hard drive so no, they are not hard coded. The problem I have is how to integrate events/storyline into the existing code in an efficient manner. ie. how to store text, check for uncompleted quests, add items to inventory (or even an efficient inventory system) and if possible animation and intercation which would be required for the storyline.

arthurprs
22-11-2009, 01:27 AM
Are you taling about quests/objectives? If yes, it's a good question, most major games use scripting languages for that, and i'm not sure if there is a better way.

dazappa
22-11-2009, 04:00 AM
the maps are loaded from map files on hard drive so no, they are not hard coded. The problem I have is how to integrate events/storyline into the existing code in an efficient manner. ie. how to store text, check for uncompleted quests, add items to inventory (or even an efficient inventory system) and if possible animation and intercation which would be required for the storyline.

As Arthur said, adding a basic scripting engine is a very good idea. By that, I mean you should have some sort of function that is capable of parsing strings and deciding if it should add/remove items from the inventory, kill the player, warp the player, etc.

As for actually implementing events/storyline into existing code, your code is obviously going to have to be modified. For the sake of not shoving your entire storyline and every single event into the code, external files are a must. If you make a system to read external files (Eg: Also you should add NPC IDs and scripted tiles to the map file, where NPC data is then loaded from the corresponding NPC file) and process them, the generation of content will be much easier.

For keeping track of quests and such, all you should really have to do is assign a unique quest ID to each quest. Then, like map files, store the state of the quest ID in a file (Completed/Uncompleted/In progress).

Again, who can define "efficient" with regards to an inventory? You're obviously going to need a save system, so like quests, assign item IDs to items, where using the item ID you can retrieve info like the name and stats of the item. Then simply save the item IDs the player has in his inventory to a file.

code_glitch
22-11-2009, 09:35 AM
jee, i must say thanks a lot. I was coming to the script idea but had some doubts but when youput it that way the way forward is pretty clear. You guys are great. I didn't think I would be combining some of the things I'd already done (mainly the ID thing) with stuff I'd never done or even dreamt of doing (scripting mainly...) but anyway thanks a lot. This definitely cleared some of my doubts.

Now that i think of it, the only possibility on the long term that is not definite would be network play... but that isnt going to happen any time soon so i guess theres not much point worrying about it.