Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK Player for Andorid not working

Author
Message
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th Dec 2017 15:29
Okay, so I finally decided to get my feet wet in the multiplayer pool.

However, when I side loaded the AppGameKit player onto my Android tablet, it starts then stops saying that it cannot run the network code and may require a restart.

So, I restarted and got the same message.

Does anyone have any idea of what the problem might be?

My WiFi is turned on, so it isn't that.

I have tried to follow the instructions in the manual with no luck.

Thanks in advance

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 6th Dec 2017 20:42
Are you using the core multiplayer AppGameKit commands or socket's ones ?
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th Dec 2017 21:11 Edited at: 6th Dec 2017 21:27
I am using the Multiplayer Example in the Manual. (Home>Examples>Getting Started with Multiplayer) (the one with the 5 and 25 chip)

It was not reading the IP address. (I had the WiFi on but had to manually connect (had forgotten auto was not set up yet))

So, after that brain fart, I got that resolved, but now it just says UNCONNECTED and spins forever.

I am broadcasting from a PC (laptop), and trying to pick it up on an Android Tablet with the AppGameKit player.

I am connecting the Tablet to the PC's WiFi to connect to the LAN and get an IP address.

I know it is probably me doing something wrong, because I am a complete noob when it comes to networking in AGK.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 6th Dec 2017 21:50
Quote: "I am connecting the Tablet to the PC's WiFi to connect to the LAN and get an IP address."
That doesn't sound right. Your router would usually be providing the WiFi signal,and serving DHCP, so your tablet can obtain an IP. Your tablet should be connecting to your router's WiFi, not your PC's WiFi.

Check if your tablet is actually getting an IP address (go to Settings > Wi-Fi > Menu (three dots in the corner) > advanced > scroll down to see IP address).
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th Dec 2017 21:59 Edited at: 6th Dec 2017 22:18
My laptop has a built in router for WIFI called Intel My WiFi Technology.

So, it has two WiFi one for connecting to external routers and the other for broadcasting a wireless LAN. (WiFi, and My WiFi)

I can have that turned off and still use the Laptops WiFi to connect to my mobile hotspot for a WAN.

I use that laptop to create a LAN, and I know the Player has an IP because it gets displayed at the top when running.

It actually shows a IP4 and an IP6 address after I connect to the PC

I will try looking in the settings though and see if it matches.

Edit
The IP addresses in the tablets WiFi ... settings were the same as being displayed in the AppGameKit Player.

I tried turning the my WiFi off and then connecting both to the hotspot and still nothing.

The AppGameKit Player says built Sept 22, 2017, so that should be a good one right?


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th Dec 2017 22:30 Edited at: 6th Dec 2017 22:32
Okay, I got it sorted out.

EDIT > PREFERENCES > BUILD > DEVICE IP ADDRESS

"Enter the IP of a device to broadcast apps directly to it, this can be useful if AppGameKit has trouble detecting the device. This can be IPv4 or IPv6."

I punched in the IP address for the tablet and it worked like a charm then.

Not sure why it wouldn't detect it normally, but thanks to Paul for this manual override!

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 6th Dec 2017 22:30 Edited at: 6th Dec 2017 22:34
Sounds like an interesting setup. Maybe your laptop router isn't forwarding the broadcast packets or something. Make sure your devices are on the same sub-net of the local network and that the required ports are open so the devices can see each other. Maybe try pinging your android device IP from your PC. Example, my android device is on local address 192.168.10.39, and I can ping it from my PC:


EDIT: Glad you got it sorted!

Attachments

Login to view attachments
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 6th Dec 2017 23:32
yes, sometimes software routers and even hardware routers are configured to block broadcast UDP packets (like mDNS for example). Maybe you have a firewall/security section to see which feature is disabled or not
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 8th Dec 2017 10:15
Quote: "Not sure why it wouldn't detect it normally"

Both devices need to be connected to the same router.

Your laptop was connected to your internet router and the tablet was connected to a different one. This way, even though all devices are ultimately connected together, scanning the internet router for connected AppGameKit apps will not work.

As you've found out, you can either broadcast directly to your device as you have done, or connect both devices to the same router. (Preferred when testing multiple devices)
Click here for VR Legend of Zelda stuff
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 8th Dec 2017 15:45 Edited at: 8th Dec 2017 23:58
Quote: "Both devices need to be connected to the same router."

They were both connected to the same router.

Quote: "Your laptop was connected to your internet router and the tablet was connected to a different one."

No, the laptop was not connected to the internet (the external router).

Anyway, this set up allows for the two WiFi to not interfere with each other. (according to its documentation)

The Intel My WiFi Technology allows for the LAN to operate while the computer is connected to the other WiFi for a WAN, or if it is not.

The external connection is not supposed to affect the LAN, but I had the external router shut down except for the time I tried connected both to it.

This built in adapter is supposed to support 8 devices connecting to the LAN, so I was hoping to test using at least 3 or 4 devices at the same time.

The laptop is always connected to this LAN, whether it is connected to the internet or not using the other WiFi, so they were both connected to the same Network.


Quote: "yes, sometimes software routers and even hardware routers are configured to block broadcast UDP packets (like mDNS for example). Maybe you have a firewall/security section to see which feature is disabled or not
"

I have checked all of that and cannot find any setting blocking it.

Typing in the IP to broadcast works on any of my devices, but without that it will not detect any of them.

So, that limits me to testing just one device at a time instead of multiple devices, which is not ideal.

I tried making a build of the code with an edit to use the IP address of the host when Joining clients to the network.

That worked as long as I was broadcasting, but trying to run all clients (including host) as apps did not work.

My hope is to get this networking puzzle figured out, so I can add a 2nd player to "Star Castle" for co-op play.

Right now it is single player in an HTML5 build, but I would love to have a multiplayer APK .

Anyway, the Player is working now for any device that I manually enter the IP address to broadcast to, so I will just have to trial and error the rest.

Thanks guys

Quote: "EDIT"

Okay, so I have been digging deep into these network settings, and I've been experimenting with the optional settings instead of the defaults.

Now, I have the apps working between devices on the LAN without needing to manually Broadcast from AppGameKit or use the Player at all.

I am sure that there is some quirky default setting in the My WiFi that is keeping it from detecting on a broadcast from AppGameKit, so I just need to find it.

I am very happy to get my apps playing nice together though, so now the real work begins and I think I will start with something simple before diving into Star Castle CE!

Maybe PONG or something simple like that, then onto my old games like Twenty Squares, which really should/would be a nice two player game.

Once I feel more comfortable with the multiplayer commands, then it is on to more players for Gladiator Quest, which is long over due.

Now I am finding myself wishing that I had done this a long time ago, but thanks to all the recent posts about networking for the motivation. @ Lillybyte

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-11-24 07:04:00
Your offset time is: 2024-11-24 07:04:00