Corona® AutoLAN- Public Internet Multiplayer Support Beta! Join Now!

Thanks for the reply M.Y., I hadn’t tried that func combo yet, once I found a solution to my immediate problem, disconnecting and reconnecting manually to the same server, I figured I’d ask and move onto my next step. I saw client:stop() just killed the timers and figured there must be more to it.

Here is a cross post from another thread I commented on that I think is relevant to this thread:

Total newb here, but I’ve got to agree with Danny.

While PubNub would work great and is quite simple to work with, the responsibility for message count scares me.

I’ve been playing with autolan for the last week and found it more than up to the task, especially using it for in app/game chat. It works great in the sim, haven’t built and installed a functioning app on a device yet.

The lack of a native keyboard in the sim was frustrating me, couldn’t see it “work” and didn’t know how to actually utilize it and or make it work in sync. To many unknowns to get my head around.

So last week after getting a Dropbox invite from M.Y., I decided to figure it out and proceeded to build my own primitive keyboard/chat screen.

It works really well, I’m not saving message history, although I’m sure it can be done.

I’m currently working on assigning “channels” to isolate players in game to their own chat session. Anyway, here’s what it looks like…it’s totally functional and I’m going to include it in my first app. which will be multiplayer. :slight_smile:

When I got the text entry cursor to work, it put a proud grin on my face. What do you think?

BTW, this is using autolan.

Photobucket

FWIW, I setup the code in a module, which I hadn’t experimented with yet, newb here. It’s almost plug and play, which was my first attempt at using my own external module or separate Lua file. When the player hides chat and goes to the game screen, I’ve got a small icon that remains visible and goes from orange to green when a new incoming chat message is received. The player just taps the icon button and the chat screen is visible again. I really like have total control of the chat screen UI.

Those Runtime Listeners in the templates are really useful. What a great idea to include those. I’ve got them set up to drive the “Status” icon dot to change color to reflect disconnected, scanning, failed attempt and connected. How much fun can one have?

[import]uid: 106779 topic_id: 19917 reply_id: 91849[/import]

@MY, Thanks! It’ll be free though so no need to buy :wink: Will be including additional content to unlock via a one-time in app purchase, but especially since multiplayer will be an integral part I’m hoping to get it in as many hands as possible.

@borgb @MY You have a grace period on iOS specifically which should allow you to handle this case. But I agree this is best handled on an individual basis - there is no one-size-fits-all solution here, as different games will have different needs.

@xnailbender Really cool! I’ve also integrated live chat into my game’s lobby with AutoLAN (demo’d in the vid I posted on the previous page). It sounds like we’ve got a similar approach, but the custom interface you’ve built looks great (I’ve just been using the stock native UI). [import]uid: 87138 topic_id: 19917 reply_id: 91857[/import]

Revaerie, thanks! I can’t believe I actually got it to work, all my boys have to say is "you’ve got to have Caps Dad…lol.

It’s been in the back of my mind for a few weeks now, but your video, which is a great promo for autolan btw, pushed me over the edge to give it a go. I doubt I would have even attempted the project with PubNub because I am so concerned of the message count spiraling out of control. That’s a big assumption that I actually get any of my games onto peeps devices.

I doubt I would have taken the time to dig into the Dropbox M.Y. sent me if I hadn’t seen your demo video, because I’m quite comfortable with PubNub now and the learning curve I’ve been on for the last couple months has been so steep, I wasn’t sure I had it in me. The multiPong demo set the hook, it blew me away.

Again, thanks for the nudge… [import]uid: 106779 topic_id: 19917 reply_id: 91898[/import]

I’ve almost completed the integration of wi-fi multiplayer now but I am experiencing some problems. One of them is that when connected to the wi-fi that is used at work I cant find any players. I have to set up a network on my Air and then connect to that which works, but if the server is not the macbook then clients dosent connect properly. it finds it but dosent connect to it. Not sure how to check where things go wrong there.

So just wondering if there are any special settings for networks that needs to be checked by the users before they connect? So I can add that to a beta disclamier or something :slight_smile: [import]uid: 17969 topic_id: 19917 reply_id: 92724[/import]

Hey Borg, ironic how multiplayer game development can be such a lonely world.

I guess the first thing to verify is that the client is calling client:scanServersInternet(scanTime) and the Server is calling server:startInternet() when initiated.

It just sounds like you may be scanning a lan possibly?

I’ve spent the last week trying to cycle back and forth between being a server and then becoming a client for several instances and then back to being a server. Seemed like such a simple task, but for me, not so much.

Conflicting listeners were a big culprit and lack of experience working with “requiring” different .lua files compounded the mire.

