Electric Turnip
  • Blog
  • Stories
    • Story 000
    • Story 001
    • Story 002
    • Story 004
    • Story 007 - Unfinished
    • Story 008
    • Story 010 - BattleWagon
    • Story 012
  • Images
    • Adventure Caddie concept gallery
    • Page Design Gallery
    • Older Work
  • 5FEAT Video
  • Videos
  • Game Experiments
    • Climb
    • Super Shapetoy
    • TurboGarbageTruck
    • 031 - Best Games - Enchanter
    • 033 - Shader Test
  • Contact

In the Lab

6/28/2011

0 Comments

 
I've been working on a lot of experimental things. Many of them have been in the builds, and you might have seen some of them. Some others, I have been working on in other scenes and tests. Since I haven't set up the ability to play with previous builds (still coming), I figured I should give a quick run down of some of these experiments.

On the ball

Probably the most difficult challenge so far has been to get the endless spherical world working. I started by creating the obvious. I made a sphere and the built in sphere physics collider, and put the truck on it. That was an absolutely spectacular failure. The truck would go shooting off in random directions, jiggle violently in place, or fall trough the planet (sphere). Often it would do all three. I figured that this wouldn't be adequate to the task, but it never hurts to try for very simple straightforward solutions.

Next I tried setting up a sort of artificial gravity. The physics engine has a built in gravity that applies a force of 9.8 newtons along the negative y vector. Simply put, stuff falls down. I needed stuff to fall toward the center of the planet. Lucky for me a lot of other people over at the unity forums had done a bunch of that work, so I only needed to modify it. Once I adapted some of the other artificial gravity systems and simplified them for my needs, it actually wound up being one line of code. The object with gravity applied to it simply looks for the center of the planet and then moves toward that with 9.8 newtons of force. Done.

So the artificial gravity worked fine, but stuff would still keep flying off the sphere collider, and would occasionally end up in orbit around the planet. Literally. I could hit a garbage can with enough force that it would fly off the planet ending up in a perpetual free fall. It was really funny, and I might use it for something later on, but it meant that, given enough speed, the truck would also leave the surface of the planet, and that was pretty much the end of the fun. The truck would also freak out pretty regularly and usually fall through the planet The main culprit turned out to be the sphere collider. For any math nerds out there, this is probably pretty obvious. A sphere is not a really a stable shape to set things down on. So I ditched the sphere.

The next obvious road was to create a mesh collider. The physics engine and the graphics work off of separate models. The physics engine really only works with very simple objects. The graphics on the other hand can be very complex with little to no slowdown on most devices. For every object that you want to react to gravity or collisions, you will need both a physics and a display model. Using a mesh collider, you can effectively, use the same mesh for both, if the display model is simple enough. Making a decent looking sphere requires a pretty dense and complicated mesh. So that was a no go.

The best collision objects in the engine tend to be cubes or boxes. So I hit on an idea that worked out really well. I figured, why not have the truck just bring the ground along with it. I made a box that's a little larger than the truck and placed it just under the wheels. Then I made a script that told the box to follow the truck around  so no matter where the truck drove in the world, it would bring its piece of ground with it. On a flat surface it worked fantastically. I went about adapting my artificial gravity code to make the collider rest on the surface of the planet sphere and rotate smoothly around the center of the planet to stay positioned under the truck. That also worked very well, but caused some other problems with the camera flipping over and the the controls would sometimes jank out when the truck passed over the poles due to an unfortunate side effect of Euler angle math called gimbal lock. Here is one of the best explanations I've ever seen of gimbal lock.


So I could go back and change all the code I had in place for making the truck move around, or I could change the rules of the game world. So I did that. Instead of driving the truck around a ball that sits stationary in space, the truck drives around on a flat XZ plane and the planet follows around underneath it rotating in the opposite direction. And the rotations are all using quaternion math, so gimbal lock won't be a problem. Any object that doesn't require player input, like the garbage cans and blocks aren't affected by gimbal lock, so they just roll around on their own little ground colliders and everything looks like it is resting on a sphere.

So that is how I went from driving around on a flat plane to driving around on a ball. That's pretty much the stuff I think about day to day working on TurboGarbageTruck. I'm certain that there are better ways to do all the things I'm doing, but development is an iterative process and I should gradually figure out what works best for this game.

I've set up a twitter account so you can follow development over on the right there. I'll tweet any time a new build goes up or I do anything significant with the development, like posting up concept art, videos, or blog posts. You can also follow me @Owen_McManus for dev and non dev related tweeting. 
0 Comments

The Brokenest Build

6/22/2011

0 Comments

 
I  just put up a new build of TurboGarbageTruck. This is easily the most broken build I've put out since the very first tests. It's also one of the most interesting, as far as I'm concerned. There are a few things that I've been working on in different experiments that have gelled together in this build. That it functions, on even the most basic level, is enough for me to call this a success.

Forward we go.
0 Comments

Truck sketch

6/2/2011

0 Comments

 
I did up a new Truck design sketch. I think I'm getting closer to capturing the character of Truck. Seriously, this an anthropomorphic garbage truck who's sole purpose is to alternatively smash and gather things in his world, to make a larger and larger garbage pile. I'm really just designing him as a character because I find it entertaining.

I compressed about 45 minutes of sketching down to 3 for the video. Much longer than that and some of the slower bits really get pretty boring to watch.

I have never recorded myself sketching. It's weirdly intimidating. Most of that self conscious feeling I use to have when someone would watch me draw or paint has faded with practice and time. Now, if someone comes to peek over my shoulder while I'm drawing, or modelling, I don't really worry about what they think of my doodles. I'm usually much more concerned that they will just get bored. Recording myself sketching, I'm just worried that the screen capture will break or the computer will crash. It felt like I was drawing to beat the clock. After a few minutes I sort of relaxed into it a bit, but this is definately a new process, and it will take me a while to get comfortable. Modelling with the screen capture running will be... interesting.

0 Comments

    Archives

    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    November 2012
    June 2012
    October 2011
    July 2011
    June 2011
    May 2011
    April 2011
    March 2011
    November 2010
    October 2010
    August 2010
    July 2010
    June 2010
    May 2010
    April 2010

    Categories

    All
    Adventure Caddie
    Best Games

    RSS Feed

Owen McManus
  • Blog
  • Stories
    • Story 000
    • Story 001
    • Story 002
    • Story 004
    • Story 007 - Unfinished
    • Story 008
    • Story 010 - BattleWagon
    • Story 012
  • Images
    • Adventure Caddie concept gallery
    • Page Design Gallery
    • Older Work
  • 5FEAT Video
  • Videos
  • Game Experiments
    • Climb
    • Super Shapetoy
    • TurboGarbageTruck
    • 031 - Best Games - Enchanter
    • 033 - Shader Test
  • Contact