networking engine

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

networking engine

Post by wEEp »

Hello,

I want to create a simple MP game. The goal is that you and another person can run in a world around and u see the other.

I tried it with winsock but its not so good for it. Do know a good networking engine?

Cheers
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

You know about the Search function?

winsock is absolutly perfect for it ;)
However using a highlevel eingine like RakNet would be simpler.
I never tried myself but IrrNet does already integrate network with irrlicht. Maybe you should give it a try.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

u have a little example for winsock with irrlicht?

In my version it was pretty slow with winsock...
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

it will be simpler to use ENet or something like this. If you write your own system you have to care about a lot of things.
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

i will just make that 2 ppl can round in a world and they see each other. I tried it with winsock but it was 2 slow bcz when the algorithmus is in recv and the other client not sending it lags ...the timing must be perfect or what do u think?

Like i said i would like to get some examples ^_^
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

you should know the theory behind networking before implementing it.
recv() is a blocking function. You can either use threads or use non-blocking functions. All this should be covered in tutorials about socket programming.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

can u give me a short example?^_^
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Sylence wrote:recv() is a blocking function.
Correction. recv() is a blocking function by default. It is non-blocking if you creat non-blocking sockets.

Travis
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Check out irrNetLite V2.

Some comments from users:
ya that was what i looking for !!!
the status is irrNetLite2beta but its fn amazing stuff. thanks to BlindSide yet again
I had been trying to compile this for about 15h, what a relief!
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

Thanks , but the problem is that i can't use OOP things. It needs to be procedural. Its a school project and it musn't instance classes. This is why i need a simple non-blocking socket.

edit://

Got it ^_^

Code: Select all

u_long iMode = 1;

ioctlsocket(connectedSocket, FIONBIO, &iMode);

	
		rc=recv(connectedSocket,buf,256,0);
		cout << buf << endl;
iMode '0'= blocking mode, '!=' = nonblocking mode :)
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well here some problems you have to concern with:
-there is no guarantee that you will recieve the complete packet at once
-with blocking your client can block if the other side does not call recv and you try to send a datas whichs fills your sendbuffer up
-with nonblocking the datas can not be sent in this case
-you have a delay with network
-you have to care about concurrence of actions (time and place)
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

Nox wrote: -you have to care about concurrence of actions (time and place)
Well, thats atm my problem...;)

I alrdy fixed the other problems.
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

Hello guys, im working on MP game, too.... i wonder whats the best tool (with tutorials) for me, can you recommend something? Any hints, etc?

btw i wonder should server do physx calculations and send it to client, or the calculations should be done on server and client simultaneously?
wITTus
Posts: 167
Joined: Tue Jun 24, 2008 7:41 pm
Location: Germany

Post by wITTus »

Forget Winsock. Why reinvent the wheel (except for learning purposes)?

I used my own socket class for almost 6 years. But this time I used BlindSides IrrNetLite, because it builds the packets for me and handles player (dis-)connects etc. and I can only recommend it.

However, it will remain a very tough task.
Especially interpolation makes me sick! :roll:
Generated Documentation for BlindSide's irrNetLite.
"When I heard birds chirping, I knew I didn't have much time left before my mind would go." - clinko
Post Reply