Switching the server

Switching the server

Next version 1.1.2 will have a new server version as well. So I had to find a way of switching server versions without stopping the game availability for the players!

In the end it was quite an easy solution. New server listens on a new port number, so it is already running while the old server is still serving the data to the players. Both versions running together, each one on a different TCP port.

The new app version 1.1.2 will use the new TCP port, so the players will gradually update the app and switch the server without noticing any change.

There is a trick though. The version 1.1.1 already had a code to alert the user that it is necessary to update the game. So when the new server becomes the only running server the apps will start showing this message and requesting the user to update the game and thus start using the new TCP port.

So how does the old server knows when to alert the old apps to update the game? It is a node.js server so I only have to turn on a switch on the server code and restart the server, quite easy. Before doing that I will also copy all data from the old server into the new one and that is it!

This approach also makes it easier for Google and Apple reviewers to play the game, testing the new app version which already has a new server working. Otherwise they could reject the game for errors concerning the server version instead of the app version.

 

Serialization and Mono

Just found out that [OptionalFieldAttribute] does not work on Mono, and therefore on Unity 😦

Actually a new field in a class should not throw any error messages on older applications using older versions of this class.

But unfortunately it does throw an error on Mono and there is no way of preventing that on the older applications 😦

Here some links about it:

How it should work

Nice info on how to handle optional fields

Another fellow having the same issue

and if you are still curios about it, BinaryFormatter.AssemblyFormat

Improving the game physics

Improving the game physics

The “smoothing” algorithm used in the image recognition now can help the game improve its car physics!

With a better interpretation of the hand drawn racing track, it is possible to generate an improved car physics such as the “rolling friction” on fast curves.

Basically it is the amount of speed reduced when the car takes the curve too fast, drifting a little. This makes the car loose speed which can be used to improve the pilot performance or it can make the car take the curve slower than it could be done.

That depends on the shape and length of the curve. Gotta use it wisely! 😉

 

v1.1 Create your own tracks!

v1.1 Create your own tracks!

This version is a HUGE improvement! Now it is possible to create the track inside the game. No need for the SlotLeague Tracker app anymore.

The track creation has actually been improved to generate much smoother tracks and now it works on iOS, Android, Windows, MAC and Facebook Gameroom!

The image recognition has been improved to identify ANY color of ink, and it will work even on ball point pen! As long as your pen is not failing too much 😉 It does need a continuous single outline to be correctly identified as a racing track.

And there is a new official ranking track! Track number 6! Try it! A real beautiful track! The layout was designed by a lot of guys that love slot cars and SlotLeague Time Trials got the permission to publish it along the game!

Have fun!

Smoothing Catmull-Rom

The video above shows how the smoothing algorithm can improve significantly the Catmull-Rom calculation of points identified by image recognition…

(to be continued)…

Hand Drawn Track Creation on 1.1.0

Hand Drawn Track Creation on 1.1.0

Next version 1.1.0 will have a new menu on the track panel of the game (swiping right the main menu panel).

It will be possible to download new tracks from the Facebook Group, Select which one you want to play (from created and downloaded tracks) and now it will be possible to create new tracks!

The Android App “SlotLeague Tracker” can already identify hand drawn sketches of racing tracks and publish on Facebook for everyone to download.

“So if there is an Android app for that, why bother creating a new menu?”

For two reasons! First, because it is a LOT easier if the option is already on the game! Second, because it is a much IMPROVED process!!

Now even ball point colored pen can be used on any simple white stock sheet of paper! Besides, the track identification goes under a “smoothing” process of the track points.

This means that even though a hand drawn track does not have a high level of precision (such as an SVG editor can) the smoothing process tries to ignore imperfections and make the curves smooth and consistent with the other curves and straights of the track!

On the featured image above, the track is hand drawn and the new menu is used to create it on the game track database. On the top left there is a picture of the identified points which are used to render the “smoothed” track. Blue points mean those points that define the racing track. The white points are added in order to help the math formula to calculate the smoothed points better!

Unfortunately both limitation of SlotLeague Tracker still remain: 1) cannot create tracks which intersect itself (“8” shaped tracks) and 2) cannot create tracks with variant height points, such as the “First SVG” track officially numbered 1.

There is only one issue being corrected and tested and this next week, version 1.1.0 will be released! Let’s start drawing slot car tracks!

It does not stop at 1.0!

It does not stop at 1.0!

There are many improvements to be made to the game. Those will be released as soon as tested. New game mode, better rendering, performances improvements, all will be released before version 2.0 😉

So, it is already time for version 1.0.1! What has been changed:

  1. The track loading time has been greatly improved
  2. User made tracks are now validated to prevent basic rendering errors
  3. Menu logic simplified

 

Track loading

Every time the player selected a new scene, when coming back to the main menu the whole process of loading and generating the track was performed. This was kinda annoying after a few menu clicks…

The game has been improved to keep the last rendered track on memory, and only starts a new loading process if the current track has changed.

 

User generated tracks

It is possible to create tracks where some turns are too close from other turns. This gives no room for rendering the track or the game objects around it. Now there is a validation of the track before saving it.

 

Menu logic

It is hard to find a way of explaining the two race modes and how they differ from each other. Specially when in a casual game the player does not feel like reading text right?

So instead of showing text messages and relying that the user will read them and interpret each one, now the game decides what is probably the best scene to be launched.

For instance, if you have selected a new track, then the game automatically starts a time trial on that track, instead of going to the main menu and doing nothing until the user chooses “time trial” or “ranked race”.

This menu logic has been changed thanks to the players feedback!