|
Smokey Joe
|
 |
« on: January 02, 2012, 11:26:04 pm » |
|
Playable proof of concept! http://www.sapphirecontrol.net/files/SmashBoard-network-demo.rarOkay, so, like, first off here's the game. I've linked a working early build and its gmk file, as well as a netcode variant I've been trying to work on with not much success, or any idea of what I'm doing.
For those of you interested in what this game is about, it's basically a turn-based strategy game similar to chess, using Super Smash Bros. characters as pieces. The idea is a tad similar to TF2 where you would use a variety of different characters in tandem with each other (having Mario ride Yoshi, or using Ice Climber's belay to help a teammate cross a certain distance, etc.) to overpower the other team and complete an objective, like killing the enemy team's Princess Peach, or obtaining the smash ball and holding it for a long enough time.
But I didn't post this just to show off an incomplete alpha with only three playable characters, bugs, and no goals.
What I want to do is make it online compatible. And I'm dumb as shit at networking. Like I've rarely ever made code for receiving and sending packets.
I've got the Faucet Networking dll and installed it, that's not the problem, but I just... don't know what to do with the code. I kinda started by ripping the code from Pong and trying to meld it to suit what's going on in SmashBoard, but the only sign of life I've got so far is when the client connects to the host, then it's just all dead and quiet. Not even the disconnection errors show up, how the fuck did I screw that up?
So basically, I just want any help whatsoever getting this game to work online. Whether you want to do it yourself, tell me how to do it, philosophize on what's wrong, doesn't matter to me. If I can just get it to work, then I'm home free on the rest of the project.
Oh, and here's a pic of the game, for anyone who just wants to see what it looks like.
|
|
|
|
« Last Edit: February 11, 2012, 01:46:04 am by Blue Warrior »
|
Logged
|
~ Smokey Joe
|
|
|
MTK5012
2011 Haxxy Finalist
Offline
Posts: 738
I was Gangsterman
|
 |
« Reply #1 on: January 03, 2012, 09:06:19 am » |
|
i might help as i am a bit understand at networking but i am still a dumb ass at this section and,i don't much time i'll read it now but i might do it tomorow coz im busy at school EDIT: it's heavy as hell,make a sound loader like mine please EDIT2:can you remove or change the sounds in to less heavy sounds? i don't have 2 hours to download it,gotta sleep
|
|
|
|
« Last Edit: January 03, 2012, 09:56:51 am by Gangsterman »
|
Logged
|
|
|
|
Orpheon
2011 Haxxy Award Winner
Offline
Posts: 5830
Developer
|
 |
« Reply #2 on: January 03, 2012, 03:48:08 pm » |
|
Will this ever have more then 2 players in the same game?
Anyway, you don't want to have the same system as gg2 for anything turn-based. You want something that's called a lockstep model (I think). Basically, you send only the orders. Like "Character x/y got moved left". You never actually send the positions or whatever of characters like gg2 does, because you don't need that. These orders you broadcast everywhere, check if they're valid (=possible), and everyone moves a step and says "Got it". I don't think you'll have big problems with using TCP, so you don't have to play around with UDP and packet drops unless you really want to, so at least that's good news.
This assumes there is no real-time element involved. If there is, it's going to get more complicated if you want to avoid lag.
Do you know some networking theory, like what is a socket, what is TCP, what is a packet, etc...?
|
|
|
|
« Last Edit: January 03, 2012, 03:55:08 pm by Orpheon »
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
|
Smokey Joe
|
 |
« Reply #3 on: January 03, 2012, 03:51:52 pm » |
|
Not really set in stone yet. There probably won't be more than two teams, if that's what you're asking.
|
|
|
|
|
Logged
|
~ Smokey Joe
|
|
|
Orpheon
2011 Haxxy Award Winner
Offline
Posts: 5830
Developer
|
 |
« Reply #4 on: January 04, 2012, 07:29:01 am » |
|
No, it's how many different computers will have to be connected.
If you want more then two, then you have to decide whether you want a P2P or a server-client system.
|
|
|
|
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
MTK5012
2011 Haxxy Finalist
Offline
Posts: 738
I was Gangsterman
|
 |
« Reply #5 on: January 04, 2012, 08:44:26 am » |
|
got 5 min to skim through your codes haven't found the networking stuff yet EDIT:found it what is this? write_ushort(opponentSocket, 200); what does 200 use for? EDIT2:DUDE!you didn't even put in the sending/receiving inputs codes and i see it working well
|
|
|
|
« Last Edit: January 04, 2012, 10:05:00 am by Gangsterman »
|
Logged
|
|
|
|
Orpheon
2011 Haxxy Award Winner
Offline
Posts: 5830
Developer
|
 |
