The prehistoric period

 

I think I'm here

There's what looks like maybe half of a game engine.

Completed

  • Directional lights
  • Point lights
  • Deferred/forward renderer capabilities for MANY lights in the scene
  • Camera with zoom
  • Scene Manager with loading and play scenes
  • Shaders with multiple texture and sprite batching to significantly reduce draw calls
  • Sprite animation
  • UI windows/panels that can be drawn with custom artwork
  • "backend" talking to "frontend" via channels (eventually tcp/udp sockets as well)
  • Database creation and usage
  • Initial world generation using chunks, grids and tiles

Need to do

  • Sound
  • Networking with actual sockets instead of only channels
  • Collision
  • Input
  • UI widgets that can be drawn with custom artwork
  • Chunk/Grid manager to simplify streaming data between client/server
  • AI/Simulation System
This last month I spent some time fleshing out proper use of the z-buffer.  Drawing sprites with transparency is tricky because to achieve proper blending, you need to use the "painters algorithm" and draw back-to-front.  Opaque sprites are preferably drawn front-to-back to avoid redrawing over the same pixel multiple times when content overlaps (early-out optimization).  Also, opaque objects are cheaper to light when run in a "deferred" render pass.  After some deep-diving and days of troubleshooting, the ballet of sorting/batching/pipeline permutations came together:


Shaders

I found a bug in the render api (wgpu) that prevented me from writing shaders that used multiple textures with physical rendering hardware (graphics card).  Thankfully the author reworked the multiple texture logic and merged his fix in github master.  Master hasn't been released yet so I had an opportunity to learn how to force rust code to reference repo's instead of crates.io.  

This also allows me to use the "wgsl" shader language.  WGSL is the dedicated shader language for WebGPU and has very rust-like syntax.  Before this fix, you had to use GLSL and convert to Spirv through a weird compilation process.  Things are much cleaner now!

UI

I did explore UI a bit using a framework called egui.  It's easy enough to draw simple straight lines and use the out-of-the-box theming but there's obviously a strong desire to change the look for the game.  While not much to look at, I figured out how to draw buttons and windows with custom textures:

It's just the first step towards a more pixelated UI, aimed at something similar to this:

Colors

Kyle (brother) drew up a fun lantern with multiple layers in asesprite:

This was a good opportunity to start refactoring shaders to support color blending and configurable opacity.  In this example, I wrote code to animate the lantern but color-shift the "fluid blobby portion" from red to blue and modulate opacity:



Until next time

Comments

Popular posts from this blog

One More Step

New to this