Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

myBad Studios

26
Posts
2
Topics
5
Followers
4
Following
A member registered May 09, 2018 · View creator page →

Creator of

Recent community posts

(2 edits)

Hi Rohan

What you are asking for is indeed very little so this kit can definitely handle this, for sure... but if that is ALL you need then this kit may be a bit overkill for you. Contact me directly and I will sell you the login and data parts separately. That'll set you back $80 rather than $200.

The login part of this kit will manage everything to do with knowing who the current player is. Since you now know who the player i (stored in the background) you can now update this player's data (player id sent along automatically in the background). And job done...

Say the player completes the level and you now want to store the score online. All you need is the following function and then you can just call it once the score is calculated:

void SendScore(int level, int score) { 
    CMLData data = new CMLData();
    data.Seti("Level_"+ level, score);
    WUData.UpdateCategory("Scores", data);
}

That's it. Your score for that level is now stored online. Of course, this will overwrite the current value even if it is higher than the last score so you will have to test if the current score is higher before you call that function but , yeah, that is how easy it is. 

To fetch back the player's progress/scores you can either fetch it back one at a time or all at once. All at once seems a better choice. Do it right after the player has logged in and now you know exactly where the player is at and you have all the player's scores ready to test later for new high scores. You would do it like this:

CMLData Scores = null;
void StoreScores(CML response) => Scores = response[1];
void GetScores(CML ignore) => WUData.FetchCategory("Scores", StoreScores);
void Start() => WULogin.onLoggedIn += GetScores;

And that is that. Now you can see how many levels the player has completed by checking: Scores.Keys.Length;
And if you want the score for level 3 (I assume you will name your levels 0,1,2.etc... and not 1,2,3... so level 3 will have been saved as "Level_2") you just do this: 

int current_score = Scores.Int("Level_"+2);

Job done :) 

So as you can see that part is really really easy... The only part of what you want to do that is NOT handled out of the box is showing the player's score/progress on the website. That data is available for admins to see inside the dashboard but it is not visible to players at all. That will require some custom coding and will depend entirely on how you want to display your data.

As you can imagine, the number of ways that you can display data on a website is limited only by the number of ideas you can have in your lifetime... as such I can't give you a one-case-suits-all function to do that but once you know how you want to show your data on your website you can fetch it back super easily. When it's all said and done, it's just data in a table and data that is keyed in a way to make it easy to get to it...  so if you don't know how or don't have someone on your team that can write SQL code / WordPress plugins, just let me know and I'll see how I can help. :)

(1 edit)

Hi Alex

check your inbox for the longest email you have ever received in your life. I do love to type and it takes great restraint to keep my emails short... but I do try ever so hard ;) :P

You said "I posted on itch also but was told you might prefer email". Well you were right about that... but I was going "He posted something on itch? Really? Then why didn't itch let me know?" and just as I was finishing off your record breaking email I finally got the notification that you posted on here! :D

As you may have noticed above, I don't mind posting on here and I don't bother to skimp on details [read: write a lot] but via email it just makes life easier for me and I can include files etc if needed and we can share personal info you may not want public (like your game's URL or security string or whatever)  so I prefer to answer pre-sales questions in here but offer customer support via email directly. Either will do but email is simply preferred.

With that said, the support email is already in your inbox and by now you may have already solved the issue so all that is left to say is: If you have any other questions, feel free to email me and ask away! :D

(1 edit)

So sorry for the inconvenience, mate!

That thing you are getting with the huge list of folders is actually something I have encountered myself on a number of occasions and caused a lot of head scratching to be sure. That was super common for the longest time then it just stopped. You are officially the second person I know of in the last couple of years that this has happened to... and you won't BELIEVE what the problem is.... Are you ready for this? Unzip the file with some other app. Tadaa.... THAT is actually the problem, believe it or not! :O

Once extracted you should have the .unitypackage file and that is that. Install that into your Unity project and inside your project you will find a VERY small zip file that you then install on your website. The file is called wuss_login.zip. Once that is installed and activated you are good to go.

Of all the things you could possibly expect to go wrong, which unzipping tool you use... I know that was the last thing on my mind back when this happened to me, but...that is all it will take to get rid of your headaches :O Who would have thunk it!? :O

Unfortunately that is something you will need to add as a custom feature. I don't check that at all. My kit has a hand full of error messages (like checking if an email address is validly formatted or that the password matches the verification) but apart from that it only relays any errors that WordPress or your site sends back. In the case of username and email, that is part of the registration process and I just say: "Do registration(); If there is a problem, send back what it was". WordPress determines if anything is wrong with the supplied info and if not I just relay to you what it said.

WordPress does have functions that you can use for stuff like that but I didn't implement any functions check for that, sorry. 

(1 edit)

Sidenote... If you use Facebook's free native plugin for Unity to authenticate the person's login... well since I wasn't able to do the Facebook login thing myself and people kept asking about it I added an extra option to my kit where, if you are CERTAIN that a user is who he says he is then you can simply replace my call to AttemptToLogin() with DoTrustedLogin() and pass along the user's email address. My kit will then allow you to log that person in without a password. Thus, as long as the email address in his WordPress account matches the email in his Facebook account then you can log them in via the Facebook native plugin , get the user's email address from FaceBook directly and then pass that email to my function to leg them in that way.

Of course, by the same token, you can log them in via Facebook and then, if they don't yet HAVE an account on your site simply auto complete the email address from the FaceBook asset and submit a registration from my kit like normal. Thus also ensuring the email address matches :) 

Slightly more roundabout than I would like but at least this way you are using Facebook's own code and you are sure it will always be up to date and work as Facebook intended for it to work AND you get the added benefit of my kit no longer needed the login page / password to be entered.  Only problem here is that if they ever change their email address then they will need to make sure they update it in both places in order for FB login to succeed...

Hope that helps. :)

