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 / [SOLVED] Are Turn Based mobile games possible?

Author
Message
badkneecap
13
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 19th Jun 2020 18:47
AGK seems capable of creating multi-player games on a network, but is it possible to do turn-based game on a mobile phone? Has anyone successfully done this? I assume the data would need to be stored on a server somewhere. Plus, there would be a lot of logic to identify the user (possibly by phone number), find another player, etc. Has anyone had any luck setting up something simple to accomplish this?

What about AppGameKit Studio or another software package?

The author of this post has marked a post as an answer.

Go to answer

gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 19th Jun 2020 19:18 Edited at: 19th Jun 2020 19:19
I am new to AppGameKit and never done this kind of game, but as long as you can talk to a server using sockets, which is supported, you can do anything multiplayer. Of course, you'd need to host/create the server yourself. The server doesn't need to be in AppGameKit either.

You can also implement P2P and just use the server for things like player discovery, match history, ladderboards, etc.
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 21st Jun 2020 01:16
This post has been marked by the post author as the answer.
There are many possible solutions to this kind of task.

1. A php server with a communication over http requests
2. A server based on the host and join network commandset
3. A raw socket connection

For roundbased games, it is even possible to upload some sort of filefrommemblock() containing all information
to a webserver while the opponent requests this file, although I would recommend you to stick by the php server or the regular network commandset

So yes, possible

badkneecap
13
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 1st Jul 2020 00:06 Edited at: 1st Jul 2020 00:09
I like the PHP server solution and I could probably put something together using the HTTP commands. What about identification? What would be a simple way to uniquely identify the person posting the info, like their phone number? I don't want to make the user "register" for a username. There is a lot of work that needs to be done for something like that. What's a simple alternative? I am working on a mobile game and this would make it easy for someone to open the game, start or select an existing game and take their turn and wait.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 2nd Jul 2020 21:34
There is a GetDeviceID() command which (I believe) returns a unique ID for the device that you run the app on.

It might be worthwhile to use another value as well, such as the time and date they first ran the app?
badkneecap
13
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 10th Jul 2020 01:26
Thanks. I ended up using a webserver. I created a simple DB, added a tables and a few different PHP scripts to create, load and save game progress. I also used the GetDeviceID() command. Works perfectly as is. I did add a date and time stamp so I can track how long a turn is open in case I need to forfeit a game.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Jul 2020 01:35
BKC (& whomever else),

are the set-up details something you can share?

I was hoping this wouldn't end up as another "yes. it can be done" thread.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Jul 2020 13:19 Edited at: 12th Jul 2020 13:53
Quote: "Thanks. I ended up using a webserver. I created a simple DB, added a tables and a few different PHP scripts to create, load and save game progress. I also used the GetDeviceID() command. Works perfectly as is."

Great.

I am looking forward to see what you some up with.

Quote: "BKC (& whomever else),

are the set-up details something you can share?

I was hoping this wouldn't end up as another "yes. it can be done" thread."


That is why I did not want to respond at first, because I know it can be done, but I do not have a working example.

I have been experimenting with doing a turn based multiplayer with an HTML5 build using PHP, but my PHP is limited and I am still working out some 'hiccups' .

As you guys know, I did a high score leaderboard for an HTML5 using PHP, and that was not too much trouble using the GET to pass form variables with a validation key.

Passing, saving, and displaying the data for a leaderboard was not too bad because it is just creating a web page for display.

My experiments passing data to be used by the app is still funky though as I sometimes get extra data when passing, but I am pretty sure it is because I am so unfamiliar with this process.

With that said... I am sure it is something I am doing wrong, so until I can figure it out, I am not much help here other than just saying... 'yes. it can be done...if you know PHP".

I could make a million excuses why I have no taken the time to master PHP (it is definitely worth learning) , but it is simply "laziness", or "chronic-fatigue-syndrome" for those who want to blame their own personality traits that society sees as shortcomings on imaginary mental conditions.

I'm just lazy most of the time, but sometimes I get inspired/intrigued enough to crank an idea out into virtual reality making it a half ass idea still trapped in the metaphysical realm waiting to be brought to life in the physical realm by the not so lazy, even over active sometimes, people who like to build "real things".

Not sure if I will ever finish the multiplayer HTML5 build project, because when I am not being lazy it is usually because a new idea has inspired me enough to work on it and leave the current project unfinished, and now a terrain thread has inspired me to build a remote guided missile simulator for real life micro glider ideas involving helium balloon launches.

