Handle players in online games.
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
RakNet is uniquely optimized for networking for games, that's it's major design principal. It has a simple and rather efficient compression algorithm that you can apply to your data, optimizing the bandwidth usage of your application. It comes with a lot of useful plugins (although I like doing things myself personally) and provides useful debugging tools to help you detect problems with data transmission. Add to that it's heavy cryptography support and it makes a pretty good package for games, especially if you want to stop man in the middle attacks and packet spoofing.
Also, like others have mentioned, you only have to pay after you are finished developing and decide to sell it for profit. The free license is not viral in any way, so you can feel free to statically link to the library (or include the source directly and modify as needed).
Also, like others have mentioned, you only have to pay after you are finished developing and decide to sell it for profit. The free license is not viral in any way, so you can feel free to statically link to the library (or include the source directly and modify as needed).
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
xsocom wrote:Well Im doing an orpg so I prefer TCP
The guy who wrote X Wing vs TIE Fighter wrote: TCP is evil. Don’t use TCP for a game. You would rather spend the rest of your life watching Titanic over and over in a theater full of 13 year old girls.
No further comment.xsocom wrote:Also read this:
http://www.gamedev.net/features/reviews ... ductid=220
The Fine Article wrote: Posted: May 11, 2003
Absolutely yes.xsocom wrote:So an fast and easy question, will this be a good choice for a Online RPG Game?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
After a while now I have been using this raknet and start to get problems with packet losts etc, and you said "Absolutely yes" about my question about if its a good choice to have in an online game? Well its not good to have packet losts in dmg packets and animation changes etc.rogerborg wrote:xsocom wrote:Well Im doing an orpg so I prefer TCPThe guy who wrote X Wing vs TIE Fighter wrote: TCP is evil. Don’t use TCP for a game. You would rather spend the rest of your life watching Titanic over and over in a theater full of 13 year old girls.No further comment.xsocom wrote:Also read this:
http://www.gamedev.net/features/reviews ... ductid=220
The Fine Article wrote: Posted: May 11, 2003
Absolutely yes.xsocom wrote:So an fast and easy question, will this be a good choice for a Online RPG Game?
I send packets like this.
Code: Select all
bool Server::BroadcastInRange( RakNet::BitStream &OutPacket, CUnit *pUnit )
{
if( !pUnit )
return false;
UnitMap::iterator itr;
for( itr = mUnits.begin( ); itr != mUnits.end( ); ++ itr )
{
if( !itr->second )
continue;
if( itr->second->getDistanceSq(pUnit) <= (UPDATE_DISTANCE*UPDATE_DISTANCE) )
{
pServer->Send(&OutPacket, SYSTEM_PRIORITY, RELIABLE_ORDERED, 0, itr->second->pClient->pSystemAddr, false);
}
}
return true;
}
Any idea?
Thanks.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
What do you mean by "packet loss"? If you're specifying RELIABLE_ORDERED, which you are, Raknet will only fail to deliver packets if there's a total failure of the connection.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
I don't know what you're doing wrong with raknet, but I've never experienced packet loss from using reliably order.
PLUS YOU SHOULD NEVER NEVER EVER EVER EVER EVER USE SYSTEM PRIORITY. EVER.
Are you running a proper receive loop on the other end to pick up the packet? Are you sending a packet every single frame of you game? Doing this is a great way to clog up the bandwidth and increase latency from having the client fall behind on new packets. I make use of dead reckoning on my servers and clients to both reduce sending of redundant data and adjust my world simulation to account for lag. An update only really needs to go out if there is a big change in the object.
PLUS YOU SHOULD NEVER NEVER EVER EVER EVER EVER USE SYSTEM PRIORITY. EVER.
Are you running a proper receive loop on the other end to pick up the packet? Are you sending a packet every single frame of you game? Doing this is a great way to clog up the bandwidth and increase latency from having the client fall behind on new packets. I make use of dead reckoning on my servers and clients to both reduce sending of redundant data and adjust my world simulation to account for lag. An update only really needs to go out if there is a big change in the object.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
So, either you've found a bug in Raknet's core functionality that nobody else experiences, or...
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
i totally disagree with rogerborg and the reference to gamaustra x-wing coder guy.rogerborg wrote:xsocom wrote:Well Im doing an orpg so I prefer TCPThe guy who wrote X Wing vs TIE Fighter wrote: TCP is evil. Don’t use TCP for a game. You would rather spend the rest of your life watching Titanic over and over in a theater full of 13 year old girls.
1. for starters that article was written in 1999, when most people had still dial-up connections and the internet reliability ( ISP/routers etc ) wasn't so great. conditions, 9 years after that are ALOT better.
2.) UDP sucks. it's faster but unreliable and can be spoofed easily as it is connection-less.
3.) I know at least one very successful commercial game ( lineage2 ) which works using TCP ( and the same goes i guess for the rest of ncsoft games ). the same goes for WOW : ituses tcp. fast google search : http://us.blizzard.com/support/article. ... ue?rhtml=y look at the end of the page.
Thus i don't see why one should use udp instead of tcp, the only barrier is that tcp is more 'difficult' but provides so much features that udp doesn't and you would eventually need to implement if you woulnd't like for cheats like those in counterstrike to appear..
I guess its PEBKAC....bc u have to call receivePacket in one tick so long until it returns zero.rogerborg wrote:So, either you've found a bug in Raknet's core functionality that nobody else experiences, or...
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
I fully respect your right to be wrong.Mirror wrote:i totally disagree with rogerborg and the reference to gamaustra x-wing coder guy.
Reliability is up? Well, I'm glad you've started out by making an argument in favour of using UDP.Mirror wrote:1. for starters that article was written in 1999, when most people had still dial-up connections and the internet reliability ( ISP/routers etc ) wasn't so great. conditions, 9 years after that are ALOT better.
TCP sucks. It's inherently slower, since most routers prioritise UDP traffic. TCP/IP has (at least) 40 bytes of overhead per payload packet, compared to 28 for UDP/IP. TCP can be spoofed easily with a man-in-the-middle attack.Mirror wrote:2.) UDP sucks. it's faster but unreliable and can be spoofed easily as it is connection-less.
Oh, sure, TCP is fine for MUDS, or whatever those crazy kids are calling their PBEM games these days.Mirror wrote:3.) I know at least one very successful commercial game ( lineage2 ) which works using TCP ( and the same goes i guess for the rest of ncsoft games ). the same goes for WOW
The main benefit that I can see to TCP is that it's bidirectional, so there's no need to open any incoming sockets. This is significant, but it's a very different argument to efficiency, ease of (developer) use, or security.
Maybe one isn't writing a MUD and one would like to use a protocol designed for real time communication to perform real time communication? Perhaps one doesn't need all of one's communication to be reliable, and would prefer to avoid the inherent overhead of TCP and the unavoidable overhead of invisible resends?Mirror wrote:Thus i don't see why one should use udp
TCP is far easier, since it deals with sequencing and reliability internally. That's why libraries like Raknet and more specifically Enet exist, to implement reliable UDP that's as simple to use as TCP.Mirror wrote:the only barrier is that tcp is more 'difficult'
Counterstrike? Y'all from the future? Time from an anecdote, from the Early Olden Days.Mirror wrote:you would eventually need to implement [TCP] you woulnd't like for cheats like those in counterstrike to appear..
'Roger' was my original Netrek handle from the early 1990s. I changed it to 'Rogerborg' when I wrote a (cy)borg client that successfully hacked its way into the server, using (can you guess?) a man-in-the-middle attack on the TCP communication between client and server.
I wouldn't call it trivial, but it's not far off.
Any argument that a TCP communication can be authenticated, well... I'm in the middle. The slave client is going to authenticate it for me. The communication has to be encrypted to be secure from a MitM TCP attack, and if it is, then that makes it equally secure from UDP spoofing, doesn't it?
Your turn.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way