Handmade Network»Wassimulator

Recent Activity

Cactus Viewer update version 2.1.5 is out!
This update includes a few QOL features and some bug fixes. These include:

  • Cactus now grabs the font file from the system, and no longer has to include the ttf file inside of it, dropping the exe size significantly to 2.7 MB.
  • Introducing a simple installer that allows to easily add Cactus to start menu, desktop, add an "Open with CactusViewer" button to the right-click context menu, and associate common image extensions with Cactus. Using Inno Setup scripts added to the repo (improvements to that are very welcome!). Note: this is optional, you can still just use the exe directly with no setup.
  • Config file is now in JSON format, this allows to edit settings in the file directly and helps making setting changes backward compatible in the future.
  • Added a setting for selecting how an image is zoomed when first open and the settings to "save zoom for each image" is selected, you can now have it either fill the window or zoom to 1:1.
  • Added a feature where you can choose the format of the color you copy using the color picker, including Hex, RGB and HSVm with different parenthesis styles. Introduced by @orcenhaze in #35.
  • Fixed commandline loading issues in #25 by @orcenhaze in #35.
  • Fixed the issue of the status bar being 1 pixel too small on the edges which allowed to see the image in the back at the bottom too.

Thanks to @orcenhaze for the contributions to this release!

Thanks to a great pull request from @hkva we have a very nifty feature of supporting copying an image in its current rotation, cropping, editing etc to clipboard with ctrl+c, which allows you to easily paste it in chat etc for quick edits without having to save.
Also I added mouse navigation with forward and backward buttons to flip thorugh images in a folder.


Cactus Viewer now live redraws the window resposively when resizing the window. it's a small update, by using fibers there is no need to seperate the main loop to a separate thread to achieve this.
The update is live:

Cactus Viewer Update 2.1.1
Minor update, added performance improvements and few minor features:

  • Reduced memory footprint by replacing some cstdlib mallocs with Windows Alloc functions.
  • Changed the current themes, fixes some fugly colors and adds a new theme.
  • Added buttons to reload the folder and shuffle the order of files in the viewer and a button to fit the image within the window inner frame.
  • Added option to hide status bar and only show upon mouse hover with the rest of the UI.

CactusViewer update 2.1.0 is released!

This update brings:

  • Image cropping
  • Gaussian Blur filters
  • Image saving functionality for any changes
  • No resource usage on idle (update only on relevant window events)
  • improvements to histogram rendering and a few bug fixes

You can download the image viewe and read the patch notes here:

you can now save image edits to disk, including rotation, cropping, and image value changes

Did somebody say image cropping?

Cactus Viewer now now waits on Window events, instead of unnecessarily redrawing on idle, still supports UI animations and handles events set by image loader threads to wake up the process.
(tried demonstrating updates with printf("I");, best I could)

You can also blur images for these specific purposes:

image saving pipeline, which should allow you to save whatever the shader is displaying, so any image value changes for now like saturation or gamma, etc. Planning to implement more basic image editing functions such as cropping, soon.
the render and encoding pipeline now works.

CactusViewer 2.0 is officially out!
This is a big one.
This update brings radical changes to the architecture, code structure, style, and intruduces a number of new features:


  • New render backend, replacing OpenGL with a Direct3D 11 renderer.
  • New handmade immediate-mode UI library that supports animations, themes, and subpixel antialiasing for text, replacing ImGui.
  • Windows Image Component decoders, opening the range of supported formats to pretty much anything Windows can open with their apps, plus the automatic support for any extra installed image codecs that WIC can support.
  • WebP codecs using Google's libwebp decoders, supporting both still and moving images.


  • Histograms with toggleable red, green, blue, and mix channels.
  • Live image value sliders to adjust brightness, saturation, contrast, and gamma.
  • A toggle to enable sRGB rendering.
  • Controls for rotating images without changing the file.
  • Support for reading EXIF metadata and displaying it, and correctly rotating JPEGs.
  • 3 UI themes to choose from in settings, including a light theme.
  • Fullscreen mode


  • An update to the coding style and naming convensions to something consistent, with better building scripts.
  • Moved the main repo to the current, under the master-2.0 branch, the previous version with ImGui and OpenGL is still available and be found under the branch: master-1.0.


