RakNet bindings for Ogre?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Rak'kar
Gremlin
Posts: 152
Joined: Sun May 30, 2004 5:51 pm

RakNet bindings for Ogre?

Post by Rak'kar »

I'm not sure how much demand for this is, so I'll ask. Would anyone be interested in bindings between RakNet and Ogre?

What I can think of immediately is support for Ogre's data structures, Vector3, Matrix, etc.

Perhaps RakNet can be added as a Framelistener as well.

If that's all there is then it's probably not worthwhile. But if you have suggestions for more difficult features let me know and I will do this.
User avatar
ldrrn
Gnoblar
Posts: 10
Joined: Sun Oct 23, 2005 4:33 am

Post by ldrrn »

that's wonderful! i just planned to do that myself, and i guess a lot of people have the same plan. an official binding will save us a lot of time
posix337
Gnoblar
Posts: 3
Joined: Fri Feb 22, 2008 5:01 pm

Post by posix337 »

I'm sure that anything to strengthen the networkability will be very popular!
Rak'kar
Gremlin
Posts: 152
Joined: Sun May 30, 2004 5:51 pm

Post by Rak'kar »

Can you let me know what you would like done?

My immediate list is

1. RakNet's bitstream class can write Ogre's data structures efficiently.
2. Framelistener?
3. GUI output of RakNet's statistics?

If it's too trivial it won't be worth doing, so give me a hard problem :)
User avatar
eugen
OGRE Expert User
OGRE Expert User
Posts: 1422
Joined: Sat May 22, 2004 5:28 am
Location: Bucharest
x 8
Contact:

Post by eugen »

Are the raknet licensing conditions meet ogre ones?
Or could u explain what would be the overall architecture of this integration?
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

1. FrameListener - no. I think many applications dont use FrameListener for their own reasons. GUI output maybe too trivial and there are many GUIs to choose from here.

2. Yeah, maybe an Ogre friendly BitStream class - but I am not sure how because most of the time you want to transfer Vector3 and Quaternion which can be passed as arguments directly.

2. A simple (maybe FPS) multiplayer Ogre demo demonstrating position+orientation interpolation + dead reckoning would be cool. Although I must say it didn't really showcase your library abilities, it is more like cool advertisement.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3
Contact:

Post by Praetor »

We are just starting look at RakNet now for a distributed virtual performance (think like the Theater) application. I'm sure we'll have plenty of ideas, so this is definitely of interest to me. I just don't know enough about RakNet to offer suggestions now.
Rak'kar
Gremlin
Posts: 152
Joined: Sun May 30, 2004 5:51 pm

Post by Rak'kar »

Whatever code I add would be part of Raknet, and just interfaces with Ogre. I won't include any Ogre code with RakNet. This is the same thing I do with FMOD for voice chat. So if you wanted to use the additions you'd have to download RakNet to get them.

I do like the idea of an Ogre based sample for RakNet. I'm not too keen on writing an entire game myself though.

One possibility is to find an Ogre game and add networking to it

It would have to be something small, that I can do easily, and fun enough people would actually play it (and thus you can test multiplayer). And the author would have to be OK with it being open source, so people can see it as a demo for RakNet's features.

I would write as much code as possible as utility classes, especially networked interpolation and object serialization. This way people can use those utility classes in their own games.

I'll look at the showcase now and see if there is anything suitable.
User avatar
ldrrn
Gnoblar
Posts: 10
Joined: Sun Oct 23, 2005 4:33 am

Post by ldrrn »

i'm also like the sample ogre+raknet idea. regarding the choice of ogre game, what about 9thlife? it was an australian student project, it is opened source now and being maintained by ogre's community
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

I'm pretty confident many people uses Ogre and Raknet for their game engines, so this would definitely be of interest for them. I would also like one, of course :)

As for some application, I suggest some kind of "distributed demo". An interactive demo that can be controlled via net. For instance, an abstract art animated demo showcased in a big screen, that can be configured from a remote terminal ("localhost" also possible), so that the person in charge can change the decoration (a party/con?) from any computer.
Image
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

Rak'kar wrote:Whatever code I add would be part of Raknet, and just interfaces with Ogre. I won't include any Ogre code with RakNet. This is the same thing I do with FMOD for voice chat. So if you wanted to use the additions you'd have to download RakNet to get them.

I do like the idea of an Ogre based sample for RakNet. I'm not too keen on writing an entire game myself though.

One possibility is to find an Ogre game and add networking to it

It would have to be something small, that I can do easily, and fun enough people would actually play it (and thus you can test multiplayer). And the author would have to be OK with it being open source, so people can see it as a demo for RakNet's features.

I would write as much code as possible as utility classes, especially networked interpolation and object serialization. This way people can use those utility classes in their own games.

I'll look at the showcase now and see if there is anything suitable.
Cool, the raknet author on the Ogre forums :D

You don't need a full game - just add in some flying cameras with position/orientation interpolation against clients.
Rak'kar
Gremlin
Posts: 152
Joined: Sun May 30, 2004 5:51 pm

Post by Rak'kar »

Here it is, it took me a day to write

http://www.rakkarsoft.com/raknet/downlo ... -3.042.zip

The project is in DependentExtensions/Ogre3DInterpDemo . It assumes you have OGRE_SDK as an environment variable. If not, change the project properties accordingly.

