PlayerPrefs v. XML File for Saving Data in Unity3D? - database

I searched all around Google and YouTube and I could not find a definite answer to my question.
Should I use PlayerPrefs or XML files to save the all the data that is in Version 1 of my game? Or is their any other format of saving that you prefer?
My game does not have much data that will be saved onto it, but it is not very minimal either. The things that I will save in my game are: Options Menu (Sound FX on or off, game music on or off, and the 10 second Story Animation on or off), Scores for the distance you go in my game (around 10 scores, kinda like a billboard), and a very simple store where you can unlock two more characters after you have achieved a certain distance in the game. Their is not much right now but I am going to be releasing updates in my game and it will continue to grow and expand, so I would like the savings option that can be expanded upon the best. I tried my best to explain my unique scenario, if you need more information just let me know and I will add it. Thank you! :)

I searched all around Google and YouTube and I could not find a
definite answer to my question.
That's because both of them will accomplish the work. It doesn't really matter which one you use. They both can save your game data.
Now, In my own opinion, you should use XML for portability reasons.
When you save your game data with PlayerPrefs, you will be stuck with it on that platform. For example, PlayerPrefs is saved as .xml on Android and .plist on iOS and Mac OS, .dat on Windows App Store and as a registry key on HKCU\Software\[company name]\[product name] key on Windows. These are not interchangeable.
Assuming you want to allow players to transfer all player settings from one platform to another, that would be a problem. By using xml, your game will be able to use it on any platform you want. So a player can take their settings from their Android phone and use it on their PC or Mac without problems.
When you want to change your game engine from Unity to another such as UDK, you will have a hard time using the player's old data. I've seen a question about transferring player's data from Unity to another game engine. If this person used xml, that wouldn't be a problem at all. You will get negative feedback if your players lose their data due to game engine change. If you think that you never have to change game engine, remember that you are not the founder or the CEO of Unity Technologies SF. They make their own decisions and any other competitor can buy them anytime and shut them down. This happens all the time. Stick with xml if you really care about PlayerPrefs vs Xml.

Related

Take photo of pre-formatted screen and extract specific data

Apologies in advance if this is a dumb question. Is there fairly straightforward way to write an app that will use the Camera (for example iOS) to take a photo of a pre-formatted screen and recognize / retrieve that data?
This isn't a top secret project or anything, so I'll be happy to share as many details as necessary. Basically my electric car displays a pop-up with stats when it turns off. Since there aren't any OEM apps that track things like charging, I guess I have to do it manually. I figured, since the screen is always the same, perhaps it would be possible to aim the camera "just right" using an app that could look for certain data in certain places. The way a shopping app looks for barcodes or Apple Wallet reads credit card numbers.
Is this a dumb idea? If it's easy and you'll make a million bucks selling the app, then feel free to steal it. I'll be your first customer. In the meantime, is this doable by a random jackass who's way over his head when it comes to programming? :-)
For example, if I could just grab Energy Used and Miles driven, then I'm sure I could programmatically get other data like date/time from the device taking the picture. Here is one example.
'energy used' popup Sample screen 001.

Is there a way one can access the game time variables like health bar and other scores from a game running on unreal engine

My objective requires that I am able to access game time variables like health bar, certain scores etc, when the game is running. I do not want to change this variables, or cheat in the game in anyway, I just need to collect this data and do not want to modify it.
I need to be able to get that information in a python/c++ environment. I know that cheat engine like software might be able to help me, but since DRM and anti cheat software prevent me from doing just that and therefore it might not be possible anymore, other option I am currently exploring is to screengrab and using opencv and character recognition get the information I need visually, but this seems like unnecessary and extra work that might even not work that well.
I also explored if there is any API from unreal engine (the game is based on unreal engine) that might just allow me to do just this, but had no luck so far. So I ask you one more time, you to suggest me some solutions to this issue.
I think DOTA 2 allows this in some way, since openAI/others use data like this to train their AI's so it should be possible right!? I am just interested in knowing how can this be done.

Need recommendations on techniques or designs for this type of web site?