Facebook and my plugins is not an option, though, no. Sorry. Unity's internet access is super primitive: Send a URL, get a response. The end. Even if you just go to a url like http://mysite.com and your site then redirects you to http://www.mysite.com via a 301 redirect Unity will throw an error! Status 201 means "Everything is awesome after the redirect", Unity sees that as an error. Unity's web access is super simplistic: Call a URL, get back a page with a 200 status OR ELSE(!!!!!)

Thus, any type of AOUTH login that requires multiple calls to pages that send messages between servers before finally sending back a "Okay, all is good now, eventually"... yeah, I have no clue how to get that to work, unfortunately. I am thinking that will require writing an entirely separate system using non-Unity classes (maybe using sockets via some .NET native classs ??? I don't know). So, no, sorry, Facebook, Google, Twitter etc... all those OAUTH login systems are not supported by my kits. :(

In the dashboard there is a setting asking you what the default role of new accounts should be. Just select it from the drop down list. Problem is that both website and Unity signups will be assigned the same role. As I explained above about setting that usermeta entry,  find that same place in the function (basically, just before returning success) and instead of writing that entry to usermeta change the user's role instead. If you need help with the code, just send me an email and I'll send it to you. Should only be about 2 lines of code. 1 to add the new role and one to remove the previous role. 

Actually, I don't know how the heck this works but for some reason WordPress actually lets you have multiple roles... When you query the user's roles it gets returned as an array :O Weird... Anyway, yeah, sould only be 2 lines of code so let me know if you struggle with that and I'll help you out :)

By the way, just some food for thought... Since my dialogue engine comes with a Visual Novel prefab I have been toying with the idea of creating a Visual Novel game for my website. Thing is that the code never needs to change between one story and the other, all that has to change is the text file for the story so I would build the game once and then just add new stories over time. One of the things I wanted to do was to allow site visitors to create stories also. Since they don't need access to the binary to do so I would then just give them a web page they can access via the Dashboard and have them write the dialogue in there.

In order to get access to this page in the dashboard I would just assign them a custom role or capability on my website (most likely a capability). Using WordPress Money I could sell them Dialogue Editing capabilities right on the site and as soon as the payment clears, voila, go to the dashboard and now they have access to edit / create stories.

This may be another avenue for you to explore. Give ppl a custom role on your site and then in Unity simply tick the box to fetch back the roles during login and inspect that instead of the custom meta which you won't have to write any more. This basically moves the automation from the Unity registration function into a manual process done on the website somehow. Not sure what it is you want to sync but by using custom roles you can give authors and consumers different pages on the website without involving my kits at all. In addition you can still check the roles like before so there is that... but if a custom role is overkill for your needs then the method in the previous post should work just fine :)

At least now you have options :)

Hmmm..... the entire point of this exercise was to make the distinction be as invisible as possible so this is not something I've ever thought about. But now that the question is raised, I DO use WordPress's own code to actually create the accounts and everything BUT I do so inside a function I created as part of the plugin. All you would have to do is just open up the unity_functions.php and find the loginRegisterAccount() (or something similar) function, read through the code till you get to the part where I have verified the login and say everything is now fine then just add this:

      update_user_meta($current_user->ID, "unity_registration", 1);

Now, inside Unity you can check to see if the account was created via the website or not by adding "unity_registration" into the meta fields array and after login just check for either:

if (results[1].Int("unity_registration") > 0) or if (results[1].Bool("unity_registration"));

On your website, though, I don't have access to any of your plugins, obviously, but since you just added a simple usermeta field during a registration made via Unity you just need to update whatever scripts you are writing to just check if that usermeta field exists and if it's 1.

if (get_user_meta($current_users->ID, "unity_registration", true) == 1) echo "WoHoo! Unity detected!";

I think that should do the trick, no?

You can try and install it into 2017.2 but I can't guarantee Unity will play nice. The only problem you might encounter is that the prefabs will be broken. I include a demo to get you up and running but by no means are you FORCED to use it. I specifically isolated all WordPress functionality and GUI stuff from one another so that you can use any GUI system you want and create a GUI to suit your taste so, again, by no means are you being forced to use the prefab I include... but having said that, the thing is pretty darn comprehensive and even goes so far as to localize the entire login kit into 4 languages and auto detect the presense of additional assets and expose login preferences for them if found... If you have to create it from scratch you'd be losing out on a lot. Fortunately, the code will still be functional so you can easily recreate the entire thing by just dropping the scripts onto the right objects and dragging the right stuff to the right field. Easy... just very tedious and mind numbingly boring work... That is the only problem I predict might happen if you install the asset into 2017.2...

