Physics Phrustrations and Chaotic Connections

Physics Phrustrations and Chaotic Connections

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

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:

You can see there are still movement issues here…

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.

14 thoughts on “Physics Phrustrations and Chaotic Connections

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top