Me, Myself and a Box

A POST MORTEM REVIEW

What went Well?

  1. Setting up Newtonian Box to mimic original “interactable_box” logic

    • This was probably the easiest step of the whole process. I simply duplicated the interactable_box entity, and used the existing interaction logic as the foundation that my script extended upon

  2. Implementing Newton’s First Law of Motion

    • This was kind of tricky. To start, I really had to dig into the blueprints of the project, and deconstruct what was there so that I could use the logic to determine which direction the box needed to move, test each tile in that direction, and make sure the box did not enter a tile that was supposed to be inaccessible. Once it reaches an inaccessible tile, it moves the box to the last accessible tile. This resulted in a smooth and nice looking transition as the box moves from the originating tile to the final one. The major problem I ran into with this mechanic is listed below, in “What Went Wrong”

  3. Implementing Newton’s Second and Third Laws of Motion

    • Once I was able to get the Newtonian Box to move until it couldn’t, it didn’t take me too long to figure out how to detect if the “stopping” object was another Newtonian box, and implement these laws. I definitely woke the house up whooping in joy when the first box slid across the map, connected with another box and sent that one flying off. I added another whoop after placing a third box in the path, and seeing that the mechanic continued, and as intended, would continue until the moving box encountered an inaccessible tile.

  4. Setting up the “Clone Tile” mechanic

    • This was a super fun mechanic to implement. Because the initial navigator presentation did not include the completed mechanic (see Clone tile in “What went wrong?”), I had to design the entire mechanic from scratch. The amazing thing with this is that all of the trial and errors I went through implementing my movement mechanic had really given me a solid understanding about how the code worked, and I was able to get this mechanic fully functioning in half the time it took me to complete my first one.

  5. Using both mechanics to build fun and challenging levels

    • Using both of these mechanics when designing a level was an absolute pleasure, both during the design process, while playtesting myself, and when having my family members test out my levels. Combining just these two mechanics opened up so many options for puzzles that my biggest block here was not going overboard on “early” levels and delve too deep into the possible complexities available.

Testing out the Newtonian Movement Mechanic. The darker boxes are Newtonian boxes and the lighter one is the original interactable_box

Testing out the Clone Tile Mechanic

What Didn’t Go so Well?

  1. Newtonian Boxes moving in diagonal lines when pushed right or left, but in straight lines when pushed up or down.

    • This perplexed me to the point that I had to reach out for assistance in understanding what was going on. The issue was complicated by the fact that the first lab assistant that responded to me stated that my script looked correct, and they also had no idea why the box would be moving diagonal instead of in straight lines. I struggled with trying to correct this for a couple of days, and was almost ready to give up when the instructor was able to identify where my obstacle was: when generating the level map, the tiles on the “y” axis wrap to the next side of the map to a new “x” location to build the next row. Because pushing the box left or right caused my pathfinding function to test all tiles along the directional axis until it found one that could not be entered, my test continued into the new “x” rows until that condition was met. This resulted in the box moving diagonally “down” when pushed left and diagonally “up” when pushed right as the pathfinder followed each row end to the next “y” box in the array. 

    • The instructor suggested using the generated tile map’s width and height as limiters for my pathfinding function, and implementing this suggestion instantly fixed this issue.

  2. Implementing Newton’s Second and Third Laws of Motion

    • This was more of a minor hiccup that involved me not completely understanding how the tiles detected their neighbors at first. The initial logic used the player pawn’s tile as the test, and set the movement direction to be opposite from where that pawn was located. I really spent some time in learning how these direction tests worked, and thought I had fixed my issue, but the initial box still would not pass on the movement. My “AHA” moment came when I realized that I was still testing for stamina before applying movement to the new box, and of course, the Newtonian Box does not use stamina, so this was always testing as false. Once I removed that bit of code, it worked beautifully.

  3. Activating tiles between originating tile and final tile

    • In my initial concept, the Newtonian Box was supposed to activate each pressure pad it passed along its route. I had included this in the concept because I did not understand how movement worked in this system yet, and was used to using collision boxes, so had assumed that the tiles would simply detect the box as it passed by and trigger the plates. But after learning that the box doesn’t actually move through any of the tiles between its origin and destination, but merely creates the illusion of movement, I became stymied on this functionality and removed it from my plan. Looking back now, I know that I could have built an array within my pathfinder function, and used that to activate the intermediate tiles accordingly, but you live and you learn.

  4. Clone tile had no tile

    • When I first accepted this mechanic through click-up, the creator had not been able to implement a tile functionality to spawn a clone, and had circumvented this by placing both the player pawn and the clone pawn on a map, and then switching between the two, and in order to switch between the two, they had hard-coded references to the two pawns in the level blueprint. I knew this would not work for me, because I wanted the player to be able to spawn multiple clones and have the ability to destroy existing clones, so I needed a more dynamic approach. While building the mechanic, I chose to limit the clones so that only one could exist in the level at any given time. This allowed me to have the “Switch Entity” function only look for the existing clone/player when transferring possession. To facilitate this in later levels requiring multiple spawn, the clone tile looks for an existing clone, and if it finds one, destroys that clone before spawning a new one. I also limited the tile functionality to only be usable once per level.

  5. Having only one type of pressure plate resulted in puzzles that were too easy to solve.

    • Because the way the tile system is set up, using my Newtonian Movement mechanic means that my box needs an open path to be usable. This was not so much a problem with just my one mechanic, but once I added the clone tile to my project, the issue reared its ugly head. During level design, I found that it was nearly impossible to design a puzzle using both mechanics in the solution because the player could just skip using the boxes altogether by manipulating the player entity and the clone entity to navigate the puzzle and completely bypass having to use a Newtonian Box. I solved this by implementing new tile mechanics in which one pressure pad only responds to the player, one only to the box, and a third responds to either. This allowed me to really control the flow of my puzzle designs.

I could not for the life of me figure out why these boxes were flying in diagonal directions!!!

Getting the movement mechanic to work was such a joyous moment for me! I made a lot of joyous noises that woke everyone in the house up!

In Conclusion

This was such an enlightening experience. Prior to this, all the work I have done in Unreal Engine has been physics based, using collision boxes, line traces, etc. Learning this tile-based system has truly helped me to have a stronger understanding not only about how those systems all work, but also has given me invaluable insights into scripting with blueprints and different methods of implementing actions in future projects. I really appreciated the novelty of the scripting approach used in this project, because it was unique enough that no amount of searching YouTube or asking AI for suggestions helped me. I was forced to deconstruct the code I was given and really dig into it for analysis in order to get the smallest result in-game. I feel like this has broadened my understanding of blueprints in a way that no other project has done before this, and have spent (and will spend) many days on adding new mechanics to this game, continuing to grow it into a full fledged project down the line. This has given me something truly solid to sink my teeth into and practice with.