As far as the code is concerned, that will work just fine in any version of Unity that supports .NET4. So here is what happened...

I created the kits for Unity 4 and it worked perfectly fine since day 1, never requiring any fixes as new versions of Unity was released. The only reason to ever download a new version was to get access to new features. From Unity 4.... right up to 2017.2. Then came Unity 2017.3 and they broke the WWW class. Using Debug.Log you could clearly see they leave one of the mandatory headers empty but they still maintain "We didn't break it. We didn't", even though the facts are right there, staring everyone in the face... So what did this empty header mean for my kits? Simple: I can no longer contact the server. The server always returned an error because it wanted that header (the header tells it how long the header info is so since the header.length value was always blank WordPress couldn't process the request). So, yeah, no biggie... :( Sigh...

As it is, they said that the WWW class was just a wrapper around the UnityWebRequest class and eventually they want to get rid of the WWW class completely so I figured that since all my kits are now completely broken anyway, now would be a good time to change my code to work with UnityWebRequest and so I did that. At that point, though, since I was now forced to create a new version for 2017.3 and later I figured, well, since C#6 is as awesome as it is and 2017.3 supports it, why NOT update the code to require it? And so that came to pass...

Thus... the code now uses the alternate version of internet access, the version Unity prefers us to use, and thus it should work just fine in any version of Unity that has the UnityWebRequest class... BUT I made .NET4 a requirement so that is the only REAL restriction on what version of Unity you can use the CODE with. I am not sure what version of Unity they first introduced .NET4 in but I think it was 2017.1 so the code should work just fine in 2017.2

The ONLY problem here is that Unity does not allow you to install assets made in one version of Unity into another version of Unity that is older than the other one. For models and scripts etc it won't make much difference but for prefabs and materials they tend to break them completely. By completely I mean you will see the folder structure of the prefab in the hierarchy but all scripts on it will be missing and the entire thing is just.... well... broken. 

As a general rule of thumb, if you get something in, say, 2017.3.15 and you try to install it into 2017.3.0 there is a huge probability that it will work just fine... but if you get something in 2017.3.0 and try to import it into 2017.2.x the chances are huge that it will break the prefabs. :( Unfortunately the only way to know for sure is to install it and see... and if push comes to shove then I can just send you screenshots of what the prefabs should look like and you can just recreate what you see from that... that is basically the worst case scenario I can imagine...

Nothing wrong with my code... just issues with importing .unityasset files into incompatible versions of Unity

(1 edit)

P.s. for examples of how CML works, visit my website at https;//mybadstudios.com and visit the product page in the store. Since leaving the Asset Store I updated the site quite a lot and products now contain Tutorial and FAQ and other tabs to give people a better understanding thereof. MBSCore has quite a detailed demonstration of how CML works.

Quick recap:

  • In-memory database
  • Search and filter functions
  • Runtime strongly typed variable generation
  • When compared to a database you COULD have multiple "tables" inside a file since each one just needs a node to mark where it starts and then you just add your rows under that
  • When comparing to DB tables, CML "rows" do not need to have the same  cols for every row. Each row can be as unique as you want it to be
  • Technically speaking, each "row" could be a separate "table" if you want it to be. CML absolutely supports nested tables within nested tables up to infinity deep (or int.MaxValue, at least :P )
  • Safely access data that is not stored in the "row" without runtime errors. CML will return default values by type thus if a variable has the default value for that type you don't even have to bother saving it to the database. This applies to all supported typed: int, long, float, Rect, Vector2, Vector3, Color, Quaternion, string
  • Save anything that you can turn into a string (including base64 encoded binary files)

As you can see, quite a nifty little class to have :) See the product page for sample code to see just how insanely easy this is to use and why you will never want to use XML ever again after trying this! :D 

2. How does one technology compare to another? I honestly can't say. I haven't used the others so I don't even know how well they perform on their own, let alone compared to one another. :( 

The reason why I decided to go with WordPress was because i had created a very very, very simple login kit using vanilla php and mysqli and that asset sold like hotcakes for months... yet apart from saying "Yes, this username and password match what was stored back when the account was created" the asset didn't do anything else. By adding WordPress to the mix I was able to make use of their security features and user tracking across server contacts (i.e. I didn't have to send the username and password along with every single server contact and re-authenticate the user with every single contact) and also, thanks to the WP codebase it meant I could very easily add loads of new features very easily.

Working with WP was both fun and offered great flexibility.  I fell in love with it, simple as that :D 

