Monday, December 3, 2012

Balancing Physics


This is how the game currently looks like.

It turns out that balancing the game physics for flying robots will be a long journey. In this post, I will explain one example, Flight height.

First of all, there are two factors influencing how fast a robot takes off: Its weight (depending on amount of parts used) and amount of propellers attached. This allows for a huge range of possible combinations from robots that are too heavy to fly ( :P ) to very lightweight constructions that lift off immediately.

Especially for lightweight flying robots it was at first very easy to just literally skyrocket in a couple of seconds, until they were too high to see the ground - not only making it very difficult to keep control over cruise height, but also making orientation close to impossible (No ground in sight -> "Where am I?"). Hence, it was necessary to somehow limit the flight height.

So I decided I need to scale something that influences how high one can fly depending on robot height. I made up a function for a scaling factor: 1 - [(Max Height - Current Height) / Max Height]

This returns a value from 1 when the robot is grounded to 0 when it has reached the maximum height. After some experimenting, I found out the best thing to scale by this factor is the vertical speed when flying. As a result, more lightweight robots still lift off faster than more heavy ones, but none of them can get over the maximum height, since their speed will be multiplied by zero.

Graph visualized by Google
To make the whole vertical slowdown a bit more smooth, I multiplied that factor by itself, so now it approaches zero like the graph in the picture.

1 comment:



  1. Finally got my debts of my neck and i have enough money saved for my Christmas shopping. It all happened as i stumbled into this email address blankatm002@gmail.com initially i was looking to get extra jobs to boost my salary and i found how the blank atm card from this company gives you more than $20,000 all in 1 month. At first i though it was another internet scheme until i saw several reviews of how this blank card from this company has changed the lives of many without hesitation i ordered for the card and in less than 7 days it was delivered to me and the agent showed me how it works and it was even tested its been just 3 weeks and everything seems a lot less stressful this company has really changed my life and standard of living. I would love you on this site to visit blankatm002@gmail.com and get a card today to ease that stress and get good money its so quick.

    ReplyDelete