Feature #849

Show item/mega countdowns in spectator mode like "easyitems" in Quake

Added by antibody over 2 years ago. Updated about 1 year ago.

Status:FeedbackStart date:12/02/2011
Priority:NormalDue date:
Assignee:terencehill% Done:

0%

Category:HUD
Target version:0.8

Description

It would be useful to show item countdowns when in spectator mode (for spectators only, which would be the default), or when a vote is called (to show for all players). This is similar to the "easyitems" command in Quake which can be seen in most professional commentaries. When this "easyitems" option is turned on, the HUD display is modified to include things like:

- time remaining until the next mega armor appears
- time remaining until the next mega health appears
- time remaining until the next strength appears

...etc etc.

A screenshot of this is attached with the relevant HUD piece annotated.

easyitems.jpg (39.6 KB) antibody, 12/02/2011 08:25 pm

itemstime.jpg - Big gap (20.6 KB) Chryyz, 06/06/2012 10:56 am

xonotic20120611145001-00.png (569 KB) terencehill, 07/05/2012 10:15 pm

xonotic20120611144949-00.png (561 KB) terencehill, 07/05/2012 10:15 pm

xonotic20120611144939-00.png (524 KB) terencehill, 07/05/2012 10:15 pm

261
370
379
380
381

History

#1 Updated by divVerent over 2 years ago

20:48:55 @divVerent | useful it would be, but quite complex to properly network it
20:49:01 dfdashh | Understood.
20:49:29 dfdashh | Even if not possible now I wanted to log that so it does not come again. Get the answer and refer to it later :)
[...]
20:53:33 @divVerent | so they can be revisited later
20:53:41 @divVerent | but - keeping it open for a while first
20:53:52 @divVerent | maybe someone wants to do it
20:54:21 @divVerent | one thing I'd like to know - does it suffice to know the NEXT MH/Strength/...
20:54:29 @divVerent | or the next of each kind
20:54:31 @divVerent | or timers for all?
[...]
20:54:47 @divVerent | only the next one could be done a bit more sanely, by using stats and calculating the time the next one spawns on server side
20:54:50 @divVerent | that gets rid of most bad issues
20:54:52 dfdashh | That was my primary reason for creating it
20:55:28 dfdashh | divVerent: I think the main intent is for the "special" items
20:55:29 @divVerent | but, that implementation then would eat server load
20:55:30 dfdashh | Not for all
20:55:35 @divVerent | yes, but all special?
20:55:39 @divVerent | like, if the map has two MHs
20:55:47 dfdashh | No, not if it has two
20:55:48 @divVerent | or should it only show a countdown for the next one
20:55:54 dfdashh | Just "the next one of this type of item..."
20:56:01 @divVerent | but... then you don't know which one it is
20:56:03 @divVerent | is that okay?
20:56:09 dfdashh | Yeah, I think that will suffice
[...]
20:56:17 @divVerent | okay, adding that conversation to the ticket
20:56:23 dfdashh | It would be akin to "the next megahealth will be available in <n> seconds"
20:56:47 dfdashh | Don't need to know "the first megahealth on this map will be available in ..."

#2 Updated by terencehill over 2 years ago

20:54:47 @divVerent | only the next one could be done a bit more sanely, by using stats and calculating the time the next one spawns on server side
20:54:50 @divVerent | that gets rid of most bad issues

Would it be that bad to implement the protocol in this way, with Write/ReadByte?
When a special item is taken, the server sends the item type ID (3 bits), item number ID (5 bits) and remaining time (8 bits).
The client reads the data and takes care of locally decreasing the times.

That allows to network up to 8 item types (currently in game there are 6 special item types) and up to 32 different items of a type.

Using stats (addstat stuff) wouldn't there be the need to send times of the tracked items every second?

#3 Updated by divVerent over 2 years ago

We should avoid the SVC_TEMPENTITY way, as that's not part of the CSQC spec and causes problems in some cases (e.g. disconnects of clients which are currently downloading CSQC code).

