MERCH!
Giant Bomb - a website about video games and the people that make them

I'm Makin A Game: Behind the Scenes Boring Stuff

by fobwashed

What've I been up to since the last update? I don't have a video to show this update since as usual, the bulk of what I've been doing is behind the scenes stuff that won't really be something you can see. That being said, I figured I'd do a write up of what I've been doing for anyone that's interested. . . Not sure who would be, but I know I would if someone else were to write it so here it is....

What've I been up to since the last update?

I don't have a video to show this update since as usual, the bulk of what I've been doing is behind the scenes stuff that won't really be something you can see. That being said, I figured I'd do a write up of what I've been doing for anyone that's interested. . . Not sure who would be, but I know I would if someone else were to write it so here it is.

Save room for more

Resource Management

As usual, I've been making a lot of improvements to existing code and how everything works with each other. The biggest changes I've made have been to the way my game handles loading and unloading content between levels. It'll now ditch all textures and sounds and whatnot that are no longer necessary to hold in memory between level changes and load up only the files it needs to work what'll be up next. This all takes place during the loading screen. At this point, it's not necessary since I'm working with such a low amount of textures/sounds/resources but later when I'm building things out, have more things going on and all that jazz, this'll prolly be a bigger deal. So I wanted to put a system in place to handle it all before it became a problem. I've got a pretty good idea as far as what types of things I'll need to be loading and unloading so I've built it to handle more than I'm currently using and also set it up in a way that makes it easily expandable.

Loading Stuff

There's been a lot of changes to what goes on during the load screen behind the scenes. Since I'm disposing of no longer used textures, during the load of the next level, I have to check to see what items I need to have loaded for the game to run. These checks are pretty quick and they work in conjunction with my content management stuff. I've also made some large changes to how items/objects are spawned and respawned. I'll get more into the details here when I'm finished and things are set. Right now, I'm trying out various things to see what works best -_-;;

Tools are goddamn important

Level Editor Improvements

As I've been adding new classes and rejiggering the way my game is structured, I've been modifying my level editor as well. Once again, I'm very happy with the way programming works. For instance, I was having some issues with figuring out which collision rectangles were effecting which textures when things go invisible and it was a chore to individually click all the textures to see which ones were which. . . so I went ahead and wrote in code to allow me to see what things are associated with what things.

Main Edit Window of Editor

So for instance, I can either click the rectangle, or a texture, and all textures/rectangles that are associated with the selected one will be shown. In this picture in particular, I selected one of the foreground leaf textures, and it shows me which textures are in the same group of textures that will fade when the player runs into the also selected collision rectangle. This is also true for spawn rectangles, and pathing. If I were to click one of the paths, all NPCs/Enemies that use that path would be shown. Also a lot of little ease of use things such as a ruler for measuring pixels. I used to use a grid or just reference other textures that I knew the size of, but figured, what the hell, why not make a quick ruler tool? And Bam. As I've been doing all this, I've come to realize how damn important tools are for generating content and will be expanding on this greatly.

This is what I'm currently using to place enemies on the map. I can choose the type of enemy, and set all the various variables to my liking. Previously, I had to manually find the path I wanted to link to the spawned enemy, type in the enemy type and all it's other assorted variables, but again, I spent some time building it into the actual editor and now I can just fill out clearly labeled boxes, check off what I want, choose from a list of available paths/rectangles/etc and just generate it. I can save it, and test run it in the game immediately. Tools. Tools is the key. It took a bit of doing to make it, but now I've got this sort of interface for all sorts of things including NPC, player, camera, various interaction rectangles and other goodies. In the end, the time I save with being able to quickly create large map changes will pay for itself in time spent actually creating the tools to do so. I very much expect the tools to get much more complicated moving forward but I've (hopefully) planned ahead for expand-ability so it shouldn't be too difficult.

Spritesheet and Animations for Levels

This is something I've been working on for a while, and pretty much I've just been improving on parts of it. I think I'm pretty much done with updating this section of the editor. It now loads up sprite sheets using the image and an XML file. It'll load up every sprite, properly name it and set all it's properties so that I can just drag and drop it into the level. If it's animated, I'll get all the controls such as which frame to start on, how fast it should animate and whatevs. In addition, it was taking a long time to load up and I figured out it was because every time I changed directories, it would be tearing up the spritesheet and making thumbnails for each piece, every time. I went ahead and set it up so that it'll do this once, and save all those thumbnails in a directory. Now, it'll do it once and in the future it'll check to see if the thumbnail for that particular item already exists. If it does, it'll load up existing thumbs instead of creating new ones which reduced load times on folder changes by like, iono, 90%? It'll also run checks to make sure that even if the file does exist, it's up to date with the spriteSheet in case I've made changes.

Other changes I'll need to make eventually

I'm sorta looking forward to incorporating particles into the level editor. For things like falling leaves, steam, etc. Eventually I plan on being able to place all that stuff from within the editor as well. Other than that, I guess it's just whatever I need. Maybe cutscenes? I do know that I'll prolly be setting up NPC dialog from within the editor but I've gotta get that stuff set up in the actual game before I start writing it into the editor.

Reduce redundancy

More generalized lists for fewer iterate calls

Prior to recent changes, every update, my game would call through a list of enemies, a list of npcs, a list of interactive objects, projectiles, the player, etc. Basically, a ton of freaking lists. Everything was separated into their own group of things to update. This in itself isn't a huge issue, but it got to be pretty messy when I would have to check collisions between everything in their own lists, and also in every other list. It was a damn mess. I've since figured out a way to group EVERYTHING that has any chance of interacting with each other, into one master list to check through. This was maybe one of the single greatest things I've done up to this point because it simplified everything. Collision between objects for one, is incredibly easy now.

The Technical Hows

This is specific to XNA, but I'm sure can be used for any C# or object oriented programming. Since all my collidable objects are reference based objects, the master list I created is just a list of a base class I created that contains the specific things I need to make the types of checks I need. Every type of object still has it's own individual list for when more type specific actions need to take place, but for general things such as 'are these two things touching', every separate list on level creation is loaded into the master list. Moving things from one list to another is easy as the master list is public and can be accessed from anywhere in any class due to the static nature of the main game engine class containing that list. So, for example, when the player throws a bomb, the bomb will add itself to the master list. This will insure that it will be updated with everything, collide with everything, and be able to damage everything else in that list. When the bomb explodes and is done, the bomb's last action will be to remove itself from the list. It will no longer be updated and all this without the need to check if it's still active before updating or drawing it. More than anything, I love that I no longer have to make all those checks to determine whether or not something is active. That alone will save me many, many checks because it used to make that check for every object, on every update and every draw call. This is prolly something that everyone who knows what they're doing is already doing, but hey. I'm new to this and figuring out this basic stuff makes me happy =P

That's it for now

I've got so much that needs doing that it almost seems overwhelming at times. I think it's better to have a bunch to do and constantly be making progress rather than being stuck not knowing what to do next. . . I think. I'm pretty sure I'm nearing the point where the engine itself should be pretty finished and I just need to start adding content. Enemies, moves, lots and lots and lots of art. . . Sounds. Jeebus. I still would love to have VO but I was thinking, I only have like 3 or 4 friends that might be interested in doing it, and of them, I'm not even sure that they'd be good enough at it. You know, not make something that sounds like it's a remake of the original Resident Evil -_-;; I'll be back with more updates as I make progress. I'll try to make have something to show in video format. I feel like I've forgotten to mention a lot of things that I've already forgotten I've done. . . but I guess it'll come up sooner or later if I did. Sorry for the wall of text.