Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: KK20 on February 25, 2013, 03:26:55 pm

Title: Unique Equipment: How big is too big?
Post by: KK20 on February 25, 2013, 03:26:55 pm
I've been working on a script recently that makes equipment items unique--rather than saying you have 2 Bronze Swords, you have 1 Bronze Sword (A) and 1 Bronze Sword (B). My intention is to create other add-ons to this system, but right now I'm just getting the basic idea down. My main focus has been making this script compatible with just about anything.

Currently I have it where new items are pushed to the end of $data_weapons/armors. I've got a whole sorting system and some method rewrites and what-not. The biggest trouble I have with, right now, is knowing when the equip no longer exists in the game (it's not equipped, not in inventory, not stored somewhere, etc.).

One solution I came up with is just let the item stay in the array forever. But now I don't know if this will become a huge issue. I have to save the $data_weapons/armors into the save files now--that's a lot of data isn't it? Especially how every equip is a new instance and such...

I'm currently running out of time typing this up. Be back later.
Title: Re: Unique Equipment: How big is too big?
Post by: Blizzard on February 25, 2013, 03:51:28 pm
I think it you went over a couple hundred of kB, that's really no big deal. The only problem might be loading times. A few MB might already be too much. But yet again, that's up to the game developer, isn't it? You only provide the tools. How they use it, is up to them.
Title: Re: Unique Equipment: How big is too big?
Post by: KK20 on February 25, 2013, 10:18:06 pm
The initial problem that occurred to me was if the player happened to obtain a lot of weapons and armor to the point of eating up all the available memory. Granted, no player would probably ever receive more than a million equipment items in one game, but I don't know what type of game this may be.

If I were to create an add-on where using a scroll can enhance the weapon or destroy it, and somehow the player had the ability to access infinite scrolls and said weapon, $data_weapons would fill up quite a bit.

Probably what I should have asked is "How many elements of RPG::Weapon and RPG::Armor can I have loaded in an array before performance/issues arise?"

Maybe I'm over-thinking this too much and not being practical (would a player REALLY go out and buy/earn thousands of equipment pieces during his/her whole playthrough?), but I guess I'm kinda thinking in the long run as well.
Title: Re: Unique Equipment: How big is too big?
Post by: winkio on February 26, 2013, 12:01:04 am
This problem is usually solved by a limited inventory, say of max size 100.  After the inventory fills up, you have to throw away old items before you can pick up new ones.  I would look at how any MMO or loot based RPG handles inventory for ideas.
Title: Re: Unique Equipment: How big is too big?
Post by: KK20 on February 26, 2013, 03:36:28 am
I never considered that mainly because I never intended the script to put a limit. That's up to the game designer.

I've decided to just keep adding items to the end of the array. If the array sizes do become some kind of issue, I'll find some way. I've only made changes to a couple methods in Game_Party, Game_Actor, and RPG::Weapon/Armors, aliased Array, Hash, Scene_Save/Load, and Game_System, and created a few new classes. It's ugly as hell at the moment. :P