sneak peak into something I'm working on; CactusViewer is getting a fresh coat of paint, new handmade UI system to replace dear ImGui, D3D backend, and built in cleartype text rendering

the idea is that the character can scan the accessible environment for points of interest, and can construct a path to whichever one they choose
notice how because the wall was blocking the wall, they couldn't account for the other two points.

more progress on the something I am working on!
Second video shows the editor: Entities can be customized to assign what sprites to use under what condition and what in-game tools can be used on what entity.

A little something I am working on, here's its level editor. I've detached the sprites from the tile type, and the tile can fill randomly from a set of selected sprites. Which means I can change or add assets without breaking the map data file.

custom handmade HLSL skybox shader with matching basic directional lighting
with @archon

been learning blender for the last week in order to make assets for the 3D game, here's a rifle I made:

Progress on our 3D engine with @archon
Today we got FPS controls setup!

Cactus Image Viewer just got a major update!

  • Win32 platform code implementation allowed for a standalone executable.
  • Support for loading image files in the sorted order of the folder they're in.

You can get it for free and check out the source code over here: https://github.com/Wassimulator/CactusViewer

or attached:

Putting it all together: Dialogue nodes now can set quest index to trigger events. In this little demonstration, the events get triggered consecutively, NPC teleports to the hallway, walks to the player, initiates conversation, player responds and goes through dialogue tree to a node that ends the conversation, that node sets quest index to trigger the next events, which in this case is the NPC walking back out and down the hallway.

