streamSyncInterval feature

A place to request and discuss new engine features / functionality

streamSyncInterval feature

Postby Doidel » Thu Feb 06, 2014 6:16 pm

Hello Rob

streamSyncInterval currently provides the following params:
streamSyncInterval (val, sectionId)
As far as I know there is no way to set this on a clientId base, meaning:
streamSyncInterval (val, sectionId, clientId)
where clientId can be undefined, a string or an array.
Point of this:

  • clientId == undefined: works as before, the stream interval is applied for all clients for this section.
  • typeof(clientId) == 'array': The provided interval will only be applied to the provided client's data section (i.e. first I set "stamina" to be updated all 50ms without providing clientId ==> is applied for all clients. Then I set "stamina" to be updated all 100ms for clients x, y and z. E.g. because they are not important or far away)
  • typeof(clientId) == 'string': clientId = [clientId]

What do you think, is this reasonable? Would you accept a pull request if I implemented something alike?

Kind regards
Roman
User avatar
Doidel
 
Posts: 59
Joined: Tue Jan 14, 2014 5:05 pm

Re: streamSyncInterval feature

Postby Doidel » Thu Feb 06, 2014 8:56 pm

Seems like I can do that partially with the streamControl, but not on a per section base. Just per clientId and room..

Maybe though I could (ab?)use the room system for this:
I could divide my level into several rooms and then add and remove the player to the 9 rooms around him. It's a bit weird.. but could work. At least it's some sort of control which would achieve just that :)

And then for a "more seldom" stream interval I would add and remove the player to all other rooms periodically. Add - await first stream - remove again and set a timeout.

The problem I see with this currently though is that I cannot define a streamRoom per se for a IgeEntity, I have to mount it to a scene (or a child of it), which I wouldn't want to in some cases... Moreover I would like to decouple the whole room system from scenes...
Maybe I can just "hack" it by setting entity._streamRoomId after creation, guess that would work.
The problem that still remains though is that entities can only be mounted to 1 room... I'll change that in a pull request, inc by tomorrow.

(When looking through all that network code I must say there are some minor details I really appreciate, e.g. using integer ids for sections instead of their name, etc.)
User avatar
Doidel
 
Posts: 59
Joined: Tue Jan 14, 2014 5:05 pm

Re: streamSyncInterval feature

Postby Doidel » Wed Feb 12, 2014 2:37 pm

Waiting to discuss implementation with Rob. Code is ready.
User avatar
Doidel
 
Posts: 59
Joined: Tue Jan 14, 2014 5:05 pm


Return to New Feature Discussion

Who is online

Users browsing this forum: No registered users and 1 guest
cron