It's a popcorn popper demo. The server has a bunch of popcorn kernels, which pops and flies around. After a short while all the popcorn is deleted and respawned.

The client is a dumb client in that the client does not do any physics or handle the details of spawning or popping the corn kernels.

Specific to Ogre:

How to interpolate between the real and the visual position using a helper class TransformationHistory. Given a time in the past, it will tell you where you were then, using interpolation. If you hold down space you can see the client run non-interpolated, which is very choppy indeed, as it only sends 4 times a second. Let go of space and it's smooth again.

Covered as part of RakNet:

ReplicaManager2 class, which automatically handles the networking for creation, destruction, and serialization of the popcorn kernels.

To run it, start two instances on the same computer. Press 's' for server on one instance, 'c' for client on the other. Hold down space to see the client run without interpolation.

If you want to run it over the internet. change the hardcoded SERVER_IP variable to whatever.

Let me know if it is helpful to you if you are new to RakNet.
eLunir
Gremlin
Posts: 181
Joined: Thu Jan 17, 2008 10:04 pm

Post by eLunir »

That was damn fast! Heh, it's really nice to see the author of such a popular library around here :)
About the demo - I found it really nice. To be honest I did have some experience with RakNet in past, but if I was new, I'm sure it would have been really helpful.
-EDIT- shame on me, by accident I've tested the wrong demo :oops: . As ldrrn says, indeed it is missing the .h and .cpp (or an .obj at least, and a few other minor problems).
Last edited by eLunir on Sun Mar 02, 2008 4:52 pm, edited 2 times in total.
User avatar
ldrrn
Gnoblar
Posts: 10
Joined: Sun Oct 23, 2005 4:33 am

Post by ldrrn »

compile error due to missing ReplicaManager2.cpp and ReplicaManager2.h and many many other problems
dbrock
Kobold
Posts: 30
Joined: Sat Oct 20, 2007 4:49 am

Post by dbrock »

ReplicaManager2.h is missing =]. Can't compile heh, otherwise, great work!
Rak'kar
Gremlin
Posts: 152
Joined: Sun May 30, 2004 5:51 pm

Post by Rak'kar »

Sorry about that, the build tool didn't add that file.

It's fixed here, and I tested it:

http://www.rakkarsoft.com/raknet/downlo ... -3.043.zip

In the solution, one of the dependencies is the DLL project, so if you are not running the _vc8 solution, be sure you build the DLL project first.
User avatar
NickM
Bronze Sponsor
Bronze Sponsor
Posts: 65
Joined: Sat Jul 01, 2006 10:41 pm
Contact:

Post by NickM »

I haven't tried it yet but I'm sure this will come in very handy when my project gets to that stage, Thanks for doing it. :D
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218
Contact:

Post by Jabberwocky »

Very cool.
Image
User avatar
ldrrn
Gnoblar
Posts: 10
Joined: Sun Oct 23, 2005 4:33 am

Post by ldrrn »

The problems are fixed, the demo works great. thanks very much
eLunir
Gremlin
Posts: 181
Joined: Thu Jan 17, 2008 10:04 pm

Post by eLunir »

Checked the demo too. Great work!
User avatar
NoodlesOnMyBack
Goblin
Posts: 200
Joined: Tue Feb 05, 2008 4:14 am
Location: Buenos Aires, Argentina
Contact:

Post by NoodlesOnMyBack »

Rak'kar... amazing job! you are the man!
tgraupmann
Gnoll
Posts: 696
Joined: Sun Feb 20, 2005 5:28 am
Contact:

Post by tgraupmann »

How would physics work in the mix?

I'm guessing you have a server/client.

So the server has physics, and publishes periodic network updates.

And then you have the client polling and updating positions.

But what would you do with the client if you wanted proper physics to be applied between network updates.

I'm thinking for cases when latency is high on the client. Like > 100 ms.

Code: Select all

1. Server physics update

2. Server network publish

3. repeat

4. Client network poll

5. Client IDLE > 100 ms so predict popcorn physics

6. Client network update, adjust to server position

7. repeat
User avatar
fassihi
Goblin
Posts: 215
Joined: Sat Sep 16, 2006 6:51 am
x 8
Contact:

Good question

Post by fassihi »

This is a very good question and I guess networked physics can become rather complex.

I've heard about solutions where they model low level physics on the client and high level physics on the server.

Does anyone have any experiences regarding this issue?
Rak'kar
Gremlin
Posts: 152
Joined: Sun May 30, 2004 5:51 pm

Post by Rak'kar »

fassihi has the right idea. What I have done in the past is to have both the server and client model the physics, and have the server send updates when significant events occur (collisions) and also at a periodic cycle while the object is moving. When the client gets a packet, it should apply the delta over some small amount of time to remain accurate.
davidotcom
Gnoblar
Posts: 18
Joined: Tue Oct 23, 2007 12:05 am

Post by davidotcom »

I'm also looking into networked physics using RakNet, Ogre, and Newton.

They had a lecture in this year's GDC regarding networked physics:

# http://www.gaffer.org/downloads/Network ... DC2008.pdf
# http://xemu.blogharbor.com/blog/_archiv ... 36354.html

I'm interested in seeing how this can be applied Raknet, Ogre, and Newton.
Post Reply