Visualizing Insertion Sort

Description

The project was made for one of my final year University classes named “Creative Visualization and Animation”. The project was made in Unreal Engine 5 and entirely made using C++ The assignment brief was to create a short video that utilized computer generated imagery and animation to present information that is usually difficult to explain without visualization techniques. I chose then Insertion Sort algorithm as my topic since sorting algorithms can be difficult to understand. You will see that the video is split into two parts. The first demonstrates the need & value of sorting algorithms. The second part demonstrates a fully interactive simulation where an individual can practice using the algorithm.

Project Hurdle

One of the main problems I faced making this project in Unreal Engine versus Unity is the lack of Coroutines in Unreal Engine. For the simulation to autocomplete the sorting, it required the ability to pause areas of the algorithm to allow for the sorting animation and text. The algorithm then needed the ability to return to the correct position within the code block after the text and animations had been displayed. Coroutines in Unity would be an obvious choice to easily allow for this behavior. While there are 3rd party libraries that allow for similar behavior in C++ I was determined to solve this problem myself. The solution I came up with was to break the sorting algorithm into multiple functions. Then when the autocomplete button is selected the entire sorting algorithm runs, and it stores a Queue of function pointers to the various functions in the sorting algorithm. These functions return a boolean which indicate whether or not a pause is required. This solution worked very well and allowed for the smooth transitions between the algorithm, animations and text.

Previous
Previous

Networked FPS

Next
Next

48 Hour Game Jam Game