[Open Assets] Race HUD

This content may be freely modified and/or maintained by anyone.
Status
Not open for further replies.

Tamkis

Lua Grasshopper
After playing Duon the Adventurer's SRB2 Riders v2.1 WIP beta port and some generic circuit courses during April 2015, I realized something was missing from Race/Circuit and Competition gametypes. Something very important... a live, on-screen Race HUD with ranking! Because having to press the button for showing the player's scores while racing is obnoxious and not very informative for Race modes. Also, Race modes are lacking some features.

The following wad package contains a Lua script and other assets to add a Race HUD and other improvements and functionality to Race/Circuit and Competition gametypes (just referred to as "Race" modes onwards). It shows the usernames and player icons of the top 5 racers in Race modes on the left side of the screen, your rank in the bottom left corner, and a Win/Lose logo upon finishing the race (depending on if you finished in first place or not). The script also supports properly ranking a Metal Sonic racer! Race ranking is waypoint-based, like with circuit tracks in Trackmania. Hitting starposts and completing laps will increase your rank.

Features:
  • Starpost and lap-based ranking

  • Race HUD
    • Displays top 5 racers with usernames & player icons on left side of screen
    • Numeric rank shown in bottom-left hand corner of screen
    • Debug output of ranking data instead of numeric rank (for both player & Metal Sonic)
    • Finished racers' Hud usernames & icons greyed out upon finishing race, and rank locked
    • Long HUD usernames truncated
    • Your HUD username shown in Yellow
    • Other racers' HUD usernames shown in white
    • Metal Sonic racer HUD support
    • Win/Lose logo shown upon finishing the race if finished in 1st place or not, with speeding up of music upon 1st place person finishing race ("pinch")
    • Customizable countdown sound lump for race start
    • Script intelligently and appropriately adjusts ranks as players join/leave mid-race in netgames

  • Metal Sonic racer support
    • Customizable icon lump in WAD for the HUD
    • Customizable Metal Sonic name for the HUD
    • Metal Sonic's name shown in Red on HUD
    • Metal Sonic racer toggle-able
    • Maps with Metal Sonic racers MUST have starposts with starpost activator sector specials near them for Metal Sonic to "hit" checkpoints via the activators and be ranked appropriately

  • Custom console commands
    • MSRace (bool)
      • Toggles Metal Sonic racer as appropriately in applicable levels
    • MSName (string)
      • Changes HUD display name of Metal Sonic
    • DBUG (bool)
      • Shows internal stat variables used for the ranking instead of the rank in bottom-left corner
    • Pinch (bool)
      • Toggles speeding up of music upon first place person finishing race
Known/potential bugs:

  • Ranking may be broken before first lap is completed in a Circuit netgame. It tends to stabilize after everybody completes 1 lap
  • An error spam occurs when players join mid-race in a netgame. You will have to restart the race upon people joining mid-race to be able to communicate with each other. (Need help fixing this)
  • Metal Sonic ranking may be slightly off in netgames.
Todo (future updates):

  • Bug fixes
  • Better ranking based upon both starposts hits, laps, and distance between players and next starpost?
  • Add support for additional Metal Sonic racers via XKower's NPCs?
Credits:

  • Duon the Adventurer & Deadpool the Hedge...
    • Beta testing and Lua support
  • X68000
    • Betatesting in IRC/in a netgame

C&CC welcomed! Also attached with DL is a separate Circuit test level to show off a proper Metal Sonic race level (with ranking). It replaces GFZ2.

Have fun, and race on!!
 

Attachments

  • srb20001.png
    srb20001.png
    64.1 KB · Views: 1,337
  • srb20002.png
    srb20002.png
    72.9 KB · Views: 1,129
  • srb20003.png
    srb20003.png
    70.9 KB · Views: 1,088
  • srb20004.png
    srb20004.png
    74.6 KB · Views: 918
  • srb20005.png
    srb20005.png
    70.5 KB · Views: 786
  • srb20006.png
    srb20006.png
    63.8 KB · Views: 832
  • Race_HUD_Spam_Fix.7z
    131.2 KB · Views: 972
Last edited:
Welcome to releases.
As a suggestion, perhaps you should make it so that the player face color actually changes?

You could replace this
Code:
if (player.done)
v.drawScaled(x, y, (FRACUNIT/2), face, V_HUDTRANSHALF)
else
v.drawScaled(x, y, (FRACUNIT/2), face)
end

With this
Code:
if (player.done)
v.drawScaled(x, y, (FRACUNIT/2), face, V_HUDTRANSHALF, v.getColormap(player.mo.skin,player.mo.color))
else
v.drawScaled(x, y, (FRACUNIT/2), face, 0, v.getColormap(player.mo.skin,player.mo.color))
end
 
Such unneeded honor brought to life an awesome idea of a mod. Anyways, I'm SO GLAD that the lua spam didn't occur anymore, I'd rather have a broken HUD than not being able to chat.
 
Tamkis said:
Add support for additional Metal Sonic racers via XKower's NPCs?
Smells like new concept for making but first I need to finish Match-mode NPC but we can co-op in making our respective concepts and make them faster.
But concepts of realising concepts aside, good job with making this hud idea I wonder what further you can do?
 
Smells like new concept for making but first I need to finish Match-mode NPC but we can co-op in making our respective concepts and make them faster.
But concepts of realising concepts aside, good job with making this hud idea I wonder what further you can do?

In order for NPCs to work compatibly with this, you would have to find a way to force them to travel a certain path waypoint-style. Perhaps tweak the NPC lua code to allow each NPC Thing to have their own unique ID via the "parameter" Thing field, and create a new, invisible object. This object will serve as waypoints, with the order determined by its angle. Also perhaps use each waypoint's paremeter field for an action (ie, 0 for just walk/run through, 1 for jump.)
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top