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!
Spawning a networked object for all clients
-
JuliusBtesh
- Posts: 58
- Joined: 30 Sep 2014, 17:08
Re: Spawning a networked object for all clients
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
Are you using MMORooms? http://docs2x.smartfoxserver.com/Advanc ... /mmo-rooms
If not, how does your game work?
Thanks
-
JuliusBtesh
- Posts: 58
- Joined: 30 Sep 2014, 17:08
Re: Spawning a networked object for all clients
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)
-
JuliusBtesh
- Posts: 58
- Joined: 30 Sep 2014, 17:08
Re: Spawning a networked object for all clients
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
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.
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.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team