Angry Bots Multiplayer Coop

Photon Angry Bots Demo

Get it - runs ins the cloud, no Server necessary
Download from the Asset Store:
Photon Angry Bots Multiplayer Showcase | Templates | Unity Asset Store

Overview
In collaboration with M2H we’ve been developing a multiplayer coop version of the official Unity demo “Angry Bots”. This demo now shows the power of Unity AND Photon. The multiplayer is implemented using the new Photon Unity Networking plugin.

You can play the game via Wooglie.com: http://www.wooglie.com/playgame.php?gameID=899

Related Asset Store Downloads
Photon Unity Networking: Photon Unity Networking Classic - FREE | Network | Unity Asset Store
Photon Viking Demo: Photon Viking Multiplayer Showcase | Network | Unity Asset Store

Requirements
Compatible with Unity Free.

As server use either

Feedback is welcome! Just reply here.

So is this photon plugin free for use or what? I can’t find any info on the use of this plug in.

Edit: nevermind, got it: link

I’ll ask what I asked in the Viking Demo thread, is the server authoritative in this example? I’ve seen a lot of photon examples from you guys, but nothing where the server has control over movement. In all the unity demos the server is just a simple relay agent that pushes data to the remote clients.

Leepo mentioned in the other thread that only the player health and enemy AI are authoritative.

now available in the asset store:

The Photon server only relays messages in this case. The masterclient is authorative over health and enemy AI but not over player movement indeed (for simplicity). You can already make the masterClient authorative yourself.

Wen i try to download it,It set that i need to activate the account
my unity account is active ,the unity asset it active
My Unity 3D is 3.4.1.
will this mean photon account do i have to make 1

If one were to modify the code to make the master client authoritative over movement as well, would there be any benefit left in using Photon over the built-in networking? It seems to me that this would require a ton more bandwidth, thus making your max-player limit the same as it would be if you weren’t using Photon, maybe even lower since there seems to be an extra trip for all the movement data with Photon in the middle.

Am I missing something? I’m not an expert in networking yet, still trying to wrap my head around some basic concepts. :slight_smile:

I don’t know anything about photon’s networking, but I’m assuming that its the same as the built-in networking in that even seemingly “peer-to-peer” messages are authoritative under the hood. For example, if a client sends a message to another client (or all clients), under the hood it really sends it to the server and the server relays it to all other clients. There is never any true client-to-client communication.

That said, the only difference between non-authoritative and authoritative movement is in non-authoritative, the client is telling everyone (the server, and the server relaying to everyone) where he moved, and in authoritative, he’s telling the server what button he pushed, and the server is relaying to everyone (including the client pushing the button) where he is moving based on that input. So the only extra trip is the moving client getting movement confirmation/prediction correction back from the server.

Cloud enabled.

hI, i get Loading 0% without any messages in console, copied my appid and pressed save

HI,U3D 3.5 can make swf now ,this DEMO can comunicate with AS3??I want to know how to make web game using U3D3.5 and flash molehill.

i get loading 0% too whats the problem?

As we released a new Photon Unity Networking version, this demo was updated as well. It’s already live in the store.

dreamflyer: So far, export to flash is not possible. We’re working on it but integration into AS3 is slow.
ficho: try to update, create a new, empty project and import the package in there. Make sure to follow the readme (adding the scenes to the build setup, etc.)

This is also updated to PUN 1.12.
I didn’t notice performance or other issues (like someone commented in the Store).

This is now updated to PUN 1.14.

Hi there! i have a simple question, for example if i create a room, and one dude enter and we kill one “spider” in all client (active) the enemy disappears, but if later join another person, he still see the enemy that just killed before … how I can solve this problem?

PS: Sorry for my poor english.

The simple solution would be to have a buffered RPC take care of that. When players join, they get all the buffered RPCs and can remove the killed enemies, before jumping into the action.

Simple solutions always have some drawback though:
If you do this for a lot of enemies, the room will fill up with buffered RPCs and joining players will be flooded with those and in worst case, slower machines will loose connection or won’t catch up.
It’s fine for a small levels and rooms that get closed after a while.

Aside from buffered RPCs, Photon allows you to set properties for a room. Those can be updated by any player and they could contain byte[ ] or short[ ] or whatever.
Let’s say you have more than 255 enemies, then each could get an ID of type short. For each kill, some player needs to add that ID to the room’s killed-enemies property. Anyone who’s around already gets the kill anyways, so the property update doesn’t have to be broadcasted. New players first look at the property and remove those enemies.

EDITED: I found the problem … in Health.js

In the line:

view.RPC(“SetHP”, PhotonTargets.Others, health);

I change for this:

view.RPC(“SetHP”, PhotonTargets.OthersBuffered, health);

Thanks @TobiasS for the explanation!

Updated to PUN 1.15. Click here for details.