As for how well it performs, well, like I said above, Unity calls WP, WP does stuff and send back a custom text response instead of generating an HTML page (using the themes and templates and all that stuff) so from Unity's end there really isn't much going on: Contact the server, wait for the reply then do something. On the WP side of things, that works like WP normally works (except it doesn't generate the HTML output) so if your question is "How well does WP perform for a busy site with millions of people?" then you need to contact the WP guys and ask them for those figures cause that sounds like something they might know... from my end, using my kits is 100% the same as making people visit your website.

  • Considering 26% of the entire internet runs on WP I would assume it doesn't do a bad job, though ;) 
  • I myself was curious about all the SQL queries WP runs and how it will affect performance so I spoke to a DBA who all but laughed in my face as he told me that mySQL can easily run hundreds of thousands of instructions at the same time so no way would I be able to create a tool that will break SQL... So, basically, subject to things like record locking, of course, it seems me thinking my kits will break the website is akin to me having an ego the size of the moon... apparently ;) :P
  • BUT, having said all of that, there is one very important thing to note! Since this works like a web page this means my kits are meant to be used passively, not for real time games. I.e. Login in now, fetch the player data a second later, submit a high score every 5 or 10 minutes, save the game data whenever he reaches a save point and click's "Yes, please save" then wait for the server to say "I'm done"... do NOT try and save player position and rotation 50 times a second. That will absolutely NOT work!!!

If you want to use the kits for use with multiplayer games like shooters or MMOs etc, the by-the-frame updates will be handled by your server application but the data itself... well... thisi s where my kits get interesting. :D MBSCore (The broken asset of the Asset Store) has a class called CML which runs everything in all my applications. CML is like XML on steroids with loads of search and filtering functions that allow you to view your CML object as an in-memory database... and i mean that in every sense of the word. Every single CML object can contain any number of "tables" if you care to go as complex as that, otherwise you could simplify your life and use one CML object for each table.

The key thing to keep in mind here is that when your player logins in, you contact the server to fetch all his data. You then keep that data in memory inside that CML file and use that single object for all your game data (achievements, inventory, game settings, position, rotation, quests, whatever you want) and whenever the player reaches a checkpoint or whenever you feel like it you just send all or parts of that data to the server to say "Track this for next time" and then don't even bother with the server result. Send the "store this" command and continue playing. Next time the player logs in after starting your app, all the data is fetched again and you use everything from there. (You don't HAVE to do it this way but I tend to do it this way as it makes sense to me to do this).

What this boils down to is that your players log in and then don't contact the server very often after that... so will millions of players that only contact the server every few minutes kill your server? I doubt that but, like i said, I am not the expert in THAT particular department. All I can do is make an educated guess based on my understanding of the kits and the DBA who laughed at me when I asked if my kits could kill the server ;) 

Hope that answers your questions :)

Hia

1. Unity and I had a falling out. They screwed up, my customers paid the price, I demanded they let me serve my customers, they demanded I leave. That is the short version. Everything I've created for the past 6 years all run on MBSCore and after the latest update they accepted I realized that I accidentally slipped in two bugs that broke the kit. I tried to fix it asap but Unity simply refused. Months went by during which I contacted numerous people via numerous media numerous times but the asset store vetting team kept refusing the update without giving a reason beyond "Something is wrong with something somewhere in the asset. Find that and fix it then resubmit". Not very helpful, is it? 

When I asked about this I simply got no response from anybody via any medium any time for all the weeks of trying... I said "The core of all my assets is broken. My customers are sitting with a broken asset for weeks now. You won't tell me why you reject the fix... what am I supposed to do?". The first response I got was "We have closed your store and all your assets have been removed". 

This resulted in everybody loosing everything they ever got from me during the last 8 years (including free assets) with 0 option to download it if they don't have a local copy still and 0 chance to get an update if they have an old copy. After 7 weeks of enough complaints from enough people they finally allowed people to download the latest versions of the assets they paid for. Isn't that nice of them? Unity also took only 2 months to finally get back to me regarding my emails saying "I keep getting emails from people asking me why the assets were removed and if the assets are no longer being supported or what. There is lots of confusion out there. Can I at least update the meta data to tell existing customers they can still get updates from my site?"... They agreed and let me do so... for everything except the broken asset and the turn based battle kit.

To this very day the asset you can download on the asset store is broken and to this very day Unity has made 0 effort to tell people this and they refuse to let me fix it, instead sending me emails that read (and I quote) "We are not interested"... So yeah, a few customers have asked me to return to the store and one literally begged me for days on end to return to the store but (a) they don't want me there and (b) with that level customer service I  don't want to be there. 

For the past 8 years almost all my reviews reviewed my customer service along with my assets and I got reviews like "I don't know where he finds the time to help me as much as he did", "He delivers the best customer service I have ever received on or off the asset store" and even "His support is so good that you should buy his asset even if you don't need them"...  For the past 8 years I put m customers first to the point where I would go to bed at 2am, receive a customer support email at 2:30am and get up to go reply. Like the Japanese say: "Customer is God". Customer first always... Yet, on the asset store I uploaded a broken asset at around August/September-ish and on the very next day I noticed the bug and sent an update to them the same day! It's been almost 6 months and Unity still hasn't even bothered to tell any of my  customers not to use that asset (that is at the core of everything). Me/ It took me less than a day to have a system up and running where all existing customers could download their assets from my site without having to pay for it again... Unity "are not interested" 6 months later in telling their customers that the asset on the store is broken... 

