• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Improving this system...

Status
Not open for further replies.
I have a few suggestions.
  • I would highly suggest using something like AutoIndex that will automatically give a unit a unique index whenever the enter the map (and recycle it once the unit leaves the map).
  • Why are all your globals public?
  • O(n) searches are extremely inefficient, especially when there are hashtables out there. So please stop looping through indices and use a hashtable.
  • Instead of your extremely inefficient trackable library, I would suggest azliers Trackable2.
  • Shouldn't PanCameraTo(CAM_X,CAM_Y) be PanCameraToTimed with a duration of 0?

There is an extreme amount of work that can be put into the coding, because quite honestly it's pretty bad.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Answers:
  • i don't want the indexes to be recycled as it would mess things up, also i only want the units actualy using the system to have indexes
  • still in development, they will be made private when i merge the triggers as far as i can.
  • i have been suggested the use of Table and it's 2D arrays so i may just use that.
  • forgot to search thehelper.net as i had a bug where i couldn't visit that site, anyway thanks. But i need a lot of data stored in the actualy trackables, and i need trackable groups which neither that library has :p
  • a minor thing,the camera moves where i want it to anyway.

Oh well i did what i could only to make it work, since i started from nothing, now gonna replace those high number of looping with the usage of Table.
Also gonna start merging things, as well improve my trackable library, because quite honestly the one you suggested doesn't have an option to add multiple values to 1 trackable. Also it uses gamecache which i am trying to avoid :p

EDIT:

It would help a lot if you could suggest more things about the TrackableGroup library as it is the core of my system and i am trying to get it more efficent even as i speak.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
The system is getting better with every passing hour!

I am replacing all that crap things i made with the hashtables and the code is getting more readable and more compact =)

Now i only don't know is having 3 hashtables for 1 system to much or? :p

I need separate data storing so i need 3 hashtables, or so i figured.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
As far as I know, hashtables have no perodic maintenence next to the fact they use a handle index (which can slow WC3 down). However considering 1 trigger with 1 action and 1 condition uses more handle indexes than the hashtables in that system, all I can say is it is not something to worry about (not bad).

There may be a 255 cap on hashtables as they run using simlar mechanics to gamecaches I beleive, but so far such a limit is beyond reach while mapping in the normal way.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
New version of the system with still debug messages but added preload,somewhat interface and item equiping.
The things not supported in this version:
-stat reduction on item unequip
-more examples
-item sets
-updated multiboard
-merchants / merchant inventory

Oh well hope bypassers find this interesting, feedback is apriciated =)
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
nice system :D
is it MUI?
unfortunately I am not experienced enough to find it out myself but I remember something like that with trackables
it seems like it's possible to even detect the mouse hovering over a trackable so it should be possible to make something similar like the wc3 tooltips which display the item stuff when hovering above them but I think you already made a plan how it will be at the end
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Newest version, featuring some merchants examples and other stuff.