Kinda like the remote controlled torpedoes conceptualized for WWII that were never built, but decades later the anti-jamming frequency technology from those designs was used for spread spectrum technology for cell phones. (I had nothing to do with any of that, but I can talk about other people's historical work freely)

Yes it can be done, and the lack of examples is not necessarily an indicator of anyone being lazy or secretive, just that this may be more dependent on a firm knowledge of PHP than that of AppGameKit, so any example will be as unfamiliar and misunderstood as it will be appreciated.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 12th Jul 2020 15:56 Edited at: 12th Jul 2020 15:56
My app lets users create accounts without registering with email addresses or phone numbers etc. They press a button and a unique user ID is generated and checked against and added to a database on a server using PHP, and with that they can move from device to device. Something that you can't do with device ID.

I do store device ID too to try and spot users with multiple accounts.

So don't rely on device ID alone if you want people to continue their game across multiple devices

Another option is to use social logins like Twitter, Facebook, or Discord etc. each of those would give you an ID that you can use to create a new user account, and will allow a user to move from device to device. AppGameKit let you sign in with Facebook but everything else has to be done and managed on a server.

One thing to keep in mind is that Apple will reject your app if you have social log ins and not "Sign in with Apple"
OryUI - A WIP AGK2 UI Framework
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Jul 2020 16:21
I guess emails are obvious IDs since they are usually used for recovery.

The device ID is very restrictive, but that is great for certain applications.

I have been kicking around the universal ID and Email idea for accountability, with device ID for auto log ins.

Of course, the email address (or other identifier) is used to validate the addition of unrecognized device id's the first time the device accesses the system.

Still in the basic layout phases for my multiplayer ad-venture, but want wagering available for a multi-game currency.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 18th Jul 2020 13:13 Edited at: 18th Jul 2020 13:36
I was originally planning to use the device IDs to ensure the same user was not running multiple windows in a multiplayer game (like poker).

However, the device ID does not work with HTML5 builds, so it seems that an alternative ID may be a better option if you want all platforms to play together,

Using the shared variables now available for HTML5 builds , will still prevent the multiple windows on the same machine though, because the variables for the separate windows would conflict.

I guess I will just have the device ID for android and when it shows null, then I know it is an HTML5 user and I can create encrypted user IDs based on that and store that as a shared variable to create a virtual device ID for anyone using HTML5.

The goal was to have a server list of IDs for verification and purchase logs for each users, so I guess the HTML5 users can stay totally anonymous until they make a purchase, but purchases of course will be tied to emails via PayPal, so they will need proper log in info for recovery.

I have been playing a little with the shared variables, but I have not pushed it to see what I can do with them as far as workarounds and clever tricks.

I would love to figure out a way to store everything on the users system and nothing on the server, so the server would be just a hub to create or join matches.

Also, working on a universal game currency that will be used for all my games now that we have the shared variables, so earnings of coins in our favorite games we have mastered can be used/spent in other games that we are beginners at or are having difficulty with,

Mixing that idea with a virtual casino or other games for wagering on skill would really spice it up, so I may start incorporating optional wagering systems in all my games.

I played very little with shared variables in my slots game and was pleasantly surprised at how easy it was to make that 100% better, so now I want the log on and purchases for coins sorted out before I start making a list of games for this system.

Anyway, just wanted to share that the device IDs do not work in HTML5 builds, because I was thinking that the other day, but wanted to test it first since I have missed so many updates.

Quote: "
My app lets users create accounts without registering with email addresses or phone numbers etc. They press a button and a unique user ID is generated and checked against and added to a database on a server using PHP, and with that they can move from device to device. Something that you can't do with device ID"

Very smart indeed, and I am headed that way.

Quote: "I do store device ID too to try and spot users with multiple accounts.
"

I think the shared variables may provide an easy solution to the multiple window issue.

Sure, savvy users could maybe work around it, but if they are going to that much trouble then I am afraid those users would try to hack any solution and be a perpetual pain in the butt.

Another thing nice about the device ID is the thought of banning problematic users, and ensuring they don't just come back with a new account.

With that not an option for HTML5 users, then I may have to have two separate game lobbies; one for Android users (ban bad users), and one for HTML5 for an anything goes type of thing.

Providing a playground for misfits may be a good way to keep them somewhat controlled, so a redirect behind the scenes without them knowing it may be better than a ban.

That way, all the cheaters could still have their fun cheating each other, without having negative effects on the honorable users.

Quote: "One thing to keep in mind is that Apple will reject your app if you have social log ins and not "Sign in with Apple""

Another proprietary worm in that shiny Apple? ... That figures.

Do yourselves a big favor before you head down that long road of reasons why Apple will reject you, and simply reject them first.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 19th Jul 2020 10:36
Quote: "Do yourselves a big favor before you head down that long road of reasons why Apple will reject you, and simply reject them first."

They may be difficult and frustrating at times (most of the time), but I don't think rejecting them first is the best advice.
OryUI - A WIP AGK2 UI Framework
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 19th Jul 2020 13:55 Edited at: 19th Jul 2020 19:06
Quote: "They may be difficult and frustrating at times (most of the time), but I don't think rejecting them first is the best advice."

To each his own, so good luck with dealing with them.

If you knew what I know about that company then you might think differently.

Everything Apple does is to increase the bottom line for Apple and its stock holders. Nothing they do is for our benefit or the best interests of their customers.

Go ahead and jump through their hoops if you want to, but I am telling you now to get used to it, because they are not going to stop going out of their way to sell you more hardware you do not need thanks to their unwanted software changes. (sure some changes are legit, but that is subjective)

I am always impressed by your work and I look forward to your posts Kevin, so I am not trying to steer anyone wrong here with bad advice,.

I am just warning about the time you are going to invest jumping through their hoops, and while some people see better sales on their store vs Android, don't forget to consider the investment you had to make in their hardware just to comply with their terms to create software for their device.

We all know that you can develop software for that hardware without owning the hardware, yet we are forced to buy the hardware anyway just because of their policy?

What a waste of resources, and that is all their revolving door of selling you hardware you do not need is, a waste of resources and not a good thing for this planet or us folks trying to make it sustainable.

Sure, the advice is not for people already invested in Apple hardware and who already have Apple apps published and Apple users, but for those who have not started those frustrations... you have been warned.

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

Login to post a reply

Server time is: 2024-04-26 16:46:13
Your offset time is: 2024-04-26 16:46:13