After being a client for several connect/disconnect cycles, I was getting a console error of a “nil” value on Client line:374 I think. It appears, for some reason I was/am getting a nil message from the server or an incomplete message while establishing a connection, or possibly on the client side decoding the message/storing maybe, I really don’t know.

This error will terminate the connecting process on the Client side. The Server seems to be functioning properly.

I added an “if” statement work around that seems to be working, but still interested to find out what’s causing the error.

Are you getting any console errors to help debug your problem if indeed you are publishing/scanning the internet?

[import]uid: 106779 topic_id: 19917 reply_id: 92973[/import]

@xnailbender

I’m just working on the local wi-fi solution at the moment, havent tried out the internet yet since I thought it would be easier to get this part done first and then moving onto the big world wide web :wink:

I’m not getting any errors and it works good with simulator and also I tried it at home and there it worked with no problem between my ipad and iphone. I will need to do some more testing there though, just havent had the time. I also tried setting my iphone up as a wi-fi spot and connecting with my ipad but dosent seem to work. if my iphone is the server the ipad dosent find it. and if the ipad is the server, the iphone finds it but wont connect.

I’m also going back and forth, basically trying to break the game to find errors and then trying to fix them or at least go around them if a solution cant be found. I’ve done some changes to my code I will try out again today, but have not edited the client/server files so nothing should be different there.

Still very new to programming so its slow going but getting a step closer every day :slight_smile: Hopeing to be done with a “beta” version that I can release within the week. It dosen effect the rest of my game so should be safe to put out so I can get some feedback from the users as well. [import]uid: 17969 topic_id: 19917 reply_id: 92987[/import]

@Borg

Interesting you can connect on your iphone @ home. Not sure how it works, but I assume your iphone is trying to connect over the internet on your broadband connection at work circumventing the router. How it connects at home has me miffed. When you go “internet”, you’ll start utilizing M.Y.'s MatchMaker server. One of my next projects will be to get off of M.Y.'s MatchMaker server and onto my own MatchMaker server. It seems like it should be an easy task, but for me, probably not so much which is typical. lol.

Obviously you’ll have to change the applicationName on the Client.lua and Server.lua when you go “internet”.

I’ve managed to get the applicationName dynamically changed when my players connect so they are isolated and no one can barge in on their match or chat. I’m using the applicationName as a channel selector/identifier and is probably causing my Client line:374 error somehow, but the randomness of the Client kicking the error has me stumped. GL

[import]uid: 106779 topic_id: 19917 reply_id: 93066[/import]

Dont think the normal version tries to connect to the internet? Isnt that only in the beta?

When trying abit more yesterday I could set up my iphone to share internet and then connect my ipad to this one. I could then run the ipad as server and connect with the iphone, but not run the iphone as the server and find it with the ipad.

I’m not so into network setup and everything so might be that there is something setup here at work that prevents the connection between the devices and that my more simple setup at home with just a normal router dosent have that.

Any tips or info about this would be great though :slight_smile: I’ll just be fine tuneing some graphics instead while I wait for some answers, hehe. Maybe I’ll try and make a video capturing the simulator showing it off as well. [import]uid: 17969 topic_id: 19917 reply_id: 93227[/import]

@Borg,

I’m really not sure what flavors of autolan M.Y. has available. I’m working with a Dropbox invite from M.Y. and it’s Corona® AutoLAN v 1.2.

I suppose it is still in Beta, but not sure what the status is. I know I’ve found adding 2 simple “if” statements to the client makes connecting rock solid now.

It’s internet ready and can easily be configured to go from lan to WWW. It’s amazing how fast it connects BTW. When they talk about “real time”, it is. Only slowed by normal ping.

As far as your connecting issues, I’m thinking it has to do with a lan configuration trying to connect at times through the net. I’m way out of my league here and only guessing. I’m sure M.Y. will surface sooner than later and will clarify what’s up.

I don’t believe once using the TCP MatchMaker over the internet anything network wise has to be specially configured, but not sure.

From my experience, when switching from server to client, or client to server, it is important to remove all the server listeners and then add the client listeners. I was adding multiple listeners without realizing it and was not removing all of them when cycling back and forth. Things were glitchy because of this I believe.

I’m still using PubNub to run my lobby at this time, but am now in the process of switching the game play over to autolan. I’m a total progaming newb and not sure I can get my head around switching the lobby over to work as well as it does with PubNub now. I’ll see how creative I can get, who knows.

GL, looking forward to see your game in action. [import]uid: 106779 topic_id: 19917 reply_id: 93237[/import]

Hello everyone,
Sorry about the delay we have been very busy releasing Corona Cider.

