gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Multiplayer?

#165655 - afireohno - Fri Jan 02, 2009 3:56 am

Is it possible to make a multiplayer homebrew game for the ds?
From what I've read WMB won't work. Is this correct? If so, is there other ways to implement multiplayer? If anyone could point me in the right direction I would appreciate it.

#165657 - nanou - Fri Jan 02, 2009 4:51 am

There's liblobby and dswifi.
_________________
- nanou

#165659 - Lynx - Fri Jan 02, 2009 5:05 am

Quote:
From what I've read WMB won't work.


Well, the receiving DS would need to have FlashMe installed to bypass the RSA checks of the downloaded game/app.
_________________
NDS Homebrew Roms & Reviews

#165661 - chatterbug89 - Fri Jan 02, 2009 7:35 am

Lynx wrote:
Quote:
From what I've read WMB won't work.


Well, the receiving DS would need to have FlashMe installed to bypass the RSA checks of the downloaded game/app.


Well, if you had the game completely loaded into RAM, couldn't they load it on their DS, remove the cartridge, then load on the other person's DS? Guess it's not the most elegant "solution" though....

#165665 - afireohno - Fri Jan 02, 2009 11:07 am

chatterbug89 wrote:
Lynx wrote:
Quote:
From what I've read WMB won't work.


Well, the receiving DS would need to have FlashMe installed to bypass the RSA checks of the downloaded game/app.


Well, if you had the game completely loaded into RAM, couldn't they load it on their DS, remove the cartridge, then load on the other person's DS? Guess it's not the most elegant "solution" though....


I have access to multiple ds's with slot 1's, so transferring the actual executable isn't necessary.

#165671 - afireohno - Fri Jan 02, 2009 5:59 pm

nanou wrote:
There's liblobby and dswifi.


I'm having trouble finding information any info on either of these (particularly liblobby). Could someone link me in the right direction.

#165672 - nanou - Fri Jan 02, 2009 7:44 pm

IIRC liblobby is supposedly buggy. I don't really have any good info on it, maybe someone else can help you there.

I haven't really used either of them TBH, but dswifi is available at http://www.devkitpro.org/devkitarm/dswifi-036/. I believe it's documented doxygen style but I can't remember the last time I looked at it. There's also plenty of threads here that explain its use.
_________________
- nanou

#165673 - afireohno - Fri Jan 02, 2009 9:38 pm

nanou wrote:
IIRC liblobby is supposedly buggy. I don't really have any good info on it, maybe someone else can help you there.


Thanks for the help. I was actually able to find some info on liblobby.
http://forum.gbadev.org/viewtopic.php?t=14198
There was just a lot of info to sift through. I'm still pretty confused on how to get it working so if anyone has any other advice I would appreciate it.
Thanks again