So, I've just decided to build my own fantasy sports web site.
You know the type of site where you can pick players from your favourite league and depending on how they do you get a certain amount of points in your team. There are fantasy teams for all types of leagues and sports, I'm sure you know what I'm talking about.
I haven't settled for a specific sport or league just yet because I want the basics to fit to different types of team-based sports.
I have a few expectations on it myself. If you can come up with any other I'll be glad to hear them.
I expect the site to be dynamic and have many visits during a game, but almost only static content otherwise.
Player points should be updated in real-time during a game.
I would need a list that shows each game being played and the points of every player in that game. It should also show minutes played, goals, assists etc.
Each registered user would be able to see the points and players of his/hers team updated in real time.
I need the site to scale so that if I start with 1000 teams I could end up with 5 million.
I probably won't be needing language support right now, but who knows in the future.
Based on these prerequisites what would be best to use in terms of language (php, .NET, drupal or other cms's), database (mysql, sqlserver, xml) and other techniques?
Maybe it doesn't really matter what I use?
I guess the dynamic and real time update of each player's points is where I need help the most.
Thanks in advance!
/Niklas
EDITED
I could use an array with the following data for a specific game week:
Player ID
Minutes played
Sport specific points(goals, assists, penalties, yellow cards, man of the match bonus) etc.
Total points in current game week
When the game is over I'd add these to a DB and sum this data with any previous game weeks. Plus player value, number of teams that has selected this player, etc.
You are probably going to have to go down the custom route for your "Game" code - rather than using a CMS, although depending on your experience, you may be able to leverage a framework (e.g CodeIgniter) to speed up some of your DEV time.
This type of site would be pretty language agnostic, however it would depend on the actual numbers of users you are looking at as to the most scalable solution / set of techniques to deploy.
One of the biggest considerations you are going to have to look at would be the design of the data model, and the platform that this sits on.
If you want to be processing near to realtime updates, you are going to want to focus your efforts on making the DB queries / processing the most efficient possible.
One big consideration that you have not discussed here is caching. There is some data on your site that I am sure will be static for long periods of time (such as weekly totals etc), and there is data that will be very much real time (but only during match days).
However, during match days you will have a lot more traffic than non match days, and you will therefore have a lot of requests for the same data in a short period of time. Therefore, employing a good caching strategy will save you masses of CPU power. What I am thinking of, is to calculate a player's score and then cache for 1 minute at a time, therefore each time that specific player is requested, you are retrieving from a cache, rather than recalculating each time.

Using Spotlight as the "database" of an application

I'm developing an OS X application to organize "things" (as iTunes is to music and iPhoto to photos). Instead of having my own database and index, I'm considering using Spotlight to essentially serve this purpose.
Has anyone tried this? Is it wise?
The main benefit, as I see it, would be simplicity and avoiding redundancy. It seems a bit wasteful to implement my own index machinery when OS X comes with one built in.
I have little experience working with Spotlight, however. From a user's perspective, I do know that it has been slow and imprecise in older versions of OS X. I also have a gut-feeling that since it's aimed at searching the whole filesystem, using it for "local" purposes becomes hackish.
Obviously, my applications's index needs to constantly be up-to-date. Can mdimport be used for this?
Several apps ship this way. I believe there is at least one company that puts all their customer data into text files to use Spotlight to find information. I save notes with keywords all the time with full confidence that Spotlight will be able to find it later!
In general, you don't need to prod Spotlight to keep the index up to date. It is very good about watching file changes and indexing rapidly.
The key, really, is figuring out your file format. If you go with something that Spotlight can index -- say, text files -- then you don't have to write an importer. If not, you do. Also, have a look at Core Data as it has excellent Spotlight support, too.
One caveat; there are those users that manually turn off spotlight indexing on a particular volume. Rare, but possible.

Managing a large collection of music

I'd like to write my own music streaming web application for my personal use but I'm racking my brain on how to manage it. Existing music and their location's rarely change but are still capable of (fixing filename, ID3 tags, /The Chemical Brothers instead of /Chemical Brothers). How would the community manage all of these files? I can gather a lot of information through just an ID3 reader and my file system but it would also be nice to keep track of how often played and such. Would using iTunes's .xml file be a good choice? Just keeping my music current in iTunes and basing my web applications data off of it? I was thinking of keeping track of all my music by md5'ing the file and using that as the unique identifier but if I change the ID3 tags will that change the md5 value?
I suppose my real question is, how can you keep track of large amounts of music? Keep the meta info in a database? Just how I would connect the file and db entry is my real question or just use a read when need filesystem setup.
I missed part 2 of your question (the md5 thing). I don't think an MD5/SHA/... solution will work well because they don't allow you to find doubles in your collection (like popular tracks that appear on many different samplers). And especially with big collections, that's something you will want to do someday.
There's a technique called acoustic fingerprinting that shows a lot of promise, have a look here for a quick intro. Even if there are minor differences in recording levels (like those popular "normalized" tracks), the acoustic fingerprint should remain the same - I say should, because none of the techniques I tested is really 100% errorfree. Another advantage of these acoustic fingerprints is that they can help you with tagging: a service like FreeDB will only work on complete CD's, acoustic fingerprints can identify single tracks.
For inspiration, and maybe even for a complete solution, check out ampache. I don't know what you call large, but ampache (a php application backed by a mysql db) easily handles music collections of tens of thousands of tracks.
Reecently I discovered SubSonic, and the web site says "Manage 100,000+ files in your music collection without hazzle" bt I haven't been able to test it yet. It's written in Java and the source looks pretty neat at first sight, so maybe there's inspiration to get there too.

Resources