after performing some major surgery on the game engine, I found that practically nothing worked anymore. each time I fixed one problem, I found two more lying in wait. the symptoms ranged from a purple screen to double gameplay speed to crashing on pause. after a stressful few days I think I have found and resolved everything, and the engine is much more powerful now than before. but I definitely learned something about trying to do too much at once.
by far the weirdest bug was the OutOfMemory exception that was crashing the game after about 5 seconds of flying. using Microsoft’s profiler tool (to monitor memory usage) and the process of elimination, I narrowed it down to the scrolling starfield in the background.
it turned out that in the process of blindly and mechanically trying to update everything to use the engine’s new improvements, I made a really stupid mistake. when a star in the starfield hits the bottom of the screen, it is supposed to destroy itself. instead, it was making a copy of itself. not only are there now two stars instead of 0, but on the next frame, they are still at the bottom of the screen, so both of those will make copies of themselves too. 2, 4, 8, 16, 32… you can see how you would quickly run out of memory at 60 frames per second.
the difference was accidentally writing “Register” instead of “Unregister” in a single line of code. bugs like that give you an appreciation for how fragile computers really are. two letters can be the difference between a working application and an unusable, frustrating, mind-melting, hair-pulling mess. it took me about 4 hours to find and fix that problem. just as a program that seems “smart” really just has a smart developer behind it, the same principle applies to stupid ones.
largemann here. dont make art posts often, sorry about that. get this: one time hom deleted a post i made on here. what a joker.
some ideas for a new hud:
and here’s a pic of my new dog:
we’ve been reworking a lot of the core game recently. we are focused now, some really cool ideas will soon become reality. the next release will once again be much different than previous releases, but i think you will enjoy it.
WARNING: technical post ahead!
I had never investigated render targets in XNA before because I didn’t understand how/when they would be useful. now that I understand them, I want to use them all over the place! I thought I’d give a brief explanation here on what I’ve discovered in the last few days in case anyone finds it interesting. I’ll probably follow this up with another post in a few days to show an example of where I’m using it right now.
XNA’s RenderTarget2D class is an extension of the Texture2D class. while I won’t claim to know the specifics about how it works, the net result is that you can draw sprites to a RenderTarget2D rather than directly to the video buffer. this creates a texture to which you can apply any kind of processing. you can composite them together, or turn around and draw this texture directly to the video buffer, or apply a filter to make everything more brown to make everything look more like modern games.
MW’s HUD is a great candidate to use a render target, so it makes a good example of when/how to use them. right now, each item on the HUD knows its “local” coordinates within the HUD, but those must be translated to “screen” coordinates before it can be drawn. I also need to be careful with z-ordering (layering) to ensure that the elements of the HUD area always drawn on top of the gameplay. this has always felt wrong to me, but I couldn’t think of a better solution until now. however, if I simply draw all of the components of the HUD to a render target, they don’t need to know where on the screen the HUD is being drawn, nor do I need to worry as much about z-ordering. they only need to know where they are on the HUD (relative to its upper left corner) and what z-ordering to have within it.
here’s how it would work…
1) stop drawing the HUD components directly to the flight screen:
1) create the components of the HUD:
2) create a RenderTarget2D that has the same dimensions as the HUD overlay:
3) draw each component to the render target with coordinates relative to upper left corner of the target and with the appropriate z-ordering (e.g., the box that shows your crystal should be drawn behind the crystal itself). the result is a single “painting” which can be used just like any other texture/sprite:
4) draw the entire HUD texture to the bottom of the screen:
(I haven’t actually converted the HUD to use a render target yet, so this is just a mockup of how it would work, but it’s on the agenda)
one cool thing to note is that this would make it easy to display the HUD on the top of the screen if the player would prefer that. to accomplish that, I could have the gameplay field render itself to a separate render target, creating two final textures which can just be rearranged.
P.S.: the screenshot key (F5) utilizes render targets to capture everything that is occurring on screen in one texture. then, because RenderTarget2D is an extension of Texture2D, I can just call SaveAsPng() to save the screenshot to disk!
we’ve been mysteriously absent the past few months, haven’t we? we’ve been pretty busy. homskillet moved to Knoxville, Tennessee and started a new job in a strange land, and largemann got a puppy. but now we’ve gotten that annoying irl stuff out of the way, so we can get back to the important things in life, like making a video game that 6 people have heard of, 4 of which are disinterested family members, and the remaining 2 of which are us.
lifted straight from our facebook page:
haven’t had much time (or motivation) to work on the game lately because of some big life changes for both members of the team. now that we’re settling back in and things are returning to normal, we’re ready to get back to work! we are going to have a meeting soon to decide where we want to take the game next. does anyone have anything they’d specifically like to see make it into the game? new modes? ships? powerups? enemies? get rid of the ship entirely and make the game about squid suits in space?
after a period of silence, we’re back to wrap up the series on the gauntlet build. this will cover everything that’s left! but first, we want to ask everyone to like our new facebook page. you can also follow us on twitter now: @AAhomskillet and @AAlargemann are our personal accounts, and @AAMetallicWing is for the game itself. notice that we still have no idea what twitter is actually for and use it mainly to insult each other.
anyway, on with the build details!
press F5 at any time to capture a screenshot. the image will be saved to [MyDocuments]\SavedGames\MetallicWing\[buildNumber]\AllPlayers\screenshots. for example, my screenshots (on Windows 7) are saved to C:\Users\hom\Documents\SavedGames\MetallicWing\0.5.0.2\AllPlayers\screenshots.
the size of the image will be based on the current scale of the game, so if you are playing at 2x (the default), the resulting image will also be 2x. speaking of which, did you know you can use F1-F4 to adjust the scale of the game at any time?
2. new sfx
previously, we’d been generating all sound effects with a really cool tool we found online. it’s been incredibly useful, but we always knew that these were just placeholder sounds. we just needed to make sure everything worked while we figured out where we’d get our “real” sound effects from. largemann has stepped up and has begun creating his own sound effects from scratch. you can already hear a few of the new effects in this build: artifacts, upgrades, and the ship’s thrusters are all brand new sounds. we’ll be replacing more as he completes them.
as a first attempt at spicing up the background imagery of the gameplay field, we created a simple starfield effect. we were worried about adding stars before now because we thought they might distract from the gameplay too much. we managed to find a middle ground that seems to work well; the stars are always visible, but they are very dark and almost blend in with the background. they will also occasionally flicker:
when the player uses thrust, the stars speed up and the flicker rate increases dramatically:
4. name & logo
we finally have a name for our development team:
and here’s our little mascot:
that covers everything we thought we should share about the new build. there are tons of minor screen, balance, gameplay, and UI tweaks as well, but they are too numerous to mention. or remember.
as mentioned earlier, the gauntlet build introduced a few small improvements to the squid suit to make it more viable.
previously, traveling in the squid suit involved a period of charging up. this works well when you need to travel long distances, but it makes fine grained adjustments very difficult. to maneuver around individual enemies, you can now tap the boost button for a mini-burst, which is denoted by a higher pitched sound. under the covers, we increased the amount of “friction” on the squid suit such that it loses its speed more rapidly during a mini-burst. this allows you to come to rest more quickly, which in turn allows you to move again more quickly!
you can now collect (and use) items in the squid suit. this goes for crystals, artifacts and upgrades. any crystals you may have collected before losing your ship will survive the ejection!
3. ship reentry:
due to popular request, you can now enter the ship again after ejection. obviously, this only works if it has not since been destroyed. in the future, we’re hoping to add some kind of “daredevil” bonus for players that try venturing away from the ship for long periods of time.
4. ship restoration:
an extension of point #2, if your ship is destroyed in gauntlet mode, you can grab an upgrade to restore it! unfortunately, any boost upgrades you had collected for the ship will be lost. but that seems like a fair trade, doesn’t it?
over the next few posts, we’re going to break down a few of the many new features in the latest build.
first up.. the Power Missile:
the power missile takes a different approach towards frustrating the player. like regular missiles, it changes its velocity to track towards the player over time. rather than traveling in large packs, however, the power missile hunts alone. it also cannot be fooled nearly as easily. normal missiles will deactivate if they lose sight of you, but the power missile is persistent. it will continue to track you unless you make an effort to put it down.
so how do you do that?
here’s a hint:
the new build is ready after a long day of work and a few moments of panic! it’s a little late, but the time was well spent on a number of small improvements. (we could have switched the release date on the previous post and hoped nobody noticed, but we decided to just be honest instead.)
a more thorough list of changes will appear in future posts, but the most important addition for this build is the new Gauntlet mode. here’s how it works:
at the start of a new round, things are (relatively) easy. enemies are weak, infrequent, and few in number. throughout the game, items called artifacts will randomly spawn on the playing field. every time you collect an artifact, your score is increased. however, collecting an artifact also results in a slight increase in difficulty. examples include an increase to missile speeds or an instantly generated nautilus.
as you collect artifacts, you will also come across upgrades . they are similar to artifacts, but collecting an upgrade will give you a slight edge. examples include reducing the cooldown of your thrusters or instantly wiping out all enemies. unlike artifacts, upgrades are not stationary, so you have to move quickly if you want to collect them. upgrades do not count towards your score. they are provided purely as a courtesy from the developers.
one more thing: you can now collect items in the squid suit. if you’ve lost your ship, try collecting an upgrade!
please try the latest build and let us know what you think! send any suggestions, bug reports, or threats to email@example.com
we are working hard on another public build! the plan is to have it uploaded on 10/7 by 11:59 EST. that gives us just over 24 hours from the time of this post.
here’s what you’ll find in the new build:
- brand new gameplay mode
- new enemy type
- moving starfield background
- improvements to the squid suit
- improved screenshot feature
- revamped main menu
- name & logo for our development team
- tiny gameplay & balance tweaks everywhere
- bug fixes
- new bugs
more details will be posted with the build. stay tuned.
in the meantime, enjoy this gif:
I slapped together a simple particle effect that fires when a crystal slices:
what do you guys think? does it enhance the effect?