Graduated!

Woohoo.

Other things I’ve done recently:

  • Added support for animated and alpha blended tiles.
  • Added parallax backgrounds.
  • Finally got around to fixing the FPS counter (not that it gets used much since a frame takes about a millisecond to update and render)
  • Added a notification flag in the corner of the screen to detect accidental runtime loads of resources.
  • Working on making some of the resource previewers (currently looking at the particle system one) support live reloading of the resource for quicker development. This currently requires rebuilding the content project, which is semi-annoying.

Resource cleanup

Rewrote a bunch of the resource management in Platformer so that each “screen” has its own ResourceManager (used for loading sprites/fonts/textures/etc.); this is more in keeping with how XNA intends the underlying ContentManager to be used and more correct in general.

Well hello there

Once again I have forgotten to update this blog in months. Some of you may have noticed that shilbert.com was entirely down for a couple months. What happened was that my web host decided to disappear off the face of the planet; luckily, I was able to get backups from the datacenter the host was using, LiquidWeb. They had my data back to me the night I asked. Classy service.

Anyway.

I have not done an awful lot more with Platformer. The Portal Turret project has been resurrected, and I spent this weekend making my own programmer for the dsPIC33f MCU I am going to use, rather than paying $60 or more for a programming device. I might publish the circuit schematics/Arduino sketch/Python program I made at some later date. I also reverse-engineered the audio-based level transfer system for Bangai-O Spirits for DS, and made a receiver program in C#. This could let people develop PC-based level editors, and also to pass around levels in binary format instead of as MP3′s or YouTube videos. So, some stuff has gotten done, although I want to get back to working on Platformer soon.

IT’S ALIVE

Oh, so there is a blog here. I almost forgot.

I have had a little bit of time to work on Platformer again. Some of the things I am working on are:

  • Particles.
  • Refactoring how rendering works a little.
  • Thinking about enemy design.

Particles are not very interesting right now; they’re just a prototype that only supports single-pixel particles. Eventually I am going to have particles made up of series of line segments (for sparks) as well as particles that are animated sprites (for smoke.)

Particles.

Particle test. Not very interesting.

Projects & Tests :(

Agh, not enough time to work on platformer recently.

I did get a little time to implement a prototype of a throwing knife weapon, which is interesting, but I still need to add some actual enemies and gameplay.

Also, I messed around with the scripting language, doing some completely unnecessary (but fun) work like control-flow graph optimizations and peephole optimizations. Some graphs follow:

Before optimization (notice jump-to-jumps) and some slightly redundant bytecode:

output_beforedot1

Before

After:

After

After

There’s some weirdness still, like right now the STVAR (store variable) opcode doesn’t actually eat the top-of-stack because it results in less instructions for a naive code generator to support things like A = B = C, but now that there’s peephole support I’ll probably change it to be more reasonable — the codegen can just emit DUP, STVAR to support that, all statements will be suffixed with a POP, and I can add a peephole rule to change that to just STVAR for the common case.

There’s also a bunch of things that it still doesn’t support, like right now it doesn’t actually assemble the basic block graph into linear code yet because I haven’t thought of a smart way to choose how to order blocks so it can take advantage of fallthrough and not need a JMP at the end of every basic block, or a JT <ifTrue>, JMP <ifFalse>.

It also doesn’t do anything really fun like variable liveness analysis, common subexpression elimination, or code motion; it’s also a stack based architecture so there’s no register allocation to be done. Maybe I’ll spin this into a separate project to write a JIT or something, so I can actually get a game done while also satisfying my bizarre compiler desires.

Collision cleanup

Cleaned up some issues with the “new-ish” tile collision system, including an issue with sliding on slopes, adding “thickness” back to walls (i.e., so the player’s bounding rect is not zero pixels wide), and a little optimization. I also fixed some 1-frame glitches in animation that occur when you dash.

Back, maybe?

After a long hiatus I have been getting some time to do a tiny bit of work on Platformer again. Unfortunately, I am spending that time unwisely by prematurely optimizing the script VM. I think I am basically up against the limits of how fast I can make a VM loop for a dynamic language in C#/.NET — the only improvements left are going to be incremental — so I really ought to just wait until script actually slows something down and then just move that into C#. But it’s kind of fun to mess around with optimizing.

Spelunking

Experimenting with some “larger” tiles — i.e., making 32×32 blocks instead of just 16×16. It gives you more room to fit in details and looks a little less monotonous. This is inspired by the “fat” tiles used in Joakim Sandberg‘s work.

screenshot00031

I also tracked down a bug that was causing the editor to very rarely get stuck in a mode where you couldn’t use Undo or Redo. It only occurred when you moved a tile selection, but dropped it exactly back where it was originally. The code was doing a return without popping a level off the undo-tracking stack.