ogre and multiplayer?

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
User avatar
JohnBoyMan
Gremlin
Posts: 194
Joined: Sun Nov 07, 2010 12:21 am
Location: Vancouver

ogre and multiplayer?

Post by JohnBoyMan »

Hello i have gone well into making a game now, and im wondering if maybe i should implement multiplayer before i get to deep into it. I don't know much about this, i do understand client server stuff. I know i would need a socket connection with a client server with ipv6 . How would this be done, any knowledge?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: ogre and multiplayer?

Post by jacmoe »

Yes, that would be a good idea.
You need to design it with it in mind from the very start.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
JohnBoyMan
Gremlin
Posts: 194
Joined: Sun Nov 07, 2010 12:21 am
Location: Vancouver

Re: ogre and multiplayer?

Post by JohnBoyMan »

Ill do it.
User avatar
Mind Calamity
Ogre Magi
Posts: 1255
Joined: Sat Dec 25, 2010 2:55 pm
Location: Macedonia
x 81

Re: ogre and multiplayer?

Post by Mind Calamity »

JohnBoyMan wrote:Ill do it.
It's nice to be optimistic, but it's not really that simple, I recommend reading a book, or some blog posts on multiplayer programming before starting off, it'll be better than just embarking on a long dark path without any guidance. ;)
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
SillySalmon
Gnoblar
Posts: 9
Joined: Sat Sep 17, 2011 4:12 am

Re: ogre and multiplayer?

Post by SillySalmon »

One of the problems is that multiplayer is not just knowing a little something about sockets. The whole problem is much larger than just being able to send a packet over a connection. It quickly grows into creating a game, finding a game, joining it when players are behind firewalls and then choosing how to manage game objects.

The task is made easier by choosing the right language and for me the only good choice is C++. It gives you the flexibility to layout your class memory, so you can easily serialise it, while giving you high level code structure to make the programming code easier and type safe. Not to mention C++ performs much better than other similar high level languages and performance is something you need for networking, especially servers.
User avatar
Mind Calamity
Ogre Magi
Posts: 1255
Joined: Sat Dec 25, 2010 2:55 pm
Location: Macedonia
x 81

Re: ogre and multiplayer?

Post by Mind Calamity »

<moderator>REMOVED QUOTE</moderator>
Yeah, and after all that's done you need to make the game logic "networkable", what I'm trying to say is, that communicating with NPCs for example, or interacting with players should be done on the server side, not on the client side, to ensure no cheating, and that every player connected sees what every other does.
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
User avatar
JohnBoyMan
Gremlin
Posts: 194
Joined: Sun Nov 07, 2010 12:21 am
Location: Vancouver

Re: ogre and multiplayer?

Post by JohnBoyMan »

HAHa
a long dark path
User avatar
Zonder
Ogre Magi
Posts: 1176
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 76

Re: ogre and multiplayer?

Post by Zonder »

it does depend on your game though don't forget starcraft that just simulated each player on each players machine and they just sent device input information. Every client has to be syncronised in that senario though and thats why lag in that game was a big nono.

you still would need game finding / joinging though with eithen that. But don't think that should necessarily be part of the main game transport that can be seperate.
There are 10 types of people in the world: Those who understand binary, and those who don't...
User avatar
JohnBoyMan
Gremlin
Posts: 194
Joined: Sun Nov 07, 2010 12:21 am
Location: Vancouver

Re: ogre and multiplayer?

Post by JohnBoyMan »

you said, starcraft sent device input information. I'm making a game like it. I'm curious as to where to start, alot of my game is in the frameRenderingQueued. Would i just have that outputted to the other computer's frameRenderingQueued? What type of io would i use.
User avatar
Zonder
Ogre Magi
Posts: 1176
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 76

Re: ogre and multiplayer?

Post by Zonder »

JohnBoyMan wrote:you said, starcraft sent device input information. I'm making a game like it. I'm curious as to where to start, alot of my game is in the frameRenderingQueued. Would i just have that outputted to the other computer's frameRenderingQueued? What type of io would i use.
they way I would do this is by running my game logic x times for each player (think a computer AI controlling the other side but a player gives the actions) each player has a virtual device which recieved their controller input from the other machine instead of hooking into the local devices. so basically you abstract your game input system so it can recieve input from any source.

this isn't necessarily the best way I was just pointing out how other games have done it.

see this pdf I found http://web.cs.wpi.edu/~claypool/courses ... s/BT01.pdf
There are 10 types of people in the world: Those who understand binary, and those who don't...