Network multiplayer Tic Tac Toe in FB
Network multiplayer Tic Tac Toe in FB
I know, sounds amazing right? Well as far as TTO goes, its generic, and does nothing new. That wasn't the goal however, the goal was to write a simple, mostly well written game to demonstrate how to properly network a program. The goal was also teaching myself how to better handle a networked system. I feel I have definately achieved those goals.
The networking side of things is handled by enet, everything else by built in FB routines.
fb_tto
This archive contains binaries for both the client, and server, as well as the source code, and finally an updated copy of enet.
I should also probably mention, the client shortcut in there is intentionally pointed at my server.
-Edit- A stupid error on my part caused the client to behave poorly-Edit_
For Lachie: there are two programs, as well as two shortcuts sv_tto.exe is the server. cl_tto.exe is the client.
The shortcuts point to their respective programs. cl_tto.exe shorcut points to my server. sv_tto.exe shortcut causes the server to host on port 9920.
The networking side of things is handled by enet, everything else by built in FB routines.
fb_tto
This archive contains binaries for both the client, and server, as well as the source code, and finally an updated copy of enet.
I should also probably mention, the client shortcut in there is intentionally pointed at my server.
-Edit- A stupid error on my part caused the client to behave poorly-Edit_
For Lachie: there are two programs, as well as two shortcuts sv_tto.exe is the server. cl_tto.exe is the client.
The shortcuts point to their respective programs. cl_tto.exe shorcut points to my server. sv_tto.exe shortcut causes the server to host on port 9920.
-
- Posts: 2338
- Joined: May 31, 2005 9:59
- Location: Croatia
- Contact:
Well, I think you accomplished the original goal. I'll definitely have this in mind if I end up coding a simple network game (simple because of the restrictions of my own connection).
I do wish you wrote better documentation and more polished game, but let's hope someone will do that soon. Also, I never liked the connection procedure with several FB programs of this sort I tested. I always expected a better interface for this, and perhaps all in one EXE file. Not sure if this can be done, but not typing the server name with INPUT is a start.
I do wish you wrote better documentation and more polished game, but let's hope someone will do that soon. Also, I never liked the connection procedure with several FB programs of this sort I tested. I always expected a better interface for this, and perhaps all in one EXE file. Not sure if this can be done, but not typing the server name with INPUT is a start.
I would love to write a better front end for this.I do wish you wrote better documentation and more polished game, but let's hope someone will do that soon.
Yeah, it seems a bit clunky, but I just think it's cool that it works. The UI can always be improved though. I agree with you that having the server/client builds in a single build (or at least accessible from a single build) is pretty important. As it stands, that's just poor design.I never liked the connection procedure with several FB programs of this sort I tested. I always expected a better interface for this, and perhaps all in one EXE file.
It would be rather sweet if we developed a standard of sorts for implementing networking into FB programs, more specifically games.Not sure if this can be done, but not typing the server name with INPUT is a start.
Actually the initial versions of this had both the client and server in the same binary, the issue I found was that it was hard to distinguish the two. I figured since I was writing this for people who perhaps didn't have a very solid grasp on network programming, confusing them further for the sake of "good design" would be somewhat pointless.
Actually, good design would seem to dictate that they would not be confused.confusing them further for the sake of "good design" would be somewhat pointless.
Here are my first thoughts on a single exe build. Have two options in game:
"Host a Game" - uses server code
"Join a Game" - uses client code
Seems simple enough, no?
-
- Posts: 2338
- Joined: May 31, 2005 9:59
- Location: Croatia
- Contact:
arenth,
The link to the zip file doesn't work (anymore?) - Could you either repost it or send it to me via email (leopardpm@yahoo.com) - I am in need of understanding exactly what you have tried to show!
Thanks!
The link to the zip file doesn't work (anymore?) - Could you either repost it or send it to me via email (leopardpm@yahoo.com) - I am in need of understanding exactly what you have tried to show!
Thanks!
-
- Posts: 2338
- Joined: May 31, 2005 9:59
- Location: Croatia
- Contact:
ok, got it - trying to decipher, but seems alot more involved than I expected!Lachie Dazdarian wrote:You can check http://games.freebasic.net
Not sure what version I got there, though.
thanks!