Sponsors





Top Zune Sites
Microsoft Zune Player Top Site List
Top Zune Sites
Zune Cards

Go Back   Zune Boards > Zune Discussions > Zune Games > Development Discussions

Register Zunecentive FAQ Members List Calendar Search Today's Posts Mark Forums Read

Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related.

Reply
 
LinkBack Thread Tools
Old 05-09-2008, 02:38 PM   #1 (permalink)
Squirt
 
Join Date: May 2008
Posts: 12
Reputation: 24
$zB: 11
Donate
Default Zune Multiplayer Stuff

Ok, so I am definitely on board with games for Zune and hoping this thing really takes off.

The killer feature will definitely be multiplayer here. I really want to develop some multiplayer apps to carry the Social to an all new level.

The only thing is, all of the current multiplayer code is for Windows and Xbox. Does anyone have any pointers as to where I could start to see how multiplayer works on the Zunes?

Working sample code would be awesome if there is any out there.

Thanks,

- ionman



ionman is offline   Reply With Quote
Remove Advertisements Sponsored Links
Advertisement
 
Old 05-09-2008, 02:42 PM   #2 (permalink)
Experienced Zuner
 
collver's Avatar
 
Join Date: Sep 2007
Location: some where left of the right
Posts: 120
Reputation: 14
Send a message via MSN to collver
$zB: 95
Donate
Default

is there nothing in the documentation as to how you would take advantage of the wireless in game dev?
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
Noob Patrol : Locked and Loaded

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



collver is offline   Reply With Quote
Old 05-10-2008, 04:05 AM   #3 (permalink)
Squirt
 
Join Date: May 2008
Posts: 12
Reputation: 24
$zB: 11
Donate
Default

There really isn't. I only found one page of stuff on the Zune in the MSDN docs that come with the new version. All of the multiplayer docs are currently for Xbox and PC, which include stuff that the Zune doesn't have, I am pretty sure.



ionman is offline   Reply With Quote
Old 05-10-2008, 07:56 AM   #4 (permalink)
Administrator
Ultimate Zuner
 
Join Date: Jul 2006
Location: Irvine, CA
Posts: 5,720
Reputation: 177
$zB: 1776
Donate
Default

Doesn't seem like anyone from anywhere knows yet. Perhaps Microsoft will release the info soon.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



lpxxfaintxx is offline   Reply With Quote
Old 05-10-2008, 09:30 AM   #5 (permalink)
Experienced Zuner
 
Join Date: Feb 2008
Posts: 172
Reputation: 4
$zB: 6
Donate
Default

Maybe in a couple weeks



Nathaniel is offline   Reply With Quote
Old 05-10-2008, 06:48 PM   #6 (permalink)
Support Team
Experienced Zuner
 
Join Date: Oct 2007
Location: Albuquerque, NM
Posts: 237
Reputation: 28
$zB: 87
Donate
Default

i don't believe that the networking stuff was added into the CTP version. I think we might have to wait until the next release
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

thanks to
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
for the sig

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




Bman22 is offline   Reply With Quote
Old 05-11-2008, 01:54 PM   #7 (permalink)
Squirt
 
Join Date: May 2008
Posts: 17
Reputation: 20
$zB: 9
Donate
Default

I've started writing a small multiplayer game and I've managed to get 2 Zunes connecting through XNA. Actually it's quite easy using the XNA, I used System Link as the type of connection.

It's quite unreliable at this point (e.g. it crashes many times when trying to join, in some cases I have to restart the game on both zunes to make it work). I don't know if that's because I'm doing something wrong or if there are some issues in the CTP.



Adrian Vinca is offline   Reply With Quote
Old 05-11-2008, 05:53 PM   #8 (permalink)
Squirt
 
Join Date: May 2008
Posts: 12
Reputation: 24
$zB: 11
Donate
Default

Would you mind sharing the source code that connects the two devices, or explaining how you did it? Thanks!



ionman is offline   Reply With Quote
Old 05-12-2008, 02:18 AM   #9 (permalink)
Squirt
 
Join Date: May 2008
Posts: 17
Reputation: 20
$zB: 9
Donate
Default

Here it is.

This is my first attempt to write any networking code using XNA so please take it with a grain of salt. My code is quite unreliable at this point (e.g. connect than disconnect than try to connect again throws exception - the only solution I found so far is to restart both zunes). But, if the stars are properly aligned, it will get the 2 zunes connected. If they don't connect, restart both zunes and try again.

I don't have any code to send any data between the 2 zunes.

Instructions:
- Deploy the code on both zunes (you need to make the Zune active in the Device center).
- Launch the application on both zune
- 1st zune (host): Press Up on DPad so that it hosts the game. The background will turn blue and the Zune will start hosting a game
- 2nd zune (client): Press Down on DPad so that it tries to join an existing game. The background will turn red and the Zune will stat looking for a game. If it finds one, it will try to connect to the first one it finds.

If everything worked fine, the 1st zune should say "Player joined".

http://cid-a912b1c0a524f973.skydrive.../TicTacToe.zip

Hope this helps! I can't wait to play multiplayer games on the zune!
Adrian



Adrian Vinca is offline   Reply With Quote
Old 05-12-2008, 05:05 AM   #10 (permalink)
Squirt
 
Join Date: May 2008
Posts: 12
Reputation: 24
$zB: 11
Donate
Default