With me placing the customer first and THEM forcing ME to give the customers bad service simply by blocking me from getting updates and bug fixes to my customers... that is not a place I want to be on. Get the products from me, get updates within seconds after I created them. Compare that with Unity's "we are not interested" attitude and yeah, I have no interest in being on there...

(2 edits)

Hi mate.

Sorry to say but myBad Studios is no longer on the Asset Store. All the assets still work as before and everything is still the same as always... the only difference being all our assets can now be found only on our website (mybadstudios.com ) and on here.

None of our assets will be released on the Asset Store ever again. Existing Asset Store customers can download updates from our website but the Asset Store and us have gone our separate ways.

As for not needing a unitypackage any more, well, the login asset has a pretty comprehensive all-in-one ready made prefab that you can just skin and use as is... or redo completely, as you see fit... but the WordPress plugin is not dependent on Unity to work. As long as you send it the right params when you call it and you have a CML parser to parse the results then these kits can in fact work on any platform. Considering I have only written a CML parser for C#6 that limits the additional platforms to .NET platforms(I'd think. Welcome to prove me wrong! :D ). Sooooo, technically, no, it doesn't NEED the unitypackage (just the WP plugin(s) and the CML parser)... but the Unity prefab(s) sure speed up getting started... :)

Thanks for reaching out. :)

Hi Diego

Thanks for the interest. Let me try and answer those questions for you...

1. All my assets require at least 2017.3 but it works just fine in all versions of Unity after that. Basically,  as long as you use .NET 4 (i.e. set Scripting Runtime Version to 4.x in Player Settings) then you are good to go.

2. Source code? Absolutely. I have never distributed a single DLL in all my life. Full source, always. :)

Check out the WordPress myCustom product for a free sample. It won't work unless you have the Login kit installed but at least you can see for yourself how the code is distributed. Unity code, Server code, Dashboard code... full source included for all of it. :)

All's well, mate.  

I realise that you were asking for suggestions and my pot was not entirely on point.  As such, I can see how you could have seen it as self promotion instead, however, the fact of the matter is that I read your post and I uploaded that entire package to this site especially for you. Heck, I don't think I even posted an announcement here in the forum to tell people the asset is on itch... It's available to all, sure, but I uploaded it for you. Buy on the Asset Store or download for free here... trying to be a good neighbour :) That is why I was so upset by the apparent spit in my face with your reply.

Anyway, we are on the same page now and all is well. As for GameSparks, yeah. I refer to them as Sparks or sometimes Sparky. I do that so often that I often forget the full name :P My Bad :P The way I look at them, they basically do everything a person could want and if only I didn't have such a hard time getting their API to work I would have used them for everything and recommended them to everybody for anything. When it comes to "features" there are few websites that make me fall in love every time I read them... Oh such lovely words ... all those features with the word "free" mixed in between... I think I'm going to faint... ;) So if you are asking "what features should I"... I  can usually stop reading right there cause I already know what my answer is going to be: "Just do whatever GameSparks does and you will be golden" :)

Not sure if that was helpful but that is my opinion non the less :) Good luck with your tool

Peace out

I apologise for my generosity and for wasting my time to offer you something out of the goodness of my heart. Please don't send me a pipe bomb for my efforts!

I thought you said you didn't want to waste time signing up with sites during 1 hour game jams and so I offered you a solution. Nothing is stopping you from still making your own version with whatever features you wanted. I just offered you a working solution you could use right NOW during your weekly sessions UNTIL whatever system you are making is done. 

I did not expect you to be this ungrateful for me dropping my price by 100% to give you a proven tool as the only response to your 2 week old post. Remind me to not do anything good for people in future. Apparently they will just spit in my face for doing so.

Here's a thought: DON'T download the tool. Problem solved.

Sheesh. If you want a features request list, look at Sparks and just include everything they offer. Done. 

Here you go, mate, try this...

https://mybadstudios.itch.io/simple-achievements

All you need is a unique name for each user and you are good to go. You can create your game's achievements right inside of Unity using the included prefab and for the achievement's images you can either store a URL then fetch the graphics online or you simply save the name of an asset in a Resources folder and you are now ready to move on to the rest of your game.

(3 edits)

Okay, so that was the responsible thing to say...now, let me teach you about a hack you can employ to solve your data saving problems.

So, Unity allows you to create a public field in your script, then lets you drag a prefab onto that field in the inspector and during runtime you instantiate that prefab and use it however you see fit... This is Unity 101 and everybody knows this.

What you might NOT know, though, is that you don't HAVE to instantiate that object before you use it. As long as you have a reference to it then you can use it directly.... this includes changing values in the prefab. the thing is, though, that if you didn't instantiate the prefab first then it means you are actually modifying the prefab that WILL be instantiated later but hose changes are forever. You cannot undo whatever changes you made...

...and here comes the interesting part...