@Borgb,
“I’m just working on the local wi-fi solution at the moment”
This is the perfect way to go! Just a few lines extra and everything should work for the net.

“Dont think the normal version tries to connect to the internet? Isnt that only in the beta?”
This is correct, the normal version is only for internet

“but not run the iphone as the server and find it with the ipad.”
Not exactly sure why it would work one way but not the other way around. The only thing that could prevent devices from discovering each-other at work is if UDP broadcasts are blocked perhaps?

@xnailbender
Thanks for giving us a try! We hope the learning curve was easy and we are glad things are working properly. Can you put up your client.lua and server.lua versions on the dropbox, we will look at them.

“I’m really not sure what flavors of autolan M.Y. has available. I’m working with a Dropbox invite from M.Y. and it’s Corona® AutoLAN v 1.2.”
Yes you are using the most up to date version of the beta. Currently the beta is the only one with the internet feature.

“I’m sure M.Y. will surface sooner than later and will clarify what’s up.”
Sorry about the delays, we have been busy cooking up some Cider :slight_smile:

“From my experience, when switching from server to client, or client to server, it is important to remove all the server listeners and then add the client listeners.”
This is absolutely correct. Or else you will get multiple events. This is true for any Corona event.

Thanks everyone for your support,
M.Y. Developers [import]uid: 55057 topic_id: 19917 reply_id: 93256[/import]

@M.Y.developers,
so when I cant find anyone on the wi-fi at work it might be that UDP broadcast is being blocked as well? I have noe idea how its set up here so might be. Works great at home at least. How iphone gets set up when sharing internet I dont know so it might be that problem there. It works ok when I set up a computer to computer on the macbook so guess its all about how its configured.

Sometimes I have to restart the game as well on device in order to discover a new server… is there something I’m not resetting then on client side? Im removeing event listeners, stopping client and disconnecting as it is now. Will have to do some memory tests I guess to see if there is something leaking somewhere.

looking forward to moving onto the online version but I guess then I will need to learn to set up PHP on a server to get things running :slight_smile: [import]uid: 17969 topic_id: 19917 reply_id: 93265[/import]

@M.Y.

I realize your team is more than busy with the cider roll out. I haven’t played with it yet, but looks and sounds great. Looking forward to working with it.

I’ve deleted my question I had in this post, I think I’ve got the source of my console errors figured out. I’m now able to cycle back and forth from server to client, making connections is now quite solid.

Disregard my previous comments about my console errors as they were resulting from my newb abilities. I wouldn’t be surprised if others see the errors pop up though.

Thanks, Nail

[import]uid: 106779 topic_id: 19917 reply_id: 93662[/import]

Hello Nail,

We apologize for the delay. Yes, we have been pretty busy with launching Cider and it should be soon. We are glad that you were able to solve the issue. Please let us know if you have any more problems.

Regards,
M.Y. Developers [import]uid: 55057 topic_id: 19917 reply_id: 94371[/import]

a little test of the multiplayer part so far:

http://www.youtube.com/watch?v=yaKhXv9vuQU
Im about 90% done now for release as a beta at least. Still some polishing I want to do but it works for the most part now.

Still having some problems with not everything getting cleared or something because sometimes I have to restart the game on the devices in order for them to discover the server. And I would like a way to keep the connection alive for a little while but not that important. Just one thing that would make it abit more userfriendly :slight_smile: [import]uid: 17969 topic_id: 19917 reply_id: 94406[/import]

@M.Y., by far my biggest problem is lack of developed mass between my ears.

@Borg…NICE work! The game looks great, although I had a hard time keeping up with the Superman speed of your touch’s in the video. I really like how you sync’d the game play on both devices, similar to the multipong demo. Realtime multiplayer is so impressive.

My programing and graphics are so primitive it’s frankly embarrassing, but a guy has to start somewhere. I’ve certainly given myself room to improve. :slight_smile:

Curious if you are using the client:autoConnect() to attempt to keep the connection alive. Utilizing it properly was the basis for a lot of my persistent console errors I was seeing/kicking, which required a device reload to continue. You can understand the frustration I was experiencing as I couldn’t advance to the next screen to continue development.

This is why I asked M.Y. for a function to completely dump/destroy the server and client on termination as simple solution to my error problems. Connecting the first time when calling require:(“server”) / (“client”), the connection succeeded 100% of the time. Unfortunately gracefully using the disconnect/stop ()'s on their own to terminate the client/server while cycling didn’t work consistently for me.

I battled for a week before I realized not utilizing the client:autoConnect() properly was the cause of the errors being kicked.

