WiFi in DS Game Maker

Show us what you're making.

Re: WiFi in DS Game Maker

Postby WillWill56 » February 22nd, 2013, 2:49 pm

I've been thinking. To make sure that the whole DSGM community can benefit from this multiplayer library, I may need to write what will most likely be a series of tutorials detailing both how to use the new server I'm programming and how to incorporate multiplayer into a game.

If people want this, I'll be happy to provide (or at least give it my best shot). Of course, I'm still working on the server right now, so the waiting continues.

EDIT: I just thought of an interesting name for the first tutorial:
DSGM Multiplayer Tutorial 01: Two peas in a pod
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby Z-Dragon » February 22nd, 2013, 4:15 pm

Good luck and welcome back Will (if I hadn't already).
Still alive. Still ashamed of my past behavior on these forums.
No, really. I'm sorry.

If you see me, no you don't.
Won't be on here as a participant because I have no games in mind to actively pursue and finish. Busy with multiple roleplays and writing, anyway.



_______________________________________________________________________
Current projects:

The Great and Powerful Text-Based Game
P0rtal DS (In perpetual hiatus until Sonic comes back (probably never))
User avatar
Z-Dragon
 
Posts: 254
Joined: December 23rd, 2011, 10:51 pm
Location: New Brunswick, Canada

Re: WiFi in DS Game Maker

Postby Nobody » February 22nd, 2013, 8:43 pm

WillWill56 wrote:I've been thinking. To make sure that the whole DSGM community can benefit from this multiplayer library, I may need to write what will most likely be a series of tutorials detailing both how to use the new server I'm programming and how to incorporate multiplayer into a game.

If people want this, I'll be happy to provide (or at least give it my best shot). Of course, I'm still working on the server right now, so the waiting continues.

EDIT: I just thought of an interesting name for the first tutorial:
DSGM Multiplayer Tutorial 01: Two peas in a pod

I'm sure the tutorials wouldn't have to be anything really extensive. Multiplayer as far as programming is making a bunch of variables, sending them over the internet, and knowing what to do with them on the other side. I'm sure some of the more advanced DSGM users will understand how to do it
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: WiFi in DS Game Maker

Postby WillWill56 » February 23rd, 2013, 2:04 am

Nobody wrote:I'm sure the tutorials wouldn't have to be anything really extensive. Multiplayer as far as programming is making a bunch of variables, sending them over the internet, and knowing what to do with them on the other side. I'm sure some of the more advanced DSGM users will understand how to do it

Yeah, knowing me they probably weren't going to be extensive to begin with. Thanks for the warm welcome, Z-Dragon. The reason I was thinking some tutorials might be useful is because I remember there was one user who kept asking for a function that could send an entire struct. In terms of network programming, that's fairly difficult, and would cause all sorts of problems even if the function knew the size of the struct. To quote Beej's Guide to Network Programming:

Beej wrote:Another question you might have is how do you pack structs? Unfortunately for you, the compiler is free to put padding all over the place in a struct, and that means you can't portably send the whole thing over the wire in one chunk. (Aren't you getting sick of hearing "can't do this", "can't do that"? Sorry! To quote a friend, "Whenever anything goes wrong, I always blame Microsoft." This one might not be Microsoft's fault, admittedly, but my friend's statement is completely true.)

Back to it: the best way to send the struct over the wire is to pack each field independently and then unpack them into the struct when they arrive on the other side.

That's a lot of work, is what you're thinking. Yes, it is. One thing you can do is write a helper function to help pack the data for you. It'll be fun! Really!
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby Nobody » February 23rd, 2013, 2:16 am

How do you plan on making your wifi lib? I never looked at the original example you posted. Did you make DSGM actions for your lib or is it all just functions/vars included in headers and libs?
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: WiFi in DS Game Maker

Postby WillWill56 » February 23rd, 2013, 2:49 am

It's kind of both. Include a library, and then use the custom DSGM actions to use the library.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » February 23rd, 2013, 2:23 pm

I'm getting close to a working beta, all the data stuff is done and dusted and I've got plenty of the network part planned out.

