• 🏆 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!

[General] Preventing too much item and protecting loot/ loot system ideea

What the best solution

  • Option 2: item visibility/hiddeing

    Votes: 0 0.0%
  • Option 4: your ideea

    Votes: 0 0.0%

  • Total voters
    4
  • Poll closed .
Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
if we have a map where a creep can drop 0-x item, so can drop nothing or more item, also boss can drop more item, what is the most efficient way and same time the most eye candy way to preventing the too much item on ground (this could cause lagg, also ground not visible coz of too much item and this make harder if u find something)

1.
Create a dummy unit (no attack, same look like default items model, so treasure chest) and add items to them and add ~2-5min expiration timer, if u right click then in full screen u can choose what item do u want take from treasure box dummy unit.

so boss if drop 4 item, then create this treasure box dummy unit where boss died and add all item to unit, add expiration timer to dummy unit, dummy unit owner is the killer, when dummy unit die then create another dummy unit with exp. timer but for player neutral pasive (this unit not respawn anymore) but from neutral pasive dummy treasurebox unit every player could take the items, until from 1st only the killer player.

2. make all droped item to invisble and make periodic trigger where u check what unit is currently selected, if have a unit selected to player then pick every item in 800 range, if item vs unit distance is lower than 600 then make item visible, else make item hidden

3. when items dropped add to a periodic timer, and make 2 integer array, 1 for timer (timer count back by 1 until reach 0, timer index is the added item index, if its reach the 0 then remove item) another integer array for keep track the owner, after timer lower than 60 make owner to 0, so all player can pick the item.
like:
adding when dropped items like this way
index=index+1
item_array[index]=last created item
item_owner[index] = killer player
item_timer[index] = 300

4. tell your ideea about how to make it look cool and same efficient
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Option #1 seems a rather annoying way to get loot. It works in MMO's because it's only a small screen and dragging/dropping/checking items is way easier.
Many people might like it though, because it's the one with the most eye-candy, but I dislike such systems. It only slows me down on my quest to get epic loot.