This time I worked on the laptop interface. And we now have an Email app! It integrates with the event manager so that now email events can be triggered within the story. Now you can get pestered by your collogues inside a game as well!
(while the editors are done with dear imgui, I don't ship them in release, so the laptop interface is handmade imgui, text rendering and otherwise are in SimplyRend)

Back to my isometric RPG project. Today I worked on making an event manager and editor, with that data stored on and loaded from disk. The events work on the basis of "quests" each of which is an array of "events" that get triggered based on an a level index which the player has. That index gets advanced as the player advances in the respective quest. Events can be anything from camera events, to teleportation and movement. And the way the code is set up right now allows for easy changes if I want to add more types as the story might need.

At this point all necessary tools to start game design are ready, a world level editor, a dialogue tree editor and an event editor. All in-game, and all store their data to disk and allow for easy testing and change on the go. The in-game protagonist laptop mode is still WOP, more on that later.

glTF animation rendered using d3d11 with @archon
thanks to @d7 for the minimal example: https://gist.github.com/d7samurai/261c69490cce0620d0bfc93003cd1052
using cgltf for loading the models: https://github.com/jkuhlmann/cgltf

Part of the RPG I'm making is minigames on the protagonist's laptop, this meant I had to make a mini desktop interface within the game. It has its own immediate mode UI and button interface, (not using ImGui for this), and window draw functions can take a callback to functions that run their "apps" so the rendering is injected in the pipeline and scissored and placed correctly. All of this is using SimplyRend.

I was working on the shell application and implemented string and vector types to have an easy to use tokenizer, here is the thing in action.

Some improvements on the editor while working on the story. Visual aids to help Unspaghettify ™️ the editor, and controls to rearrange links

Pathfinding implemented. A* search algorithm.

Spent some time working on expanding the dialogue editor. I rewrote the data structures to support more complex content creation, previously it supported specifically 6 options to every node and it was all dialogue, it didn't allow for nuance that might trigger custom code, expanded options, or simple actions like "give" and "take" or "attack" interactions with the NPC. The regidity was there because data structures were static arrays until now. Now a node can be connected to any number of other nodes with variable types and options, it can carry an "SCI", a special code index, which can be treated as an enum to trigger special code in a big switch statement in the game loop, all of this can be saved and reloaded, and works with the undo/ redo system. This required a restructuing of the ImNodes implementation, especially their unintuitive node ID system. I also added some visual changes to the editor and color coded stuff, which required tweaking ImGui's source code. Making editors is fun.

Lots of progress! I wrote the data structure and logic of NPCs, game state savefiles of where each NPC is and at what level, and I hooked it up to the existing dialogue system, which can be edited and expanded on through the in-game editor. The text rendering is done using SimplyRend's new functions that support wrapped text. We are getting somewhere with this!

Spent some time wrapping up certain debug functions and displaying already collected data here and there from the renderer. Using C++ constructors to profile functions or code blocks and displaying that info in a debug menu.

Spent some time making some QOL improvements on the isometric level editor, now you can visually scroll through voxel types, search for voxels, and access a recents list to quickly fill the grid with a certain type. Also ImGui can now work with SR_Sprites which is nice!

Took a while to make the animated assets but I got something rudimentary working. We got an animation system! with flexibility to support sprite sheets with different dimensions, frame count, and animation lengths, FPS independent. Next step is to put a few NPCs in the scene and hook up the dialogue system and editor already in place.

Setting the groundwork for an animation system required a fundamental rethinking of the render algorithm, since movement includes floating point change in points in 3D space, I couldn't get away with the regular layer sorting I was doing already. This time I push all things into an array then run a qsort() alogirthm that orders thing in floating point percision in 3D space (this also made this all possible with one draw call), this allowed the sprite to transition behind and in front of objects without weird clipping and order bugs. (I need to actually make the animation gifs now)

Got a stair system and collision checks working

Added a level editor, each cube in the 3D map can have a certain type of block or type_none those types correspond to sprites and the renderer does the draw calls in the right order. The level can then be exported to and loaded from file. I'm realizing Most work on this project won't be technical, mostly asset making and level design.

Working on an isometric 2D world and just set up a render pipeline. the thing was to figure out an efficient way to organize the render commands with as few draw calls as possible, since the order requires taking diagonal rows from back to front. The solution was to make an array of render queues. The way the thing now works is you just specify the x,y, and z of the block in question, in game space, and pass the sprite RenderIsometric(SR_Sprite * Sprite, int X, int Y, int Z), the coordinates get transformed to isometric and the command then gets pushed to its appropriate render queue which gets looped on and the render calls get batched. in the example above there is a total of 10 render calls, the minimum amount necessary to render the sprites in the scene with appropriate alpha blending.

Caution: this demonstration wobbles.

Working on a little dialogue-based game. Today I made an in-game editor with ImNodes and ImGui to visualize the dialogue trees, it saves to and reads from and parses a file that holds the text data, supports undo/redo. The dialogue demo here is written with my render library SimplyRend

A little progress on limited time but it’s nice: SimplyRend now supports wrapped paragraph rendering, it has a mini lexer implemented where it looks ahead and wraps the words before they overflow a width limit set in a parameter. All in a single render call: SR_PushTextWrapped()

Over the last two or so weeks I've been working on a little handmade image viewer, and since I've started a new job I won't have much time to add more features to it. Since it's stable and I already use it on my own rig, I'm releasing CactusViewer alongside the source code today!


  • Supports PNG, JPG, JPEG, BMP, and GIF extensions.
  • Scans folder of opened image and allows flipping through supported images within folder.
  • Multithreaded file loading.
  • image pan and zoom with fitting modes; to width or height.
  • Pixel color inspector and a quick copy of HEX value to clipboad.
  • Animated GIF support with play/pause and seek controls.
  • Quick toggle between nearest-neighbor and linear filtering for pixelart images.
  • Pixel grid.
  • Customizable background color with support for checkerboard with custom colors.
  • Drag and drop support to opening image files.
  • Switches to turn individual RGB channels off and switch between premultiplied alpha and straight RGB.
  • Keyboard controls to pan, zoom, flip through files and GIF controls.
  • Customizable settings to save each image's zoom and pan locations within a session, or to reset image zoom and pan upon file change.

You can check out the source code, and find prebuilt binaries for Windows here:

Not programming, but art: I’ve been working on hand and foot studies over the last two weeks, here’s 21 hours’ worth of sketches. Plus a time-lapse video of the process: https://youtu.be/yql2Xtx2MrM

Over the last week I've been working on a small lightweight** image viewer **(calling it Cactus Viewer), GPU rendered. So far we have: Folder scanning, Multithreaded loading of images, zoom and pan, a quick switch between nearest neighbor and linear filtering for pixel art, a pixel grid toggle, pixel inspector with a quick copy to clipboard color HEX. Adding a couple of more features and releasing this alongside the source code very soon!

Writing menu systems for games can be easily overcomplicated. In this article I go through writing a simple and robust menu system based around functions without using any data structures. The upshot is robust, readable, scalable code that flows logically, produces fewer bugs, and is easy to debug and work with.


To preserve platform compatibility, I used SDL2 to manage rumble events. However, The functions were too simple and restrictive. So I wrote a rumble event manager to handle custom vibration events over multiple frames for the game, in this article I go over how it's done:


SimplyRend is the standalone header graphics engine that runs AV-Racer, in this detailed article I go through how it works. The diagram below sums up the implementation and render algorithm. https://wassimulator.com/blog/programming/av-racer/devlog_4.html &AV-Racer

No idea why I took so long to do it. Anyway AV-Racer now supports Steam Achievements.

You can get it here for like 3 bucks btw: https://store.steampowered.com/app/1978850/AVRacer/


Basic shadow mapping, an evening project with @archon

My little handmade project, AV-Racer is finally released on Steam! Featuring career championships with 5 car classes and 24 playable tracks + two-player splitscreen with controller support. The project started on new year's and now it's complete. Thanks to everyone here for your support, I am proud to have been part of this awesome community while making this.

You can get it now on Steam: https://store.steampowered.com/app/1978850/AVRacer/

Inspired (and equally humbled) by the amazing rrespacker from @raysan5, I finally bit the bullet and spent the evening on writing a small packer for AV-Racer. It is very barebones, the packer is a commandline tool that packs a single file type without compression into one file, and a simple API to handle fetching addresses. It is now in the game to be released. it's on GitHub : https://github.com/Wassimulator/SimplyPack

After 4 Months since starting this project, AV-Racer is finally now live on Steam with planned release sometime next month! Featuring career championships with 5 car classes and 24 playable tracks + two-player splitscreen with controller support. The game is handmade in C using some libraries like OpenGL, stb, and SDL. If you find it interesting, feel free to wishlist on Steam! https://store.steampowered.com/app/1978850/AVRacer/ &av-racer

I wrote a post explaining how I make the maps and map files for my car game, AV-Racer.

https://wassimulator.wordpress.com/2022/04/15/av-racer-devlog-2-maps-and-the-editor/ &av-racer

Hey everyone, AV-Racer is in a relatively finished state, we're working on the Steam set up and I'm currently looking for people who are interested in playtesting the latest version and would kindly give feedback to their experience, before we release this thing publically. the game features a career mode with unlockable tracks, single player, and local two-player split screen. if anyone is interested, feel free to DM me.

Muratori's Pizza also has donuts &av-racer

we got split screen local play. Progress in Career mode unlocks more tracks to be playable in single race and split screen modes &av-racer

Gameplay demo below. cleaned up the UI, created new menus, new effects, game loop . I'm committed to the CRT effect (watch video in Fullscreen), decided on a new name, AV-Racer. At the end of the video, there's a race result screen. &av-racer

Shader work using SimplyRend, I tried this cool shader I found on ShaderToy. 2 post processing passes. Pixelate and quantize, then curve screen and add TV effect. &av-racer

Finally, migrated the game to OpenGL, in the process I created a single header small rendering library for easily getting a project up and running in OpenGL instead of the limited SDL renderer. it uses a couple of stb libraries, and a personal math library I made.

It offers streamlined sprite loading and packing, render layers, custom shaders, a text renderer with simple functions, load, and render. It utilizes immediate mode, and has two basic pipelines for basic shapes and textured quads.

The goal is ease of use, with modularity, and since I always start with SDL2 to get an idea up and running and then struggle with the migration (with migranes) this is a solution.

Particularly proud of this one, here it is: https://github.com/Wassimulator/SimplyRend &av-racer

I finally have a working (handmade) collision detection and resolving system of multiple objects and walls.

It’s a Body Oriented Intersection Negation & Kinetics system. Also known as B.O.I.N.K &av-racer

New AI system that projects a point forward and measures steering accordingly, results in the car following the AI spline very well, instead of waving around as per the previous version.

A difficult problem to tackle in a non-uniform spline based AI is acceleration and deceleration, and deducing the right times to hit the gas and brakes. The problem might blow up to require entirely new AI line organization, either uniform spline sizes, vectors and curves, or corner/straight based AI lines to make the car decide dynamically when to change inputs, as the decision is always based on the upcoming corner and that can be anything really. Being a vague problem, and also being unnecessary to make a dynamic model in a game that uses premade tracks, I ended up tackling the acceleration deceleration problem by just recording relative speeds at every nodes myself once, and then saving the values in the track metadata file. The AI then adjusts gas and brake accordingly, the results are pretty good as demonstrated in the video.

I also discovered through testing that adding a scaler to all of those values made the AI faster or slower without any loss in accuracy (up to a point. at some level the car gets too fast to make the corners). The speed points relative to each other was the determining factor in performance and not the exact speed values in a node per se. The car now adjusts speeds dynamically. This will make difficulty levels and driver performance difference much easier to design.

Now as you can see, the car is whoppingly fast around the corners, and the AI now beat my own record with the controller in lap times, and the system was deterministic enough to get accurate reproducable lap times up to a 100th of a second in lap time accuracy.

Randomness and overtaking systems should be easeir to make now by adjusting next AI node locations within a limit &av-racer

***Finally ***got the collision system to work properly without clipping bugs.

The challenge was resolving collision relative to what side of the wall the car was, determining a "right" side was also dependent on how the walls were created in the editor (clockwise or anticlockwise stacked nodes). The second challenge was resolving the angular velocity and linear velocity vectors in a way that makes sense, the more steep the attack angle, the stronger the change in these velocity vector directions should be. If a scaler wasn't isn't there, the car would bounce off the same regardless of how fast it attacks the wall, which looks unnatural.

with this in place, AI cars come next.


Editor finished. using the metadata drawn in it, I could determine collisions with walls (collision resolving still needs some work) and whether the car is on or off the track, this allowed to make tarmac grippy and non tarmac surfaces drifty, and helps determine the car's relative position on the circuit. with this information we could simulate tyre wear on different surfaces. Here's a lousy lap to demonstrate: &av-racer

two control modes, simulation and arcade, they're vastly different, arcade has automatic shifting and is simple enough to be played with a keyboard, the former requires delicate analog input, it simulates individual tyre forces, grip and traction, while arcade is just fun to drive with no hassle. also finally got to making a better track, and added a minimap, right now I'm making an editor to easily create track metadata like walls, surface info, and AI nodes and waypoints. The next step is to get the editor and parsing to work (more tedious than complicated) then we should be able to start working on a gameloop


Added tire spin and loss of traction, oversteer, weight transfers, Gforces and a G-meter &av-racer

Wrote a little program that tests your reflexes, it takes the average of 10 tests. People who game regularly, especially FPS tend to have measurably faster reflexes. it's limited by hardware latency so its data is objective within tests done on one machine (if anyone has any practical tips on how to resolve measurement with hardware latency I'd welcome it)


