Jump to content
  • Advertisement

Project: Unsettled World

Inception, or How I Lost My Mind.



Well, this is the first post for a project I've been working on for a few months already. 

So, let me rewind a bit....

A few months back I started toying with the idea of making a game with an actual spheroid planet as the core of the environment.  Yay Unity and Blender!!  A few weeks of toying around and I had a pretty neat little 5000m diameter spheroid planet with custom gravity and a player character(UMA v2) running around on it. 

Well, that was way easier than I expected...

It was at this very point, the actual madness began to set in.  Well, it's working, I guess I should make a game out of it...  Okay.  Hmm, online?  Of course!  Hmm, mmoYES!  Oh, damn, I've really lost it now.  Crafting, well, certainly.  Mining and hunting?!  Don't be silly, yes yes yes yes, all the yes.

Bigger? hmmm.... hmm... yes?

Let's try 10000m radius..  hmmm...  Jittery character movements.. and jittery everything... hmm... 

9000m radius?  all good... hmmm...

And this is where I learned all about the floating point precision problems of 3d engines at great distances from 0,0,0..  Fun stuff.  Only slightly maddening.  But, in the end, also easily solved by rotating the entire freakin planet periodically so the player character and camera stay close to 0,0,0.

Let's pump this guy up to 30000meter radius and call that good for now. 

I ran across a few other jitter problems along this winding path but those were solved through the careful use of the "FixedUpdate" vs "Update" method selection.  Moving anything that involved my custom gravity or physics in general to a FixedUpdate method was the solution for most cases.

So, we got a character and a planet...  I guess we need stuff to do. 

And from here the rabbit hole only started lengthening, until there really was no beginning or end.

So, there's one of the nutshells...  The inception!

Over the next few days I'm going to try to detail as much of the current guts of this beast as I can for anybody who's crazy enough to follow along, while trying to not distract myself from creating more of them of course. 


Project Stats:

Unity Game Client Lines of Code: 24,032

Avatar Server Lines of Code: 2,480

Economy Server Lines of Code: 387


Recommended Comments

FYI - There are issues with Unity and very large numbers for positioning that leads to jitter problems, the floating point precision in unity suffers at large numbers as you've already discovered, when you talk about 30km radius objects you're going to hit these.

I read about this issue in passing so i'd have to find links again, but i do believe there are some assets on the assetstore that will help with this... the work around is something in the realm of 'rehoming' the camera to origin and moving the game world around it when you have the camera position exceed a set limit from origin. IIRC it was somewhere around the 10,000 mark but thats going by memory.

Edited by Stragen

Share this comment

Link to comment

"But, in the end, also easily solved by rotating the entire freakin planet periodically so the player character and camera stay close to 0,0,0."

I should have expanded on that a bit as it took a few days of research and imagination to resolve.  The fix was not only the periodic rotation back to 0,0,0, but the 30km offset for the planet is kind of important to mention as well.  Smaller terrain segments and a lot of code shifted around between Update and FixedUpdate, there were a lot of things that went into the jitter issues..  I'm sure there will be more.

re-homing, re-zeroing, I ran across the actual technical term in another thread on here "origin re-something" or something.. haha, and promptly lost it..  I ended up implementing all the fixes in my own code though.  Unfortunately, I find that most Unity assets are either too heavily tied into the built in gravity or otherwise not a good fit for my environment, AKA just way too much money.

Share this comment

Link to comment

How did you implement the gravity? Just using inbuilt rigidbody kinematics or your own code? I ask because i was considering a similar system, using Unity, but have slowed down on this part due to not being confident with the floating point dramas - not a hurdle i want to try to jump just yet...

I'm curious as to if 'moving the world around the camera' lead to unexpected behaviour with those systems and calculations....

Share this comment

Link to comment