...even between play sessions. Yup. Hit play, change any values you want, remove your hard drive and plug it into a separate machine, boot that up and start the game and still the data will be the values you changed them to. Copy the game to a flash drive and install it on your mate's PC and the first time he plays the game he will start with your new values. It would basically be as if you originally set those values when you were busy making the game in the first place.

Unfortunately, this is not the most helpful bit of advice because if you save player's settings this way then every single player will start the game with the settings of the last person who played the game. See? Useless... But since it sounds like this issue is related ONLY to people playing the itch.io hosted WebGL version and you are planning on moving the game to other platforms, well, maybe you might be prepared to take this drastic measure...

What about you create a class (THAT CAN NEVER CHANGE AFTER THE FIRST TIME YOU DO THIS!!!) that contains all the data you want to save for a player. I.e. score, the upgrade level of each weapon, the current ammo, world position, rotation, kill count, etc. All of it. Let's say you call that class PlayerData. Now simply create this script, create a prefab from it and make sure something points to it so you can access the prefab:

public class AllSavedData : MonoBehaviour {
    public Dictionary<string, PlayerData> data;
    public void SavePlayerData(string me, PlayerData mydata) { data[me] = mydata; }
    public PlayerData GetPlayerData(string me) { get { return data.ContainsKey(me) ? data[me] : null; } }
} 

Please note that I have not tested this but in theory this should work. This is incredibly bad coding and should only be used out of sheer desperation but, if I am correct with this then all you would need to do is find SOME way of uniquely identifying a user (PC GUID maybe?) and then you can store all their data as part of the game POST release. The biggest problem with this is that all player's data will load for every player and then you have to extract just the entry you want. This is why I say this is very bad code.

Edit: Come to think of it, I think this means that each time you update the game you will overwrite this prefab anyway so unless using Butler to only update changes somehow allows this to still work then good, I guess... but yeah, just know about this little bug / feature / hack and see if this can be of use to you. I highly advise against it but if you can't come up with a solution that works then what have you got to loose by trying, right?

The other, most safest way, is to save the data to your own server. A very basic and simple solution would be to write a super simple php script that does nothing but create a new file and save anything you sent it to that file. This way you can fetch back that file using the super simple:

string my_settings;
IEnumerator GetMySettings(string me){
WWW w = new WWW("http://mysite.com" + me + ".txt");
yield return w;
my_settings = string.IsNullOrEmpty(w.error) ? w.text : string.Empty;
}

So now you just have to worry about how to serialise PlayerData into a string and back again and hope and pray that someone doesn't use your script to upload code to your site (there are workarounds to prevent that so not that big of a deal) and there you have it. Save the data on your website as a small text file per user and you never have to worry about loosing any settings ever again.

Again, also a drastic move but just throwing some ideas out there.

My entire store is basically built around the ability to store your game's settings but my solution is to store it online under a user account. 

The big PRO here is that your data is synced across all devices you play on (i.e. you can play in your browser then pick up your phone and have the same progress/settings on there or vice versa). The big CON here is that you must store all their data in your own web space. Nevertheless, that is my approach.

I was actually surprised to find this topic because when you read the Unity docs (or at least back when I read them in this regard) they stated that the DataPath is relative to your game and can thus be overwritten but the persistentDataPath was defined as a path based on the platform you were playing on (i.e. the path is the same on all phones, on all Windows system, on all Mac desktops etc) specifically for the purpose of having your data persist between updates. If you are saying it isn't doing that then that truly is weird...

Thing is, though, the actual name of the project and developer determines where the data is stored so just make sure you don't change the name or the com.myname.gamename settings in the PlayerSettings and as far as I am aware, that SHOULD be the end of all your woes! :O 

Note that when you build the app, a GUID will be generated based on the Bundle Identifier, and this GUID will be part of persistentDataPath. If you keep the same Bundle Identifier in future versions then the app will continue accessing the same location on every update.

and of course on Macs

user data is written into~/Library/Application Support/company name/product name

Normal DataPath though...

WebGL: The absolute url to the player data file folder (without the actual data file name)
(1 edit)

https://mybadstudios.itch.io/mbs-core


MBSCore is the foundation on which I build absolutely all of my projects and normally I promote it based on that fact but I have had instances of people telling me they would have been happy enough to pay me literally 10 times what I am asking for MBSCore just for one of the components inside it: CML. It is for that reason that  for a change,here on itch.io, I am focusing my attention on bringing CML to your attention... and then I just throw in a whole pile of extra goodies on top of it as added bonuses :D


The TLDR version: 

Because the non-LTDR version exists (and you will see just how long a short version is when you look at the product page) I had to try and come up with a real TLDR summary for CML and that goes like this: XML on steroids only simpler, faster and easier with far more features.


The slightly longer "almost TLDR" version:

I already list all the stuff that makes CML so truly unmissable in my daily workflow, in great detail, on the product page so I won't bore you with repeating all those details here. Instead, I'll just tell you a quick origin and first use case  story...

