Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jul 07, 2014 at 03:58 PM by Firedan1176 for the following reason:

Answer wasn't entirely relevant; also asker's fault

avatar image
0
Question by Firedan1176 · Jul 07, 2014 at 01:05 AM · stringdatabasestatshashtable

Most efficient way to store a list of data as a string?

Okay, I need 1 string that will save a player's stats, and it has to be a string. I can't use UserPrefs either. My game needs to store the 2 weapons a player has (primary and secondary; there are pistols, sub-machine, lmg, assault, shotguns, and melee weapons), the number of grenades (0-8), number of barriers they can place (0-2), if they have equipment (claymores, etc), cash, and their current level in the game.

I guess it necessarily doesn't have to be a string, but it has to go into a text document in 1 line (word wrap obviously doesn't matter). This is what I've got so far, with decimals separating each and every item:

1a.1b.0.0.0.2.1.0.22000.18

This player has the first pistol (primary; hence why there's an 'a'), the fisrt sub-machine gun, 2 grenades, 1 barricade, 22,000 cash, and rank 18. I can easily just split this data and all, but do you guys know any other possible way to store this? I'm not looking to save room, because that's not a problem.

I just want to know if you guys out there know any fancy way to 'encode it' and then 'decode it' to make it smaller (again, doesn't really matter, but also security). Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
1

Answer by SirCrazyNugget · Jul 07, 2014 at 01:12 AM

As you've also tagged the question with hashtable I'm guessing you're just looking for a way to store the data and retrieve it without it necessarily being legible by humans (safer choice if you want less chance of it being tampered with).

Mike Geig did a session on Persistent Data using Binary Formatters.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Simple Dictionary / Hashtag system for Inventory with Unityscript only ?? (no C#) 1 Answer

How to change from login scene to character costum scene ? 5 Answers

Storing unit data for an RPG 5 Answers

Quick SQLite question for Unity Game Database 1 Answer

How do I connect to an Oracle Database? 6 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges