![Physics Phrustrations and Chaotic Connections](https://egoproblemsgames.co.uk/wp-content/uploads/2022/03/thumb_20220325.png)
Well hello lovely people! It’s that time again. Not only is it blog day, but the weather is finally turning! Hope you are enjoying the sunshine. If you aren’t, you should be! Or, well, read this blog first. Then enjoy the sun! Let’s go for a recap shall we?
I’ve been focussing on internals again. I wasn’t happy with how the movement felt, so I’ve been playing around with the logic. Now, the simplest solution would be to just use Unity’s premade CharacterController right? Sadly, this isn’t possible. The character controller Unity provides doesn’t cope with the physics requirements we have. Grabbing and dragging objects in such a way that the weight of the object affects the player’s movement was proving taxing. It’s possible I may try again, as I’m still not wholly sold on the movement, but I have made some decent improvements at this point I think.
The next thing on my list was to make the dog feel a bit more alive, to get it closer to how the finished product might feel. I knew this would be temporary, so I busted out some quick Sine and Cosine curves to make the dog both oscillate and rock back and forth.
Background for non-techies: We fairly often fall back onto some common utilities when coding. The Sine and Cosine curves are good examples of this. If you hark back to GCSE maths, you may remember that these curves give you values ranging from -1 to 1, regardless of what angle you give the function. Now that “angle” doesn’t have to be an angle at all. If you perhaps apply Sine/Cosine to time, a number that is constantly increasing, you will get a smooth repeating loop from -1 to 1 like this:
![See the source image](https://th.bing.com/th/id/R.88eae3e97ad429b0e2afd00ce39da3ef?rik=N1kiPETdQXeIDg&riu=http%3a%2f%2f4.bp.blogspot.com%2f_6t_ZmJSkbL4%2fTJLFDrqFhYI%2fAAAAAAAACbU%2fBZgLx7HLP9U%2fs320%2fSinewave_horizontalview.jpg&ehk=EDOaKQWkPDjj4yS%2fStEScQMxqNMblpmP4F2AewtEc0A%3d&risl=&pid=ImgRaw&r=0)
With Cosine, the value Cos(0) is 1, with Sine, the value Sin(0) is 0. So depending on where we want to start, we can choose different functions. To make something that oscillates from 0 to maxY (where maxY is any desired maximum value), we just multiply the function (let’s say “Sin(time)” for ease) by maxY: “yPosition = Sin(time) * maxY”.
Though that isn’t quite right, is it? That would oscillate between -maxY and maxY. Hm. Well there’s a simple solution! We just take the “absolute value” of Sin(time). The absolute value just removes the negative of a number. So Abs(-2) = 2. Sorted. We can also adjust how long a full loop takes by changing how quickly time increases. But I’m getting a little carried away now!
The first attempt of this wasn’t… quite right:
Seems like I got some of my initial values wrong. For a start, the duration of the curve appears to be a decade, and the rotation looks a bit funky. I played around some more and got to this point:
We’re getting there, but this isn’t a game about Bambi, so I made some final adjustments:
Lovely! As a temporary aid to get that doggy feel, I’m very pleased with that. An interesting thing to note here is that that movement doesn’t affect anything about the gameplay. The collisions and the grabbing are all the same. This can be best seen in the second video, where I collide with a box I’m 3 feet above. This is deliberate, as the movement is visual flair only, and because it’s temporary, the less it modifies the better!
The final thing I want to talk about is the UI changes. Using the event system I detailed in the last post, I have now hooked up a Chaos Tracker that keeps tabs on what damage you are wreaking and updates a bar at the top of the game. The bar itself is very simple. It just scales the fill out from the left to the right as chaos increases. An event tells it the max chaos in a level and another event tells it when the chaos is changed. The result looks like this:
My next steps are to get the max chaos calculating itself, though as we’re planning on having objects all give different chaos values depending on how you use them, that might be more trouble than it’s worth! I’m going to go get on with that now I reckon, then make the most of the sun!
Matt out.
Hi, I’m sending you this message via your contact form on your website at egoproblemsgames.co.uk. By reading this message you’re living proof that contact form advertising works! Do you want to blast your ad to millions of contact forms? Maybe you prefer a more targeted approach and only want to blast our ad out to websites in certain business categories? Pay just $99 to blast your ad to 1 million contact forms. Volume discounts available. I have more than 35 million contact forms. Let’s get the conversation started, contact me via Skype here: live:.cid.aebc78a94c13344c
I have a question. You just read this message right? That means you’re now a potential customer and I can do the same thing for your business. I can blast YOUR ad to 1 million websites just like I did to yours for just $98. More pricing plans are also available, contact me via Skype for details: live:.cid.dd8a3501619891fe
I have a question. You just read this message right? That means you’re now a potential customer and I can do the same thing for your business. I can blast YOUR ad to 1 million websites just like I did to yours for just $98. More pricing plans are also available, contact me via Skype for details: live:.cid.303294bd15a81bc7
Hello,
We noticed egoproblemsgames.co.uk is only listed in 8 out of 2500 directories.
This severly impacts your backlinks and search engine rankings.
Come get listed in all 2500 directories on DirectoryBump.com
I just posted this ad message to your website and you’re reading it. That means it’s done its job! I post messages like these to millions of sites every day! I can do the same for YORU AD message for less than $100 to reach a million sites. Send me a skype message here to discuss: contactformmarketing2023
vurcazkircazpatliycaz.d3a6YihX0G98
hyperkineses xyandanxvurulmus.i54JU9iUQTEM
am siteleri wrtgdfgdfgdqq.LKT8Ru263Tn1
amciik siteleri 0qbxjluaxcxjsxzz.KhIoXdS8BsWS
hd poen video gghkyogg.2VDNvzQUV7d
Get Found On The First Page of Google in Less Than 2 weeks by Using our Priority Stealth S.E.O. Syndication Method.
Pay us once and you’ll get Organic Search Engine Results using videos that will continue to drive traffic 24/7 year round!
The Benefits are incredible – since by paying us once there will be:
– No Additional Ad spend needed!
– No Additional Costs for Ad copy!
– No Additional Costs per Clicks!
– No Commercial Licensing fees ever!
Get Started Today and Get Seen Tomorrow!
Learn More: Reviews2Videos.com
Hi,
We are a provider of premium databases from the UK for companies.
I want to know if you need any sort of data for your business in the UK?
Please visit or pcxleads.com respond to this email and let us know what you are looking for.
Regards
Jannes Welman
Hi there, would getting brand mentions on credible sources like Forbes, BBC, The New York Times, and The Guardian boost your site’s rankings and increase traffic?
Would that interest you?
Andrew
Work From Home With This…You Will Never Look Back
$500+ per day, 100% Free Training, go here:
ezwayto1000aday.com
Hello egoproblemsgames.co.uk
We noticed your website egoproblemsgames.co.uk doesn’t have a Mobile App for iOS and Android.
We are building Android and iOS Apps for $99 each a combo deal of $149 for both
You can get a free preview on PCXLeads or email us back and we will send you a mockup for your apps.
This promo is valid till end of June 2024.
Regards,
PCXLeads
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
Hello,
It is with sad regret that after 12 years, LeadsMax.biz is shutting down.
We have made all our databases available on our website.
25 Million companies
527 Million People
LeadsMax.biz
Work From Home With This 100% FREE Training…, I Promise…You Will Never Look Back
$500+ per day, TRUE -100% Free Training, go here:
ezwayto1000aday.com
Hello from LeadsMax.biz!!
We are shutting down and have made all our data available for all the countries!
Come check us out and search your business and consumer data for free
LeadsMax.biz
Your blog is a testament to your passion for your subject matter. Your enthusiasm is infectious, and it’s clear that you put your heart and soul into every post. Keep up the fantastic work!
Your blog is a breath of fresh air in the often stagnant world of online content. Your thoughtful analysis and insightful commentary never fail to leave a lasting impression. Thank you for sharing your wisdom with us.
Normally I do not read article on blogs however I would like to say that this writeup very forced me to try and do so Your writing style has been amazed me Thanks quite great post
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! By the way, how can we communicate?