Hacker News new | ask | show | jobs
by gus_massa 252 days ago
Too late to edit: More feature requests:

From some TrackMania videos, you can play against with your own last/beast ghost.

I guess you are picking the 7 fastest car or the last 7 cars (that are mostly hardcore users), so they are quite fast. Is it possible to add a few slow cars, perhaps select a mix of times?

Bonus imaginary points for:

* my car obliviously :)

* the fastest/last 7 cars

* 6 cars selected with an even distribution. If the fastest is 1 minute and the slowest 4 minutes, let's say approximately 1:15, 1:45, 2:15, 2:45, 3:15, 3:45

* 2 cars with a time close to the expected time of the player. If in the last round the player got 2:17, let's pick an old car with 2:07 and another with 2:27, so the player has two ghost nearby.

1 comments

Hey gus_massa, thanks a lot for the feedback! Those are some really cool ideas.

For the other players you see in the race, we’re currently picking random players from the database. It would definitely be nice to select a mix of fast, average, and slower cars for a more balanced distribution (that was our original plan), but unfortunately the GameSnacks API doesn’t support that feature yet. Since some hardcore users play a lot, their ghosts tend to show up more often in the pool.

Right now you can already see your own ghost car in the Daily Challenges, but being able to see your “best time ghost” in the standard races is also a really cool idea!

I guess ypu are picking 7 random users. Is it possible to pick 1000 and then automatically cherrypick 7 of them? Does the API save all the races or only the best of each player?
The API saves all races, now just your best one

Yes, selecting 1000 and then cherry-picking would be a great idea in theory, but ghost data is quite heavy (around 300–400 KB per ghost). We are already compressing it as much as possible: saving only about 10 frames per second and interpolating the rest, reducing decimals to a minimum, and storing rotation only on the Y axis. We also keep only the ghosts of cars that complete a race in under 4 minutes to avoid excessively large files.

Because of this, loading 1000 ghosts and then picking a suitable set of 7 close to your skill level would make the process too slow. Currently, we have a maximum load time of 10 seconds for the ghosts, and we are aiming to ensure the game works smoothly even on slow connections.

Have you tried compression?

For example instead of storing, x1, x2, x3, x4, x5, you can store x1, x2-x1, x3-x2, x4-x3, x5-x4 Using few decimals it may compress better with the standard algorithms.

Assuming almost constant speed, you may guess x3 from x2 and x1 and x3=~ 2*x2-x1, so instead of x3, x4, ... you store x3-2\x2+x1, x4-2\x3+x2, and compress it.

For a car, I'd assume constant acceleration and if I didn't make a mistake, x4=~ 3x3-3x2+x1, so you store x4-3x3+x2-x1 and compress the sequence.

Hey, thank you so much! I’ll share this information with my programmer, maybe with this we can further reduce the ghost file size and bring in more samples to make the selection better match your skill level.

In any case, the ideal solution would be if the API allowed us to send the player’s average time as a parameter, so we could fetch opponents at a similar skill level, that would greatly improve the gameplay experience. I’ll mention it again to the backend team, and if we’re lucky, maybe they can prioritize that feature.

Cheers, and thanks again!

Too late to edit. I forgot a 3 in

x4-3*x3+x2-x1 --> x4-3*x3+3*x2-x1

Good luck with the project.

PS: Usually tweaking the parameters to select the opponents/ghost and make the game fun (that is what is important) is hard. (More cars? Less cars? Use the last time of the player? Use the average time of the player?) So after you solve the problem, a post-mortem may be an interesting blog post to summit here.

PS2: another typo in my first comment: defectively -> effectively