I'll create a bare-bones server and let you know when that's done, then anyone who wants to try it out can do so, assuming it works with the old DS WiFi lib (which it should, but if not, a quick rewrite will do the trick). I'll document how it works, of course, so you can actually test out all the new features of the server.

Once I've seen how the server works and tried it out myself, I'll rewrite the networking part of the server, make it more modular and simple, and add and tweak the features.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby Nobody » February 23rd, 2013, 5:15 pm

How does it currently work? I'm assuming if it's a universal server for all the games that at some point in time, each game needs to create a profile. Would there be an action to create this or would we have to contact you to set up the profile?
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: WiFi in DS Game Maker

Postby BLsquared » February 23rd, 2013, 7:06 pm

Welcome back, Will!
You may call me BLsquared, Commodore, or TexasBatman. Preferably BLsquared.
My avatar was made by this guy: http://christianmanga.com/smf/index.php ... bum;in=374

"Every puzzle has an answer." - Professor Layton
"In war, there is indeed no substitute for victory." - Douglas MacArthur
"Love and Peace!" - Vash the Stampede
"It's High Noon!" - McCree
Member of Memefefe's Squad
User avatar
BLsquared
 
Posts: 997
Joined: August 10th, 2011, 4:39 pm
Location: United States of America

Re: WiFi in DS Game Maker

Postby WillWill56 » February 24th, 2013, 7:34 am

The way I'm (hoping) it will work, you will probably contact me to have a game category created, but all you will really need to give me is the name, and I will give you the GID of your game category (basically the number of your game category, nothing special). As for the communications between the DS's, I've gone for a bit of a one-size-fits all approach.

To communicate with the server, you send packets with 3 things; a destination UID, the size of the data being sent, and the data. The UID and size are unsigned integers, so the packet will be 4 + 4 + x bytes in size if you want to send x bytes (you put x in the size field, not 4 + 4 + x).

