Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connecting 2 PC's Over The Internet
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00901593
Message ID:
00902559
Views:
38
Hi Kevin,

Just some thoughts. I never programmed the games. :) I guess there should be some book on how to program online games.

I assume there is some mechanism sending the messages between the PCs

What is the role of the host in this exactly? I guess this is a PC that keeps track of the connected users, game stats, etc. But if there is a host, then if it suddenly disconnects - the game is lost with all the info the host kept. Therefore, that info should be passed to one of the other PCs to be a host and continue the game.

However I think it could be also done if there is no dedicated host PC.
Then, all the information must be duplicated/sincronyzed on every connected PC, so they are equial. In that case the question is which PC they should syncronize with? Who is the first among equals? :)

At any time there should be one PC, where the game application is "marked" as a host. Say, it has .lHost property. This would be an indicator that all other PCs should sincronize with this PC.

There also should be a timestamp property (in all PCs' apps) of last syncronization. When any message is sent between the PCs (the move, stat, chat, etc.) then all PCs get this message. If the chat message reached the destination, only the message target PC shows it. The other just re-syncronize all info with the quasi-host PC.

If there is another message goes around, but the quasi-host cannot be found, then the PC with the latest timestamp takes it over as a quasi-host, so the others will syncronize with it.

Just an idea.




>Nick,
>
>I posted a thread not too long ago about game programming. I know you have
>some experience with connecting via the internet, so I wanted to throw this
>at you.
>
>This is all based on the fact that I have no knowledge if this at all.
>
>I'd like to be able to connect up to 5 PC's via a TCP/IP connection.
>I would want one PC to be host, but if the host disconnects, then the next
>PC to have connected becomes the host.
>
>From this point, I would simply want to pass messages around to all PC's connected
>to the host. For example, a typical message might be "Move piece 'A' to grid x,y"
>and then when received on each PC, the application moves the peice.
>
>In this scenerio, any type of message could be passed, such as game stats, chat,
>piece movement, player join/quit, ect.
>
>So, first, am I lost on this? Or is this doable? Could you point me in the right
>direction?
>
>Many thanks
>
>Kevin
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform