How do I create players accounts?

0 favourites
From the Asset Store
Players follower. use it for anything which follows the player
  • We need to create player accounts where players can change passwords, preferences, game play data. We would like to do so on a server. Any suggestions? Tutorials? Thank you.

  • One possible way: use Playfab for server side, use Playfab (paid) plugin to interface to C3.

    construct.net/en/forum/construct-3/plugin-sdk-10/construct-master-collection-139046

    playfab.com

    I am using both for game event tracking, unique player login, and a simple leaderboard for my C3 game and it's working well.

  • Google's Firebase is nice & it's free upto a certain limit.

    I have made a tutorial on this. This uses JavaScript.

    LINK>>

    The first part of this tutorial will also help if you want any other API services for your project...

    It includes-

    Authentication- Creating Accounts using email id, and using existing Google Account, Signing Up/In/Out

    Firebase Realtime Database

    A Leaderboard System

    Security Rules

  • This is out of the scope of Construct, and depends on what software your hardware server can handle. Depending on that software, I invite you to use an online search engine and reach out to developers' communities around this software/server-side language.

    From there, you manage your scripts in order to make your user system on your server.

    You will need AJAX in Construct in order to communicate with this distant server.

    You can check out some examples of use indicated in the How do I FAQ for Construct2

  • It should be possible to create your own authentication/database server with the multiplayer plugin, but decidedly not recommended as it wasn't intended for that sort of use.

  • C3 doesn't doesn't have direct access to database resources, like MySQL, that you're going to need to manage large amounts of data like account creation, user names, passwords, forgotten passwords, sending verification emails, EULA changes, etc. Your C3 project is going to have to communicate with a server somewhere.

    Perhaps the easiest way is with Ajax and sending requests to a web server. But this is going to require programming in another language like PHP, Ruby, Perl, etc. The advantages of these are they're relatively easy to work with. The disadvantage is, they're a send/wait to receive system. Your C3 project will have to send a request and then, look for a response. The server side scripts will only run when C3 sends the Ajax request. The server won't be able to just send data to the C3 project out of the blue.

    The other viable way is via WebSockets. The advantage of this method is that it's a two-way communication street. Think of it like a chat server. The C3 project can send information any time it wants and it can receive information any time the server sends it. The advantage of this system is that you can have a steady flow of communication back and forth and a WebSockets server can communicate with databases like MySQL. The disadvantage of this method is that it's going to be a lot more difficult to create as you're going to need to create actual server software in a higher language like C# or Python. It's going to be harder to make secure and that server software is going to need to be running on a machine somewhere 24/7. If that server crashes, your game goes down.

    I seriously doubt that the multiplayer plugin can even come close to handling this as it uses a very specific signaling server that's not designed to really accept data outside of what it expects. You could do what I read as one suggestion and have a specific client start up first and act as the server. But even then, since C3 has no way to communicate with a real database you'd be limited to local storage which I'd consider quite volatile. MySQL can sift through millions of rows of data in a fraction of second. C3 has nothing built-in that even comes close.

    Writing a tutorial for this would be possible but it would be out of the scope of C3 as it would mostly involve writing code in another language, setting up databases and making MySQL queries.

  • First, thanks for all of your replies. Second, I am going to go through each of the options suggested and see which one fits per my skill-set and needs. Again, thanks much!

  • Google's Firebase is nice & it's free upto a certain limit.

    I have made a tutorial on this. This uses JavaScript.

    LINK>>

    The first part of this tutorial will also help if you want any other API services for your project...

    It includes-

    Authentication- Creating Accounts using email id, and using existing Google Account, Signing Up/In/Out

    Firebase Realtime Database

    A Leaderboard System

    Security Rules

    Sparsha, will this work for C2?

  • Any external language that accepts an Ajax request will work with C2 or C3. I personally prefer having my own server and MySQL database over firebase. Reason?

    firebase.google.com/pricing

    At least for testing, I can get a shared web host with MySQL running on SSD's for $5.00 a month. And I can always upgrade to a dedicated server if I need.

  • Any external language that accepts an Ajax request will work with C2 or C3. I personally prefer having my own server and MySQL database over firebase. Reason?

    https://firebase.google.com/pricing

    At least for testing, I can get a shared web host with MySQL running on SSD's for $5.00 a month. And I can always upgrade to a dedicated server if I need.

    Fengist, thanks for the follow-up.

    I'm currently using HostGator which has its own database option. I guess my main point is I want to be spoonfed (LOL!). If there was a tutorial which showed how to set-up the database (with very minimal coding - other than C2), I would be ecstatic. I could even tweak it for my specific needs. Nonetheless, the current plan is to continuously run a lobby server on my HostGator account which will also have an ever-growing array until I personally build my skill-set, find a plug-n-play solution, or some other option which I may be unfamiliar.

  • Any external language that accepts an Ajax request will work with C2 or C3. I personally prefer having my own server and MySQL database over firebase. Reason?

    https://firebase.google.com/pricing

    At least for testing, I can get a shared web host with MySQL running on SSD's for $5.00 a month. And I can always upgrade to a dedicated server if I need.

    Correction. My strategy is to create a C2 file, which is just an array, located on my Hostgator server. Then I would have the main C2 game connect to the Hostgator server and interact with the array via AJAX.

    Will that work? And if it does, can you direct me to a tutorial or step-by-step process to make that work. I was looking the signaling server C2 example which Scirra has for creating a chatroom or two player game. Is that sufficient to use or does the server to be set-up in some special way, as well?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can check out some examples of use of AJAX indicated in the How do I FAQ for Construct2 and showing examples of PHP scripts.

    There are also third-part addons existing for Construct 2 IIRC.

    construct.net/en/forum/extending-construct-2/addons-29/plugin-firebase-68718

    construct.net/en/forum/extending-construct-2/addons-29/plugin-firebase-90265

  • > Google's Firebase is nice & it's free upto a certain limit.

    >

    > I have made a tutorial on this. This uses JavaScript.

    >

    > LINK>>

    > The first part of this tutorial will also help if you want any other API services for your project...

    >

    > It includes-

    > Authentication- Creating Accounts using email id, and using existing Google Account, Signing Up/In/Out

    > Firebase Realtime Database

    > A Leaderboard System

    > Security Rules

    Sparsha, will this work for C2?

    Yeah! Why not? Just download Valerypopoff’s JavaScript plugin for C2..

    The Flame Plan pricing is high- $25 is too much..

    For small starting apps, the free plan itself is quite good and you can upgrade to a plan whenever you want.

    If you choose Blaze Plan, you have to pay according to your usage.. If your game does not have to store too much data you will be able to save $20..

    You may find this post useful.

    Check out the Blaze Plan Calculator section in this webpage(The desktop version of this page is more informative)...

    Here you can see how much data you can store and how much it would cost you.

    Unless you are developing a game professionally having to store lots of data, the free version may be enough..

    For hobbyists like me, it serves me my needs (till now) well and free!

    The database is secure and minimum coding is required..

  • Correction. My strategy is to create a C2 file, which is just an array, located on my Hostgator server. Then I would have the main C2 game connect to the Hostgator server and interact with the array via AJAX.

    Will that work? And if it does, can you direct me to a tutorial or step-by-step process to make that work. I was looking the signaling server C2 example which Scirra has for creating a chatroom or two player game. Is that sufficient to use or does the server to be set-up in some special way, as well?

    For the longest time, before I broke down and learned SQL, I used flat file databases like you're planning. For many things, they're adequate and relatively fast. Here's some issues you're going to run into:

    Passwords. PHP has built in features to hash passwords into MD5 or SHA1 hashes. Without some ability to compare the password the user enters to a stored hashed password, your passwords are going to be plain text. Keep in mind that people tend to reuse passwords!

    Email Verification: The easiest way to verify a user is to send them an email with a link to a website to verify. That link should have 2 things in the query string, the user's email and another random hashed string like this: www.mysite.com/verify.php?email=me@my.org&hash=SOmecoLLectionofRAndOmGarBage. If the email and that random string match when that page is called, then it's a successful validation. Construct has no built-in way to send emails.

    Forgotten passwords: You'll need some way to send an email or other method (SMS for two factor authentication) to people who've forgotten their password.

    Nextly, security: While it's not always easy, Construct games can be deconstructed. If you provide a direct link to that array inside the C2 client and your game becomes popular, it will be found. Just assume it will. What would happen if I plugged that direct link into a browser or got to poking around?

    There are a lot of things that Construct can do. And there are a lot that it can't.

    As for learning MySQL, you'll need some language to interface into it like PHP, Perl, Ruby, etc. I strongly suggest that you get an IDE like NetBeans and break down and learn it. I write code in several languages but it still took me a good year to become proficient in PHP & MySQL to the point that I felt confident in what I was doing. If you're going to keep writing games, whether in C2, Unity, Unreal or any other engine, learning how to connect to resources that aren't native to those engines will be essential.

    A quick story. A number of years ago I wrote a shareware program for Windows. It's teleprompter software. You can find it here if you're curious: http://www.uprompt.com. I did a lot of planning for security and how to use registration keys. But it wasn't enough. I knew that I had finally hit the 'big time' as a shareware author when some hacking group released a keygen program that would create registration keys for my software. While it was a source of pride that some hacking group found my software worthy of cracking into and I actually boasted that on it's website as a selling point. 'My software is so good, they've cracked it." it also created a need to rethink how I did things. Always assume that someone will spend the time to bot, hack, cheat or otherwise abuse your work for their own personal satisfaction. If yours becomes popular, it will happen.

    I'm trying to convince you to break down and learn MySQL and PHP, so let me give you an idea of the power it would put at your disposal. My teleprompter has automatic registrations. When a user clicks on the PayPal button on the website and makes a purchase, PayPal sends what's called an IPN (instant payment notification) to one of my PHP scripts. That script digests the information and adds it to a MySQL database. It also sends me an email notifying me of a payment received. The teleprompter accesses another set of PHP scripts that checks that MySQL database. If the user enters the correct license ID and registration, the PHP script tells the teleprompter that it's valid or invalid and if valid, registers the software for full use. All of this takes place without my intervention (unless something goes wrong) creating a passive income. I have a database of all of my users, their names, emails and I even have stats on how my software is used so I have information I can digest.

    Construct is a great gaming engine. But that's exactly what it is, a gaming engine. If you want to be able to have the flexibility in your games to say, add in vanity items, add in pay-to-win, subscriptions or even one-time purchases, tracking users, high scores, leaderboards, or a whole host of data, learning a database like SQL and a web-based language like PHP will give you the power to do that.

    I can guarantee you that the guys at Scirra work in a lot more than just Java to sell, maintain and promote Construct. And there's a good reason why.

  • Here, let me give you a real-world example. This is a game I'm working on and it's still very, very early in the works:

    That skill sheet is pure HTML with clickable items. When the user logs in, a PHP script looks at a MySQL database with the list of skills (around 70). It then looks at a table with the user's level in each of those skills. Using the data from both of those, it builds the HTML and that's passed back to Construct as a JSON key. The data from that key is then loaded into an HTML Element plugin. When the user clicks on a skill, it again, accesses a PHP script via Ajax and uploads a description of that skill which is displayed on the right.

    If I change the information in the database the HTML changes. I don't have to keep writing new skill sheets if I add, delete or change a skill. I just change the database.

    No array could do that.

    Here's the login screenshot. Again, the login, create account, forgot password, etc. The same things you're looking to do, all handled by PHP and MySQL on the back end.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)