Hello,
First of all thanks to sfs team for building this amazing api.
I am creating board game in which if sufficient players are not found in room NPCs need to be created.
Have checked NPC documents as prescribed here.
https://smartfoxserver.com/blog/ways-of-working-with-npcs-in-a-multiplayer-game-p-1/
https://smartfoxserver.com/blog/ways-of-working-with-npcs-in-a-multiplayer-game-p-2/
Seems little bit confusing for me.
Two ways to create NPCs..
1. Create NPCs as client application.
2. Create NPCs at server side.
Question is: At which level and where to create NPC at server side?
Do I need to create NPC at room level (in room extension) when sufficient users are not found?
Where to create NPC
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Where to create NPC
Hi,
if you need to compensate the number of missing players with NPCs I think the best strategy is to create them from server side.
Yes, if your game is controlled by a Room Level Extension then that's the right place to create them by calling the
getApi().createNPC(...) method
As regards "when" it depends on how the game works. Maybe you could run a timer that allows players to join the game, and when this expires you can check how many real clients have joined and add the necessary NPCs.
Cheers
if you need to compensate the number of missing players with NPCs I think the best strategy is to create them from server side.
Do I need to create NPC at room level (in room extension) when sufficient users are not found?
Yes, if your game is controlled by a Room Level Extension then that's the right place to create them by calling the
getApi().createNPC(...) method
As regards "when" it depends on how the game works. Maybe you could run a timer that allows players to join the game, and when this expires you can check how many real clients have joined and add the necessary NPCs.
Cheers
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Where to create NPC
Thanks Lapo, for helping hands.
Who is online
Users browsing this forum: No registered users and 90 guests