WiFi in DS Game Maker

Show us what you're making.

WiFi in DS Game Maker

Postby WillWill56 » September 18th, 2011, 2:41 pm

This topic will (hopefully) hold various discussions and demos regarding JanMulder's and my progress on integrating online multiplayer into games made with DS Game Maker.

At the time of posting, there isn't a great deal to report to most of you. WiFi is still in its early stages, but a few first steps have been taken.

JanMulder did a lot of work on WiFi in the Ni-Fi help topic (NiFi stands for Nintendo WiFi, I just found out), but he has taken a break from working on his WiFi system, and I haven't heard of his progress since.

I've only recently finished obsessing over some server code for the DS, and have a little demo that works nicely and stably. I haven't got any client code done yet, I hope to complete that sometime next week.

My demo allows you to telnet to your DS on port 3746 and type text, which will appear on the DS's screen (backspace and enter work). Tapping the touchscreen will send text back to your computer telling you the location you touched (there's an odd delay DS -> PC if you hold it down, but not PC -> DS, oddly).

To use it you'll have to memorise your DS's IP address (I forgot to display it :oops: ), but if you know what telnet is, you'll hopefully be able to work it out (To those who know: the DHCP lease should last long enough for you to check in another homebrew program beforehand e.g. CLIRC, or you'll know the static IP if you set one).

Stay tuned for more info! (and find my demo attached below)
Attachments
WiFiTest2.nds
(354.56 KiB) Downloaded 450 times
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby JanMulder » September 18th, 2011, 4:21 pm

No real progress on my side indeed. It's just the receiving being slow and the connecting that only works sometimes. It is possible to send and receive data, but it's too slow to be done without lag.

Tell me when you have time, Will, we should be able to get this working.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 18th, 2011, 4:39 pm

A week from now is my school holidays, I'm hoping to get my basic lib finished off quickly, then look into your system, and sort out things like the cause of the delay, having a central server pass information between DSs, and formatting of packets for things like object orientation.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby JanMulder » September 18th, 2011, 4:55 pm

Ok, well, just tell me when you want to have a look at my lib.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: WiFi in DS Game Maker

Postby Sonic The Hedgehog » September 18th, 2011, 6:31 pm

How long have you guys been with DSGM :shock:
Sonic is gone for good as far as I know.
Or is he?
Spoiler: show
Probably
User avatar
Sonic The Hedgehog
 
Posts: 807
Joined: June 22nd, 2011, 12:26 pm
Location: My happy place

Re: WiFi in DS Game Maker

Postby Bobbyloujo » September 18th, 2011, 7:20 pm

Sonic The Hedgehog wrote:How long have you guys been with DSGM :shock:

They've been here for years.
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: WiFi in DS Game Maker

Postby Sonic The Hedgehog » September 18th, 2011, 7:35 pm

Bobbyloujo wrote:
Sonic The Hedgehog wrote:How long have you guys been with DSGM :shock:

They've been here for years.


How long have you been bobby
Sonic is gone for good as far as I know.
Or is he?
Spoiler: show
Probably
User avatar
Sonic The Hedgehog
 
Posts: 807
Joined: June 22nd, 2011, 12:26 pm
Location: My happy place

Re: WiFi in DS Game Maker

Postby Bobbyloujo » September 18th, 2011, 7:39 pm

November of '09
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: WiFi in DS Game Maker

Postby JanMulder » September 18th, 2011, 11:16 pm

I haven't been here for so long. I think I joined the forum december 2008 and I really started using the program a year afterwards (at first I didn't like it / I was bad at it).
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 19th, 2011, 7:00 am

I think I joined the forums in Jan/Feb 08, but I never really made any games, I just explored a lot of programming concepts that fascinated me, including WiFi, because I was new to programming. And I got my DSi stolen near the end of '09, so I left the community for a year and a bit (don't know how long that 'bit' was off the top of my head) until I returned just recently.

Update: I'm having fun pouring copious amounts of data into the demo I made and increasing the size of the receive buffer. I think the DS is receiving a megabyte every 10 seconds! Fun!

I may make a demo to actually write that data to file and calculate the write speed of the SD card. Should probably measure the speed of what I'm doing too.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 24th, 2011, 5:40 am

