Jump to content

Winter Games 2016 - On the road again - Part 1

AggrorJorn

1,059 views

Finally done moving to my new house and today I got my computer setup again. And as a start, I thought, lets give it a go for the winter games tournament.

 

It is a little racing game where the tracks gets randomly generated on the given seed. I think I will call it "On the road again", named after the song and because of the fact that the level generation allows you to skip parts of the track if you simple fall down on the track below you.

 

 



9 Comments


Recommended Comments

This was just today? Damn you work fast. I love the concept of it and that people can compete for score on the same tracks. I wonder if you'll have high scores for both the least lives lost and fastest time (and/or maybe a weighted system combining both). I can already imagine lots of different track piece types as well, including objects on one side or another like obstacles or speed boosts.

Share this comment


Link to comment

Guessing your post about web API was to track this? I think you could uses leaderboards for this. I like how you have an instance of the car stay where it left off. What might be cool is to incorporate that into the leaderboard data. Maybe you can store the position of each user in the leaderboard (remember you can create multiple leaderboards to store whatever numeric data you want), and then when we start you query the leaderboard to get the top 5 players. Take their images and use that to create a unique material in code and use that material for an instance of a car that you place at that players pos/rot that you stored in leadboards.

 

It's a sort of bastardizatiin of the leaderboard but it would be cool to see top 5 cars and where they fell. You could have "score", "score.pos.x", "score.pos.y", "score.pos.z" leaderboard names and the same for rotation to store your data for each user.

Share this comment


Link to comment

I love the idea of showing other player info and visuals to the current player. It seems like it wouldn't be hard to incorporate.

Share this comment


Link to comment

Yes, that was something I wanted to try, but it just looks so awful and I really just want to push a lot more data to the database, without constantly have to make a new steam database.

Initially I wanted to do it like they do it in Trackmania, where you can compete with the ghost of other highscores. But this requires 3positions, 3 rotations every other second or so and that's just insane. I you would play for 100 seconds, you would need 600 highscore databases. For now I will just stick with the fastest time and attempts.

Share this comment


Link to comment

That's why you wrap it up in a class so those details are hidden :). I'm playing around with this because I'm curious if I can get it to work. I'll see if I can figure something out as this would be handy for other things. It wouldn't be to store multiple records per user though as that's way more complex, but I think I can get it so each user gets one record of any number of columns so you could store its final position, rotation, score, any other int.

 

This would all work if the value gets overwritten. Looking back at Josh's original post I see that at that time it would only write the value if it was higher than the current value which wouldn't work for this as a general storage of nits per user.

 

If you just showed the top 5 cars I don't think that would look bad at all. I'd want to see them. I would be much more inclined to keep playing the game to try and beat those guys. Each start of the race you'd have to re-get the data and clear out the old cars and place the new top 5.

 

I'll test if the value we write each time makes it or if it only takes the highest value as that's the key to the entire thing really.

Share this comment


Link to comment

So I have done some experimenting but the performance is really getting bad after a couple dozen highscore tables. I think there is some sort of time out after a while.

So I thought about trying to be smart what kind of data I am storing. For instance you can have a rule that position can only take 4 integer positions (minus values not included) and store the x,y and z after each other. This works pretty well. For instance: 123415678412 is actually vector3(1234,1567,8412 ).

Share this comment


Link to comment

Good idea. Just make sure your maps are high enough and always going in the positive direction of x & z. So does it only take the highest value though? I.e. If the value was 10 and you later set it to 8 does it actually store the 8? That's strange that multiple leaderboards time out or is that slow.

 

Why would you need a couple dozen? I would think one for each field which should just be 7? 3 for pos, 3 for rot, and 1 for score?

Share this comment


Link to comment

If your previous highscore was 10 and now 8, than the highscore will not be updated and the 8 will simple be ignored. I think valve has huild in a little logger that halts the creation of many highscore tables from the same address. I think I got to 64 highscore tables before I started getting delays in the return message. Eventually I couldn't even make new highscore tables, So I though I had hit a limit. But after a few minutes it worked again.

 

I don't think I will be spending a lot more time on making (read: testing) a complex workaround for the things I want to have in my. I will just stick with a basic highscore system for now. What I really miss is a way of seeing which users seeds were used by people and which are popular. I wanted to display a list op popular seeds. My own database could do that easily, but now I do this the following way:

 

every time a user enters a seed for a level, lets say '1337', a higscore table is updated with this value: 13370000000. Every time a user retries the level, the highscore is updated to 13370000001. I get this 'seeds-highscoretable' and read out the seeds and the times it has been userd. Eventually showing a list op popular seeds. Level count (to be replaced with unique users) goes to a maximum of 9999. A bit hacky, but it works.

 

This is an actual result I am getting:

  • 13370000056: results in: seed 1337000, timesplayed 0056
  • 87341200012: results in: seed 8734120, timesplayed 0023
  • 32400000004: results in: seed 3240000, timesplayed 0004

Why would you need a couple dozen? I would think one for each field which should just be 7? 3 for pos, 3 for rot, and 1 for score?

Not If I want to do ghosting of the best car. every second I store the position and rotation of the car.

Share this comment


Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...