Forum Showroom Unity + PlayerIO Car tutorial (Source included)

Show your interesting finds or creations off here.

Unity + PlayerIO Car tutorial (Source included)

Postby fox1980 » September 30th, 2010, 2:37 pm

I took the amazing Unity Car Tutorial from this page http://unity3d.com/support/resources/tu ... orial.html and added PlayerIO multiplayer support.
It wasn't as straightforward as i tough, but wasn't too difficult either (i only started using Unity this weekend). Since it's hard for me to test it cause i only have 1 computer, i've uploaded the compiled game so you can download and test it, and hopefully leave some feedback. If there are no major bugs i'll release the complete Unity project source.

You can download the client here : http://www.seines.pt/downloads/carclient.rar

Image

It's not meant to be a complete multiplayer game, i simply added the possibility to see other players cars and bump into them. I also added some checkpoints and laptime, since it wasn't in the original tutorial. Your best lap times won't be saved tough when you exit the game.


SOURCES

C# Server Project : http://www.seines.pt/downloads/server_source.rar
Unity 2.6.1 Project source : http://www.seines.pt/downloads/cartutorial_source.rar

In the Unity project you need to open Assets\Pro Standard Assets\Player.IO Client .NET\PIONetwork.cs, find these lines:

Code: Select all
client = PlayerIO.Connect(
"put_your_game_id_here", // Game id (Get your own at playerio.com. 1: Create user, 2:Goto admin pannel, 3:Create game, 4: Copy game id inside the "")
"public", // The id of the connection, as given in the settings section of the admin panel. By default, a connection with id='public' is created on all games.
userid, // The id of the user connecting. This can be any string you like. For instance, it might be "fb10239" if you´re building a Facebook app and the user connecting has id 10239
null // If the connection identified by the connection id only accepts authenticated requests, the auth value generated based on UserId is added here
);


and change "put_your_game_id_here" to the game id PlayerIO assigned to your game.

The Unity project is not compatible yet with version 3 wich has been recently released. If you want the link to download 2.6.1 here it is: http://download.unity3d.com/download_un ... -2.6.1.exe
Last edited by fox1980 on October 1st, 2010, 6:17 pm, edited 2 times in total.
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm

Re: Unity + PlayerIO Car tutorial

Postby Oliver » October 1st, 2010, 1:46 pm

Dude... That... is..... AWESOME!!!!!!!!!!!!!!!
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Unity + PlayerIO Car tutorial

Postby -Mani » October 1st, 2010, 2:29 pm

sweeeet!
really awesome!!
-Mani
Paid Member
 
Posts: 83
Joined: April 11th, 2010, 6:13 pm

Re: Unity + PlayerIO Car tutorial (Source included)

Postby fox1980 » October 1st, 2010, 6:20 pm

After a little more testing i found no major errors, so i'm releasing the full source code as promised. I updated the first post on this thread with the source code links. Hope this is useful to someone.
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm

Re: Unity + PlayerIO Car tutorial (Source included)

Postby Benjaminsen » October 4th, 2010, 10:30 am

It's really cool, with a bit of extra interpolation, a mini-map, a ranking system and a win / loose system that could be a quite popular game.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Unity + PlayerIO Car tutorial (Source included)

Postby fox1980 » October 4th, 2010, 2:22 pm

I'm not sure if i'm even going to make a car game. I just wanted to try Unity with PlayerIO and decided to share this since there are no Unity examples.
What makes PlayerIO with Unity a bit harder than other platforms, is that Unity executes PlayerIO event handlers in a different thread, so you can't access gameobjects inside onmessage for example. I had to implement a message queue system for it to work, it's all in the PIONetwork.cs script, tough it's not heavily commented it should be easy to understand.
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm

Re: Unity + PlayerIO Car tutorial (Source included)

Postby Soldierghetto » November 28th, 2010, 4:08 am

I don't know if this is late... But...
Which .dll do I upload to Playerio?
Soldierghetto
 
Posts: 1
Joined: November 28th, 2010, 3:12 am

Re: Unity + PlayerIO Car tutorial (Source included)

Postby Benjaminsen » November 29th, 2010, 11:57 am

Soldierghetto wrote:I don't know if this is late... But...
Which .dll do I upload to Playerio?


You upload the DLL that the development server runs. The one found in http://www.seines.pt/downloads/server_source.rar
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Unity + PlayerIO Car tutorial (Source included)

Postby fox1980 » November 29th, 2010, 1:16 pm

You have to download the C# project Benjaminsen linked and then compile it. The dll will then be saved to the "output" folder. If it doesn't exist you have to manually create it, some zip programs don't create folders when they're empty.

Anyway, if you want to wait a bit more, i'm working on a new version compatible with Unity 3.0 and upwards that fixes some bugs and handles collision and interpolation much nicely.
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm

Re: Unity + PlayerIO Car tutorial (Source included)

Postby Septem » April 13th, 2011, 4:24 pm

Page Not Found
Any chances to download sources?
Septem
 
Posts: 1
Joined: March 21st, 2011, 9:51 am

Re: Unity + PlayerIO Car tutorial (Source included)

Postby LanceJZ » April 3rd, 2012, 9:26 am

Is this going to get updated? It has been two years sense the last post, I'm interested in this, but it needs updating. I hope it is not dead.
Thank you for your time.
LanceJZ
 
Posts: 1
Joined: April 3rd, 2012, 9:25 am

Re: Unity + PlayerIO Car tutorial (Source included)

Postby prsolucoes » September 21st, 2012, 5:13 am

I need it too :(
prsolucoes
 
Posts: 47
Joined: March 18th, 2010, 3:20 pm

Re: Unity + PlayerIO Car tutorial (Source included)

Postby daymont87 » February 8th, 2013, 8:11 pm

Upload it please, links not working((
daymont87
 
Posts: 5
Joined: February 2nd, 2013, 6:39 pm

Re: Unity + PlayerIO Car tutorial (Source included)

Postby vizgl » June 29th, 2015, 8:03 pm

Does somebody has this sources???
vizgl
 
Posts: 3
Joined: September 25th, 2014, 5:11 pm


Return to Showroom



cron