Now that I understand what is happening, everything is working as expected and indeed there is no reason to completely destroy the server/client on reload or cycle. Hopefully this insight may help you solve your connection problems/ keeping your connection alive. I didn’t see closing and reloading the app between every game as a satisfactory solution or work around so I stuck with my debugging adventure as autolan is to valuable not to have working consistently and properly.

GL, Nail

[import]uid: 106779 topic_id: 19917 reply_id: 94548[/import]

@borgb,
It looks fantastic! keep up the good work.
And I would like a way to keep the connection alive for a little while but not that important.
Perhaps we can just increase the timeout. This will prevent a premature disconnection event. Thank you for the support.

@xnailbender,
Thanks for identifying the issue with AutoConnect. We will look into it. We are glad to see that you have got everything working properly. We designed the client/server system in a way that you do not need to completely destroy the object every-time you want to restart.

Now that Cider is finally released we will be releasing some updates for Autolan. Hopefully this will solve some of the problems you have been struggling with.

Thanks,
M.Y. Developers [import]uid: 55057 topic_id: 19917 reply_id: 94646[/import]

@xnailbender
Thanks! Yeah, the pace is abit fast. I recorded it in 30fps but for some reason it was changed to 25 when it was saved and went alot faster than it should. Need to learn that program abit better for a final demo of the multiplayer :slight_smile:

I’m not using client:autoConnect() as it is now. Havent looked into that yet. If used it just connects to the first server it finds? I have had some problems with having to reboot the program in order for the client to find the server. Will have to see if I can force this problem up again and see what I can do with client:autoConnect().

@M.Y.developers
Thank you! I have looked at the timeoutTime parameter. Tried increasing it and it would then enable me to spend more time with the client/server suspended so think that could be used when the player gets a phone call or something. I noticed that when hitting the lock button on the device however it would disconnect no matter what. Is it possible to do some reconnect here if the device comes back before the timeout?

was thinking of changing the timeoutTime if the application gets suspended, so that one has more time to do whatever the reason was for the suspending instead of disconnecting quickly. And then just reset to normal when its back.

one can set that with the server:setOptions(params)?
like server:setOptions(timeoutTime = 10000)? and same for client?
[import]uid: 17969 topic_id: 19917 reply_id: 94716[/import]

Hello Borgb,

The main problem with setting a timeout for so long is that it will prevent the same player from joining in the event of a true disconnect. This was by design (to prevent the same ip from joining twice) but we see will change this behavior. When someone connects with the same ip the server will automatically disconnect the previous connection with the same ip. With this design, timeout events will be generated but it will be up to you to disconnect the client (to make room for another one) or keep it connected.

Thanks,
M.Y. Developers [import]uid: 55057 topic_id: 19917 reply_id: 94795[/import]

@M.Y.

Just to clarify, nothing wrong with the autoConnect(). It just has to be setup to scan lan or internet accordingly I think.

My problem was keeping track of the listeners again. Previously I eliminated my problem of creating multiple instances of the same listener without realizing it. This time, I wasn’t removing the proper listeners at the proper time which was resulting in simultaneous calls to client:stop/disconnect and client:autoConnect which would start and scan for me.

I had taken your example of adding and removing listeners when making a server or client. This technique alone was not working for me.

I’ve found it mandatory to remove any client listeners that call start or scan prior to disconnecting/stopping the client and then add the removed listeners back in when makeClient is called.

There’s more.

I’ve found in order to make consistent connections without kicking errors while cycling, not only must the relevant client listeners must be removed prior to disconnecting the client, the client should be terminated before the server. I’ve even setup delay timers to insure the server does not die/stop before the client has the time to remove listeners, disconnect/stop when the connection is terminated from the server side.

It appears to me, the client must disconnect/stop before the server is allowed to disconnect/stop.

I have not found a solution for a dropped connection as a result from “suspend” or actual loss of connection for an extended length of time. It appears the app must be reloaded for autolan to connect properly again. Reloading the app is a substitute for a complete dump/destroy function.

I’m sure there is a way to “reset” autolan to the original load state, just don’t know what to do exactly.

This is my experience, I’m sure more experienced mileage will vary.

Thanks, Nail

[import]uid: 106779 topic_id: 19917 reply_id: 94956[/import]

@M.Y. -

AutoLAN looks great.

What is the future for AutoLAN? Would it be possible for people to play over the Internet via a server intermediary?

I would certainly buy AutoLAN if there was an AutoWAN server written in LUA so we could make game servers.

When Cider gets autocomplete / hints, I’m buying it! It’s the feature I’m waiting for.

Thanks! [import]uid: 13784 topic_id: 19917 reply_id: 95507[/import]