Implemented engine sounds using OpenAL, added gears, RPM, torque curves, and engine braking, and added a local split screen multiplayer mode. &av-racer

2D Car simulation collaboration with @archon. Here we simulate the tyre forces and solve for the sum of longitudinal and lateral forces based on the slip angle and using Pacejka's formula on each of the four tyres. (There is surprisingly sparse material online on how to simulate this so we had to come up with our own interpretations) torque, track resistance, and brake force applied on the tires determine the final velocity vector of the car, and using the coefficients on the top corner, one could adjust to simulate different road and tyre conditions, and car performance. Currently working on a local multiplayer mode (Online maybe too) and up next is gears and torque curve simulation. &av-racer

Work in progress simple 2D car game together with @archon we're (still) working on simulating car and wheel forces. &av-racer

Added a genome coding system to the cell simulations. The DNA string below every column contains the information of their respective cells. A parser also can decode the string to cell info that works for the game, meaning the game can now have the ability of genome editing and creating different kinds of cells as a player

Hot reloading of in-game structures for the simulation.

The game parses two files, one that has a numbered list of all symbols and items inside the simulation, the other file has cell structures of enzymes and other data. It was hard-coded previously, now I can edit those files and with one command parse them into an intermediary number based code (using a small tool I made for this) and with a console command in-game, I can update the simulation with the new data while it's running. Took a lot of time to set up but this will streamline testing game design concepts.

