Basic: Inventory & Tasks, + Shaders and Lighting.


Spent today working on a few things:

Basis of the Inventory/Resource management. Evolving the inventory script I created for "Connection Booster" (previous game jam entry here on itch), and cleaning it up. Alongside this, I am now using specific Custom Resources for Items to keep everything cleaner (previously I was strings for item name, through the whole project). Using Custom Resources gives me a cleaner work flow, and ensures that I don't forget to add a property into a dictionary, as it will always exist on the base Resource...


Alongside setting up Items and Inventory, I created a global Task Manager to handle all "awaiting tasks", this is what will be polled by the A.I. to retrieve "Which task should I be doing?" when their state machine is awaiting a new task. This is visible (in a basic form) in the video attached, clicking on a "dirt wall" tile in the grid will queue the tile for "Excavation". The tile's Grid location is appended to the "Excavate" queue, which will be used for the Workers to determine where to dig next. This will make more sense once cleaned up (and once I implement the first NPCs: Workers).

This Task Management system is super simplified at present, in future I will be extending it to contain more meta data on each task (i.e. How many agents can attend to the task / are required, etc)...


Outside of those 2 primary additions, I spent time fiddling with lighting and creating indications for mouse location (when moving over excavatable tiles) and tasks (for excavation). In the process of doing this, I needed to clean up and re-work the Wobble Shader that I shamelessly copied from smarter people on the internet and implemented in my last update. Interestingly: the original Dungeon Keeper game actually uses Delaunay Triangulation with random offsets to make the polygons/meshes in the dungeon wobble/warp on the fly (when in the rotate + zoom view of the game). A shader based solution is much neater, and offloads all of that work to the GPU, instead of running Delaunay Triangulation for every Grid cell on the main thread! Either way, I noticed the Shader itself was causing lighting issues, so I rebuilt the light() function, and also added the ability to use Emissions (mainly used for the indicators for mouse/excavation locations). 

All of these changes are visible in the attached video - the basic building blocks are looking nicer, but still not entirely there yet! The original Dungeon Keeper game was much darker in tone, with a lot more impenetrable shadows than I have currently, though I may never be able to replicate it exactly, I will get close enough in my own style :).

Thanks for checking in! Until next time.

Get Crypt Underlord

Leave a comment

Log in with itch.io to leave a comment.