Klemens Reckfort

Level Design - Game Programming - Game Design

Home | Events | Own | About

This is a Growing Collection of Personal Tools and Projects I do in my Free Time. Sometimes it happens that I take care of Mentoring a Student for a while, Creating Connections to the Games Industry and Teaching Game and Level Design on a Personal Level. During that Process I often Develop Tools that will be listed here as well. Everything is for my Personal use (so not everything is as Clean and Documented as I would like it to be), but Feel Free to try them out Yourself if you like.


Inspector Grid Editor – Unity Engine – Rect Array Example

Sometimes you want to Organize Geometrical Data visually, thats why it is very useful to have a Grid Editor for Unitys Inspectors and Editor Windows. Taking advantage of the Unity UI Elements and its possibilities to display Custom Mesh Data within a Visual Element, you can create your own Grid Editor. At the beginning it was possible to create you own Grid Editor utilizing Unitys Handles, but the supoort for that fell down, so I had to recreate it using the Custom Mesh Data approach.

Dealing with Rects in the Grid Editor

To use the Grid Editor in the Inspector here you only have to define a Rects Field as it is used as a Custom Property Drawer.

[SerializeField] Rects rects = new Rects();

Because the Grid Editor is set up in the UI Elements Environment it is possible to create Various Solutions to deal with any Data Type in a Modular Approach.

GitHub Link:

https://github.com/korrecktfort/Dubi_Datatypes

Unity Package ZIP:

This Download contains a ZIP that includes my Datatypes Package. There is more to discover than the Grid Editor here.


Base Values – Unity Engine – Scriptable Objects

I want to reduce the use of bloated Singletons. For me they only have a reason to exists if:

  • they are responsible for only one task
  • do not know about any other singletons.

Following the idea of a design pattern that is based on using the power of Scriptable Object according to This Article and This Presentation, I wanted to create a System that takes care of Re-Using Already Defined Values and make Events Happen, when the Values Change. And this should work for any kind of Value. This would in most cases reduce the uses of Singletons just to share Values to a Minimum.

What would be the usual Use Case for a System like this?
It often happens that if multiple objects want to Share the Same Value, they will need some object that Holds the Value and everyone checks if the Value Changed.
The Idea is now to have the Value as a Scriptable Object itself, and Objects that share this Value can Register or Deregister Callbacks on Value Changes of that Value into it. Because of that:

  • No Third Party needs to check if a Value Change occured
  • No Third Party needs to have all Objects that Share the Value listed to tell them a Change Occured
  • No Third Party Execution Order has to be managed to Load and Unload everything accordingly
  • Objects that share this Value handle themself accordingly

Also this was a great Task to fully get into Programming with Generics and getting used to the Unity Editor Property Drawer.


Example:

We create a Component that will hold the Base Value “playerHealth”. This Component will also take care of Modifying an Image Component Value, if the “playerHealth”-Value Changes.

using Dubi.BaseValues;
using UnityEngine;
using UnityEngine.UI;

public class HealthBar : MonoBehaviour
{
    [SerializeField] FloatValue playerHealth = null;
    [SerializeField] Image healthBarImage = null;

    private void OnEnable()
    {
        this.playerHealth.RegisterCallback(OnPlayerHealthChanged);
    }

    private void OnDisable()
    {
        this.playerHealth.DeregisterCallback(OnPlayerHealthChanged);
    }

    void OnPlayerHealthChanged(float value)
    {
        this.healthBarImage.fillAmount = value;
    }
}
Base Values can be used “locally”, meaning they do not need any Scriptable Object assigned to work. The Callbacks work even without a Scriptable Object assigned.
Here a Scriptable Object is assigned, using the Base Value “globally”. The Callbacks now react on the changes of the Scriptable Object.
Now when using the same Scriptable Object on multiple Objects, they will handle themselves accordingly. You can switch between “local” and “global” values as well.

GitHub Links for Both Modules:

Here you can get the latest Versions of my Packages.

https://github.com/korrecktfort/Dubi_Singleton

https://github.com/korrecktfort/Dubi_BaseValues

Unity Package ZIP:

This download provides a ZIP-Package Containing the Base Value Unity Package, including some Extra Functionalities inside the Package.


Character Controller 2D

I Developed a workflow creating a Physics Based Character Controller that is extendable in its Functionality. This Character Controller manipulates the Velocity of the Rigidbody in Manual ways, e.g. Custom Gravity Velocities to have the possibility to Design the Feeling of the Character Jump or when it Falls Down.

Notice how the Controller Snaps on Peaks, but still falls down as Intended on Cliffs. Also the Jump Varies according the current Surface Angle and Move Directions. The Controller is not disconnected from the Physical World, meaning any Force that gets appied on the Rigidbody 2D will still be Considered and Not Overridden.

This Game can only be Played on Desktop, sorry.

This is just a little Example of how I Approach a Complex Task like Creating a 2D Character Controller in Unity. You can play this With a Controller as well (tested with an XBox One Controller).

Unity Package:

This download provides a ZIP-Package Containing the Character Controller 2D Setup you can play above.


2025 - Klemens Reckfort
Impressum | Datenschutz