My "gravity" basically amounts to turning off the default gravity, setting the value to 0,0,0.  Followed by writing a script that applies the same acceleration force(to a standard rigidbody) but with a vector that always points towards the planets center.  That script is attached to everything that needs gravity applied to it(this may change, if only for simplicity sake).  Pretty much everything else physics wise is standard/default.  Like you I was very weary if I would be able to make any of this work before diving in, I figured the physics and 3d maths would just get all kinds of screwy and I wouldn't be able to untangle it, not the case I guess.. ;) I'll go ahead and dive into the gears of how I got my world spinning on my blog tomorrow morning.  It's probably the biggest hurdle I've run into so far(code wise) and deserves some space and documentation.  Plus I should review all that again, been a few weeks since I touched any of it. 

Share this comment

Link to comment

Posted (edited)

Can we see some screen shots of your freaky madness?

[ never mind, I just read your next blog entry :D ]

Edited by Awoken

Share this comment

Link to comment
7 minutes ago, Awoken said:

[ never mind, I just read your next blog entry :D ]

I made a few edits and left a comment about the same time you left this reply, dunno if you saw them.  Thanks for giving it a read!

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Samuel Aponte Sustache
      Ok am not an game developer but I really got annoying when a player uses aimbot and no way as a player to do a thing. Im graduated as electronic technician and I study the nand.
      This guy can be implemented on our game program as a protection in case of cheating.  The objective of a cheater is for example 7, 10, 15, kills on a row but what if the player install a nand program and instead of the cheater kill he automatically dies....."wtf" he will be confuse.  What about a nand program.  If the player suspects cheating or server admin then you will apply the cheater the medicine and he will eventually goes.
      Samuel Aponte 

    • By LonelyStep
      Thought I'd reach out for some feedback on my little project. This is an android two-player game for top-down boxing matches. The core mechanics are all that I have accomplished thus far, later I want to add different configurations for your boxer (special effects, increased health or damage, etc) and maybe even a single player AI to practice against.



      Right now the gameplay feedback I'm looking for is on the fundamental mechanics of the game.

      One area of particular concern is the window of opportunity for a player to block after their opponent has begun a punch. Currently that window is one-tenth of a second, otherwise you will be to late to counter their blow. I want it to be difficult to successfully pull off a block and have it be something that requires real attention to accomplish. I'm wondering though if it isn't too difficult right now, which may encourage mindless button mashing, which is certainly not what I want to condone.

      Another consideration is whether having three main actions (block, attack, charge) provides a good balance. My idea with having three main areas is that your two thumbs will have to leave one section uncovered at all times. This should result in hand movements that telegraph actions to the opponent.

      Aside from these, any other constructive criticism is very welcome.

      My game can be found at the Google Play Store here:

      NOTE There is a known graphics error when performing a special punch. There are no doubt other unknown errors as well.

        Thank you for your time, I hope you'll be able to find some fun in this little game!
    • By Vandallord
      Link: https://www.kongregate.com/games/Vandallord/idle-stone-history

      A wicked witch turned the main hero into the stone, you need to find a way to break the spell.
      Click on the objects and they will open.
      Click on the stone and its skill to attack the animals will grow as well as a the losses from clicking on animals.
      Click on the river to improve the function to manage time and clicks on the animals will be more precise.
      Click on the tree and it will give you things from animals and the level of luck will grow which give you an opportunity to Harder hits.
      The higher the level of monsters the more animal can visit the stone and give presents which are essential to make a portion.
      A new entry in the devlog for 13 Ronin, a retro 2d samurai fighting game, this time it's about implementing the logic for the computer player.
      Happy coding!
    • By Znippy
      Hello everyone!  
      This is my submission for the Frogger challenge.
      The final build for the project can be found here!
      I hope I have fulfilled all requirements for this challenge. Sadly, I do not have time to create a gameplay video. I am not sure if this is a must. I have added a couple of screenshots from my blog series.
      My post-mortem post will be done next week. 
      As I already mentioned on the project page, I also could offer a Linux build if somebody needs one!
      I hope you like it and I am excited to see your high scores!
      Please tell me if there is anything missing!

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!