inexorgame-obsolete / deprecated-cube-engine-inexor

UNMAINTAINED: Please have a look at the vulkan-renderer
https://inexor.org
zlib License
11 stars 1 forks source link

Implement a HUD using the web technology stack #312

Open aschaeffer opened 8 years ago

aschaeffer commented 8 years ago

What's a HUD?

What is not part of the HUD?

The following components are not part of the head up display and should be developed and discussed separately:

Features

The following characteristics must be considered when developing a HUD:

Grid Technology

    <div class="grid-stack">
        <div class="grid-stack-item"
            data-gs-x="0" data-gs-y="0"
            data-gs-width="4" data-gs-height="2">
                <div class="grid-stack-item-content"></div>
        </div>
        <div class="grid-stack-item"
            data-gs-x="4" data-gs-y="0"
            data-gs-width="4" data-gs-height="4">
                <div class="grid-stack-item-content"></div>
        </div>
    </div>

    <script type="text/javascript">
    $(function () {
        var options = {
            cell_height: 80,
            vertical_margin: 10
        };
        $('.grid-stack').gridstack(options);
    });
    </script>

Declarative Widgets

Metrics

The following table illustrates which data is available in HUD renderer.

Personal state metrics Tree
Current weapon player1.gunselect
Next weapon player1.gunselect + 1
Previous weapon player1.gunselect - 1
Current amount of ammo for the current weapon player1.ammo[player1.gunselect]
Max amount of ammo for the current weapon gamemodes.[currentmode].maxAmmo[player1.gunselect]
Quad-Damage player1.quad
Armour player1.armour
Flag player1.hasFlag
Personal stats metrics Tree
Damage dealt player1.damage.dealt
Damage received player1.damage.received
Frags player1.frags
Deaths player1.deaths
Suicides player1.suicides
Accuracy player1.accuracy
Kills per death player1.kpd
Game time metrics Tree
Max time (current round) gamestate.time.max
Past time (current round) gamestate.time.past
Remaining time (current round) gamestate.time.remaining

Widgets

This list should give you an idea which widgets should be developed:

Widget Metrics Description Graphical visualisation
Ammo Current ammo, Max ammo Shows how much ammo is left for the current weapon Bar, Circle
Weapon Current weapon, Next weapon, Previous weapon Shows the current weapon and the switchable weapons Text, Icons
Game timer Max time, Past time, Remaining time Shows information about the game time Text, Bar, Clock
Personal stats Frags, Deaths, ... Shows stats about you or the currently spectated player Text, Bars

Data

aschaeffer commented 8 years ago

This is how it could look like:

MartinMuzatko commented 8 years ago

This would be a great addition, but first we need to settle what HUD elements we want, besides the usual (Health, armor, map, etc) and edithud elements.

Fohlen commented 7 years ago

Since gridster is the most well-known, documented and maintained of the above, probably best would be to focus on that. The following elements should be backported from sauer:

Each elements should be drag & drop with gridster, and as well have a small option set (just checkboxes literally), what to display exactly.

aschaeffer commented 7 years ago

"log" == web based console? --> see #386

Fohlen commented 7 years ago

@aschaeffer quiet alrighty @IAmNotHanni wanted to dig into this since it's a thing that one can do really nicely independant

aschaeffer commented 7 years ago

The web console is a separate component and isn't part of this issue.

MartinMuzatko commented 6 years ago

@aschaeffer when designing a crosshair there are many aspects to take into account.

About the non-editmode crosshair: Are there different crosshairs for different weapons? Kill feedback (Related to #91 ) - we could flash the crosshair red on kill. All other attributes like size would go into the widget settings object.

Your thoughts? We do not have to decide on the weapons specific stuff yet, but having the possibility would be nice.