Hot answers tagged

10 votes

Would it be better to use XML/JSON/Text or a database to store game content?

Im late to the party here but I spent A-LOT of time researching this. First why I don't use the following: XML: Excessively verbose. Tons of redundancy. Repeating field names? GROSS JSON: I think ...
Aggressor's user avatar
  • 233
3 votes

How is data regarding items in RPGs and other loot-based games stored and implemented?

We can't answer questions like "how do they do it" because, well, we don't know, and they won't tell us. We can help you figure out a few things, though. In software development in general, ...
Vaillancourt's user avatar
  • 16.3k
2 votes

Tower Defence stat storing system

Firstly, I see no issue (in principle) with the first approach, the XML file. Easily editable, easily extendable. Secondly, I would still recommend not using XML, and using JSON instead, since it's ...
sh code's user avatar
  • 196
2 votes
Accepted

Best practice to store level data in a rhythm based game

Well, either one of them can be authored with existing tools, which is always a good thing. When I was making a rhythm game, I determined that it would be easier for me to just make my own format with ...
Nox's user avatar
  • 890
2 votes
Accepted

IEnumerable Elements 'Where' and 'Select' In Unity?

LINQ expressions (Where, Select etc.) are a .NET 3.5 feature. By default, Unity only supports .NET 2.0. You could change the used version of the .NET framework in the project settings of MonoDevelop /...
Philipp's user avatar
  • 118k
2 votes

IEnumerable Elements 'Where' and 'Select' In Unity?

You are missing: using System.Linq; While a little out of date at this point I find the Mono Compatibility page form the 4.10 documentation to be useful. It ...
Kelly Thomas's user avatar
  • 3,872
2 votes
Accepted

How to securely store xml/json information about actors in a game?

You could use JSON and zip it with a password (encrypt), then use a runtime zip library like DotNetZip to extract it for inspection by the game only, no-one else. Or you could access it on a secured ...
Engineer's user avatar
  • 29.4k
2 votes

Relational Databases vs XML vs public static finals: Pros and Cons

1: TOTAL overhead. Like driving a 40 ton truck to your weekly shopping for you and your spouse. Adds a lot of memory eating high end functionality into what is essentially a configuration file. If you ...
TomTom's user avatar
  • 155
1 vote
Accepted

`System.Xml.XmlDocument.Load(Path)` doesn't work on Android

Thanks to DMGregory. TextAsset is a great solution. If anyone is interested, here is what the SetLanguage method looks like now: ...
Iakov Lutsevich's user avatar
1 vote

How to create a re-usable layout of text fields that can be bound to in world space?

One very easy way is to only use one text renderer (e.g. TextMeshPro) in each place that you want to display text, and format all the text you want to display into a single multi-line string. ...
Kevin's user avatar
  • 4,916
1 vote

Unable to select MonoDevelop to open XML file from Unity project

MonoDevelop was phased out in version 2018.1. You now need to use something different, like Visual Studio.
blizzo's user avatar
  • 11
1 vote

XML, how to have two variables under the same node?

It's hard to avoid "ugly and inefficient" when serializing data as XML, but space- or comma- separated strings for coordinate data is okay. Alternatively, you can use two attributes or make position a ...
Jimmy's user avatar
  • 9,029
1 vote
Accepted

Relational Databases vs XML vs public static finals: Pros and Cons

This is definitely overkill. I'm going to liken this to drinking a glass of water out of 5 gallon bucket. Because I think unlike TomTom's answer, although apt, I'd like to get the point across that ...
Joshua Hedges's user avatar
1 vote
Accepted

Way to deserialized or load last save state scene with GameObject and other classes instead of storing normal fields via binary format?

Unfortunately, after several experiments to find the easy way to store GameObjects effectively without hassle, there is no shortcut in preserving files + game ...
David Dimalanta's user avatar
1 vote
Accepted

Data Driven Design and Game Screen Resolution

I think you want to put them in world coordinate position instead of screen coordinates; instead of the values relating to a position on the screen and thus changing; make, it say the position x=30 y=...
Adam Dunmars's user avatar
1 vote

Updating an XML Document to Match New Save Data?

You could use a datacontract. So below is how to use a datacontract with two versions of FileData ( v1 & v2 ). Comment in filedata version 1 and call testV1(). This will cause filedata version 1 ...
RobM's user avatar
  • 422
1 vote
Accepted

Should I use SAX or DOM to parse Game dialogue/text events in XML?

Typically, if you just want to retrieve one specific datum in an XML file (such as, e.g., the text of one specific dialog) a SAX parser will give you faster access times because it does not have to ...
Thomas's user avatar
  • 1,209
1 vote

Tower Defence stat storing system

Although I think @sh code 's answer is the correct way to go, I wanted to add that Unity's new prefab variant workflow is really useful for making related objects have slightly different properties. ...
Adam B's user avatar
  • 780
1 vote
Accepted

Problem in Unity ad

I solved the problem. i removed all playstore plugin from my project, then i select Edit -> Reimport all. then I import admob plugin. them in AndroidMainfest.xml i changed "android:value="true" to ...
Manoj Balaji M's user avatar
1 vote

Reading XML working in my computer but not in my Android phone

What you are trying to do is "load an asset". Here's how: http://docs.unity3d.com/Manual/AssetDatabase.html ...
Almo's user avatar
  • 6,678
1 vote
Accepted

How to make a levels map page?

If you want to define the positions of the buttons independant of the screen resolution, you might want to use a relative coordinate system. So a single screen is defined as a 0 (left border) to 1 (...
Felsir's user avatar
  • 4,057
1 vote

How can I save an XML file with Unity on the Android platform?

It's faster to debug in the Editor, so this made my life simple: ...
Seb B.'s user avatar
  • 121

Only top scored, non community-wiki answers of a minimum length are eligible