About 4 or 5 years ago I had a thought along the lines of "So what makes this thing so great?" and I answered myself "Well, if I understand it correctly, nothing, really. I bet I could do something like... actually let me shut up and just do it and see what happens". A day or two later I had the first version of CML up and running. Sure it was just a Read-Only version but hey, it worked... So the time had come to give it a spin and I decided to do so by upgrading my first and most successful asset to date, my dialogue system...

Now you have to understand that I made the dialogue system before there even WAS an Asset Store so the only place where people could find out about it was on the forum and then buy it from me via PayPal directly followed by me manually sending them the asset via email. Feedback on the forum led to more sales and that was how people learned about it. It was my first asset and was so successful that I made a net total of over $11,000 in my first year and this was without the asset store... Just doing it via email as I explained it above. 

So I re-rewrote the system to use CML as the back end and when it was all over I could not believe what I had done. 


It only took me about an hour to make the changes but the end results were:

1. My insanely rigid syntax rules where a comma or a tab in the wrong one's place would break the entire dialogue file was now replaced by a super forgiving syntax ...and not only one, but two flavours thereof... which you could mix and match into one file however you saw fit !!!

2. I made the kit infinitely more user friendly by now calling any function they choose rather than forcing them to create a specific function with a name I hard coded and then force them to funnel all their code through that one function's (sometimes) complex  nested switch statements. 

3. On top of that, where I used to force them to send exactly 3 parameters for every function they wanted to call, now I gave them the freedom to send anywhere from 0 to infinite parameters for each of the 0 to infinite number of functions they could call per turn. In addition to that I gave them the option of naming their scripted variables because, yeah, my dialogue engine now supported returning strong typed variables at runtime.

4. But most importantly of all... after making the dialogue files so much more user friendly and the syntax so much more forgiving... and after simplifying the means by which they could call custom functions with literally a near-infinite level of customise-able choices... the thing that stood out the most was that this new system was now 70% less code than the original version! And it now included multiple read and write options to boot!

Since that day I've not been able to work on a project without using CML

Absolutely everything I make runs on MBS Core and 98% of that functionality comes from the super easy to use mbsStateMachine system and CML. Once you've experienced CML you will understand what I mean when I say it will change the way you code forever.

Just imagine for a moment what I said earlier... It can generate typed variables at runtime. Considering the fact that CML is basically a virtual, in-memory database, it means that you have immediate access to any data you store therein (minus the SQL ) ... now factor in the last part of this ... You can save that entire database and every single last bit of data you are using in your game to disk with only a single line of code! When starting the game again you can load back every single last bit of your game's data and have it exactly as it was the second you closed the game the last time... all of that in 1 line of code. Now how is THAT for a changing the way you work?

From now on, just create or load a single CML file during your starting scene using this skeleton code as a starting point:

public class Inventory.cs : MonoBehaviour {
static public CML Data;
void Awake(){
    Data = new CML();
    Data.Load("data");
    if (Data.Count == 0)
    {
        //insert first play settings here...
    }
}
void OnDestroy() => Data.Save("data");
}

...and that is that. You can now store all your game's data into Inventory.Data from anywhere in the game and have all your game's data automatically save itself and restore itself upon startup. CML has made life THIS easy while affording me bucket loads of options.

It has undergone years of updates and improvements since and, as recently as the start of this very month, it got upgraded yet again.
We are now on version 4.0

In closing

CML has changed my life and here on itch.io is literally the first time ever where I explain in this much detail why some people say CML alone is worth 10 times the price of the asset it comes bundled inside of. With 22 years of coding experience behind my name I have spent the last 4 or 5 years unable to do any work without including CML in it... Take a moment and let that fact really sink in.

So to all of you I say, go read the product page, make sure you have coffee before you do so... then be prepared to get excited about what I am placing before you!

Enjoy! :D

Thanks :)

Glad you like it! :) I tend to update this quite regularly whenever I have a brainstorm moment. I'm sure there are a number of features I forgot to mention but that probably wont matter much since there will likely be new features added before I discover which ones I forgot :P 

I posted this one first as it includes everything current and future all in one so I definitely believe this to be the best value for money option but as soon as I am done with the asset I am busy working on I'll start posting the individual assets here also so people can get only the features they want and pay significantly less for them than buying absolutely everything in one go. That should allow people to ease into this system more gradually but eventually that option will turn out to cost more so yeah... Start with the best option then add the more affordable ones afterwards :)

My goal is to stop using the Unity Asset Store and sell content from my website exclusively but the one advantage they have over me is traffic. Itch.io offers me a solution to the traffic problem so I plan on releasing everything on here (assets and games) so if you are not following me yet, consider doing so cause there is a lot of content coming :)

(1 edit)

Some more control panel images





Creating a new game in WordPress...

One example of how you can present it to your site visitors...

After they clicked on one of these to get to the product page:


(2 edits)

No, this is not a web browser for Unity. This is a means of directly connecting your Unity project with the WordPress database via the WordPress API. This means that you use Unity to create your game as normal but you use WordPress as a means of identifying you for logins, store your high scores and save game content etc directly to your WordPress database.  

