Entropy Report post Posted September 23, 2005 I would like to include this in the next update (a few days left), so if someone can do it it would be really nice. Basically, I want to implement items usage cooldown. That means, all the usable items will require a certain time before they can be reused. I will take care of the server side, but I do need someone to implement it clientside. Here is the protocol: 1 octet for protocol id (we'll determine the value later on) 2 octets for length (as usual) Then follows the data, which is a pair of two octets: First octet denotes the item position in the inventory. The next octet is the cooldown, in seconds*3 So an item that has the cooldown value of 100 will take 300 seconds until it can be used again. The number of items sent is to be determined from the length field. Notes: 1. The cooldown will be displayed by putting an alpha blended texture over the item, to make it appear darker than the other items. In the left or right, or top, or bottom, whatever you think it's best, make a red bar, which is decreasing as the cooldown is decreasing. When the cooldown becomes 0, the bar should dissapear, and so should the darkening texture. The client should not enforce the item cooldown, that is if the player clicks to use an item with a cooldown >0, the client should send that info to the server. 2. When an item dissapears (server sends a command to clear a position used by an item), the client should clear the cooldown of that location. The server will send a new cooldown list, whenever necesary. So the client should not make any assumptions about that. 3. The cooldown display (darkening texture plus bar) should be displayed only in the inventory window and in the quickitem bar. Not on other windows. So, can someone implement it in such a limited time? Suggestions? Questions? Share this post Link to post Share on other sites
crusadingknight Report post Posted September 23, 2005 (edited) 2. When an item dissapears (server sends a command to clear a position used by an item), the client should clear the cooldown of that location. The server will send a new cooldown list, whenever necesary. So the client should not make any assumptions about that. 200195[/snapback] Ok, I'm confused... are we going to clear the cooldown[pos] when pos is vacated? Or will the server send a new list? Edited September 23, 2005 by crusadingknight Share this post Link to post Share on other sites
Entropy Report post Posted September 23, 2005 Ok, I'm confused... are we going to clear the cooldown[pos] when pos is vacated? Or will the server send a new list? 200203[/snapback] When an item dissapears (server sends a command to clear a position used by an item), the client should clear the cooldown of that location. Share this post Link to post Share on other sites
Lachesis Report post Posted September 23, 2005 (edited) I was asked to do this; I cannot promise to get it done before I have to leave before weekend but I'll try. * What is the max cooldown value (the value showing a red bar at full size)? (assuming 100) * Should I decrease the cooldown based on timer or assume a new server message for each decrease? (assuming the latter) Code is in CVS. The cooldown message has gotten protocol number 77. Edited September 23, 2005 by Lachesis Share this post Link to post Share on other sites
Atreyu Report post Posted September 23, 2005 Cool, so it will be different for different items, meaning attack speed. But would certain armour make this "cooldown" take longer? The heavier stuff should of course, the chainmail a little bit. Share this post Link to post Share on other sites
crusadingknight Report post Posted September 23, 2005 (edited) Cool, so it will be different for different items, meaning attack speed. But would certain armour make this "cooldown" take longer? The heavier stuff should of course, the chainmail a little bit. 200438[/snapback] You just keep clicking use on that sword, and tell us if anything happens... Edited September 23, 2005 by crusadingknight Share this post Link to post Share on other sites
Entropy Report post Posted September 23, 2005 I was asked to do this; I cannot promise to get it done before I have to leave before weekend but I'll try. * What is the max cooldown value (the value showing a red bar at full size)? (assuming 100) * Should I decrease the cooldown based on timer or assume a new server message for each decrease? (assuming the latter) Code is in CVS. The cooldown message has gotten protocol number 77. 200362[/snapback] Thanks. 1. The max value is 256 (1 octet)*3 seconds. BUT, all the objects should have the same bar length, regardless of the cooldown time (if over 0). However, it should move down faster if the time is lower. 2. We use a client timer, we can't afford to waste bandwidth like that. BTW, another change: When the client will get a "here are your cooldown times" message, it should reset all the cooldown times to 0, and set only the cooldown times it got in that package to non 0 values. So if the value for an item is missing, then assume 0, don't use the previous value for that item. Share this post Link to post Share on other sites
Atreyu Report post Posted September 23, 2005 You just keep clicking use on that sword, and tell us if anything happens... 200446[/snapback] Huh? Share this post Link to post Share on other sites
duran Report post Posted September 23, 2005 basicly its as a replacement for the staying that you have to wait a second to use another item. atleast thats the only use i can think of right now Share this post Link to post Share on other sites
Entropy Report post Posted September 24, 2005 basicly its as a replacement for the staying that you have to wait a second to use another item. atleast thats the only use i can think of right now 200479[/snapback] Yes, that's the idea, only that it will be much more complex than "you have to wait a second". Share this post Link to post Share on other sites
Entropy Report post Posted September 24, 2005 BTW, the new protocol is this: (in the to client category) #define GET_ITEMS_COOLDOWN 77 Share this post Link to post Share on other sites
Grum Report post Posted September 25, 2005 Okay, reworked the cooldown functions to workto put in client side decrease. The only problem I have is that when you move an item in your inventory the server will send you a new message, so that the bar will start at full length again. Share this post Link to post Share on other sites
Entropy Report post Posted September 26, 2005 When you move an item the server will send you the list again, so the client should reprocess that list, and remove the cooldowns for all the items not mentioned in that list. Share this post Link to post Share on other sites
Grum Report post Posted September 26, 2005 Yes, that's done. But, when you receive that new list, you will get a new cooldown value for the item you have just moved. The client then assumes this is the new maximum value, and uses this value as the maximum bar length. It wil go down faster, of course, but it just looks a little sloppy. Share this post Link to post Share on other sites
Entropy Report post Posted September 27, 2005 Ok, let's modify it then: it will send another value, the max cooldown for that item: so it will send the position, max cooldown, cur cooldown. All of them octets. Share this post Link to post Share on other sites
Grum Report post Posted September 27, 2005 Okay, done. Share this post Link to post Share on other sites
Entropy Report post Posted September 28, 2005 Great, it works fine, with two exceptions: 1. The not cooldowned item (ie. cooldown>0) is not greyed out, with the alpha blended texture that I suggested. 2. It looks kind of ugly, especially if you have, say, 20 potions of the same type, and you use one. All of them will show the same red bar, and that looks, well, not nice. Is there any way to change how the cooldown is represented? For example, in Warcraft 3 (and I think in WoW as well) the cooldowns are represented by a darkened circle, which, as the cooldown decreases, a part of it becomes normal. So when the cooldown is max, the entire circle is darkened, and when it's half hald the circle is darkened, half of it is normal color. The circle is greater than the square, so there are no corners not covered by it. Maybe we can implement something similar? Share this post Link to post Share on other sites
Lachesis Report post Posted September 28, 2005 Sure that's doable. It will require two trigonometric function calls per slot drawn but oh well. The items are currently darkened when cooling down -- 50% luminance at max heat, 100% luminance (of course) at full cooldown. Greying out in the classic sense of decreasing color saturation isn't easy with OpenGL, as it cannot be done with the blending operations it supports. However, instead of blending with black blendingwith gray would be possible. The problem with non-stackable items is certainly a bug, can't imagine why it occurs though. Share this post Link to post Share on other sites
Puntif Report post Posted September 28, 2005 maybe to avoid the trig you could use a triangle or a diamond shape instead Share this post Link to post Share on other sites
crusadingknight Report post Posted September 28, 2005 The problem with non-stackable items is certainly a bug, can't imagine why it occurs though. 202396[/snapback] Because the server is specifying an amount of time in which none of the potions can be used? Share this post Link to post Share on other sites
Grum Report post Posted September 28, 2005 Great, it works fine, with two exceptions:1. The not cooldowned item (ie. cooldown>0) is not greyed out, with the alpha blended texture that I suggested. Actually it it, but the effect goes to zero as time progresses. 2. It looks kind of ugly, especially if you have, say, 20 potions of the same type, and you use one. All of them will show the same red bar, and that looks, well, not nice.Is there any way to change how the cooldown is represented? For example, in Warcraft 3 (and I think in WoW as well) the cooldowns are represented by a darkened circle, which, as the cooldown decreases, a part of it becomes normal. So when the cooldown is max, the entire circle is darkened, and when it's half hald the circle is darkened, half of it is normal color. The circle is greater than the square, so there are no corners not covered by it. Maybe we can implement something similar? 202165[/snapback] How about we make the greyed out area start as a full square, and gradually let it disappear towards the middle of the icon? Share this post Link to post Share on other sites
Entropy Report post Posted September 28, 2005 Actually it it, but the effect goes to zero as time progresses. How about we make the greyed out area start as a full square, and gradually let it disappear towards the middle of the icon? 202448[/snapback] Lachesis: Grum's implementation works fine, I tested it with my server version and it's ok. Grum: Hmm, that might work, but the problem is that most of the items background is black, so it might not show really well... But let's see how it looks like.. Share this post Link to post Share on other sites
Grum Report post Posted September 28, 2005 I've made the blending square red. tell me how it looks, if it's too distracting. Share this post Link to post Share on other sites
Lachesis Report post Posted September 29, 2005 (edited) Changed the square to disappear pie-wise, which makes it resemble a clock. I don't know if thats what you meant in your earlier post, Entropy, as I don't know Warcraft, maybe you can provide screenshots? That's the way it looks now: Edited September 29, 2005 by Lachesis Share this post Link to post Share on other sites
Grum Report post Posted September 29, 2005 Hmm, I kinda like this Share this post Link to post Share on other sites