Trying to make Pong Networked...
Author |
Message |
Terror Byte
|
Posted: Mon Feb 13, 2006 11:13 pm Post subject: Trying to make Pong Networked... |
|
|
Okay I have NEVER done anything networked.
The only place reference material I have is the netchat.t program included in the examples in Turing.
I have no idea how to go about doing it. I have a two player version (on the same comp), and I'm trying to use mousewhere for this networked one.
Will I need two sets of mousewheres and two sets of variables for the two computers? And I need to recieve the other comp's paddle's x value. So how do I do that?
In the netchat.t program they've used 'if NetCharAvailable' and then 'get : streamnumber, ch"...
Do I need to use something similar? And if I'm supposed to use NetCharAvaiable, do I need to start the mousewhere over there? Has anyone done some similar before? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Andy
|
Posted: Tue Feb 14, 2006 8:51 am Post subject: (No subject) |
|
|
due to the lack of consistency in the turing's net module, i really wouldnt recommend incorporating a network play in such a real time based game. Because, you pretty much have two options:
1. let the host/client singly do all the calculations, and the other simply provide the co-ordinates of the mouse
2. let both computers do the calculations simultaneously.
for 1, since it takes time for the information to sent over the network, although theoretically, this time is minimal, there is still a delay, which would cause a massive lag in the game, especially when the ball is travelling at a faster speed.
for 2, unless both computers have the exact specifications, and have the exact same programs running in the back ground, one computer will do the calculations faster than the other.
pick something simpler, doing network based pong isnt going to be easy |
|
|
|
|
|
Martin
|
Posted: Tue Feb 14, 2006 7:04 pm Post subject: (No subject) |
|
|
1. Speed wouldn't have anything to do with it. With only a ball, two paddles and a score to keep in sync it should be fairly easy.
2. Implementing a simple timed movement system (meaning your paddle moves x distance over y time, not x distance over y frames) would solve this completely.
What you could do is implement two programs - a server and a client. Two players, each with a client connect to one of the servers. Whenever a keystroke is registered, it sends that keystroke and the current frames per second to the server (to calculate the new position with respect to time) and the server responds to both players with that player's new position. |
|
|
|
|
|
Terror Byte
|
Posted: Tue Feb 14, 2006 7:39 pm Post subject: Wow, doesn't sound easy..... |
|
|
Well I'm gonna take a break from that for a while..
Actually, I was thinking of doing a little something just for fun..
I want to make a small program that you can never close. I know I can make it so you can't close by clicking the x, but I don't know how I'd handle it IF:
- they right clicked on the tab at the bottom and closed it..
- Used CTRL+ALT+DELETE...
Any ideas? |
|
|
|
|
|
[Gandalf]
|
Posted: Tue Feb 14, 2006 7:53 pm Post subject: (No subject) |
|
|
You can't do exactly that using Turing (although there might just be a Window.Hide), to manipulate things like that you need a programming language that has access to the Windows API like VB, C++, etc.
Besides, why would you want to create such a program? It's only annoying. |
|
|
|
|
|
Terror Byte
|
Posted: Tue Feb 14, 2006 8:12 pm Post subject: (No subject) |
|
|
Well that's kinda the point you see.... XD
ANYWAY.....................................
I see that you play Enemy Territory alot. I love ET.
Large snip!
Mod edit: I've skimmed through this topic a few times, and can't see how what you said relates at all. Please conduct such conversations through the PM system. Click the PM button below a users post. |
|
|
|
|
|
Terror Byte
|
Posted: Tue Feb 14, 2006 10:42 pm Post subject: (No subject) |
|
|
Aw...
Well you could've left the IPs up there..
In any case, does anyone know what I can do to make it so they can't click on the bottom?
Is there something that would disrupt it? Like switching windows or creating another one?
And also about CTRL+ALT+DELETE... Can that be interrupted? Because then I can make it so that after CTRL and ALT it switches windows or something... But I'm not sure.. |
|
|
|
|
|
Delos
|
Posted: Tue Feb 14, 2006 11:56 pm Post subject: (No subject) |
|
|
Asking for help to create malicious programmes is not commendable or ammenable conduct. Since the purpose of this thread has been served, and it is getting strangely off-topic:
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|