Sweet. Thank you so much. I will try it out later today or tomorrow and see if I get anywhere with it.

- ionman



ionman is offline   Reply With Quote
Old 05-12-2008, 12:34 PM   #11 (permalink)
zB Programmer
Experienced Zuner
 
Join Date: Nov 2007
Posts: 100
Reputation: 31
$zB: 88
Donate
Default

wow! nice. I've been searching everywhere to try to figure out how to do this.



MarcusMaximus is offline   Reply With Quote
Old 05-13-2008, 02:26 PM   #12 (permalink)
Zuner
 
Join Date: May 2008
Posts: 63
Reputation: 11
$zB: 25
Donate
Default

Awesome. I've been using this as my base code for multiplay; Man, this stuff is confusing! From my understanding, there is no way for the server to simply say
player2.get(xPosition);
//based on xPosition, modify game's screen
drawScreen(this, player2)

Man, that would be nice... Someone prove me wrong!



amoo3 is offline   Reply With Quote
Old 05-13-2008, 02:56 PM   #13 (permalink)
zB Programmer
Experienced Zuner
 
Join Date: Nov 2007
Posts: 100
Reputation: 31
$zB: 88
Donate
Default

Umm you can't do that but I'm pretty sure you can have player2 send a packet with their x position and have player1 receive it and then use it.



MarcusMaximus is offline   Reply With Quote
Old 05-13-2008, 03:04 PM   #14 (permalink)
Zuner
 
Join Date: May 2008
Posts: 63
Reputation: 11
$zB: 25
Donate
Default

I've been trying to do that, but apparently the NetworkGamer class, unlike the LocalNetworkGamer class, does not have a sendData() method.



amoo3 is offline   Reply With Quote
Old 05-13-2008, 03:18 PM   #15 (permalink)
Squirt
 
Join Date: May 2008
Posts: 12
Reputation: 24
$zB: 11
Donate
Default

Quote:
Originally Posted by amoo3 View Post
I've been trying to do that, but apparently the NetworkGamer class, unlike the LocalNetworkGamer class, does not have a sendData() method.
I think I have almost completed some code that will send data back and forth. I will post as soon as I have a working example.

Thanks!

- ionman



ionman is offline   Reply With Quote
Old 05-13-2008, 04:14 PM   #16 (permalink)
Zuner
 
Join Date: May 2008
Posts: 63
Reputation: 11
$zB: 25
Donate
Default

Awesome, that would great. A friend of mine made a sweet game that I was planning on adding network support and porting the Zune. It'd be a huge help to have some real code to go off of. Microsoft's documentation really sucks.



amoo3 is offline   Reply With Quote
Old 05-13-2008, 05:57 PM   #17 (permalink)
Squirt
 
Join Date: May 2008
Posts: 12
Reputation: 24
$zB: 11
Donate
Default

Ok. I got it!

Download the Sample

Here is a working example that is pretty simple but does the job. Just launch the app, and if you are lucky enough to have more than one Zune to play with, launch it on the other one a few seconds later, and they will automatically connect.

Pressing the D-Pad will send a string with the Gamertag of the user that clicked the pad, and the direction they clicked. Just a simple illustration; you would want to do it a bit differently in a game.

The code is based primarily off of Adrian Vinca's example posted above, the tank example on the XNA site, some coffee and some of my gray matter.

Please feel free to look through this code, adapt it to your needs, use it in your games etc. Also, if someone finds mistakes or better ways of doing things, please let me know!

Enjoy!

- ionman



ionman is offline   Reply With Quote
Old 05-13-2008, 06:00 PM   #18 (permalink)
Support Team
Expert Zuner
 
soccerfreak24's Avatar
 
Join Date: Nov 2007
Posts: 2,520
Reputation: 123
$zB: 2496
Donate
Default

Quote:
Originally Posted by ionman View Post
Ok. I got it!

Download the Sample

Here is a working example that is pretty simple but does the job. Just launch the app, and if you are lucky enough to have more than one Zune to play with, launch it on the other one a few seconds later, and they will automatically connect.

Pressing the D-Pad will send a string with the Gamertag of the user that clicked the pad, and the direction they clicked. Just a simple illustration; you would want to do it a bit differently in a game.

The code is based primarily off of Adrian Vinca's example posted above, the tank example on the XNA site, some coffee and some of my gray matter.

Please feel free to look through this code, adapt it to your needs, use it in your games etc. Also, if someone finds mistakes or better ways of doing things, please let me know!

Enjoy!

- ionman
Good work! +rep.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




soccerfreak24 is offline   Reply With Quote
Old 05-13-2008, 06:10 PM   #19 (permalink)
Developper
zB Programmer
Experienced Zuner
 
Khao's Avatar
 
Join Date: May 2008
Location: Québec, Canada!
Posts: 104
Reputation: 25
$zB: 89
Donate
Default

AWESOME MAN! I love you! I will try to port it to pong as soon as I can (exams suck) +rep



Khao is offline   Reply With Quote
Old 05-13-2008, 06:29 PM   #20 (permalink)
Squirt
 
Join Date: May 2008
Posts: 12
Reputation: 24
$zB: 11
Donate
Default

Happy to help!

As a side note, that code is configured to allow up to 8 Zunes to connect. I have tested it with up to 3 at a time and it worked just fine.

- ionman



ionman is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -8. The time now is 05:44 PM.

 
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC8
<