Hey there, internet!
Dragoncoder here, Redcoat wanted me to share a bit about the work I have done for Jacob’s Highway.
So I have worked on the code that lets us make levels, and play them in the game. That’s right, folks; when the level plays correctly and has cool swooshing effects, or awesome bosses, or unending hordes of squishy enemies – you can thank me. Well, me and everyone who made content.
It has been a tough road. Going into this, I had never made a level editor, or any tool for that matter. In fact, at first we were not even going to use tools for content generation. After some demonstrations by Sientir, however, we decided to make our own tools in C#, which at the time was another first for me.
So there I was, in charge of getting the levels to work, and now being asked to make this tool in a language that I have never worked in before. Sure it is related to C/C++, but there were new syntax and standards to learn, all while making a type of program that I had never done before.
I had to pick up many new tools along the way, such as polymorphism, picture splicing, viewport/screenport translation, and bit-level data management; but in the end, I created most of our second-worst named program, the Road Scripter. Sientir helped out in several areas, and made some of the coolest aspects of it, but the majority of the structure of our Road Scripter is made by yours truly.
So, without further ado, I introduce our level editor!
Here we have the first screen that people look at, a (mostly) blank graphics editing tab. This is the area that defines how the level looks, and also defines the size of the level. On the right is the tile pallet, done by sientir. On the bottom are the tiles we have for use, any of which can be put in the favorites area on the top. In either section, double clicking a tile puts it into the level.
And eventually you get something that looks kind of like this.
Here we have a section of road graphics being edited. The red grid marks are set to be one ‘lane’ wide and high, and they represent the size of one tile. The blue lines are tiles that are currently selected. Tiles that are selected can be copied, moved, deleted, rotated or flipped. We even have it set up so that when moving tiles they snap to each other or the grid. Of course, that has been less useful than just holding control while moving tiles, which forces tiles to move only by whole grid spaces.
And of course, we can’t leave out physics, after all, without physics, the game would not be able to tell if the player is staying on the road or not. This is some amazing work done by Sientir, who made this tab pretty much on his own. We had to work together to get it to play nice with the graphics, but everything else is his own invention. Including one of the most impressive feats of coding that I have seen in a long time; The Physics Calc button. The calc button automatically generates most of the physics for a level and optimizes the number of physics boxes in the level, in short it does 90 – 99 percent of the work for us, depending on how much we use angled road areas. See the editor cannot ‘see’ the road like a person can, but it can tell if a grid square contains a tile, then it puts a box there if there is no tile. When it is done checking all the squares, it then makes a pass through all of the boxes it made, seeing which ones can be grouped up into bigger boxes. And when it is done, we can go through and edit them or add boxes to account for angled road areas. Each of the colored boxes in the above picture is a physics box, most of which were created with the calc button.
Now, we move on to the Scripting tab of the level editor. This is where a good chunk of the time making levels is spent. Here is where we can loop sections of the level to make it longer, tell the game to spawn enemies, or do some cool graphical changes. We can set loops to end on number of enemies killed, number of times looped, or even level flags, which can be set by enemies. Going much beyond that would be boringly technical, or at the very least, would require several more pictures. Needless to say, this is where I get the most questions from others when they start working on levels.
I mentioned that scripting is where we tell the level when to spawn enemies, and the wave tab is where we tell the level how to spawn enemies. Here we place the starting positions of enemies and even can set AI flags when they spawn. As an added bonus we are able to set a delay for when they spawn after the trigger they are associated with trips. And in case you were wondering, the lighter gray box is the area the would be taken up by the screen, the darker area is outside of the screen. So that way we can spawn enemies off screen and have them move onto the screen smoothly.
Here we have another section done entirely by Sientir; the Center of Lane editor. As you could guess by it’s name, this allows us to define the center of the road. This is used primarily to determine where the player respawns when going off of the road or dies. We also can set up enemies to follow the center of lane lines. Sadly, we were unable to make anything like the physics calc button for this, but the controls are fairly intuitive if you can remember the useful ctrl, alt, and shit combinations with left and right click.
And now we end this tour with the Finish tab, or level data tab. Here we name the level, select BGM, set the starting road speed, the player sprite/sprites that are used, and any parallax that are used. When all of that is set, the Export level button can be used to turn all of the work so far into something that our game engine can read, and viola! a new level is made, or updated at least. The export is a very intensive operation, since it splices the graphics, arranges the scripts, divvies up the physics, compiles the waves, and links in the lane centers.
So that concludes this tour of our level editor. I may do more in depth posts about each section and how they interact with the level in game, we will have to see how fortunes flow. Though if you want to know more about the two tabs that I did not cover… well, those are entirely Sientir’s domain. Since I may not have had much to do with making a couple of the tabs I talked about, I am working on one of the levels in Highway to the Moon. Which means that not only did I make this level editor, I am actively using it, except for the two tabs that I did not cover here in this post.
So, Until next time,
This is Dragon Coder, signing off.