Thursday, March 28, 2013

WASD - Client Version

New Demo Live - New Web Site Live - Go visit

New Demo Live:

So the new demo is available.  (its url has changed, I think, so use the link above, and then click to see the live demo)

Here is what's up with this edition:
  1. All accounts still exist.  This did not require server changes.
  2. Each player now has a map.
    1. Anytime a player logs in, the map will look exactly the same.
    2. The map is different for each player. - I'll explain in a moment.
    3. Maps are not stored anywhere - I'll explain this too.
    4. Maps are presently 32x32 tiles, but the engine is capable of near infinite - I'll explain this to.
  3. The mouse move is now gone.
  4. You can now move around the game by clicking W, A, S or D, to act as arrow keys.
  5. Ambient Lighting now exists, so you can see a bit more

Technical Mumbo Jumbo:

System.Random in .Net is slow.  Doesn't seem like it, but to produce 1 million distinctly seeded height positions, it took > 3900 milliseconds every time.  So I discussed this with numerous other developers, on several forums, until I found a solution which required little effort.  The new randomization for 1 million distinctly seeded height positions is now < 67 milliseconds, 1.7% of the original time it took.  If anyone sees some weird randomization, let met see a screen shot and know which account name you used.

To keep a map of 1 million tiles (1024x1024 map size) It would have been nearly 50 megs of data.  With any luck, this city builder will have 10,000 players or more.  for those 10k players, we would have been using 500 gigs of storage on the server, plus the transfer of the data, and the management of it would have been a nightmare on performance.  (these maps change)  So instead, I use the randomization I mentioned above, to choose the height for each vertice (corners of the tiles) and the tile type.  
 - The randomized values come from one seed per request.  The seed is generated from the X coordinate, the Y coordinate and the player's Id.  This way everyone's map is different.
 - Since these are generated incredibly fast now.  I can entirely depend on it for live data.  
 - This is why there is nothing saved.  (also no DB changes)  The playerid, X and Y are already there.  The only thing that will transfer is the data about any terrain that has changed.  
 - Since the player's unique ID is part of the seed for each tile, the layout is different for each player.
 - Since the ID's, and Locations are managed with 32 bit integers, that means that these maps can go out more than 2 billion tiles in any direction.  (hence my near infinite)
 - I don't have it reprocessing anything with position yet, so you only see the 32x32 tile portion in the game now.

To Do List:

I need to start reducing the content size.  
 - The skybox I used on the game side is not needed.  
 - I'm presently using 512x512 pixel tiles that are throw away.  I should be using 64x64.
 - The Satelite is not ultimately going to be used.  It is a very high definition model, which is expensive on the initial packets download size.  
I also need to get the map to move with the player.  I.e. process the next parts of what they will see, and only provide a small portion of that to the rendering system.

New Site:

So the new site is up.  Before, you always had to go to /index.html, and if you didn't include that, you wouldn't get anywhere.  Now, there are two separate websites.  MVC4 Service based site, and an MVC4 Web Based Site.  I've only done a minute level of RAZOR modifications to the index, which you can see from the pic above.  It still looks like an initial sample page.  But this will get cleaned up over time.

Again, please note that the website is NOT a priority.  The game is.  I will get back to the website when the game is better off.  pieces here and there.  But I have no specific plans yet.

No comments:

Post a Comment