Author Topic: RPC verses custom packet enumerations  (Read 3753 times)

yahn

  • Guest
RPC verses custom packet enumerations
« on: April 02, 2006, 09:15:11 PM »
I'm a little confussed.  To me it seems like RPC is just as much or more work than custom packet enumerations.  Unless I've been misinformed, RPC isn't very suitable for a real time game.  So my question is, what are the dis/advantages of RPC/packet enumerations?  I didn't find anything like this in the manuel.  If its already there, then sorry for the post, but could you point me to it.

Thank you for your time.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: RPC verses custom packet enumerations
« Reply #1 on: April 03, 2006, 12:33:17 PM »
It's essentially a custom packet enumeration that also supports return values and calling into object member functions.  It's easier to use than custom packet enumerations and also means you don't have to do a big recompile because a header file changed.
« Last Edit: April 03, 2006, 04:56:08 PM by Rak'kar »

yahn

  • Guest
Re: RPC verses custom packet enumerations
« Reply #2 on: April 03, 2006, 01:50:11 PM »
Well wouldn't you have to do a big recompile if you added an RPC?  Also isn't RPC slower than custom packet enumerataions?  Can you really use RPC in a real time game server?

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: RPC verses custom packet enumerations
« Reply #3 on: April 03, 2006, 05:02:19 PM »
No you wouldn't because PacketEnumerations tends to get included in everything that touches network code.  RPCs only touch the specific files that use the specific functions you are using in those files.

The speed difference isn't significant.

They do use about 1 1/2 extra bytes of bandwidth over packet enumerations, which I'm not happy about, but it's unavoidable.

Oliver Smith

  • Guest
Re: RPC verses custom packet enumerations
« Reply #4 on: April 09, 2006, 08:15:44 AM »
We use a cheap-and-cheerful halfway house, which results in only an extra byte. We "namespace" our packet IDs, so that the first byte identifies which "service" the packet is from, and the second is essentially the packet ID. With RakNet you could probably fineagle the channel id to double as the service ID ;)