And the stat would contain the next spawntime of such items (and not the time left), so it only gets updated when an item gets taken.

#4 Updated by terencehill about 2 years ago

I've fully implemented it plus some added features, please test it checking out the branch terencehill/itemstime and give feedback.
Features:
  • Panel to display left time until important items respawn in the map.
    The tracked items are mega health, large armor, powerups (strenght, invincible, jetpack, fuel regenerator) and the so called superweapons (hook, fireball, minstanex).
    When multiple occurrencies of the same type of item are already taken, time is always referred to the first item that will respawn.
    It's possible to keep showing icons of already spawned items (cvar hud_panel_itemstime_showspawned, disabled by default).
  • Menu dialog to configure the panel.
  • New waypoints for mega health and large armor, displayed just like the existing powerups waypoints, obviously only visible to spectators (sv_waypointsprite_itemstime and g_waypointsprite_itemstime cvars, both enabled by default).
  • It's enabled when playing in warmup stage, good for people willing to improve their timing skills.

#5 Updated by antibody about 2 years ago

Sounds great! I will check this out as soon as I can and post back here. Thanks!

#6 Updated by antibody about 2 years ago

  • % Done changed from 0 to 70

Okay here's an update. This seems to work fine with one MH/MA, but gets confusing with multiple. I would think that the icon for the item should remain in the panel with no timer if any one item is available and not taken. What happens if two are there and one is taken is that the timer shows for how long till the one taken respawns (despite the other one being there for the taking). Here's a screenshot of what I'm talking about. On final_rage, the lower armor is taken and the upper armor is still available, but the timer is showing the respawn seconds for the lower armor. I would want it to show no timer at all, since the upper armor is available for the taking /now/.

Screenshot: http://i.imgur.com/fhLC7.jpg

Also, the models used in the panel don't match the MH and MA - they are for the 50 HP and 50 armor. Is that intentional?

Overall I'm very excited about your progress! Thank you!

#7 Updated by terencehill about 2 years ago

antibody wrote:

Okay here's an update. This seems to work fine with one MH/MA, but gets confusing with multiple. I would think that the icon for the item should remain in the panel with no timer if any one item is available and not taken. What happens if two are there and one is taken is that the timer shows for how long till the one taken respawns (despite the other one being there for the taking). Here's a screenshot of what I'm talking about. On final_rage, the lower armor is taken and the upper armor is still available, but the timer is showing the respawn seconds for the lower armor. I would want it to show no timer at all, since the upper armor is available for the taking /now/.

Screenshot: http://i.imgur.com/fhLC7.jpg

I think we can keep both informations, if that's not confusing: timer for the next MH and at the same time highlighted icon when at least one MH is available.

Also, the models used in the panel don't match the MH and MA - they are for the 50 HP and 50 armor. Is that intentional?

Icons are the same used in the health/armor panel, they are generic.

#8 Updated by antibody about 2 years ago

Okay, that works for me as long as the highlighting is noticeable. With the screenshot I already provided it is not noticeable that a MA is up now; "highlighting" the armor by just placing a halo/aura around the image is NOT sufficient.

As for the models, I'd greatly prefer to use smaller versions of the actual mega-item images. Having the default icons there is confusing.

#9 Updated by terencehill about 2 years ago

antibody wrote:

Okay, that works for me as long as the highlighting is noticeable. With the screenshot I already provided it is not noticeable that a MA is up now; "highlighting" the armor by just placing a halo/aura around the image is NOT sufficient.

I agree, they should be highlighted in a more noticeable way.

As for the models, I'd greatly prefer to use smaller versions of the actual mega-item images. Having the default icons there is confusing.

OK... I can do that.

#10 Updated by Chryyz about 2 years ago

