Sign In Register

How can we help you today?

Start a new topic
Answered

Lua and Realtime session packets

Hi all,


I'm new to the platform and I'm using Corona SDK with LUA.


I'm trying to get my head around setting up a Realtime session and simply sending and receiving packet data for the game.


I've successfully set up a multiplayer match in which multiple players join and know how to send event requests but I'm not sure how I should be sending (and of course receiving) Realtime Data. Or setting up the RT Session in Lua.


Has anyone got any suggestions on where I should start? To begin with, I just want to be able to send a simple packet with let's say a random number and then print the number on the peers' console log.


Sounds easy and I'm sure I've been circumventing the answer for a while now but could do with some help.


Thanks!


Michael


Best Answer

Hi Michael


Currently real time is not supported on our Corona SDK.

Can you tell me more about what it is you want to do with GameSparks?

So I can guide you in the right direction of implementing  gamesparks into your game.


Regards

Katie



Answer

Hi Michael


Currently real time is not supported on our Corona SDK.

Can you tell me more about what it is you want to do with GameSparks?

So I can guide you in the right direction of implementing  gamesparks into your game.


Regards

Katie


Oh right. I had no idea.


Ok well, maybe what I'm trying to do can be achieved via events.


It's quite a simple loop actually. A touch even on Player1 game is triggered and I already have it logging in Cloud Code and responding back. But I need to update the Player2 on what's just happened.

Can we send data from Events triggered by Player1 on to Player2?

Hi Michael


You could send a message to player 2 in cloud code. 

To do this you would need to have player 2's Id.

Are you using Challenges?

How often would these loops/ events be called in a game against player 1 and player 2?

Would the game be turn based or real time?



Regards

Katie

Hi Katie, I'm not using challenges, no. The game is supposed to be real time. Turn based doesn't really work for this gameplay type. It's a bit of a 1v1 battle against each other - here's a short gameplay example From the prototype: https://twitter.com/mike_piercy/status/789935709058637824 I was thinking that each move would trigger an event request call (which might happen a couple of times a second in a match - on both player sides) and we just need to keep track of who's health depletes to zero first. So if the event call from Player1 automatically relays the information to let Player2 know that they've made a move, then I think that might work... though, time lag might be against me here. Realtime would be ideal, but maybe there's another way if Lua doesn't work with it yet? Open to any suggestions on the best way to use the platform here. Thanks. Michael

Hi Michael


It sounds like real time would be the best option for you game.

We are currently building  real time into the Lua SDK.

We are planning on having it released in two weeks.

I can inform you on this post when it is ready.


Regards 

Katie


That would be awesome. Thanks Katie. I'll keep an eye on this thread while I read up on Real-Time scripting anyway. Do you think that I don't need to log Event requests at all for what I've described above if Real-Time is working with Corona?
Hi Katie, I noticed that there was a release to the Corona Marketplace announced and I was wondering if this release has included the realtime integration for Lua/Corona that you mentioned?

Hi Michael,


I'll check into this and get back to you.


Regards,

Liam


1 person likes this
What do you guys think? Any thoughts on best approach for Realtime with Corona?

Hi Michael,


The RT side of the Corona SDK is still in testing but should be released soon. I'll let you know here as soon as it's ready !


Regards,

Liam

Login to post a comment