EDIT: So I've made some progress, but I'm getting some errors with the examples. I suspect that this is due to them being created prior to the recent libnds release, although if someone could confirm this I would be grateful.
Code:
"make" -C arm7
make[1]: Entering directory `/c/devkitPro/liblobby/roomExampleCopy/arm7'
template.c
arm-eabi-gcc -MMD -MP -MF /c/devkitPro/liblobby/roomExampleCopy/arm7/build/template.d -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/devkitPro/liblobby/roomExampleCopy/arm7/include -I/c/devkitPro/liblobby/roomExampleCopy/arm7/build -I/c/devkitPro/libnds/include -I/c/devkitPro/liblobby/roomExampleCopy/arm7/build -DARM7 -c /c/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c -o template.o
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c: In function 'startSound':
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:13: error: 'SOUND_8BIT' undeclared (first use in this function)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:13: error: (Each undeclared identifier is reported only once
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:13: error: for each function it appears in.)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:13: error: 'SOUND_16BIT' undeclared (first use in this function)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c: In function 'VcountHandler':
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:41: error: too few arguments to function 'touchReadXY'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:43: error: 'touchPosition' has no member named 'x'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:43: error: 'touchPosition' has no member named 'y'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:47: error: 'touchPosition' has no member named 'x'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:48: error: 'touchPosition' has no member named 'y'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:70: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:70: error: 'TransferRegion' has no member named 'mailBusy'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:71: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:72: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:73: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:74: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:75: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:76: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:77: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:77: error: 'TransferRegion' has no member named 'mailBusy'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:80: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c: In function 'VblankHandler':
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:94: error: 'TransferSound' undeclared (first use in this function)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:94: error: 'snd' undeclared (first use in this function)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:94: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:94: error: 'TransferRegion' has no member named 'soundData'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:95: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:95: error: 'TransferRegion' has no member named 'soundData'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c: In function 'main':
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:118: warning: implicit declaration of function 'powerON'
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:120: warning: 'getIPC' is deprecated (declared at c:/devkitPro/libnds/include/nds/ipc.h:64)
c:/devkitPro/liblobby/roomExampleCopy/arm7/source/template.c:120: error: 'TransferRegion' has no member named 'soundData'
make[2]: *** [template.o] Error 1
make[1]: *** [build] Error 2
make[1]: Leaving directory `/c/devkitPro/liblobby/roomExampleCopy/arm7'
"make": *** [arm7/roomExampleCopy.elf] Error 2

#165676 - wintermute - Sat Jan 03, 2009 12:56 am

liblobby will no longer compile with the latest toolchain & libs. It didn't work particularly well even when it did compile either.

Currently the best way to implement multiplayer is with a server/client model via an access point. This may change when Sgstair sorts out the new dswifi lib.

dswifi is mostly fairly standard Berkeley sockets with the exception of initialisation. Have a look at some of the supplied dswifi examples distributed with the nds example set.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#165916 - TwentySeven - Tue Jan 13, 2009 12:14 am

The dswifi's tcp socket implementation isn't very good.

The udp works fine, however.

#165922 - wintermute - Tue Jan 13, 2009 2:32 am

Care to elaborate?

It's kind of difficult to improve with feedback like "not very good" :p
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#165925 - TwentySeven - Tue Jan 13, 2009 3:09 am

I figure its a moot point because theres a new version in (extended) development. =D *poke poke*

You can't use the TCP sockets as is for reliable streaming. Blob transfer yes, streaming no.

If you were building a realtime game network protocol, like say an RTS, you'd need the streaming.

As for the actual issue:

The streaming is frequently interrupted by long pauses even for low bandwidth transmissions. This is apparently related to the multiple ACK spam thats been reported on these forums a few times now (along with the reply of "Wait for the rewrite!").

Some routers handle it fine, but some, like those crappy nintendo wifi-router-on-a-stick, tend to curl up and die from it.

Does that cover it?

#165927 - sgstair - Tue Jan 13, 2009 8:42 am

Yes, preparations for getting the next wifilib written are already in progress :)

to clarify: streaming is great with low-ping servers. The problem arises from the low TCP window size, which I'm not really keen on increasing without support for packet reordering - the lib is based on a few bad assumptions ;)
About the ACK retransmission thing, a lot of the time, the ACK isn't ack'd by the wireless router, and so the DS retransmits... I haven't worked out this problem yet, but I don't think it's actually the TCP stack's fault. And yes, it should go away in the rewrite, as so many other things will :P
_________________
http://blog.akkit.org/ - http://www.akkit.org/dswifi/

#165929 - TwentySeven - Tue Jan 13, 2009 11:29 am

Glad to hear its well under way.

Can I rub your feet or something to make it happen faster? ;)

#165931 - sgstair - Tue Jan 13, 2009 5:13 pm

If only it were that easy ;)

I'll probably find a good way to demonstrate progress, but not quite sure how yet. Basicly I'm re-reverse-engineering the hardware, I want to get a much better understanding of it.
It'll take a while, but not as long as it did initially.
_________________
http://blog.akkit.org/ - http://www.akkit.org/dswifi/