The panel (when not always showing what's up), has this nagging tendency to spread the items out so that they're taking the entire panel. if you just have health and armor, for instance, it will put one at the top of the panel, and push the next item to the bottom with this huge gap in between. Maybe it's just me, but I find it incredibly unappealing.

Is there a way to specifically disable this function for the actual players in warmup? I personally would really like this when spectating (even spectating warmups), but not when I'm actually playing. I feel it's intrusive, and may disrupt the learning process of timing the megas yourself.

p.s. Nice work.

#11 Updated by Debugger about 2 years ago

I'm not sure why it is'nt possible to see the timing of (e.g.) two A100s at the same time. Additionally, I didnt really ask divVerent about the following idea yet (he should know about it though). So I dont know if this is possible in the way I propose it.

<Debugger> basically, you can give each entity of the game a certain key which then gives the entity a function
<Debugger> and the engine reads the entities and makes the entities working properly by applying the keys
<Debugger> anyway, concerning the key for a mega entity, there should be the possibility to attach a key (e.g. 'A100_1_respawn') to it and to implement it into the respawn-times
<Debugger> this would be a way using entities at least and it would show each entity which has a certain attached key
<Debugger> I mean, Im not really experienced tbh but as one can add a key to any entity (workover of maps could be needed, though!) it should be possible
<Debugger> on the other hand I'm not sure how much CPU it could need
<Debugger> should be possible though beacuse the engine handles loads of entities at the same time anyway

The idea is to differ between the items (which has to be done by a certain key which has to be set by the mapper in netradiant) by using a key. So the mapper could decide which items should be shown in the item timer when spectating (older maps need some workover then!). Finally it should be possible to show each item with a certain key (or with a certain key prefix/postfix: 'ITEMNAME_...' / 'ITEMNAME_respawn' ) on the timing-arrays in the HUD.

If I had the coding knowledge to code this I would do it, so I post the idea for now here.

#12 Updated by terencehill about 2 years ago

I think I addressed all the issues reported by Antibody and Chryyz, please report if they are good enough:

  • Show the remaining time only if ALL the items of the same kind are taken
  • New icons for mega health and large armor (images taken from the actual items)
    Bonus: New icons for strength and shield (images taken from the actual items)
  • hud_panel_itemstime / g_waypointsprite_itemstime set to 2 will show itemstime panel / MH-MA waypoints even playing in warmup stage (set to 1 only spectating). Default value is 2 for both.
  • New cvar hud_panel_itemstime_size_dinamic, if enabled reduces panel size by removing spacing beetwen items

#13 Updated by antibody about 2 years ago

My computer is dead in the water, so I won't be able to test this for a day or two, but I will as soon as I can.

#14 Updated by antibody about 2 years ago

The HUD no longer shows more than one armor on final-rage. I can see the item timers when I'm spectating, but not when I actually play. This happens in demos as well as actual play (I've set hud_panel_itemstime 2, g_waypointsprite_itemstime 1, and sv_waypointsprite_itemstime 1).

#15 Updated by terencehill almost 2 years ago

I can see the item timers when I'm spectating, but not when I actually play. This happens in demos as well as actual play (I've set hud_panel_itemstime 2, g_waypointsprite_itemstime 1, and sv_waypointsprite_itemstime 1).

That's correct, item timers appear ONLY in warmup stage if you're playing.

If you think it'd be good to have the possibility to see the timers when actually playing (obviously the server should be able to turn this feature off), I must say I found complicated to implement it PROPERLY so I prefer to not propose anything regarding this. Could be added later anyway but don't ask me.

PS: I mentioned here previously the cvar sv_waypointsprite_itemstime but it doesn't exist and never existed.

#16 Updated by terencehill almost 2 years ago

I've requested the merge in #1330

#17 Updated by Mirio about 1 year ago

  • Target version set to 0.8
  • % Done changed from 100 to 0

#18 Updated by Mirio about 1 year ago

  • Assignee set to terencehill

#19 Updated by Debugger about 1 year ago

  • Status changed from New to Feedback

http://dev.xonotic.org/issues/1467

Works nicely for me. The only issue I could find so far is that the itemtimer cant keep track the times of two items of the same type (e.g. 2 Mega Armors on a map).
It will show then either no time or the time of the next upcoming Mega Armor.

Also available in: Atom PDF