RPG tutorials?

Started by
17 comments, last by Possumdude0 17 years, 6 months ago
I'm looking for some good RPG coding tutorials. I have an RPG planned out, with the story and levels ready to code, but I can't figure out how to do code the engine! Please does anyone know any good tutorials on coding a basic RPG engine. If you're wondering I'm using Allegro with Dev-C++.
Poor little kittens, they've lost their mittens!And now you all must die!Mew mew mew, mew mew mew mew!And now you all must die!-Pete Abrams
Advertisement
P.S. It's a tile-based FFI style RPG. I can get the maps drawn on-screen with the player moving around, but I can't do things like NPCs and battles and an inventory system, etc.
Poor little kittens, they've lost their mittens!And now you all must die!Mew mew mew, mew mew mew mew!And now you all must die!-Pete Abrams
I'm in the process of creating an RPG right now as well. I'm using VB6, so I can't give you actual code, but I can tell you how I am doing things.

For NPCs, I made a custom data type (equivalent of a struct in c++) which holds the variables required for a single NPC (coordinates, hp, name, etc.), and have an array of that data type. Then, when I draw the screen, I draw the NPCs after the ground and items. I have done the same basic thing for the items.

For the inventory, I just have an array called CharInv, which has the numbers of the items the player has in their inventory.

Hope that helps!
God is not all-powerful, as he cannot build a wall he cannot jump.Stelimar Website: eddy999999.ed.funpic.org/Stelimar/index.html
Since your using C++ here is what I suggest for the inventory. I suggest you use a vector to store the items. I am in a hurry, so I can't really give you code, but I am sure you get the idea. If not, then I am sure someone else here will describe it.


Chad
The only one I know of

Check out my new game Smash and Dash at:

http://www.smashanddashgame.com/

Vector? I have no idea what that means. I'm just a beginner, my only experience is with QBASIC! I must research this... "vector"
Poor little kittens, they've lost their mittens!And now you all must die!Mew mew mew, mew mew mew mew!And now you all must die!-Pete Abrams
A vector is basically a templated self resizing array. Hows that for a mouthful :P But I must ask, if you are using no kidding arrays for things like NPCs and Inv... well you shouldn't be that low level... But whatever, if it works.

also, a vector is part of the std:: namespace.

std::vector< myClass > myVector = new std::vector(..);
Tutorials? It's your game, you could say how should look data structures, you are person that would need to test a combat system if it feels right in the story.

So after carefully reading this. It seems you have, a maps, and a surprise story done. Now you don't have anything else. You must invent some combat system. And it seems you'd need to write a list of all items, and a strength of each item. Then you'd need to invent a combat system. Don't forget to learn about data structures, and create your own. I'd expect it would take you 3 months.

And yes one more thing don't forget to create some code when you are doing the above. Or you'd waste another few months.

[Edited by - Raghar on October 16, 2006 10:03:10 AM]
There is nothing bad with arrays, if you doesn't need to resize them. You could use dipper class (you work with part of that array as if it would be an object) to access data safely. Actually arrays could give you an arrayOutOfBounds exception. Resizable arrays (in some languages more correctly called ArrayList) could give you OutOfMemory error. The first case is much less likely to hide in 150 source files, 500 lines of code each.
I guess what I really need is info on how to do a dialouge system and an an NPC system. Like when you talk to an NPC, how does the game know which NPC you're looking at? Do you have to search through all the NPC's data to find matching coordinates?
Poor little kittens, they've lost their mittens!And now you all must die!Mew mew mew, mew mew mew mew!And now you all must die!-Pete Abrams

This topic is closed to new replies.

Advertisement