palib-dev.com
September 09, 2010, 09:52:29 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to PAlib-dev's user community. If you need help, be sure to Search before you post, as your question may already have been answered!
 
   Home   Help Search Login Register  
Pages: 1 [2]   Go Down
  Print  
Author Topic: IT - a Multi Player/Multi DS game  (Read 701 times)
ppiimm123
Full Member
***
Offline Offline

Gender: Male
Posts: 170



View Profile WWW
« Reply #15 on: July 28, 2010, 12:27:49 PM »

when i go into debug mode and press y then my ds goes off  Grin
Logged

s_hansse
Full Member
***
Online Online

Gender: Male
Posts: 205



View Profile WWW
« Reply #16 on: July 29, 2010, 12:49:27 AM »

I got it working perfectly now. It is actually really easy. this is how to split the data[4096] (function Handler):
just fill this fill this in under the bytesRead = .....
Code:
int count = 0;
while (count !=  (4096-32)/bytes) {
buffer[count] = data[count*bytes+32];
count++;
}
replace 'buffer' with your receiving buffer and replace bytes with the storage in bytes from the type of buffer you sent.
so if you send a char *, bytes = 1. if you send a unsigned short, bytes = 2.

I do not want to only send a char at a time, but like padnoter does it in his game.
(I used the example code to see, how he does it Cheesy)
He always sends something like this:
Code:
*S*104*456*342*543*0*1
In this line he says first, what has to be done (if I remember right, S was for moving) then the coordinates and at least, the animation of the sprite (this has not to be exactly right).

So I need to split this sting at the *s...
My code at this moment is to go to all the chars and look.
If it's a * go to the next variable to fill, else read this char into a temp variable.
(I believe there has to be sth. better)

when i go into debug mode and press y then my ds goes off  Grin
That's the sence of the y-button Wink
Logged

padnoter
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
« Reply #17 on: July 29, 2010, 02:22:49 PM »

Hi,
Greenacorn site is back up now - that's typical isn't it! away for a few days and it all goes down :-(
Glad you are getting the hang of the code - I uploaded just a very simple example, but as you've seen (from the debug mode in IT), I make strings of different information, send them out and then decode them. You can code it however you like and I'm sure there are 100 other (better?) ways of doing it, but as you've looked, here is the format I use in IT;
*X*I~F~T~L~S
where *X* is the packet identifier type (yes *S* is for sprite information)
I: incrementing packet number (I do some acknowledgment code)
F: ID of sending DS
T: ID of DS to send packet to (or All DSs)
L: Length of the next string
S: String (with the real info in, and I just use a space as marker inside here)
~ is just an end marker

but like I say, best to write your own code to fit the app/game you are doing.... hence the simple example that just shows how to send/receive.

Logged
xiao32
Full Member
***
Offline Offline

Posts: 193


Deo Volente... Deo, non fortuna.


View Profile
« Reply #18 on: August 04, 2010, 04:06:13 PM »

Ok, a few things:

1) This has really gotten off-topic
2) I'm actually working on a NiFi library based on this modification! Smiley

The library, being really really simple, should be released within a week, although most likely less (2-3 days or so..), as I've already thought 90% of it out ^_^

(Oh, and yes, it will include a demo or 2!)
« Last Edit: August 06, 2010, 07:52:47 PM by xiao32 » Logged

Markup Languages: HTML
Script Languages: PHP and mIRC Script.
Programming Languages: C and C#
padnoter
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
« Reply #19 on: August 05, 2010, 03:06:55 PM »

great - look forward to seeing it.

shame someone can't work out the "ds download play" ability... I have lots of friends who don't have (& don't want) homebrew cards
Logged
xiao32
Full Member
***
Offline Offline

Posts: 193


Deo Volente... Deo, non fortuna.


View Profile
« Reply #20 on: August 06, 2010, 07:40:04 PM »

heh alot of things are different from my example, and it WONT require a new arm7. I'll be releasing it with the following:

NiFi.c - Goes in your project's Source folder
NiFi.h - Goes in your project's Source folder
dswifi9.h - Goes in \libnds\includes\
libdswifi*.a (4x) - These go in \libnds\lib\
A demo or 2! Smiley

The dswifi9.h/libdswifi*.a files are simply the latest DSWiFi library, but they include the normal, AND NiFi-modded RawTxFrame functions.

I will have an alpha release ready soon. Its 'working', just some minor problems.
« Last Edit: August 08, 2010, 02:48:38 PM by xiao32 » Logged

Markup Languages: HTML
Script Languages: PHP and mIRC Script.
Programming Languages: C and C#
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.065 seconds with 19 queries.