Network multiplayer Tic Tac Toe in FB

User projects written in or related to FreeBASIC.
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Network multiplayer Tic Tac Toe in FB

Postby arenth » May 05, 2008 17:09

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: 2204
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Postby Lachie Dazdarian » May 05, 2008 17:41

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:

Postby Eclipzer » May 07, 2008 18:08

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

Postby arenth » May 09, 2008 14:36

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:

Postby Eclipzer » May 10, 2008 2:36

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: 2204
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Postby Lachie Dazdarian » Jun 11, 2008 22:24

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: 1089
Joined: Feb 28, 2009 20:58

Postby leopardpm » Feb 28, 2009 23:38

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: 2204
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Postby Lachie Dazdarian » Mar 01, 2009 0:04

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

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

Postby leopardpm » Mar 01, 2009 0:27

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

Postby arenth » Mar 02, 2009 23:50

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

Postby arenth » Mar 02, 2009 23:54

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

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

Postby leopardpm » Mar 03, 2009 0:19

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

Postby arenth » Mar 03, 2009 4:21

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

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 2 guests