Sign in to follow this  

RPG Systems (levels, inventory, and equipping)

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

Ok, so we are going to discuss the basic idea of my style of an inventory, leveling up and equip system. It is pretty simple. So, what does the code of my inventory system do? All it does I go through each inventory slot and sees if it has something in it. If it has something in it, it passes it by, but if it doesn’t, it is going to change the picture to whatever item is being added, and sets the slot to a “used” state. All an equip system does is something like a mini inventory, and increases the temporary stats. Then, with levels, I’ll tell you my technique. You have a variable called maxXP, and a variable called XP. Whenever you kill a monster, XP goes up some number. When XP>=maxXP, maxXP is multiplied by 1.5, and XP is set to 0. All the base stats are increased too. Then, when an attack is executed, it uses the stats to calculate damage. Is this the right way to do things? I got the inventory working in Flash, and levels working in Game Maker, haven’t tried equipping yet though. Please tell me if I am correct, and tell me your ways to do it too.

Share this post


Link to post
Share on other sites
Where? Do you want me to explain levels more, or what? I have a flash game, not finished, that has an inventory. I don't plan to finish it but I can post it. Can I post HTML? I can't upload it to, like, Newgrounds, because I know it sucks and it's incomplete.

Share this post


Link to post
Share on other sites
That's alright, Newgrounds has a lot of incomplete crap on it.</cynicism>

Seeing as how this is a discussion forum, though, I don't see the point of your topic. Are you looking for external validation, or suggestions of improvement? Are you attempting to write a (very, very bad) tutorial in a discussion-forum context?

Rule #1 of starting a topic in any discussion forum, no matter the medium, is to answer the audience's "So, what?" in your very first paragraph.

Share this post


Link to post
Share on other sites
Quote:
Original post by Jedimace
Is this the right way to do things?


It's *a* way to do things. Whether it's right or not depends on your requirements, design, etc.

Questions to consider:
(1) Why have a concept of inventory 'slots' at all? If you keep a dynamically sizeable array, you don't have to search for an empty slot; you just add the item to the end of the list and be done with it. If you want to keep the inventory within a certain size, just do a size check before adding a new item.

(2) What about inventory items that do more than just change stats? Like an item that auto-casts haste when a battle starts? Do you have a facility to handle that (if you need it)?

(3) Is multiplying maxXP by 1.5 always appropriate? It may well satisfy your needs, I don't know.

(4) How are you increasing your base stats? Adding one to all of them? Using some function based on the current level? Specifying growth in an external file? What happens if you want certain characters to grow differently than others (for instance, your strongman versus your magician)?

(5) If maxXP is multiplied by 1.5 and XP is set to 0, what about events where players can level up multiple times from a single battle? I've had it happen in many games, where I ignored a character for a long time, brought him back, and he gained 10 levels in a single battle. Your method doesn't facilitate that quite yet.

Cheers,
--Brian

Share this post


Link to post
Share on other sites
Well, the main thing I wanted to know is if there are ways that are faster and better, and if there were problems with my way, and so people could share their ways. I'm making an RPG, and I want to be as prepared as possible. I'd say this sounds closest. "external validation, and suggestions of improvement"
Quote:
(1) Why have a concept of inventory 'slots' at all? If you keep a dynamically sizeable array, you don't have to search for an empty slot; you just add the item to the end of the list and be done with it. If you want to keep the inventory within a certain size, just do a size check before adding a new item.

That is one of the most useful things I ever got out of these forums. Just with that idea, I'm already coming up with ways to do MMORPG things like trading, and improvising my RPG shops to fit those arrays. That is a great idea. Using vectors would be perfect. This idea revises my thinking! Thanks!
Quote:
(2) What about inventory items that do more than just change stats? Like an item that auto-casts haste when a battle starts? Do you have a facility to handle that (if you need it)?

BTW, I'm doing an action RPG. But, if I did a turn based RPG, I woukd probably have a dynamic list of special stuff to do at the beginning of the battle, like have numbers for everything it can do, and then have a switch case on the numbers and do the ability.
Quote:
(3) Is multiplying maxXP by 1.5 always appropriate? It may well satisfy your needs, I don't know.

I may change it to a variable that goes up. I was just going to leave it at 1.5, and maybe I need to change 1.5 around a little. I haven't tested it, just a guess.
Quote:
(4) How are you increasing your base stats? Adding one to all of them? Using some function based on the current level? Specifying growth in an external file? What happens if you want certain characters to grow differently than others (for instance, your strongman versus your magician)?

That's another thing to think about. Maybe it can add variables to the stats that multiply higher everytime so it means more when your a higher level gaining a level, and depending on your class, it adds more stats in spots than others. Like, the starting stats to add would start out for a warrior with more strength, and a magician with more magic.
Quote:
(5) If maxXP is multiplied by 1.5 and XP is set to 0, what about events where players can level up multiple times from a single battle? I've had it happen in many games, where I ignored a character for a long time, brought him back, and he gained 10 levels in a single battle. Your method doesn't facilitate that quite yet.

Well, if I wanted him to level up from like a boss battle, I could just add maxXP to XP, and he would gain one level. I could check it so that if he's been gone for a long time, add x many levels depending on how long it's been. But I've never had that happen in an RPG. Thanks Nairb, that was a very helpful post.

[Edited by - Jedimace on June 23, 2008 2:48:43 AM]

Share this post


Link to post
Share on other sites
Jedimace; FYI, I've gained multiple levels in a single fight rather often, in RPGs like Chrono Trigger, FF VII, and Star Ocean. But it happens to me because bosses are worth lots of XP, and I hate "grinding" (mandatory seeking out of random encounters just to get experience and level-up), so I'm often one to three levels below where the game designers expect me to be when I encounter a boss battle.

Share this post


Link to post
Share on other sites
If you know your max level, you could always go with the product of an arithmetic progression...

1.5^50(1000/1.5)

637621500.21405 * 666.6667 = 425081002268.1047 exp to get from lvl 1 to lvl 50.

//javascript
var start=1000;
for(var i1=1;i1<50;i1++)
{
print("At lvl "+i1+" you need "+start+" to get to level "+(i1+1));
start*=1.5;
}

This way you can just keep on adding up exp and when they reach that level of exp, it doesn't have to reset to 0.

Share this post


Link to post
Share on other sites

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