For an example of the process to set up a multiplayer game, it would start when the DS connects, gives the server its username, asks the server to join a game category by referencing its name or GID, then creates or joins a game room (can be at the request of the user playing the game, or hard coded if e.g. you're testing out the server). These commands would all be sent to the user with a UID of 0 (or 0x00000000), the "server user", using a specific protocol within the data field. To create a game room, you specify the name and user limit of the room, and you would be listed as the owner of that room.

Once a number of users have joined your game room (or just one user other than the owner, but more users is easier for this demonstration), the users in the game room can send data to the special UID of 0xFFFFFFFF. If the owner sends data to this address, it is sent to all of the users in the game room they own except for the owner. Any other user sending data to this address has it sent to the owner of the game room they are in. This allows the owner of the game room to act a bit like a server, but without port forwarding and other difficult things.

If the owner needs to communicate with the other users in the game room individually, you can request a list of the users in your game room along with their UIDs, and then send data directly to those UIDs as necessary. When receiving a packet, rather than the destination UID (which would be your UID), you will receive the sender's UID in its place, although in the aforementioned special case it will still be 0xFFFFFFFF, indicating the packet originated from the game room you are in. This can also be used to communicate with users outside of game rooms, by requesting a list of users in the current game category or entire server, or searching for a user by their username. In the bare bones beta server, you probably won't be able to use any of these user listing/finding functions, but if you know your friends UID, you can communicate directly that way, although your UID can change whenever you disconnect and reconnect.

There are a lot more things I haven't covered here, like the possibility of the server user sending you messages when users join and leave your game room, but it's still a work in progress.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby Nobody » February 25th, 2013, 2:17 am

Minus some of the technical sides of servers I don't really know, this seems fairly simple to operate. I'll be looking forward to it. Now only if I could make a game with DSGM that DOESN'T glitch.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: WiFi in DS Game Maker

Postby BLsquared » February 25th, 2013, 6:07 pm

I know, right?!
Anyways, sounds good, Will.
You may call me BLsquared, Commodore, or TexasBatman. Preferably BLsquared.
My avatar was made by this guy: http://christianmanga.com/smf/index.php ... bum;in=374

"Every puzzle has an answer." - Professor Layton
"In war, there is indeed no substitute for victory." - Douglas MacArthur
"Love and Peace!" - Vash the Stampede
"It's High Noon!" - McCree
Member of Memefefe's Squad
User avatar
BLsquared
 
Posts: 997
Joined: August 10th, 2011, 4:39 pm
Location: United States of America

Re: WiFi in DS Game Maker

Postby Z-Dragon » February 25th, 2013, 9:16 pm

Once again, good luck!
Still alive. Still ashamed of my past behavior on these forums.
No, really. I'm sorry.

If you see me, no you don't.
Won't be on here as a participant because I have no games in mind to actively pursue and finish. Busy with multiple roleplays and writing, anyway.



_______________________________________________________________________
Current projects:

The Great and Powerful Text-Based Game
P0rtal DS (In perpetual hiatus until Sonic comes back (probably never))
User avatar
Z-Dragon
 
Posts: 254
Joined: December 23rd, 2011, 10:51 pm
Location: New Brunswick, Canada

Re: WiFi in DS Game Maker

Postby Buck_7 » February 26th, 2013, 12:04 am

Nobody wrote:Minus some of the technical sides of servers I don't really know, this seems fairly simple to operate. I'll be looking forward to it. Now only if I could make a game with DSGM that DOESN'T glitch.


What do you mean by that? I think glitching has more to do with how you code things...
User avatar
Buck_7
 
Posts: 1460
Joined: February 19th, 2011, 1:44 am

Re: WiFi in DS Game Maker

Postby Nobody » February 26th, 2013, 12:16 am

to an extent, yes. PAlib though is a very glitchy library which makes making a not so glitchy game even harder
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: WiFi in DS Game Maker

Postby WillWill56 » March 5th, 2013, 4:07 am

Just thought I'd let you know here, seeing as the off topic section is yet to be replaced, that I have started my uni course. And I have classes 5 days a week. Of those days, 4 of them have classes starting 8:30 am. Of those days, 2 of them have classes finishing 7:30 pm. So work on the multiplayer server is going to be slower than I had hoped, at least for now.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby Nobody » March 5th, 2013, 4:17 am

that's ok, we can wait a bit. I'm in no rush. I'm pretty busy myself to work on DSGM projects
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: WiFi in DS Game Maker

Postby BLsquared » March 6th, 2013, 6:09 pm

Just take your time; we're not going anywhere.
You may call me BLsquared, Commodore, or TexasBatman. Preferably BLsquared.
My avatar was made by this guy: http://christianmanga.com/smf/index.php ... bum;in=374

"Every puzzle has an answer." - Professor Layton
"In war, there is indeed no substitute for victory." - Douglas MacArthur
"Love and Peace!" - Vash the Stampede
"It's High Noon!" - McCree
Member of Memefefe's Squad
User avatar
BLsquared
 
Posts: 997
Joined: August 10th, 2011, 4:39 pm
Location: United States of America

Re: WiFi in DS Game Maker

Postby Nobody » May 21st, 2013, 6:22 am

WillWill56 wrote:Just thought I'd let you know here, seeing as the off topic section is yet to be replaced, that I have started my uni course. And I have classes 5 days a week. Of those days, 4 of them have classes starting 8:30 am. Of those days, 2 of them have classes finishing 7:30 pm. So work on the multiplayer server is going to be slower than I had hoped, at least for now.

have you gotten any more work done on this yet? I'd really love to see this fully functional
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: WiFi in DS Game Maker

Postby WillWill56 » June 20th, 2013, 4:06 pm

My mid-year exams were about a week ago, and I'm still a little tired, but hopefully I'll get some work done on the server tomorrow.

I still need to work out a good format for server requests & responses, implement it, and then finish off the main code that ties everything together.

And if I ever get that finished, I might work on a single player game. Just for something completely different. Although I'll probably just make a working multiplayer game example instead, since that's much more important...
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

PreviousNext

Return to Work In Progress

Who is online

Users browsing this forum: No registered users and 1 guest

cron