This essentially means that all your games become cloud games since you can start playing on your web browser at work, continue playing on your phone while on the bus and then at home you can continue on your PC. Your progress, achievements, high scores, unlocks, everything is automatically synced since everything saves to one location and everything fetches it back from there again.

You can see an example of it in action here: http://guild.site/bad-dreams 

It's a free-to-play game that showcases how this asset logs you in via WordPress, displays your actual Gravatar avatar, stores your score and a leader board, has a shop where you can unlock stuff and then save your unlocks / upgrades / stock / currency online. Also, the kit includes virtual currency and obviously that is showcased also. Kill zombies, get cash, spend the cash to upgrade your weapons, get more cash for killing more zombies more easily, upgrade some more :D

I struggled to figure out how to showcase the serials and anti-piracy stuff since using it means you simply cannot play the game if you didn't pay for it... and yet I wanted to make this game free to play. So I used the third mode of the serials kit instead. Instead of forcing you to pay in advance or after a few levels I leave the game free to play but I give you in-game advantages IF you actually went ahead and bought a serial via the WooCommerce integration I added to the kit. Yes, you CAN buy virtual currency for the game via my WooCommerce store, sure, but that's optional. Just wanted to showcase that.

Then there are the achievements you can unlock and the candy crush style "you have 5 lives. If you die it will take 30 minutes before you get another life. Come back later" timers on display as well. All of this running on a WordPress back end with a Unity front end. 

This, of course, means an entire array of options that can be set via the WordPress dashboard. Each individual part of this kit has it's own configuration tab under the WUSS main menu and allows you to do all manner of things. 

For one, it lets you see exactly what data any player has stored on your server and allows you to edit or remove it. Remember: install once and then you can run as many games as you want off of this single website. Now imagine you have 3 games and 100 players each and all their progress and unlocks etc is saved to your site. Via the dashboard you can view and edit that info per user as and when required.

On the flip side of the coin you can also save game data for other users to use in game. Examples may include chaning how many hitpoint an enemy boss requires to be defeated or how many coins you get when you unlock chest 3 or what character is unlocked when you reach spot x or where spot x is, even. Stuff like that can be edited after launching the game and all changes are live instantly and don't require the game to be downloaded again for your updates to take affect.

Another nice little feature is being able to kick or ban a user from being able to log in to the game. Just click on ban to ban and unban to unban. One click. Alternatively, set the days, hours and minutes to kick the person off the game for and their status is automatically restored when the timer runs out. 

Generate serials for physical copies sold in stores, one click. Generate serials to use with WooCommerce sales or to hand out manually, one click. Assign a serial to a user/ friend/ whoever, one click. Revoke the serial (you guessed it) one click. View all available serials per game / view all allocated serials per game / view all the games a specific user has a serial for... check, check and check.

And then of course there is the WordPress shortcodes that generate game posters, banner links to product descriptions, shows the currently logged in person's status (banned or good standing) for the game, the leaderboards (also available as a widget).  Check out the available shortcodes here: http://mybadstudios.com/wordpress-systems/wuss-portal/

Not shown there is the shortcode to display your WebGL game inside your WordPress pages / posts. To show Bad Dreams, for instance, all it takes is this [wuss_webgl name=BadDreams height=500] and that is that.

Truly, as I said a few paragraphs back, WordPress for the back end and Unity for the front end. :) The stuff listed on the product page is the features available right now but there is a heck of a lot more coming including a friends system, PM, something similar to a FB wall, an online auction house to allow users to sell/auction off rare in-game items between each other... just to mention a few.

This is what this kit is all about :)

Hi All. 

I just published my first ( of many :D ) product on Itch.io and it's something that I am super excited about. For the past few years, in between contract jobs, I have been building up a collection of features that bring WordPress into Unity games and the other way around.

Initially I was very proud to be able to say that all my assets required 0 configuration on the server end. Just install the plugin in WordPress then get back to Unity, drag a prefab into the scene and hit play. Done and dusted. As time went on, though, not only did I start giving people server side options but I also started adding code to build their websites for them!

So at this point I can generate your game's website, let you use the website login details to log into your game, let your game use the website's database for whatever you are doing, automatically make all games cloud based and cross device synced, then let you put the game up for play on your website but require that people buy it from you directly on your website first and then I go and prevent them from pirating your game on top of all of that. Just check out the product page to see all the currently included features.

This system has come a very long way from just logging you in and saying "You are logged in. good luck with the rest of your game!" and now it is available on icho.io in a "Buy everything I've done so far and get everything I will ever do added on for free"-version. I also include a full game template with all the assets integrated already so you can see how to use them in practice, not just in theory!  :D

I hope you guys like it!

Ryunosuke

P.s. in celebration of my first product on itch.io I am giving away 10 copies of THE Dialogue Engine to the first 10 people to buy this asset. THE Dialogue Engine was the first dialogue kit to be released for Unity, released almost a year before the Asset Store was created and still going strong. It's features are way too many to even list on it's own product page so I won't even attempt to list them here :D 

https://mybadstudios.itch.io/wordpress-for-unity