Network multiplayer Tic Tac Toe in FB

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
Post Reply
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Network multiplayer Tic Tac Toe in FB

Post by arenth »

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.
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Post by Lachie Dazdarian »

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.
Eclipzer
Posts: 432
Joined: Oct 01, 2005 10:50
Location: Maryland
Contact:

Post by Eclipzer »

I do wish you wrote better documentation and more polished game, but let's hope someone will do that soon.
I would love to write a better front end for this.
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.
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.
Not sure if this can be done, but not typing the server name with INPUT is a start.
It would be rather sweet if we developed a standard of sorts for implementing networking into FB programs, more specifically games.
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Post by arenth »

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.
Eclipzer
Posts: 432
Joined: Oct 01, 2005 10:50
Location: Maryland
Contact:

Post by Eclipzer »

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.

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?
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Post by Lachie Dazdarian »

Where can I find a finalized version with the source? Because I have this without it. Once again, the last version, not this one.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Post by leopardpm »

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!
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Post by Lachie Dazdarian »

You can check http://games.freebasic.net

Not sure what version I got there, though.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Post by leopardpm »

Lachie Dazdarian wrote:You can check http://games.freebasic.net

Not sure what version I got there, though.
ok, got it - trying to decipher, but seems alot more involved than I expected!

thanks!
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Post by arenth »

Not sure if i have the original still, I'll search for it and post.
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Post by arenth »

Turns out I do, you're lucky I didn't empty my recycle bin...

Link
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Post by leopardpm »

Thanks alot, Arenth! My project is coming along nicely, and hopefully I will be able to understand the necessary network code to make it multi-user.

I appreciate your help and in not emptying your recycle bin!
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Post by arenth »

Well just let me know if you need help understanding any of it, if I recall correctly the state management was somewhat poor.
Post Reply