RPG Systems (levels, inventory, and equipping)

Started by
7 comments, last by Jedimace 15 years, 10 months ago
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.
-Jedimace1My company siteEmber StudiosAlmost Done
Advertisement
Can you provide more context?
Everyone hates #1.That's why a lot of idiots complain about WoW, the current president, and why they all loved google so much when it was new.Forget the fact that WoW is the greatest game ever created, our president rocks and the brainless buffons of America care more about how articulate you are than your decision making skills, and that google supports adware, spyware, and communism.
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.
-Jedimace1My company siteEmber StudiosAlmost Done
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.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
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
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]
-Jedimace1My company siteEmber StudiosAlmost Done
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.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
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.

//&#106avascript
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.
Ok, I get what you mean. I can make a quick function to do that.
-Jedimace1My company siteEmber StudiosAlmost Done

This topic is closed to new replies.

Advertisement