by date
time to learn networking
time to learn networking
| Name: | J Sears | |
|---|---|---|
| Date Posted: | Dec 06, 2006 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for J Sears |
Blog post
Well I sat down and busted out enough scripting to have my card game work pretty well all on one machine, there were a couple small things to add but I saw those parts being very different in networking mode so no point in wasting my time on them yet. So currently the game is set up to be able to play up to 6 players, high card for dealer on start, shuffle and deal out the cards each hand (didn't add the player making his big yet, very simple to do but wanted to wait for network) players play their cards in turn order high card/trump card/special card wins that trick then they lead off that goes till all cards are gone, game compares each players hand score to their bid score and updates their overall score and then shuffles and deals again and it's all working all the card rules are working and the board clearing is working well. So now I need to learn how to get this to network the way I want
The unfortunate part is I want to do something I haven't found and tgb references on. For the most part it seems the networking part of TGB is very under documented. I understand real time networking isn't possible but that near real time is without any code changes (due to that one little demo game someone put out). So that means my idea should work but I don't know how to start it yet.
Here is my dream that I hope to make happen. When the player launches the game it connects to the master server (later on when I figure out how to make AI play this card game good there will be an option for single player) and upon connecting to the master server it loads up a screen of a chat room and enters the person in that chat. So of course the person can chat there then probably on the side of that there will be a window with tables (in the MSN zone style games I believe) where people can sit down at a table and when enough people sit that game launches so the screen changes to in that game and they start playing.
I haven't been able to find any good guides on doing much of any of that, so I will try to learn it over the next few days and try to get it going somehow. In the meantime I may start working on some of my awful graphics skills to set up some guis to give an idea of how it should look and if they're too ugly find someone who is willing to spend a little time making good ones.
my basic thought flow so far seems like most of this networking shouldn't be toooo bad
-auto connect to masterserver on load
- on connect place person's name in box that lists people there
- bottom of chat box has a text field box for person to type in when they hit enter or click send it sends it
to master server and master server updates everyone's chat box
- person clicks on one of the table's and sends a message to server saying they took that spot
- server checks to make sure spot is still open and is so puts a marker there, sends update on that
window to all connected
- when given table reaches set amount (first person to sit down would specify 3-6 players) server sends
message to all those machines updates image on the games window to everyone else as in progress
Now what I don't know at all yet is how to set each one of those games as a seperate game on the master server, hopefully it would be as easy as an array but have to learn more to know. So it all seems possible just have to figure it out.
The unfortunate part is I want to do something I haven't found and tgb references on. For the most part it seems the networking part of TGB is very under documented. I understand real time networking isn't possible but that near real time is without any code changes (due to that one little demo game someone put out). So that means my idea should work but I don't know how to start it yet.
Here is my dream that I hope to make happen. When the player launches the game it connects to the master server (later on when I figure out how to make AI play this card game good there will be an option for single player) and upon connecting to the master server it loads up a screen of a chat room and enters the person in that chat. So of course the person can chat there then probably on the side of that there will be a window with tables (in the MSN zone style games I believe) where people can sit down at a table and when enough people sit that game launches so the screen changes to in that game and they start playing.
I haven't been able to find any good guides on doing much of any of that, so I will try to learn it over the next few days and try to get it going somehow. In the meantime I may start working on some of my awful graphics skills to set up some guis to give an idea of how it should look and if they're too ugly find someone who is willing to spend a little time making good ones.
my basic thought flow so far seems like most of this networking shouldn't be toooo bad
-auto connect to masterserver on load
- on connect place person's name in box that lists people there
- bottom of chat box has a text field box for person to type in when they hit enter or click send it sends it
to master server and master server updates everyone's chat box
- person clicks on one of the table's and sends a message to server saying they took that spot
- server checks to make sure spot is still open and is so puts a marker there, sends update on that
window to all connected
- when given table reaches set amount (first person to sit down would specify 3-6 players) server sends
message to all those machines updates image on the games window to everyone else as in progress
Now what I don't know at all yet is how to set each one of those games as a seperate game on the master server, hopefully it would be as easy as an array but have to learn more to know. So it all seems possible just have to figure it out.
Recent Blog Posts
| List: | 01/25/08 - persistance is rewarding 08/28/07 - My thoughts, and my farewell 05/23/07 - some progress on cards 04/23/07 - teaching my computer to play cards 01/03/07 - I'm not dead 12/06/06 - time to learn networking 12/05/06 - back on a decent pace 12/04/06 - back at it |
|---|
Submit your own resources!| Tom Eastman (Eastbeast314) (Dec 06, 2006 at 08:35 GMT) |
| Tom Bentz (Dec 06, 2006 at 10:33 GMT) |
Edited on Dec 06, 2006 10:42 GMT
| J Sears (Dec 06, 2006 at 21:54 GMT) |
@bentz I would love to take a look at that, sounds like that would help get me headed in the right direction on the meeting chat room part
| Tom Bentz (Dec 07, 2006 at 06:01 GMT) |
www.garagegames.com/mg/forums/result.thread.php?qt=54851#412805
Edited on Dec 07, 2006 06:01 GMT
| David Higgins (Dec 08, 2006 at 14:47 GMT) |
You could possibly find some examples on using the TCPObject, I believe I wrote a few a while back -- not sure if the sample archives are still on my site for download though (have to double check later this evening).
As far as a chat room, you'd probably be best setting something up similiar to IRC -- either read the IRC RFC and mimick it directly, or just make up your own "protocol" and do a mock IRC implementation.
As for the seperate games, an outside server instance would most likely do the best job -- TGB's networking is turn-based, meaning that the client sends a command to the server, and the server responds -- there is no real "real time" networking that would work 100%, however, you only need turn-based networking anyhow as your only doing something when something happens -- the server won't be moving objects without a player interacting with them first ...
Do keep us updated on your progress with networking ... I'm curious.
| David Higgins (Dec 20, 2006 at 01:16 GMT) |
Just curious, haven't heard from you in a while -- have been looking forward to hear about your progress.
You must be a member and be logged in to either append comments or rate this resource.


Not Rated