« Reply #6 on: January 04, 2012, 01:03:30 pm » |
|
write_ushort(opponentSocket, 200); Why are you using a ushort instead of a ubyte (range 0-255)?
|
|
|
|
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
|
Smokey Joe
|
 |
« Reply #7 on: January 04, 2012, 02:24:38 pm » |
|
I told you dog, I'm dumb as shit at networking.
I need help just getting STARTED on it.
Also, sorry about the filesize. I just finished a sound loader version, I can upload it if you guys want.
|
|
|
|
« Last Edit: January 04, 2012, 02:25:19 pm by Blue Warrior »
|
Logged
|
~ Smokey Joe
|
|
|
|
Smokey Joe
|
 |
« Reply #8 on: January 05, 2012, 12:15:51 am » |
|
Will this ever have more then 2 players in the same game?
Anyway, you don't want to have the same system as gg2 for anything turn-based. You want something that's called a lockstep model (I think). Basically, you send only the orders. Like "Character x/y got moved left". You never actually send the positions or whatever of characters like gg2 does, because you don't need that. These orders you broadcast everywhere, check if they're valid (=possible), and everyone moves a step and says "Got it". I don't think you'll have big problems with using TCP, so you don't have to play around with UDP and packet drops unless you really want to, so at least that's good news.
This assumes there is no real-time element involved. If there is, it's going to get more complicated if you want to avoid lag.
Do you know some networking theory, like what is a socket, what is TCP, what is a packet, etc...?
I just now saw this edit There are no real-time elements here, so that should work just fine. I have a very basic grasp on the concepts of networking, but I have no idea how to tell it to... y'know.... do those things.
|
|
|
|
|
Logged
|
~ Smokey Joe
|
|
|
MTK5012
2011 Haxxy Finalist
Offline
Posts: 738
I was Gangsterman
|
 |
« Reply #9 on: January 05, 2012, 02:26:34 am » |
|
I will try to make a working netplay ok? (thank god it is tbs)
|
|
|
|
|
Logged
|
|
|
|
|
Smokey Joe
|
 |
« Reply #10 on: January 05, 2012, 04:00:55 am » |
|
I will try to make a working netplay ok? (thank god it is tbs)
That would be golden. Tell me if you need any help sifting through my code.
|
|
|
|
|
Logged
|
~ Smokey Joe
|
|
|
MTK5012
2011 Haxxy Finalist
Offline
Posts: 738
I was Gangsterman
|
 |
« Reply #11 on: January 05, 2012, 06:20:04 am » |
|
just don't hope an instant result,i got 1h each day(if I'm lucky) btw,i believe that this is the number of the bytes: socket_sendbuffer_limit(opponentSocket, 65536); and: what is this? write_ushort(opponentSocket, 200); what does 200 use for? and: global.ping?you wanna send the ping?wat for? and: how many move player can perform maximum? move - atk? also the range of walking/attacking/doing spells (how many blocks) since i don't got much times,i think it's better if you give me a brief "instruction" of how to play
|
|
|
|
« Last Edit: January 05, 2012, 07:22:13 am by Gangsterman »
|
Logged
|
|
|
|
Orpheon
2011 Haxxy Award Winner
Offline
Posts: 5830
Developer
|
 |
« Reply #12 on: January 05, 2012, 07:21:31 am » |
|
btw,i believe that this is the number of the bytes: socket_sendbuffer_limit(opponentSocket, 65536); What? Since when does a limit have to exist?
|
|
|
|
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
MTK5012
2011 Haxxy Finalist
Offline
Posts: 738
I was Gangsterman
|
 |
« Reply #13 on: January 05, 2012, 07:32:11 am » |
|
i think GG2 have it but it more "complicate" but it's 2,not 65536 right?
|
|
|
|
|
Logged
|
|
|
|
Orpheon
2011 Haxxy Award Winner
Offline
Posts: 5830
Developer
|
 |
« Reply #14 on: January 05, 2012, 07:58:25 am » |
|
Ehm... socket_sendbuffer_limit(socket, size) : void Prevent the sendbuffer from growing larger than this value (in bytes). 0 means no limit. If the sendbuffer would exceed this capacity the connection will be closed and an appropriate error will be indicated. There is no default limit since a reasonable value depends heavily on the application. To prevent “out of memory” problems it is recommended to set this limit on every socket.
It's the maximum number of bytes you can have in a socket at any given moment, so I'd make it as large as possible without being to huge. A few thousand should be enough.
|
|
|
|
« Last Edit: January 05, 2012, 07:58:47 am by Orpheon »
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
|