Page 1 of 1

Spawning a networked object for all clients

Posted: 02 Oct 2014, 19:40
by JuliusBtesh
So I've started to get the hang of SFS and have a basic setup for spawning remote players along with local players. I was wondering what would be a good way to spawn an object for all users in the current game room to see. This would be like an enemy object with no relation to any of the users.

Thanks!

Re: Spawning a networked object for all clients

Posted: 03 Oct 2014, 09:17
by Lapo
Can you give me a bit more context?
Are you using MMORooms? http://docs2x.smartfoxserver.com/Advanc ... /mmo-rooms

If not, how does your game work?

Thanks

Re: Spawning a networked object for all clients

Posted: 03 Oct 2014, 14:17
by JuliusBtesh
Right now I am not using the MMORoom. I'm just using the SFSGame but will probably try switching to MMORoom. The reason why I didn't start with MMORoom was because I was having issues with the MMORoom Tutorial with the players not showing up properly. I basically just want to be able to spawn one 'Enemy' NPC for all clients to see and have that NPC synced between all clients with the same movement. (Also to have knowledge of all users in room)

Re: Spawning a networked object for all clients

Posted: 03 Oct 2014, 15:42
by JuliusBtesh
Ok, So I just went ahead and switched over to the MMORoomSettings and I noticed that I no longer can find the room.UserCount information. Why is that?

Re: Spawning a networked object for all clients

Posted: 04 Dec 2014, 17:19
by Bax
The reason is that in an MMORoom each client is only "aware" of the users surrounding him (in other words the users that are in his Area of Interest).
So knowing the total number of users in the Room is useless.
Also, as MMORooms are targeted at very large number of users, keeping the counter updated would be a huge waste of bandwidth.