freebasic.net Forum Index
FreeBASIC's Official Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in

Network multiplayer Tic Tac Toe in FB

 
Post new topic   Reply to topic    freebasic.net Forum Index -> Projects
View previous topic :: View next topic  
Author Message
arenth
Sr. Member
PostPosted: May 05, 2008 17:09    Post subject: Network multiplayer Tic Tac Toe in FB Reply with quote

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.
 
Back to top
View user's profile
Lachie Dazdarian
Master
PostPosted: May 05, 2008 17:41    Post subject: Reply with quote

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.
 
Back to top
View user's profile Send e-mail Visit poster's website
Eclipzer
Sr. Member
PostPosted: May 07, 2008 18:08    Post subject: Reply with quote

Quote:
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.

Quote:
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.

Quote:
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.
 
Back to top
View user's profile Send e-mail Visit poster's website AIM Address
arenth
Sr. Member
PostPosted: May 09, 2008 14:36    Post subject: Reply with quote

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.
 
Back to top
View user's profile
Eclipzer
Sr. Member
PostPosted: May 10, 2008 2:36    Post subject: Reply with quote

Quote:
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?
 
Back to top
View user's profile Send e-mail Visit poster's website AIM Address
Lachie Dazdarian
Master
PostPosted: Jun 11, 2008 22:24    Post subject: Reply with quote

Where can I find a finalized version with the source? Because I have this without it. Once again, the last version, not this one.
 
Back to top
View user's profile Send e-mail Visit poster's website
leopardpm

PostPosted: Feb 28, 2009 23:38    Post subject: Reply with quote

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!
 
Back to top
View user's profile
Lachie Dazdarian
Master
PostPosted: Mar 01, 2009 0:04    Post subject: Reply with quote

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

Not sure what version I got there, though.
 
Back to top
View user's profile Send e-mail Visit poster's website
leopardpm

PostPosted: Mar 01, 2009 0:27    Post subject: Reply with quote

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!
 
Back to top
View user's profile
arenth
Sr. Member
PostPosted: Mar 02, 2009 23:50    Post subject: Reply with quote

Not sure if i have the original still, I'll search for it and post.
 
Back to top
View user's profile
arenth
Sr. Member
PostPosted: Mar 02, 2009 23:54    Post subject: Reply with quote

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

Link
 
Back to top
View user's profile
leopardpm

PostPosted: Mar 03, 2009 0:19    Post subject: Reply with quote

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!
 
Back to top
View user's profile
arenth
Sr. Member
PostPosted: Mar 03, 2009 4:21    Post subject: Reply with quote

Well just let me know if you need help understanding any of it, if I recall correctly the state management was somewhat poor.
 
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    freebasic.net Forum Index -> Projects All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



sf.net phatcode