I wanted to know Dijkstra’s not only by memory, but I wanted to be able to code it in 5 minutes.
Turns out this is not difficult, nor complicated once you get the general idea, But more importantly, despite there being a wild west of online tutorials explaining Dijkstra's with fancy graphics I failed to find any resource that actually explained how to translate the general concepts into code. Most of those youtube videos just show you a graphic and leave it at that.
Moreover, many of the tutorials I watched failed to explain some core concepts about this algorithm.
When I scroll on Facebook or TikTok or any other social media there seems to be a growing trend in April 2021 for the tech community. Tech companies are supposedly in a hiring frenzy right now but they just can’t find good labor! They claim. There aren’t enough developers on the market! Or so they say.
This is really rich coming from the industry that uses the buzz word “innovation” to distract everybody from its laundry list of social crimes. …
I felt compelled to attempt an improvement on the existing resources on this topic because It took me a lot of time and frustration to find a resource that I felt explained it to a satisfactory and digestible degree.
A hash table is worth our time because it provides some alternatives to the humble array. In many cases, A hash table requires less time complexity than an array does.
In a typical scenario, adding a new item to a hash table is done in constant time relative to the data structure, but in polynomial…
The goal for today is to create fog of war in my game. I want the character to be able to see 7 blocks in all directions.
I’m going to use a concept called ray tracing.
Computers are not yet fast or smart enough to look around them and gather in all of the data of reality and model something like line of sight while processing 100% of the data available. So, the way most engineers have been simulated line of sight for decades is with something called ray tracing.
Ray tracing is incredibly useful for an infinite number of…
Make a level editor
I’ve made a passable tileset and level generator for my game. Now, I’m going to make a level editor.
In the future, I’ll probably use a bit of procedural generation, but I want the ability to custom make certain levels and some things within levels. That’s where the level editor comes in.
I’m going to make a web portal with js/html/css that will allow anybody to make a grid and fill it with preset tiles. It will have a button that will download the level as a JSON when they’re done.
Eventually, I'd like to put…
Now that we have a basic foundation for the game. Let’s upgrade the aesthetics a little bit.
I now have the basic foundation required to start a little world-building. Today, I’m going to make a bunch of tiles before moving forward so that my game looks a little nicer.
I spent like 2 hours making some tiles, here is how it looks.
upgrade our grid generating system to be more stable, and accept more options.
There are several problems I’m going to address today.
My grid generator takes in a text file with a matrix of single-character strings.
Each of my levels is generated iteratively.
Both of these behaviors create some restraints on my creative process because there are only ~50 single characters I can use so this restricts my entire game to ~50 tiles. I’m confident the end game will have more than 50 tiles.
Secondly, the single character restraint combined with the iterative grid generation disallows me the easiest solution…
Travel from one level to the next
Today I want to make it so my character can enter a portal or in the DCSS way, “go downstairs” to the next level. Similarly, I want my character to be able to go back up the stairs so they can go back to the old level if they wish.
There are some key things about DCSS that I want to get away from. For example, in DCSS, every floor has multiple stairs and “trap doors.” DCSS uses this as a sort of bottlenecking mechanic for the player. The player can “stair spam”…
Generate a few levels and slap an outer wall on em.
Let’s use what I’ve done so far to generate some basic levels to be used for further production.
I’m at the point now where I have a way to make some stable levels that won’t cause any game-breaking crashes. My grid_manager can take in any text file and generate the level.
Now, I want there to be a ring of walls on the outside of whatever map I make, and I want there to be a super wall on the outer edge of that. …
prevent my character from walking through walls.
Prevent my character from walking through walls while maintaining diagonal movement.
I’m not sure. I have a method in my head that I know will work but I doubt it is the most performant way. I’m also convinced that unity has decent grid-game support and probably has a better way to handle this.
However, since I have no idea what those are I’m just going to do what I know will work.
I want my grid_manager to handle my grid generation.
I want my master_manager to handle the “flow of the game.” So…
Full stack software engineer