PhotonPlayer Bot

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

PhotonPlayer Bot

Fidel
2016-12-27 19:36:37

I'm developing the following game:
https://play.google.com/store/apps/details?id=com.ViralRich.AirMultiplayer
In the game's code there is no difference between a bot and a player other than the bot having an additional AI_Control script which takes control of the spaceship. Player spaceships are instantiated using PhotonNetwork.instantiate while bots are instantiated using PhotonNetwork.InstantiateSceneObject.
The spaceships access their photon views and check their owners (PhotonPlayer) to get properties such as nickname and team. It ocurred to me that it would save me tons of duplicate code if I could create instances of PhotonPlayer for the bots. I should be able to create a PhotonPlayer of type Bot and assign it as the owner of a sceneview photon view.
What do you think?

Comments

JohnTube
2016-12-28 08:58:40

Hi @Fidel,

There was a good discussion on the same topic here.

Fidel
2016-12-28 15:32:46

I read that, I want to know Photon devs' stance in extending the PhotonPlayer class to include 'bots' which can be assigned as owners of scene objects. This would save developers a lot of duplicate code. Basically, I'm inquiring about the feasibility of implementing such a thing in future updates.

Back to top