Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic race features #2307

Merged
merged 17 commits into from
Dec 14, 2019
Merged

Add basic race features #2307

merged 17 commits into from
Dec 14, 2019

Conversation

axblk
Copy link
Contributor

@axblk axblk commented Dec 9, 2019

This addresses #2172. Included features are:

  • times in the server browser
  • times in the scoreboard (and map record at the top)
  • separate race timer
  • support for checkpoints
  • finish message
  • localized chat message for new records

The server can set a few config params:

  • accuracy of the displayed times
  • hide kill messages
  • finish messages can be displayed like the kill messages or as localized chat messages (depending on how often a finish occurs, you may want to emphasize it more)

For testing this, the two "Race Test" servers already implement this protocol extension.
You can find the code at: https://github.com/axblk/teeworlds/tree/race_proto

This is more of a proposal and I'm open for your opinions and suggestions! 😃
The flag used for the finish messages is from the old client pack. When someone has a better icon, I'll replace it.

The finish messages are a bit smaller now, but these screenshots should show most of the features:
race1
race2

@fokkonaut
Copy link
Contributor

The miliseconds should only show two decimals. And the new timer is very ugly, should merge it with the gametimer or at put it next to it somehow. In scoreboard at the top right, where the best time is should, this shouldnt display the decimals at all, just minutes:seconds

@Dune-jr
Copy link
Member

Dune-jr commented Dec 9, 2019

Good job ❤️

I think the statboard could be safely disabled in race gamemodes.

For the rest, it's much like the widely enjoyed 0.6 Client Pack.

  • the timer is just like back then and I think it's good. There used to be a clock icon next to it, actually
  • you obviously want to see precisely the best time. The screenshot is a good use case: you are less than a second away from best time.

--- edit ---
The fading checkpoints look nice and I enjoy the choice of colors for info messages & checkpoints.
screenshot_2019-12-09_08-49-02

@@ -153,7 +155,11 @@ void CHud::RenderScoreHud()
float Whole = 300*Graphics()->ScreenAspect();
float StartY = 229.0f;

if(GameFlags&GAMEFLAG_TEAMS && m_pClient->m_Snap.m_pGameDataTeam)
if(GameFlags&GAMEFLAG_RACE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now it disables the HUD in the lower right corner. It could maybe just display the fastest player. Any other suggestion what to display here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about your own fastest time and the fastest one in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works like in DM now. When you are in spec the two fastest players on the server are shown. Otherwise it displays you and the fastest player.

@fokkonaut
Copy link
Contributor

fokkonaut commented Dec 9, 2019

I think the statboard could be safely disabled in race gamemodes.

I wouldnt do that. My mod for example is based on DDrace but also supports kills, deaths and flags.

@LordSk
Copy link
Member

LordSk commented Dec 9, 2019

Good job as usual 👍 .
I think it is overall a good addition to teeworlds, as it adds only the essential parts to a race gametype.

@axblk
Copy link
Contributor Author

axblk commented Dec 9, 2019

@fokkonaut as stated in the initial post you can configure how many decimals are used for the times. In fastcap for example you want to have milliseconds everywhere. There are maps where the record is around 3 seconds.

The timer is probably what you are used to. When I replaced the game timer with the race timer in the client pack, people complained that I should bring the old timer back.

@axblk axblk closed this Dec 9, 2019
@axblk axblk reopened this Dec 9, 2019
@fokkonaut
Copy link
Contributor

Maybe make it configurable aswell, as you already made some things as configs

@axblk
Copy link
Contributor Author

axblk commented Dec 9, 2019

I consider to change two more things:

  • Add an option to not reset the wanted weapon on death. Auto switch weapon on pickup is sometimes too slow since it is client-side. Moving it to the server would require even more protocol additions. The easier solution is to select the wanted weapon before you start the race, however it is easier when the wanted weapon is kept after death.
  • Add a client side variable to configure the timer (separate or as a replacement for the game timer). While the other options are server-side (and hardcoded), the player should be able to configure this himself.

@oy
Copy link
Member

oy commented Dec 9, 2019

Good job 👍
Don't think that the game timer should be replaced by the race timer. General features should be consistent between gametypes. And when there's a timelimit on the server you need that countdown.
Maybe add a graphical icon to the race timer to make it stand out some more?
[On a different note if that's the place for the race timer that same place should probably be used for survival gametypes to show remaining players.]

@AssassinTee
Copy link
Contributor

Note: the auto pickup should be serversided, it's just a flag for the client and very easy to implement, could be in the connect message

@axblk
Copy link
Contributor Author

axblk commented Dec 9, 2019

Then I'll leave the game timer thing to custom clients 👍
An icon for the timer would be cool. Actually the only icon I have is the one from #2172 (comment). I'd prefer to use another one.

Just adding flags to the network protocol is not that easy. Doing it in the engine protocol (e.g. the connect message) would work, but it just does not belong there. Adding things to the existing game messages will not work since old servers would just drop the packets. The only non-hacky solution would be to add even more net messages.

@Dune-jr
Copy link
Member

Dune-jr commented Dec 11, 2019

Throwback to 2010 for the sake of it:

image

If I recall correctly, this was SushiTee's work, maybe with some (poor taste) tweaks.

@oy
Copy link
Member

oy commented Dec 13, 2019

@Sonix- @Zatline
This needs a better flag icon for the finish message, the actual one is too detailed and doesn't render that good.

@axblk
Copy link
Contributor Author

axblk commented Dec 13, 2019

One thing I forgot to mention: a lot of this is based on the 0.6 client-pack from SushiTee 😃

Current state with some UI tweaks and the icon from Sonix:

screenshot_2019-12-13_20-25-03
screenshot_2019-12-13_20-25-28

@oy oy merged commit 8cdd0da into teeworlds:master Dec 14, 2019
@axblk axblk deleted the feature/race branch December 14, 2019 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants