3 ms·
Is it possible to divide the world into multiple channels? So I only see updates from those in my area. Then change channels as you move? And start users in
by JTxt 14y ago
Is it possible to divide the world into multiple channels?
So I only see updates from those in my area.
Then change channels as you move?
And start users in different spawn points when usage is high?
- pubnub 14y agoHi JTxt! Yes this is possible! Just update the channel value in this line here from "/xkcd" to "/whatever_you_want" and you can take on new parallel worlds. The source code is here that you need to change: https://github.com/pubnub/pubnub-xkcd/blob/master/network.js#L4 https://github.com/pubnub/pubnub-xkcd/blob/master/network.js...
- JTxt 14y agoThanks for responding! I'm talking about dividing the map into multiple channels so that users only receives updates from those around them, and hopefully make it more responsive. So for 1000x1000 areas, if I'm at "x":3033521.3,"y":-3025356.4, my client subscribes to /xkcd_x3033_y-3025 And adjoining area/channels if they're close to a border. (but only sends updates to the current area/channel.) ...IF it's easy enough for the client to dynamically change channels, and be subscribed to multiple (up to 4) channels. Then combine this with multiple spawn locations at other interesting locations when demand is high. But they can still explore and meet others. So it should more responsive and less data sent than everyone getting updates from everyone.
- leggetter 14y agoIt definitely makes sense to split the world up into multiple channels. That's what the guys who built http://wordsquared.com/ http://wordsquared.com/ did. As you scroll you unsubscribe from channels that are out of view and subscribe to channels that are moving into view. You could think of it in a similar way to how Google Maps tiling works.
- pubnub 14y agoHi JTxt, This is a fantastic idea for resource saving. Also streaming all the data to the clients, while possible with PubNub slows down the clients as they are busy downloading the streams from all player movements on the screen. Would you be able to work with us and coordinate a way to work this? Here is the starting line to segregate channel data - https://github.com/pubnub/pubnub-xkcd/blob/master/network.js#L4 https://github.com/pubnub/pubnub-xkcd/blob/master/network.js... see the "xkcd2" at the end. This is the CHANNEL ID. You can take that and change it based on the Region of the world. You can even use the names of the world splices such as http://www.pubnub.com/static/pubnub-xkcd/images/1n1e.png http://www.pubnub.com/static/pubnub-xkcd/images/1n1e.png - 1n1e "1 north 1 east". So the channel name would be "1n1e".
- JTxt 14y agoSure, I'll try to play with it this weekend. I'll have some questions for you if I can work on this. Thanks!