Option #2 means that items are never removed? I don't like the sound of that :).
Also, does locally hiding items desync? (It's not in your GetLocalPlayer() FAQ).

Option #3 is my favourite for now. It's the one I'm most familiar with (disregarding the bad system that is "remove all items every X minutes") and it is a good way to quickly pick up your items.
If locally hiding items does not desync, then only show items for their respective player, of course (you don't need to see what you cannot pick up).

Therefore, I'm going for #3 (the timer).
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Option #1 seems a rather annoying way to get loot. It works in MMO's because it's only a small screen and dragging/dropping/checking items is way easier.
Many people might like it though, because it's the one with the most eye-candy, but I dislike such systems. It only slows me down on my quest to get epic loot.

Option #2 means that items are never removed? I don't like the sound of that :).
Also, does locally hiding items desync? (It's not in your GetLocalPlayer() FAQ).

Option #3 is my favourite for now. It's the one I'm most familiar with (disregarding the bad system that is "remove all items every X minutes") and it is a good way to quickly pick up your items.
If locally hiding items does not desync, then only show items for their respective player, of course (you don't need to see what you cannot pick up).

Therefore, I'm going for #3 (the timer).

then need ideea for 3rd, because there i dont know how to make multiboard tooltip for items, i mean u know i use 1 item type for every item qualitry/rarity/item weight, until in 1st one there i can show multiboard item info when mouse over the slot where have item but idk how to make this if item on ground, since not exist select item event and with right click (what is the only way how can i detect the item) problems is with right click u pick up the item, createing dialog when u pick up for preventing the pick up the unneeded item is also annoying.

so any good ideea for 3rd?
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
i got idea, waht about make a item_array[player number] what store the last item to where u right clicked, and make this way:
if item on ground then:
- 1x right click = monitorize the item (so show item info with multiboard)
(save item to variable)
- if u click again to same item then pick up the item

You could have some kind of buffer where after 100 items have dropped and are left on the ground you remove the last touched (FILO queue).

u mean something like
i = i + 1
item = droped item
if i == 100 then
remove item[1]
endif

so something like this?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Yes but more advanced. You might need a doubly linked list to allow reordering of touched items (sending them to the front of the buffer). The idea is that items that are the old and never interacted with will be the first to be removed. This fits with player psycology very well as one will usually forget about such items.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Yes but more advanced. You might need a doubly linked list to allow reordering of touched items (sending them to the front of the buffer). The idea is that items that are the old and never interacted with will be the first to be removed. This fits with player psycology very well as one will usually forget about such items.

ok acctually if i check every sec if item is owned then that enough for know it was touched or no, basically i meant to that:
- unit drop item then add to item rot list
- periodic trigger check if item owned or not exist (sold or destroyed) and if this true then remove from item rot list if false then decrease timer by 1 and if 0 then remove item and from list too
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Perodic trigger is inefficient, will probably use more resources than the item recycling saves.

butif i dont use then i guess very hard to keep tracking if item is touched-sold-picked-equiped (equip=drop from hero, set item hidden, save into hastable to unit custom value key)
(but maybe possible just mustcheck if item is sold/ picked and still in inventory/attacked/removed in full screen shop,droped via full screen inventory(=unhide item,setitemposition to unit position)).

and even that posible to kill in one spot alot unit and there could the whole limit, so 100 item in 1 spot, that could be insine.

oh a q.:
what if i have more 1sec periodic trigger and 1 turn on/off them, or better to make 1 big and use another variable for keep tracking how much instance running in periodic trigger?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
so 100 item in 1 spot, that could be insine
Back in 2004, yes, now its nothing.

As I said, you use a random access queue which is interacted by the appropiate events. Even with full screen inventory you can create events by placing the appropiate function calls in the full screen inventory system when it performs the appropiate actions.

A new item is made -> add to top of queue.
An item is picked up -> remove from queue (this is the only difficult step as it needs random access).
An item is dropped -> add to top of queue.
A new item is made or dropped and queue size is above X -> remove end of queue from game.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Back in 2004, yes, now its nothing.

As I said, you use a random access queue which is interacted by the appropiate events. Even with full screen inventory you can create events by placing the appropiate function calls in the full screen inventory system when it performs the appropiate actions.

A new item is made -> add to top of queue.
An item is picked up -> remove from queue (this is the only difficult step as it needs random access).
An item is dropped -> add to top of queue.
A new item is made or dropped and queue size is above X -> remove end of queue from game.


not easier if i use a simple system just with hastable?

something like:
add item to list
i = i + 1
item = this item
timer = 300
save integer to hashtable (key1: anything lets say 0, key2: this item handle id, save i)
save integer to hashtable (key1: anything lets say 1, key2: this item handle id, save the owner player number)

when unit pick up the item/or bought then:
if LoadInteger(0, itemHandleId) > 0 then
set i = LoadInteger(0, itemHandleId)
set item = item[max]
set max = max -1
endif

what do u think about this hashtable solution?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
timer = 300

What is this for?!

save integer to hashtable (key1: anything lets say 1, key2: this item handle id, save the owner player number)
Unnescescary, we do not need to know who the owner is?

if LoadInteger(0, itemHandleId) > 0 then
set i = LoadInteger(0, itemHandleId)
cache the value in a variable?

set item = item[max]
set max = max -1

What does this do?

I am not even seeing how that is supposed to work or relate to what I said...
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
What is this for?!


Unnescescary, we do not need to know who the owner is?


cache the value in a variable?


What does this do?

I am not even seeing how that is supposed to work or relate to what I said...

i know only normal listing, so increase the integer number and use that integer like item index, but now i realuzed this will be a problem and not really same than what u meantioned :D

i tryed this way
JASS:
function RemoveItemRot takes item itm, boolean delete returns nothing
    local integer i = LoadInteger(udg_CItem_Table, GetHandleId(itm), 101)
    if i > 0 then
        if (delete and IsItemVisible(udg_Item_Item[i]) and not IsItemOwned(udg_Item_Item[i])) or udg_Item_Item[i] == null then
            call FlushChildHashtable(udg_CItem_Table, udg_Item_Id[i])
            if udg_Item_Item[i] != null then
                call RemoveItem(udg_Item_Item[i])
            endif
        else
            call SaveInteger(udg_CItem_Table, udg_Item_Id[i], 102, 0)
            call SaveInteger(udg_CItem_Table, udg_Item_Id[i], 101, 0)
        endif
        if i != udg_Item_Max then
            set udg_Item_Item[i] = udg_Item_Item[udg_Item_Max]
            set udg_Item_Id[i] = udg_Item_Id[udg_Item_Max]
            call SaveInteger(udg_CItem_Table, udg_Item_Id[i], 101, i)
        endif
        set udg_Item_Item[udg_Item_Max] = null
        set udg_Item_Max = udg_Item_Max - 1
    endif
endfunction

function AddItemRot takes item itm, integer owner returns nothing
    if IsItemVisible(itm) and not IsItemOwned(itm) and LoadInteger (udg_CItem_Table, GetHandleId(itm), 101) == 0 then
        if udg_Item_Max > 8 then
            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffff00Warning: Too much item on map|r")
            call RemoveItemRot (udg_Item_Item[1], true)
        endif
        set udg_Item_Max = udg_Item_Max + 1
        set udg_Item_Item[udg_Item_Max] = itm
        set udg_Item_Id[udg_Item_Max] = GetHandleId(itm)
        call SaveInteger(udg_CItem_Table, udg_Item_Id[udg_Item_Max], 101, udg_Item_Max)
        call SaveInteger(udg_CItem_Table, udg_Item_Id[udg_Item_Max], 102, owner)
        if GetItemTypeId(itm) != 'gold' then
            call SetItemUserData(itm, owner)
        endif
    endif
endfunction

and work well till until u reach the limit +1, because 1st time when u reach the 9 item then destroy the oldest item so item[1], and new item[1] = item[max] but after that its screwed because item[1] allways the last wukk be and not the 2nd oldest, 3rd etc

u can make with loop, but have another solution what is better than loop thourgh item[1-max]?
 
Status
Not open for further replies.
Top