Sign in to follow this  

I need an example 2d tile-based RPG

This topic is 4668 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

After I've finished making Pong, I decided to make something a bit more complicated, so I went for an RPG. The theme was set to be something I dreamed of making way before I knew how to make "Hello World" - a stone age sim. RPG where your only goal (and it's not an easy one) is surviving. I've made the basics and created an editor just to get an idea what I'm getting into, and the editor works great. It can even generate decent random maps. But when I tried to throw in items and critters I got lost. Sure, I'm making some progress, but it's frustrating as hell to invent hot water over and over again. And when I write something I usualy find out that it needs changing because it can't do this or that, and my code is now an unreadable mass (I really need to read up on making modular programs). So I was wondering if any of you could point me to source code of a game similar to mine that will help me understand just what variables my tiles and critters need, and how do I make them interact? I'm completely lost in my own code right now so I'm starting again from scratch, and I'd hate to do that more than once.

Share this post


Link to post
Share on other sites
Heh, don't worry! Everyone has rewritten their first 'real' project many, many times.

If anything, the experience better teaches you how to encapsulate things so you don't need to re-write *everything*, just bits and pieces.

Share this post


Link to post
Share on other sites
But the frustration...Argh!!!*pulls hair* Currently I'm trying to figure out how to deal with moving critters. I was thinking of adding *critter pointers to struct tile. Is that how it's normaly done? And what's the standard procedure for making inventory? I just hate inventing stuff that I find to be inadequate after a couple of hours worth of programming, so I was thinking that someone might point me to a tutorial or a source code that will show me how are these common things properly done. When I just remember my random map generator. I tried making lakes by randomly planting lake "seeds" on the map, then randomly determining lake's dimensions so I can randomly determine four points to be connected by non-straight lines so I can end up with a more or less an ugly rectangular lake. And then I stumbled upon a tutorial that did lakes so good in only a couple of lines. I was suicidal.

Share this post


Link to post
Share on other sites
Well, that's the thing. There is no real 'proper' way. As long as it gets done, it's good. Sure, some ways are better than others, but there's a lot of pays that are of similar 'goodness' with just differing benefits/disavantages.

Anyways, back to your questions.

Yes, I have a list [use STL container classes] of unit pointers in my tile class. unit->move() signals the tiles to remove/add the pointer as needed. unit also has a pointer to it's current tile[s] which is similarly changed via move() or another event.

No, that's probably not the best way to do it. [though I'd wager it's probably the way it's most commonly done]

Currently, my inventories are done via a list [use STL container classes] of erm... 'piles' for lack of a better term. A pile is just a class to describe what the objects are, and a common interface to add, remove, retrieve, count, and generally manipulate the objects.

And no, that's probably not the best way either, but again, likely the most common way.

Share this post


Link to post
Share on other sites
Say, you wouldn't happen to have a source code of some fairly simple RPG on your hands? Could you post me the prototype of a tile, an item, and a monster, just to help me figure what sort of variables do I need?

Share this post


Link to post
Share on other sites
It sorta sounds like you need to step away from the computer just a bit, take a look at what you want your program to do and start working out how you can break that up into smaller problems

One thing that will help you see the issues before you need to rewrite your code is to draw out a diagram of what your trying to solve, you should almost have the system laid out before you start typing. This way you have thought of many more of the issues before you have committed to your solution.

Share this post


Link to post
Share on other sites
im not exactly sure what youre using to make your game (vb.net,C++ ect.) but heres a tutorial that completely outlines how a guy made an rpg in VB6 maybe you can find somethings that will help you.


http://markbutler.8m.com/vb-tutorial.htm

Share this post


Link to post
Share on other sites
Quote:
Original post by DJ14IVI3
Say, you wouldn't happen to have a source code of some fairly simple RPG on your hands? Could you post me the prototype of a tile, an item, and a monster, just to help me figure what sort of variables do I need?


I wrote one for high school here. It's a bit messy, but should probably give you an idea what structure should be (way too much stuff here is hardcoded, I fixed most of it for csrpg2 but there are still lots of things that should be runtime-based).

[Edited by - Ravuya on March 8, 2005 5:30:40 PM]

Share this post


Link to post
Share on other sites

This topic is 4668 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this