03-24-2011, 11:26 AM
I've been planning to add this feature for some time. I looked into it yesterday, and it seems to be something I won't be able to do alone. So I'm asking any coder that would like this feature for help in creating it.
The idea is adding HUD chat portraits similar to those in UT. Which means that when someone taunts / autotaunts or uses the main chat, all players will see a picture of their character on the HUD for a brief amount of time. Only one portrait is shown at a time, representing the last player who spoke. Here is a screenshot from UT2k4 showing how it's done there (see the center-left area of the screen). I even did an ugly mockup of how it would look like in Xonotic.
My idea was using the existing character preview images from the character selection screen. Someone proposed we allow custom avatars instead, which IMO wouldn't be the best idea (maybe we can implement that too but as a separate feature, since this is meant to show the in-game character who spoke). The best idea on my mind however, is drawing the very 3D model on the HUD. Which is possible, since CSQC can render models (used for gibs and other stuff).
The idea of showing the animated player on the HUD sounds pretty awesome to me, and much more suitable for a video transmission. When triggered by someone chatting, the model can be shown in the idle animation, while triggering it by taunt can show it in the taunt animation dancing around (all player models have it, but it's not used IIRC). The player can even hold the weapon he fragged or chatted with. IMO this would be more awesome than just an image, and it's a feature I really hope can be made into reality
But of course, such wouldn't be easy to do. So onto the technical part: There would certainly need to be some server - client networking involved, since the server needs to specify which player we are displaying. This could be achieved in two ways I can think of:
Either send all the values as stats or WriteBytes to the client (which would take more bandwitch and would be a bad idea as divVerent mentioned), or use the same system the scoreboard does to show each player's name and colors. This involves just sending the entity number to the client, and the client obtaining the properties for that player. Player name and shirt / glow are already obtained that way by the scoreboard, but the player model and skin need to as well.
The portrait itself should be a HUD panel of its own I think, since that gives more freedom to configure it. Drawing a 3D model on the HUD can use a simple method. The model's rotation would be opposite the player's rotation, and its origin would be a short distance away from the player in the direction he is looking. This will cause the client-side model to move with the player as he looks around and walks, giving the feel of being on the HUD. A 'no culling' drawflag should keep the model from being hidden by walls if you look too closely at them.
I'm planning to try starting the implementation of this myself. But given it's quite a complex feature, I'm not sure how far I can get without help. Specifically on obtaining the player model and skin using player entnums, as well as making the model appear as part of the HUD (and be movable with its HUD panel). We might also need FruitieX's help on the HUD part, since this involves making a new panel.
So if any coders fancy this feature and have time to help, please post here so we can think of something! Hope we can make this feature happen
The idea is adding HUD chat portraits similar to those in UT. Which means that when someone taunts / autotaunts or uses the main chat, all players will see a picture of their character on the HUD for a brief amount of time. Only one portrait is shown at a time, representing the last player who spoke. Here is a screenshot from UT2k4 showing how it's done there (see the center-left area of the screen). I even did an ugly mockup of how it would look like in Xonotic.
My idea was using the existing character preview images from the character selection screen. Someone proposed we allow custom avatars instead, which IMO wouldn't be the best idea (maybe we can implement that too but as a separate feature, since this is meant to show the in-game character who spoke). The best idea on my mind however, is drawing the very 3D model on the HUD. Which is possible, since CSQC can render models (used for gibs and other stuff).
The idea of showing the animated player on the HUD sounds pretty awesome to me, and much more suitable for a video transmission. When triggered by someone chatting, the model can be shown in the idle animation, while triggering it by taunt can show it in the taunt animation dancing around (all player models have it, but it's not used IIRC). The player can even hold the weapon he fragged or chatted with. IMO this would be more awesome than just an image, and it's a feature I really hope can be made into reality
But of course, such wouldn't be easy to do. So onto the technical part: There would certainly need to be some server - client networking involved, since the server needs to specify which player we are displaying. This could be achieved in two ways I can think of:
Either send all the values as stats or WriteBytes to the client (which would take more bandwitch and would be a bad idea as divVerent mentioned), or use the same system the scoreboard does to show each player's name and colors. This involves just sending the entity number to the client, and the client obtaining the properties for that player. Player name and shirt / glow are already obtained that way by the scoreboard, but the player model and skin need to as well.
The portrait itself should be a HUD panel of its own I think, since that gives more freedom to configure it. Drawing a 3D model on the HUD can use a simple method. The model's rotation would be opposite the player's rotation, and its origin would be a short distance away from the player in the direction he is looking. This will cause the client-side model to move with the player as he looks around and walks, giving the feel of being on the HUD. A 'no culling' drawflag should keep the model from being hidden by walls if you look too closely at them.
I'm planning to try starting the implementation of this myself. But given it's quite a complex feature, I'm not sure how far I can get without help. Specifically on obtaining the player model and skin using player entnums, as well as making the model appear as part of the HUD (and be movable with its HUD panel). We might also need FruitieX's help on the HUD part, since this involves making a new panel.
So if any coders fancy this feature and have time to help, please post here so we can think of something! Hope we can make this feature happen