Georgen Posted January 26, 2005 Posted January 26, 2005 Hello. I want to make a simple program, imagine a chess simulator, (only moves pieces, no aI). The idea is that the game is ran in computer A and other person is playing in computer B, and the good thing is that they are to be linked so the people is actually playing together. Sure, there must be a way for everything, the point is that this is the first time I came into this problem and I wanna face it step by step. I have heard or (read?) something about DirectX stuff, but that is to advanced for me right now. Any help, thnks!! :p Quote
SteveoAtilla Posted January 26, 2005 Posted January 26, 2005 The easiest way is to have both iterations of the program look at a shared directory, and using a shared file or files. Basically, if a file called "CompAMove.txt" exists, Computer A is moving. Part of the move on Computer A will be to write something to another file ("GameMoves.txt" or something) to denote what it did. It then deletes the "CompAMove.txt" file and creats "CompBMove.txt" and waits for that file to NOT exist. Meanwhile, Computer B is watching the shared folder for "CompAMove.txt" to NOT exist and proceeds with its move. It is a brute-force method which requires no actual computer-to-computer communications, but it would work. Just a thought. Others? Quote The three most important things in life: God, your family, and the Green Bay Packers -- Not necessarily in that order. Winning is not a sometime thing. You don't win once in a while, you don't do things right once in a while, you do them right all the time. Winning is a habit. Unfortunately, so is losing. -- Vincent T. Lombardi
*Experts* mutant Posted January 26, 2005 *Experts* Posted January 26, 2005 How about make it easier and do some socket programming :). Quote
SteveoAtilla Posted January 26, 2005 Posted January 26, 2005 That would certainly do it. I was going for the low-tech, though not really "easier" approach. ;) Quote The three most important things in life: God, your family, and the Green Bay Packers -- Not necessarily in that order. Winning is not a sometime thing. You don't win once in a while, you don't do things right once in a while, you do them right all the time. Winning is a habit. Unfortunately, so is losing. -- Vincent T. Lombardi
Diesel Posted January 26, 2005 Posted January 26, 2005 aka The crappy, don't know what Im talking about approach Quote
Georgen Posted January 27, 2005 Author Posted January 27, 2005 OH, that's it!!. I must thank you for your response <SteveoAtilla> it was fast and accurate 'cause I want to start fresh, and then when things will turn messy and UN-Cool I will jump to other (harder) methods. Let me ask one more thing... <mutant> said something about SOCKETS, I've heard that before, Im not sure what it is but I suppose now it is intended for communications and stuff. So the question is, (in a distant future) when I get enough of brutal ways to do my thing, is that (SOCKETS) the topic I should study? Quote
Diesel Posted January 27, 2005 Posted January 27, 2005 Georgen, you do not want to go the shared folder route. That is about the crappiest way possible of peer-peer communication. Do it the right way and learn about sockets. Quote
SteveoAtilla Posted January 27, 2005 Posted January 27, 2005 Georgen' date=' you do not want to go the shared folder route. That is about the crappiest way possible of peer-peer communication. Do it the right way and learn about sockets.[/quote'] Diesel, Sometimes, I personally find that the best way for me to learn to do something the right way is to first do it the wrong way. Georgen will certainly learn how to do peer-to-peer communications using the Shared Folders method, but as you and I know, it is not the most efficient or even a good way to do it. By doing it this way, however, he will learn this firsthand. Maybe, instead of tearing down the method, encourage the person who is willing to learn by doing. Georgen, as far as sockets are concerned, here is one tutorial, but I just did a Google search for "VB.NET SOCKETS". Good luck! Kahuna Quote The three most important things in life: God, your family, and the Green Bay Packers -- Not necessarily in that order. Winning is not a sometime thing. You don't win once in a while, you don't do things right once in a while, you do them right all the time. Winning is a habit. Unfortunately, so is losing. -- Vincent T. Lombardi
Georgen Posted January 28, 2005 Author Posted January 28, 2005 Thanks a LOT guys!! I wanna try both ways. I can guess the shared folder way is nonsense for real stuff, but I want first to understand the basics. I'll let you know of my advances with it!! Thanks again! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.