OUR OFFICIAL WEBSITE: https://dsgamemaker.online - ONLINE


WARNING! YOU WILL BE BANNED WITHOUT WARNING PERMENANTLY FOR SPAMMING THE FORUM WITH NON-DSGM RELATED TOPICS & POSTS! - FULLY ENFORCED!!!

NOTICE: ALL members that have NOT logged in once since their activation within 5 days have been and will be deleted!!! LAST UPDATED: 5-1-2022

NOTICE: I will NOT be sending anymore emails confirming your account being activated.. Try to log in and see if your account was activated yet..

ALL accounts MUST be Admin activated due to the server we are on! - More info in the announcements section

Please read announcements section of the forum upon logging in to stay up to date

Side note: Just a reminder, 4.9 and 5.12 are 2 totally different programs. You cannot use 1 app to load projects from the other.

Best Way to Implement Multiplayer?

Discussions and support SPECIFICALLY for version 5.12 only
Post Reply
Mr Coconut
Newly Registered
Newly Registered
Posts: 2
Joined: Wed Sep 09, 2020 11:34 pm

Best Way to Implement Multiplayer?

Post by Mr Coconut »

Hi everyone,

What would you suggest is the best way to implement local play? (And wifi as well, if possible)

Thanks a lot!
User avatar
Ruffsta
Site Admin
Site Admin
Posts: 170
Joined: Fri May 22, 2020 6:21 am

Re: Best Way to Implement Multiplayer?

Post by Ruffsta »

i am strictly a 4.9 user.. so either James or DigitatalDesignDude - (DDD is strictly a 5.12 user) - could answer you better.. i did message James to respond to this... i don't know when or IF he will.. but maybe DDD will?
DS Games:
BananaCraze / MasterMind / Rock,Paper, Scissors

*strictly a 4.9 user
User avatar
DigitalDesignDude
Appreciated Member
Appreciated Member
Posts: 84
Joined: Sun Aug 16, 2020 6:02 am

Re: Best Way to Implement Multiplayer?

Post by DigitalDesignDude »

Welcome to the forum Mr. Coconut :)

Wish I could be of more help but I never attempted any sort of multiplayer implementation before.

Some of the more experienced Ds game maker users are on gbatemp still so you might get an answer there.

I believe not all the old users are aware of this new forum and fansite yet.

https://gbatemp.net/categories/nintendo ... ssions.37/
Multimedia Developer & Designer and Former DSGM 5.12 User

Created DS Games: BioDie, Fishing the Deep

Email notifications not currently supported on this forum.
imadedsgamemaker
Site Admin
Site Admin
Posts: 15
Joined: Thu May 28, 2020 7:06 pm

Re: Best Way to Implement Multiplayer?

Post by imadedsgamemaker »

"Local play" here seems to mean "Download play". I only used it once in my life. I googled "devkitpro devkitarm download play" and found this: https://devkitpro.org/viewtopic.php?f=23&t=1686&p=3920

TLDR - I don't think it's possible. However, anecdotally, I do remember someone getting it working - but this is just a distant memory, and they may have implemented it over WiFi instead.

What I can talk a bit more about is WiFi. Trigger warning: you are going to need to be able to write C to get anywhere with this, and not trivial C. Whilst devkitARM supports the "internet stack" on the DS it does not give you any nice "high level" HTTP functions; for example, there isn't a nice "get the stuff at this URL" function. PAlib does try to make that possible here: https://sites.google.com/site/palibwiki ... als/day-20

But I wouldn't trust the PAlib wifi code as far as I could throw it. The best thing to do is to get into the PAlib source code and see what they are trying to do in those functions. Check out also "dsgmLib" (not related to DS Game Maker formally in any way) which has some WiFi functions and may have a WiFi example: https://github.com/CTurt/dsgmLib/tree/master/source

My high level advice would be this: make a decent, low latency http server that can manage game state (eg via a username), then have each DS join a game. Each DS could talk to each DS over LAN, but they would have to be on the same LAN (192.168.1.x, typically) and have to know each others' LAN IP address, which probably sucks for your players. Anyway, then go and learn how http requests are made as "plain text" (headers, content-length header, then the payload). My guess is that the PAlib functions assemble that HTTP "plain text" (headers + payload for you). If you send JSON back from your http server you will have to find a way to "parse" that on the DS as well. I don't think anybody in the world has ever parsed JSON on a DS, but there are definitely C libraries that will do that, but it will be difficult to compile them for the DS, and, probably painful to get it working in DSGM as well. So probably best to send some plain text back that's easy to parse eg "1,2,3" - then split that string into numbers, and convert to integers using C function 'atoi'.

In terms of building that http server, I'd recommend building it with node.js since it's super low latency, and deploy it on a digitalocean droplet, or on your own PC, then get the DS to talk to its LAN IP. You could make that server running locally availably globally without deploying to the cloud (digitalocean) through a free ngrok tunnel, but you would have to have your computer on all the time.

Finally, no clue how well the DS will deal with "new" https/ssl certificates, so best to run the whole thing over http rather than https. It will definitely make it quicker.
Mr Coconut
Newly Registered
Newly Registered
Posts: 2
Joined: Wed Sep 09, 2020 11:34 pm

Re: Best Way to Implement Multiplayer?

Post by Mr Coconut »

Thank you everyone for all the help!
Most likely I'll go with wifi over local play (be it ds download or having two cards), as that seems simplest. Local servers will do fine for what I'm thinking of, so I'll begin reading up and experimenting with wifi connectivity on the DS.

Thanks again!
Post Reply