HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Optimized Equipment System

03-07-2009, 02:30 AM#1
Blacktastic
What would be the best way to gay about making an optimized equipment system in this day and age of vJass? I know there are systems out there but I don't want to use them as that doesn't help me much. I appreciate their contribution but on something like that I want to be able to custom make it so I can make it do what I want it to do, and so I can just work on how decently I can write code. I was considering just using an integer array to store/retrieve items and to attach data to each item for stats, but I feel like there is probably a better way to go about this.

Hence this post, anyone have any suggestions?
03-07-2009, 07:45 AM#2
TriggerHappy
Quote:
Originally Posted by Blacktastic
What would be the best way to gay about making an optimized equipment system in this day and age of vJass? I know there are systems out there but I don't want to use them as that doesn't help me much. I appreciate their contribution but on something like that I want to be able to custom make it so I can make it do what I want it to do, and so I can just work on how decently I can write code. I was considering just using an integer array to store/retrieve items and to attach data to each item for stats, but I feel like there is probably a better way to go about this.

Hence this post, anyone have any suggestions?

The best way to gay?

You can use an struct array loop, depending on how much items.

Or you could use gamecache, like alot of the other item systems.

I don't really see much more options of storing/retrieving item-types.
03-07-2009, 11:07 PM#3
Blackroot
There is zero reason to store information about items unless you have "multiple pages" or some such. Or perhaps attached values to items. But other than that; it's useless.

If you want the highest flexibility, use a gamecache. There's no reason to use an array really, because you gain a tiny amount of preformance but add a daunting limit. The performance isin't really going to be noticed because item events aren't executed often anyway.
03-07-2009, 11:20 PM#4
xombie
Why don't you just reference other systems (you don't have to use them) to see how they go about solving the problem that you have now.
03-08-2009, 12:30 AM#5
Blacktastic
Thing is none of them even come close to what I'm working with.

28 Attributes, about 18 of which are calculated values and the other 10 will derive an item ability combination to achieve the same effect (aka item ability addition)

Unless you know of a convenient way to create 28 attributes per item. I'm just using 28 scope globals right now.
03-09-2009, 01:52 AM#6
Blackroot
Quote:
Originally Posted by Blacktastic
Thing is none of them even come close to what I'm working with.

28 Attributes, about 18 of which are calculated values and the other 10 will derive an item ability combination to achieve the same effect (aka item ability addition)

Unless you know of a convenient way to create 28 attributes per item. I'm just using 28 scope globals right now.

28 Attributes? You're digging your own grave! Whatever; like I said use a table it's much more appropriate for this application then 28 different arrays.

I'm assuming attributes are not dynamic; in that case you'd want to attach the data to the item ID and store it in a table somewhere and retreive it based on the id.

If they are dynamic; you will have to use the above method; clone the data onto the item ID (gotten through H2I) and then alter it from the ID.

It's not that complicated actually. The major thing is watching for pickup/drops and handling inventory slots.
03-09-2009, 02:13 AM#7
Blacktastic
Actually me and Deaod came up with a method via SubString. It works quite well.

to clear up confusion I will post what it looks like currently. It's.. well it's nowhere near finished but meh haha.

Expand JASS:


Expand JASS:

Everytime I type HIDDENJASS I think of ninjas that code.
Anyone else?
03-09-2009, 03:47 AM#8
Av3n
If you are using the SubString method, abuse the colour tags. Unless you are already doing it, I guess this is an useless post.

|c xx x xxx xx|r

Everything that's an x is usable.

-Av3n
03-09-2009, 03:50 AM#9
Switch33
I still think any game with 28 attributes tho is far over compensating for things.
private real array MeeleCrit //11
private real array SpellCrit //12
Things can easily be combined. SpellCrit + MeleeCrit = Regular Crit etc.

But seriously thats not much of a problem as the fact that no one will know how to calculate damage if you have this:
private real array Dodge //17
private real array Parry //18
private real array Block //19
private real array BlockValue //20
(dodge, parry, and block? jezz way to use 3 words that basically have nearly exact connotations.)

And if that isn't enough they have to worry about elements as well? Theres no end! (Don't get me wrong d2 and titan quest with elemental stuff is alright but it's horrid practice for any game design I'd say since it's just too much overwhelming cake that makes game features just look better than they actually are.)

I dunno maybe that's just me though. . . I kind of like the idea that the person playing actually has a bit of an idea of what the hell is going on.

http://www.thehelper.net/forums/showthread.php?t=120068

This is the only inventory system that struck me as worthwhile so far for wc3. Simple yet effectively it uses a bit of vJASS and the display on a multiboard is something that actually makes sense.I can't imagine doing any inventory over the size of 6 slots without using the multiboard(Also in-game UI developed that pauses the game to show your items is beyond lame!).
03-09-2009, 03:57 AM#10
Blackroot
Yeah; there's alot going on here. And this is for items. Why are you even using a static method with 28 attributes? Use a linked list with a callback function for each attribute and save yourself a coding nightmare. <or better yet; just use constant codes for the static visible attributes and cache everything else as an arbitrary stat.>
03-09-2009, 04:31 AM#11
Blacktastic
SpellCrit and Meelecrit are different because there are different formulas associated with each.

Parry/Block are frontal only. Block does not mitigate 100% damage unless the Block Value equals or exceeds that damage recieved. Parry is not applied to all classes like Dodge is. I'm not overcompensating, I am allowing a large diversity in item choice.

What do you mean by abuse the color tags?

and honestly this isn't a coding nightmare. No matter what I do, I HAVE to code each stat. All the "reals" are simple addition and won't take 5 minutes to code. The only one that will be annoying is Armor as I am making armor depricate with level.

Could you explain your method in more detail Black? From what I can tell this is the way of least hassle, although as far as optimization goes I am unsure.

Also, if you think this is alot to keep track of, then I don't really know what to say. This is nothing compared to most MMOs nowadays.

And to Switch: What the hell are you talking about? Nowhere do I pause the game. and I AM using a multiboard. I havn't added it yet.
03-09-2009, 06:13 AM#12
Av3n
You can use the colour tags (what I showed before) to store information on the item's name.
For example you can have it like this: "|cxxxxxxxx|r<Item Name>"
You can use those 8 x's to do stuff if your using SubString

-Av3n
03-09-2009, 06:45 AM#13
Blacktastic
Thats actually a nifty idea. I will keep that in mind.