EDIT: check the thread, now I run the batch file from within the game. It's all one command now

Smooth pixel art filtering, using the smoothstep anti aliased texture filtering function in the shaders from: https://www.shadertoy.com/view/ltBfRD

Rewritten the renderer in OpenGL, the game now runs with under 20 draw calls and less than 1 mb data buffered to GPU. reduced used RAM by around 600mb by placing all sprites into one texture and sending it to VRAM, the entire game sprite pixel data and font atlasses are on one giant texture stored in the GPU, used VRAM ~ 300 mb. (you can see debug info on the left, gif is low FPS and has artifacts, the thing runs at 60 with no problems).

The "Render layers" is a system that solves alpha blending problems as it is order dependent. The renderer splits the 2d space into layers so that those at the bottom get rendered first and translucent objects blend correctly. This still doesn't produce that many draw calls as you can see below.

Looks the same as before, just runs better with more control + shaders!

Update 0.2.0 is officially released! there's a ton of new features, overhauled simulation, graphics, objectives, scenarios, the works! check it out here: https://astrobion.wordpress.com/2021/08/12/alpha-v-0-2-0/

Working on simulating organic looking cell reproduction. anyway, here's a very inefficient way to draw a white rectangle:

Hot reloading live raytracing shapes using SDF equations and ray marching. collab with @archon

performance friendly Markdown parsing and live rendering with links to different pages within the game. (don't mind the filler text)

3D rope simulation using Verlet integration, enforcing constraints using the Jakobsen method, rendered in OpenGL. collaboration with @archon

Real time basic ray tracer, using compute shaders in OpenGL running on the GPU, collaboration with @archon

I managed to get drop-down menus working in my game and added textboxes where you could type

This is not strictly programming related, but I wanted to share my new game logo design:

in my Astrobiology puzzle game I've added a solution based system where you feed the cell through a pump that adds to the wash-fluid. Next I'm planning to add a simplified molecule-synthesizer that lets you place orders on custom pharmaceuticals to use and test on cells.

Consider following my little project, there’s playable alphas as well: https://discord.gg/UNNBd34J

I’m Making a puzzle game about being an astrobiologist and figuring out alien organisms. You can read more about it here: https://ragsterb.WordPress.com

We also have a discord server: https://discord.gg/aQc3Ud5W3D Your opinions would be much appreciated!

I am writing a puzzle game (C/C++ with an engine from scratch) where you play as an astrobiologist trying to figure out alien organisms. Here’s the website if you’re interested, it has playable alpha versions and links to dev streams: https://ragsterb.wordpress.com