Jump to content
  • Advertisement
Sign in to follow this  
Possumdude0

RPG tutorials?

This topic is 4413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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++.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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(..);

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!