Slopes and wedges

Here’s what I’ve been up to over the last couple of weeks.  I’m still working on the company set up stuff, it’s unfamiliar territory for me, so I had to do a bit of research and get advice from some people.  I won’t bore you with the details, but it seems there’s no getting around the complexities that require both an accountant and lawyer.  This is going to cost me a lot of money, so I want to be sure before going ahead with it!

Upcoming demo

I’ll upload the demo update as soon as the company is sorted (should be soon now), but in the meantime, here’s a sneak peak at the changes that will be in it:-

  • Improved builder tool controls and usability:-
    • Changed alignment and attachment indicators for improved visibility and clarity.
    • Improved part selection (restricting selection location to where part can be attached).
    • Better selection rotation behaviour during alignment.
    • Improved part resizing response to key presses.
    • Added part resizing indicator to show available resize directions.
    • During alignment attachment indicators are now shown for any attachments that will be created.
    • Selected construction can now be frozen in place during alignment.
  •  More user configurability:-
    • Configurable key bindings for the various actions in the game.
    • Replaced single graphics “quality level” setting with individual settings for more fine grained control.
    • Added many other options (such as mouse look sensitivity and invert, camera FOV, etc.)
    • Improved sound options (volume controls and speaker configuration).
  • UI improvements:-
    • Improved screen layouts and UI elements.
    • UI is now scaled based on screen resolution.
    • New part and attachment info UI overlays.
    • New game stats UI overlay.
    • Improved in-game context sensitive hints.
  • Updated and improved parts:-
    • Improved part behaviour key binding.
    • Differential gears now have limited slip behaviour, with tweakable “slip limit strength”.
    • Lights can now (optionally) have a key bound to switch them on and off, just like motors.
    • Beams now resizable down to 1 unit in length, and plates from 1×1 to 25×25 units in area.
    • Better wheel friction behaviour.
    • Increased max spring rate and damping values for spring dampers.
    • All part models (except wheels) now textured.
    • New light parts (now with paintable lenses).
    • New seat models (replacing old ones).
    • Wheel rims now paintable.
  • Rendering changes:-
    • Construction materialise / dematerialise effect.
    • Part paint application fade in / out.
    • Corrected part paint colour (de-gamma’d, it now visually matches colour shown in UI).
    • Upgraded time-of-day system.
  • The construction frozen state is now saved / restored from saved games.
  • New and improved sound effects (toolbox, footsteps, ambient loop).
  • Minor tweaks to desert proving ground map.
  • Bug fixes.

As usual I’ve updated any parts that were already in the demo, but I’m not adding any additional ones, all the new parts I’m making are for the full game only!

Slopes and wedges

image

On the subject of new parts, I’ve now implemented resizable sloped beams and plates, as well as resizable wedge plates.

image

Designing their shapes was a bit of a challenge because I had to find a compromise between these three competing requirements:-

  1. Be easily representable by box colliders for efficient physics.
  2. Have plenty of room for attachment points.
  3. Look good when combined with other slopes, plates, etc.

The wedge shape was the trickiest to represent with box colliders.  I contemplated using a convex mesh collider for it, but I wanted to avoid this as they are generally less efficient for physics, and I also have part intersection tests in the game that only work for primitive colliders.  So instead I created a system to dynamically add box colliders, three for the wedge edges, and then recursively adding more to fill in the wedge interior (the larger the wedge, the more interior colliders are needed).  An example of this can be seen below.

image

All resizable parts in GearBlocks use procedurally generated meshes, so I had to implement mesh generation for these new slope and wedge parts.  This wasn’t too difficult but did require a fair bit of refactoring of my procedural mesh system to allow for these more intricate shapes.

Here’s a comparison of the Desert Buggy construction, the original version vs. one I made using the new slope and wedge parts.

image

Not only does the slopes and wedges version look way better, it uses nearly 50 fewer parts than the original!

In the future I want to add a compound sloped plate (i.e. a “corner” piece), as well as curved beams and plates.  The trouble is, the colliders for these will be even more tricky to set up.  I might need so many box colliders to represent these shapes that it wouldn’t be practical, so I may well have to resort to convex mesh colliders for these.  Anyway, something I’ll come back to later.

Construction interface problems

The sloped plate part is the first part in the game that is resizable along all three axes.  Unfortunately this particularly highlights the awkwardness of the current part positioning and resizing interface.  I’m not sure what I’m going to do about this yet, but I think I’ll have to revisit the construction controls yet again.  There has to be a way I can make this better, but I’m just not seeing it right now!