Sign In Register

How can we help you today?

Start a new topic
Answered

Physics in cloud code

Hi.

I'm building a turn based 2D physics game where I want a server to be authoritative of a physics simulation and relay the sim back to clients. The game is similar to snooker, 10 balls collide for a fixed time (5 seconds). The simulation is captured at 60 fps all at once and relayed back to both players.

This would be 3000 vectors (60fps * 5 seconds * 10 balls) of positional data calculated and returned to clients each turn. There will be roughly 20 turns per challenge.

Would this be viable to do in cloud code? Apart from the difficulty of implementing it, is this outside the remit of cloud code? Currently I'm working with a typical client/dedicated-server in UE4 but if this was viable in cloud code it would save maintenance and cash spent on server hosting.


Thanks,

Ronan


Best Answer

Hi Ronan,


Apologies for the delayed response. We don't have any special support (or restrictions) for physics as such but as it is essentially maths you could try to implement it yourself. Cloud Code scripts have a default timeout of 30 seconds so as long as your calculations come in under that (I assume they would to keep the game moving as quickly as possible) you should be ok to do this. Try it out and let us know how you get on.


Thanks,

Liam


1 person has this question

Hi Ronan,


Good question, I'll run this by one of the tech guys and get back to you.


Thanks,

Liam

Answer

Hi Ronan,


Apologies for the delayed response. We don't have any special support (or restrictions) for physics as such but as it is essentially maths you could try to implement it yourself. Cloud Code scripts have a default timeout of 30 seconds so as long as your calculations come in under that (I assume they would to keep the game moving as quickly as possible) you should be ok to do this. Try it out and let us know how you get on.


Thanks,

Liam

I'll give it a go.  On my local machine the simulation is practically instant so 30 seconds is overkill.

Thanks for the response Liam.

Hi Ronan,


No problem, best of luck with the game.


Thanks,

Liam


Login to post a comment