RTS cooperative multiplayer template

Show us your completed creations made in Construct 2

Post » Sun Jun 21, 2015 8:59 am

I have uploaded a version of my upgraded RTS template to the arcade, including a commented CAPX.

Its a cooperative game play version.


RTS template in the arcade
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Fri Dec 11, 2015 10:18 pm

Hello,

I'm pleased to study a bit you capx and work around with Multiplayer plugin for tests. One thing remains obscure to me : in the "enemy" part, which seems to be shared by both host and peer, you gave a random point for the enemy patrol behavior ai. I don't understand how this does not conflict with multiple connected instances of the game. I mean, is the random function already synched when in multiplayer for secure random number generation ? (Or do we have to program this by ourself ?) I saw that it works, but why ? Why this function does not return different values ? And why it is done on the peer instance ? This should be only on the host that make all the calculations and send to peer via multiplayer messages or synched objects, although I know there's many ways to implement game logic in multiplayer (like host does main calculations and send results, or host and peer have the same simulation synchronized by functions, etc...).

Is it because the TankBase is synched so when you do a modification, it's done once ?
I saw that you disabled a random angle set at Projectile object creation. Is it for the same reason ? Because the object is not synched, so you can't use random function and set the spawner object's angle to be sure it shared ?

I miss something. Do you have some time to explain me more ? I feel lost ! The multiplayer plugin is the most difficult to deal with in Construct 2.

By the way, thanks for your useful template !
B
14
S
4
Posts: 112
Reputation: 1,287

Post » Sat Dec 12, 2015 9:33 am

The Enemies find path Event has a "Group Host is active" event, making this event only fire on a peer which has the group "Host" active, meaning it only gets fired on the host peer.

When the hosts enemy object moves, its positioning gets synced to the peer.

The random angle bit is disabled as it creates to large a difference in targeting and shooting among different peers. (preventing visual misfires on none host peers)

The aiming relies on the default turret behavior, the less difference between peers, the more accurate the multiplayer effect will feel.

This could actually do with an upgrade, but it would require a bit of fancy syncing and targeting which would be rather specific for this situation, making the the template less adaptable for other projects.

The key of this template is that you have multiple objects for peers, each able to move and act individually in a multiplayer scenario.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sat Dec 12, 2015 5:46 pm

Ok, I was a little bit confused so I misread some things. Thanks to you !
B
14
S
4
Posts: 112
Reputation: 1,287


Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 0 guests