humidifier-dev's Avatar
humidifier-dev
Member since

Recent Activity

Making Drag Drop System for Items.

Drag Drop system is directly integrated in my UI system. So it can work with any UI elements in the game. Anything could potentially become draggable. This system allows you to have several draggable elements in you game, I filter drag operations based on string hash. To fulfill those requirements I've split Drag Drop system into 4 parts:

Drag Drop detection - this part happens in widget's update code. It intercepts mouse down event

Drag Drop start - this part is specific to the gameplay, for items I've done it in player Hud controller

Drag processing - this part lives inside UI manager, because it has top most mouse input handling order, so it can always finish drag drop when a player releases mouse button.

Drag Drop finish handling - this part is also specific to the gameplay, and it's also done in player Hud controller.

All drag drop data lives in drag drop memory arena, which is reset when drag drop starts.

Working on the retained-mode UI system for my game.

I've implemented two UI elements: a quick-slot panel and an inventory panel.

I've also improved the UI debugger, which now allows me to inspect the entire UI tree structure.

The inventory panel uses the nine-patch rectangle technique, allowing its texture to scale correctly, even at higher DPI scales.

Quick slots currently use simple colored rectangles as placeholders.

The UI system uses a tree structure to organize parent-child relationships.

The layout system uses two passes:

  1. Measure pass: Collects the desired sizes of elements, starting with the children and working up to their parents.
  2. Arrange pass: Calculates the actual positions and sizes based on alignment options. This time, we start with the parent and work down to the children, allowing us to distribute the available space correctly.

I use a breadth-first traversal algorithm to render UI elements.
I specifically chose breadth-first traversal over depth-first traversal because it allows me to group elements at the same hierarchy level into a single draw-call batch.

First introduction for my current project - 2D survival-story game in handmade style.

I've never released a complete game on my own and it's time to change it. I also want to improve my current knowledge about game programming. I like playing survival games but there is no "perfect" survival game for me. They usually only have some parts that I like. So this game is a great opportunity to learn new stuff and try myself as game designer and see how I can combine all the stuff I like in one game.

This game is built in classic handmade style. I have a platform layer that manages all platform specific stuff and I have a game dll with engine and game code. All is written in C++ in a C style

Libraries that I use:

  1. Vulkan - rendering API
  2. stb image and stb font
  3. Dear imgui - debug visualization.
  4. Premake - build setup for C++

What is already implemented:

  1. Batch rendering for tile map.
  2. Some ui and font rendering with ui debugger that can pick elements
  3. AABB collision sweep for tile map and player
  4. Asset system for getting textures
  5. Quality of life features such as dll hot reloading, memory arenas and debug shape rendering

First introduction for my current project - 2D survival-story game in handmade style.

I've never released a complete game on my own and it's time to change it. I also want to improve my current knowledge about game programming. I like playing survival games but there is no "perfect" survival game for me. They usually only have some parts that I like. So this game is a great opportunity to learn new stuff and try myself as game designer and see how I can combine all the stuff I like in one game.

This game is built in classic handmade style. I have a platform layer that manages all platform specific stuff and I have a game dll with engine and game code. All is written in C++ in a C style

Libraries that I use:

  1. Vulkan - rendering API
  2. stb image and stb font
  3. Dear imgui - debug visualization.
  4. Premake - build setup for C++

What is already implemented:

  1. Batch rendering for tile map.
  2. Some ui and font rendering with ui debugger that can pick elements
  3. AABB collision sweep for tile map and player
  4. Asset system for getting textures
  5. Quality of life features such as dll hot reloading, memory arenas and debug shape rendering