http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gameprogrammer] Re: Multiplayer networking advice



Not yet, I'm still working on it.  I've never coded a server before so I've been writing stuff down and pondering it.  Any clues on how to handle multiple connected people would be helpful though as I've been stuck on how to do that.  (._.)

I was think of having the server log the IP addresses that connect and sending them data each update. 

For instance:
CLIENT CONNECTS
SERVER GETS THE IP ADDRESSES AND CONFIG STUFF
SERVER CHECKS THE USERNAME AND PASS
IF O.K. LOG THE IP ADDRESS (I guess keep it in memory or write it to a file... I'm not terrible sure)
SEND THE DATA ARRAYS TO THE CLIENT
SEND DATA TO THE OTHER CLIENTS
BLAH BLAH BLAH

Am I on the right track?

Also, for moving and stuff like that I've come up with this:
+ = client
[] = server

OnKeyDown (lets say to the left)
Client#1's character moves left
OnKeyUp
Client#1 sends his position to the SERVER
+ -------> []
And SERVER sends his position to Client#2,3,ect and the screen updates
+ <------- [] -------> +

Same thing would go for chating...
Client#1 sends data to the server and the server sends it to the other clients. 

Is that an efficient way to handle it?

Thanks a lot for your help,
Taylor

On Jan 27, 2008 3:56 PM, Alan Wolfe <alan.wolfe@gmail.com> wrote:
Seems like a decent way to go about it (:

One thing I would suggest is having each image URL have a unique ID so
that when you use wget or whatever to grab the images from their URL,
you don't have to deal with naming conflicts, you just name them based
on their unique ID#.

IE instead of you and I both having an "avatar.jpg" on our urls making
a naming conflict, my URL is ID #3 and yours is #5 so it'd just be
3.jpg and 5.jpg on the client computer.

Your client stuff sounds pretty decent IMO, do you have the server
stuff figured out yet too?

On Jan 27, 2008 11:35 AM, Taylor Peterson <assbone@gmail.com> wrote:
> Hello everyone~
>
> I'm not a very frequent poster, but I do read a lot.  I was looking for some
> advice on networking a game as I'm very new in that area.
> In my little network game players will be able to make their own little
> avatars (in what ever image editing program) and upload them somewhere (like
> imageshack or photobucket)  and paste the url to those images into a config
> file.  And they'll be able to interact with others and what not in a little
> world.
>
> My problem with this is, I've never done a game where more than two people
> connected to each other and play (they'll have to connect to a server now).
> So I'm confused as to how I could draw all of them on screen and keep it
> updated.
>
> Here's what I've come up with in my own inexperienced mind:
> http://commabunny.org/THE/networking_shiz
>
> Please critique it, or tell me if it's even posible.
>
> Thanks,
> Taylor
>

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html





--
-Taylor Peterson