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鈥檒l 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 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

This comment has been minimized.

Copy link
Contributor

fokkonaut commented Dec 9, 2019

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

This comment has been minimized.

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)

This comment has been minimized.

Copy link
@fokkonaut

fokkonaut Dec 9, 2019

Contributor

what does this do?

This comment has been minimized.

Copy link
@axblk

axblk Dec 9, 2019

Author Contributor

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?

This comment has been minimized.

Copy link
@oy

oy Dec 9, 2019

Member

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

This comment has been minimized.

Copy link
@axblk

axblk Dec 9, 2019

Author Contributor

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

fokkonaut commented Dec 9, 2019

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

@axblk

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

AssassinTee commented Dec 9, 2019

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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 added 2 commits Dec 13, 2019
@axblk

This comment has been minimized.

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
3 checks passed
3 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@axblk axblk deleted the axblk:feature/race branch Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can鈥檛 perform that action at this time.