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 /
avatar image
1
Question by UnityDeveloper08 · Dec 19, 2012 at 10:37 PM · savexmldataencrypt

Saving important data securely

Hey guys,

I am in the process of making a game that allows users to create their own weapons, and have ran into what might be an issue. When the player creates their weapon I want it to be saved to their "Armory" which is just a script that holds all of their weapons. Now the problem I am facing is how to actually save this and it not be tinkerable by the user, as this would potentially create an imbalanced game if someone adjusted the damage of the weapon in the save.

Also any suggestions on how to go about saving this will be greatly appreciated.

Comment
Add comment · Show 1
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
avatar image savlon · Apr 11, 2016 at 11:48 AM 0
Share

There is a paid course you can get for FREE on Udemy. It covers 5 different methods to save and load data in Unity3D. It covers PlayerPrefs, Text files, Binary Serialization, Xml Serialization and even SQLite! The free coupon link for this course is https://www.udemy.com/saving-and-loading-game-data-in-unity3d/?couponCode=UNITY Goodluck!

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by DuxDucis · Dec 19, 2012 at 11:30 PM

You could use the fairly easy serializer JSON.NET to serialize the class in which you weapon variables are stored. That will leave you with a string which can be encrypted, click here for further info on encryption http://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp. And then just commonly save to a plain text file and unencrypt and deserialize with JSON.NET at load. If you post some code I can give you an example.

Comment
Add comment · Show 1 · 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
avatar image Alec Thilenius · Dec 20, 2012 at 12:44 AM 0
Share

Note that if this is a multiplayer game and you are worried about cheating then the only way to secure such data is to store it on the server. Any local file can be hacked by the diligent hacker. You are then getting into the realm of authoritative servers.

avatar image
0

Answer by UnityDeveloper08 · Dec 20, 2012 at 12:11 AM

Thanks for the help Dux. How easy would it be for someone to hack this and create their gun too powerful or to put an upgrade on it that should be locked? Sorry that I dont have any code atm as it is all in R&D atm and is very sloppy.

Comment
Add comment · Show 4 · 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
avatar image DuxDucis · Dec 20, 2012 at 03:44 AM 0
Share

You don't have to worry about someone unencrypting that as the key you use to encrypt is unique.

avatar image Alec Thilenius · Dec 20, 2012 at 03:56 AM 0
Share

It isn't as hard as you may thing actually. Remember that the key will be stored locally. You don't have to crack it, you just need to find the key. If its a single player game though, then none of this is needed at all. Only multiplayer games need this type of security.

avatar image UnityDeveloper08 · Dec 20, 2012 at 06:11 PM 0
Share

The game is infact multiplayer. I think the best bet would be the authorative server route, although I have no clue where to begin with that. Anyone have any advice on it?

avatar image coolraiman · Apr 11, 2016 at 12:31 PM 0
Share

use a 256 bit encryption and hackers will need a super computer to crack it. well, you cant really crack encryption, you can just brute force it by trying every password combination possible and it would take years

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

12 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

Related Questions

How to create an XML file in Unity 1 Answer

Save data through xml Serialization on iOS 1 Answer

saving data 1 Answer

whats the best way to save a large list of variables? 1 Answer

Saving/Loading Vertices Efficiently 2 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