Networking

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
AlejandroMJ
Gnoblar
Posts: 5
Joined: Tue May 24, 2011 1:55 pm

Networking

Post by AlejandroMJ »

Hi, I´m thinking about start a Ogre3D game project, but I must know if exists something to manage the network easier, thanks you :)
User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
x 3

Re: Networking

Post by Pangamini »

try rakNet
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.
AlejandroMJ
Gnoblar
Posts: 5
Joined: Tue May 24, 2011 1:55 pm

Re: Networking

Post by AlejandroMJ »

Pangamini wrote:try rakNet
thank you:)
AlejandroMJ
Gnoblar
Posts: 5
Joined: Tue May 24, 2011 1:55 pm

Re: Networking

Post by AlejandroMJ »

and someone knows a free network engine????
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4308
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 137

Re: Networking

Post by spacegaier »

Did you have a look at RakNet's website?

Depending on what you are going for, it is free!

http://www.jenkinssoftware.com/pricing.html
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
User avatar
thebluefish
Gremlin
Posts: 170
Joined: Tue Apr 05, 2011 1:55 am
x 10

Re: Networking

Post by thebluefish »

Hi,

If you aren't looking to use a commercial networking library such as RakNet, I would suggest you take a look at enet: http://enet.bespin.org/

It's what I'm currently using for my game, and it works wonders. Though it may not be as feature-rich as RakNet, it's free and open-source.
During the code inspection, a couple of minor points were noticed: -

Function inlining was critical to performance.
For MSVC, at least, a "delete 0" caused execution of 11 assembly instructions, including a function call. So in cases where performance is at an absolute premium it can be worth inserting the extra manual test.
User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
x 3

Re: Networking

Post by Pangamini »

That enet looks pretty good as well, i am seriously thinking about switching from RakNet, since i don't use all those rich features
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.
User avatar
rewb0rn
Greenskin
Posts: 128
Joined: Sat Dec 02, 2006 10:03 pm
Location: Berlin, Germany

Re: Networking

Post by rewb0rn »

A fellow moderator of mine on spieleprogrammierer.de (german gamedev community) has written a comparison of various ways to implement networking, including raknet, and his results suggest that raknet is not the non plus ultra lib for networking as many people tend to say: http://networklibsbenc.sourceforge.net/

I must add though that I currently use raknet in my project and for the moment it works great :) Also, I have not studied those results in detail.
User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
x 3

Re: Networking

Post by Pangamini »

Do you use the raknet serialization of game objects? I have read there is such a feature but i don't know how does it work, i do all sync myself.
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.
pizzazhang
Kobold
Posts: 30
Joined: Thu Jan 20, 2011 6:37 am
Location: Shanghai/China

Re: Networking

Post by pizzazhang »

Pangamini wrote:Do you use the raknet serialization of game objects? I have read there is such a feature but i don't know how does it work, i do all sync myself.
do you mean RPC?
try bitstream: (only for Raknet4)

Code: Select all

	struct PlayerStateSync
	{
		PlayerStateSync()
		{
		}
		~PlayerStateSync()
		{

		}
		int playerIndex;
		//postion
		Ogre::Vector3 pos;
		//Quaternion
		Ogre::Quaternion qua;
	};

Code: Select all

	PlayerOperateSync pos;
	RakNet::BitStream bs;
		bs.WriteCompressed(pos);
		mRPC.Call("RPC_PlayerOperateResponse", &bs, HIGH_PRIORITY, RELIABLE_ORDERED, 0, RakNet::UNASSIGNED_SYSTEM_ADDRESS, true);
		return true;
and read the struct:

Code: Select all

		NetProtocal::PlayerOperateSync pos;
		bool read = bitStream->ReadCompressed(pos);
		RakAssert(read);
User avatar
rewb0rn
Greenskin
Posts: 128
Joined: Sat Dec 02, 2006 10:03 pm
Location: Berlin, Germany

Re: Networking

Post by rewb0rn »

Pangamini wrote:Do you use the raknet serialization of game objects? I have read there is such a feature but i don't know how does it work, i do all sync myself.
I don't, a while ago I have read that the built-in synch system has several flaws and would be rewritten in time (statement bei Rakkar on the forums). There is now a new synching system but I did not check it out. I feel quite comfortable doing it by hand anyways as its not that much work. I added different synching channels depending on the kind of action, user input (to server) and object states (from server) which are by far the most frequent types of messages are sent unreliable ordered on one channel, other things like join/leave etc. have their own channels and are sent reliable ordered. As I use client side prediction I think the standard RakNet synching wouldn't be an option for me anyway..
User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
x 3

Re: Networking

Post by Pangamini »

rewb0rn wrote:As I use client side prediction I think the standard RakNet synching wouldn't be an option for me anyway..
Detto, i do it all myself. I use the channels like you do, for physics there is unreliable ordered, for chat and important events reliable ordered and for entity creation reliable unordered (as my entity manager can handle mixed order even if entities depend on each other)
I believe TCP doesn't have such features
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.