Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by VeeooshL · Sep 18, 2016 at 02:03 PM · 2dprocedural generation

2d Solar System procedural generation

I have made a 2d solar system generator. Planets get created with random size and color, then rotate around the sun with a speed depending on their scale, the suns scale, and the distance away from the sun.

However, I have no way to save this. There are WAY too many variables. Could I use a seed to create it? I need to keep track of the position, scale and color of the planets, and the position of your ship and AI ships. I'm not sure how to save all this data. How would I do this? I'm planning on remaking this, so any solutions are appreciated.

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

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Adarn · Sep 19, 2016 at 04:39 AM

Yes you can define the seed of an RNG. If you are useing Unity's RNG you can do it with the following public static void InitState(int seed); https://docs.unity3d.com/ScriptReference/Random.InitState.html

Keep in mind that this will need to be done at the beginning of your game. Not at the save point. So that you know what your seed was.

Also you will most likely not be able to regenerate everything, as in order to do this you would need to run through every RNG call that you have made in the correct sequence when loading your saved state.

You will still need to save some values such as player position as their position is not determined by the RNG but the players input.

So yes you can seed the RNG to regenerate the same numbers, but you may need to implement a mix of both regeneration and saved values to save and restore your game state.

How big is your save state? Have you checked? or are you just going by what you think is a lot?

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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

2D topdown generating stairs (access) to generated hill 0 Answers

How To Use Fractals For 2D Procedural Generation 0 Answers

Advice on 2D Surface Terrain Generation Using Noise 1 Answer

How to return tile based on heightmap efficiently? 0 Answers

Best way to handle large tilemap? 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