Atm working on:
  • Item sets
  • Dialogs for shoping
  • Dialogs for equiping(optional)
  • Reducing in the number of hashtables if possible
  • Adding some real documentation(i am gonna make it chapter like, example: 1.1 defining types, 1.2 aplying bonus) and such so users can learn more from this and easily implement in their map
  • Item slots(sockets)
  • Fixing Max Life/Max Mana bonuses
  • Adding a single Custom Ability modificator for items that carry and ability(like immolation)
  • Maybe finding some larger models for trackables if users find the ones atm hard 2 hit
  • Moving the inventory build zone out of playable map area and camera
  • Getting a good background for the inventory
  • Possible reduce in variable number(not that there is a lot for a this kind of system)
  • Making it compatible with a custom skill tree system i am gonna work on after this one
  • Adding a AutoDeclareXY function for lazy users(meaning if you don't want to put coordinates yourself this function will)

Things that won't be in this system when published:
  • Passwords for ORPG's

Some actual feedback would be nice on this :p
 

Attachments

  • Inventory System with trackablesv3.w3x
    141.7 KB · Views: 88
Level 12
Joined
May 21, 2009
Messages
994
I hope that its much easier to use than Toadcops, i can use toadcops but you need to understand the whole system to make a new itemclass.
By the way it should be possible to use this as a save/load right? what if you give any of the destructables and trackables a custom id number (integer) and then it could be loaded again.

Good luck!

ps i dont understand what u are using a truefilter for ?
 
Level 12
Joined
May 21, 2009
Messages
994
kingz this should be possible to use for a save/load right ? i dont know if it gets a big code (it might does -.-) but if you gave like every destructable(trackable) i mean the item a integer ID then it should be possible to store them and load them with a save/load what do you think kingz ?
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Sure i can apply a save/load to it but it will then require a gamecache, the official release won't have it since i got more stuff to do first.

There are some problems you see, first every item has about 15 stored values, in a inventory with 75 slots and 13 equipable slots you do the math how much would i stuff need to store if i would try to bypass gamecache and improve efficency.

So atm there are more important issues.
 
Level 15
Joined
Sep 3, 2009
Messages
1,521
i think only saving the equiptable slots is neccesary and maybe the first 10 other slots.
as the inventory slots for me at least will only be used for the equipment and some other potions and such. materials will be stored in a different system so that wont be a problem. and neither will quest items also a different system.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Here is the newest update, contains a lot of documentation, removed most of the debug messages, added and explained how you add an item class, hope it isn't so hard to understand.

Atm working on:
- Item set bonuses and checking is an item set equiped
- Item slots & sockets
- Finding a decent background texture
- Optimizing and improving the systems code
- Uploading this system in the spell section

Till i work out all of those things, enjoy the newest version.
 

Attachments

  • Inventory System with trackablesv0.4.w3x
    155.5 KB · Views: 44
Level 12
Joined
May 21, 2009
Messages
994
why you use this ?
JASS:
set class_index = class_index+1

when you use this:
JASS:
set CLASS[2] = 2
set Req_Class[2] = '#CL2'
set class_index = class_index+1

why not this ?:
JASS:
    set CLASS[class_index] = 2
    set Req_Class[class_index] = '#CL2'
    set class_index = class_index+1

maybe its just me who is missing something.. but this wouldnt make any difference ? and it will make it faster for the user to change instead of writing a new number in the [] anyway i dont understand why people dont post anything here since their is many people that want a FSI.

Good job! keep working and if my inventory system is gonna fail then i will definatly use yours.

Why dont u put everything into 1 hashtable ? you can just store them in a higher value if you dont want to override them. just a suggestion
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Catch_ya said:
why you use this ?
set class_index = class_index+1

when you use this:
set CLASS[2] = 2
set Req_Class[2] = '#CL2'
set class_index = class_index+1

why not this ?:
set CLASS[class_index] = 2
set Req_Class[class_index] = '#CL2'
set class_index = class_index+1

You got a point, i can't belive i overlooked this.
Thanks for the feedback, i am also confused how come this has 300+ views and yet only few people post things that they want in a FSI.

About the hashtables, there is so much stuff to keep that i think it is better to divide the data.
Here is the current state of the hashtables:
1 hashtable for initial data
1 hashtable for trackables
1 hashtable for destructable
1 hashtable for unit's data

I forgot to remove the excess of hashtables since i thought i would need them but it apears i don't.
 
Level 12
Joined
May 21, 2009
Messages
994
well ill maybe read your core library later on.. But right know im gonna work on my own which is on a very early state.. Mostly i make this for practising vjass because this will not work so smooth as yours i believe..

Maybe to your to-do list add that you maybe should be able to create a item in 1 line like:
JASS:
call CreateCustomItem(name, class, icon(destructable), iid(itemid), dmg, hp etc..)

maybe you could make a string parser or something so the function would be

JASS:
function CreateCustomItem takes integer idd, integer icon, string stats returns nothing

so it will be like

JASS:
call CreateCustomItem(iid, icon, "dmg;3;6(randomizing damage like 3 is the minimum and 6 is the maximum), and then on..

well it might be some hard coding but its only if you have time and or can do it.

by the way i dont understand what the LinkCode(integer,integer) does..
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
What is wrong with:
JASS:
GetRandomReal(3,6)

For damage? :eek:

JASS:
function LinkCode takes integer i,integer val returns nothing
     set Link[i]=val
endfunction

Is used here:

JASS:
call LinkCode(0,inventory_slot)

But is basicaly:
JASS:
Set Link[0]=inventory_slot

I completely dunno why i complicated such easy things :p

Also i might consider a parser but wouldn't that just put more stress on the system? :eek:

Also there is a CreateItemSimple() function which is easy to use for those who don't like long code lines.
 
Level 12
Joined
May 21, 2009
Messages
994
well you right :) it was just a suggestion. about the link code yea i found the functioun but first i didnt really get what it does. the GetRandomReal i just meant that in the parser you had when a custom item contains "dmg;3;6" the parser find it and says dmg[item] = GetRandomReal(3,6)
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Still won't a parser put more stress on the system while it takes the string and parse it? :eek:

Also putting a wrong string would result in nothing or parsing errors, no? :O

EDIT:

If you got an idea how to link the item sets and actual items together, please notify me :)

EDIT2:

In order to speed up the systems release, i am gonna neglect the Item slots/sockets idea and get ready to optimize the code & get a decent background.

@Catch_ya

Added you to credits btw.
 
Level 12
Joined
May 21, 2009
Messages
994
Still won't a parser put more stress on the system while it takes the string and parse it? :eek:

Also putting a wrong string would result in nothing or parsing errors, no? :O
i wont have you stressing on this system =)
EDIT:

If you got an idea how to link the item sets and actual items together, please notify me :)

i will.. and im still thinking about how to make it possible
EDIT2:

In order to speed up the systems release, i am gonna neglect the Item slots/sockets idea and get ready to optimize the code & get a decent background.
yes i also think that you should focus on optimizing the code and get a background. And then maybe after you have submitted it you could update it with sockets if people wants it.

@Catch_ya

Added you to credits btw.

thank you :)

EDIT:
and a thing i also wondered about was that you cant click on an item then click on the equip slot. Maybe you should add that too

EDIT2:
if you think its too complicated with normal trackables then i have a suggestion:
using trackable2, i use it in my system and you can get a trackable2's X and Y tracked player just by doing YourTrackable2.X/.Y/.GetTrackedPlayer()
but this will cause a recoding i guess.. but it was just a suggestion ;)
 
Status
Not open for further replies.
Top