PDA

View Full Version : Network componenets for my game!



janevblagoj
02-09-2008, 12:29 PM
Hallo!
Im a author of the computer game Poppy and Rose which I programmed it in Delphi 6. I think that the game will attract more attention if it is played in a network between two players. But because Im not professional programmer, and because of my age (Im 51 year old) I just cannot make that. This is why I need help, and when I mean help I mean a source code of some kind (in Delphi 6) with these segments:
- A segment in which a connection is made between two players that should be in a peer to peer base, but one of them would act like a server and the other will be a client that will connect to the server;
- A segment that will initiate that the two players have the same time;
- A segment in which the two players transfer data between them;
- A segment where is formed a joined table of results.
Can I find a source code with this attributes, maybe from some other simple video game?

Thank you
Blagoj
My e-mail: jblagoj@yahoo.com

User137
02-09-2008, 09:11 PM
I have found WSockets very easy to use.
http://www.delphi32.com/vcl/2142/

There should be simple example provided, but the components themselves are pretty straight forward.

(Recommend using TCP)
Set properties port and host for client and then call Open. onData event activates when data is sent. Also for simple program as peer to peer with small data moving i recommend using functions that send and receive string, for easiest possible experience for a starter.

On more advanced note, there is also a onError event with parameters explaining everything. Have some TMemo up to print out those errors for debugging, do client.close when server times out or make timer reconnecting etc... but it's optional.

Traveler
03-09-2008, 03:49 PM
Alternatively, this thread (http://www.pascalgamedevelopment.com/viewtopic.php?t=4814&postdays=0&postorder=asc&highlight=enet&start=0), especially the last few posts, might be of some interest to you.

NecroDOME
04-09-2008, 05:00 PM
You can also take a look at ICS (internet compontent suite)

http://www.overbyte.be/frame_index.html