I'm working on the client side of my lib right now, expect to complete some kind of demo in a few hours.
Could be anything from something that just fetches and displays raw HTML from Google to a multiplayer game demo (MPdots?) at this stage.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby memefefe » September 24th, 2011, 6:03 am

I think a multiplayer game would be really freakin sweet! Can't wait to see what you do!
Who doesnt wanna watch a weirdo tumble?
http://kawaiiweirdo.tumblr.com
memefefe
 
Posts: 931
Joined: August 19th, 2011, 3:35 am
Location: The infinite expanses of my mind

Re: WiFi in DS Game Maker

Postby WillWill56 » September 24th, 2011, 1:35 pm

By "a few hours", I may have meant 12 to 24 hours... Anyway I got two DSs to connect to each other and recognise each other (basically just knowing that they're connected). I'm working on some miscellaneous code then I'll probably try to make an MPdots demo.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 24th, 2011, 3:25 pm

After a minor hiccup, I've browsed through the source code of dswifi and noticed that the sockets implementation isn't very extensive. The main problem is, if connect() is called on a socket that is already connected, instead of returning EISCONN to notify that the socket is connected, it will return EINVAL which means invalid argument. Not very helpful, as there is no other method of checking the connection status each frame besides select(), which defeats the purpose of non-blocking.

As a result I'm including some rather raw socket code in my project. As long as it works, I guess it's alright.

EDIT: That doesn't work, building my own modified dswifi lib :P.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby JanMulder » September 24th, 2011, 4:15 pm

So you're not writing a seperate .c file? You're just modifying dswifi?
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 25th, 2011, 4:41 am

I am writing a separate .c file, but the sockets in dswifi aren't strictly made according to the sockets documentation, so I'm modifying that too.

I'm just going to modify connect() to return 0 if it is called on a socket that is already connected, I should probably implement the EISCONN error but I'm too lazy :P.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 25th, 2011, 6:23 am

For the sake of portability and simplicity, I decided against modifying dswifi and found a better method of checking whether a non-blocking connect succeeds, is still in progress, or has failed. Hope to have a demo soon...

EDIT: I have 454 lines of WiFi goodness to test out...
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 25th, 2011, 5:00 pm

Okay, quick update. My basic WiFi lib is finished, and I did have a wonderful little demo completed and compiled in which two DS's connect and if you move a little dot on one DS, it moves on the other DS... I managed to get hold of a DSi and decided to test it myself.
I boot up the demo on my 3DS, everything's fine, then I start the demo on the DSi, and the DSi freezes at a point where the 3DS didn't freeze. Tried several times using various methods and each time the 3DS didn't freeze and the DSi did.
This just shows the annoying "differences" between DSs. I'll sort this out later and might release the demo, but I need to sleep now :P.

Might as well attach the lib for Jan to play with.
WiFi 5.zip
(6.75 KiB) Downloaded 420 times


Update: The DSi no longer freezes as I initialize WiFi a little earlier. Player 2's dot is moving on Player 1's screen (with a little delay of course) but not vice versa, so I'll sleep now, figure that out later.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Re: WiFi in DS Game Maker

Postby JanMulder » September 25th, 2011, 5:52 pm

Will, if I understand this correctly, the DS itself has to be a server. Is that true?
If yes, it hasn't got any use. The user would have to forward a port in is router first etc. That's not what people want.

Maybe the select() on the client side is a good one. I'm not sure of that though.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: WiFi in DS Game Maker

Postby WillWill56 » September 26th, 2011, 8:05 am

The DS server can be replaced by a central PC server if you want. It was just easier for testing to have DSs for both the server and client. This was just a test lib, remember?

However, on the topic of port forwarding, I believe you haven't played Minecraft or Terraria? Both great games that require port forwarding if you want to host a multiplayer game. Not at all hard. However, some people do use Hamachi, which isn't an option for the DS, but on the whole, if you are into homebrew and into multiplayer games, it shouldn't be too hard.

I do admit that having something other than the DS as the server is much more logical, even if users host the server themselves and have to port forward anyway.
WillWill56
 
Posts: 152
Joined: April 15th, 2011, 3:02 pm

Next

Return to Work In Progress

Who is online

Users browsing this forum: No registered users and 1 guest

cron