I moved to a new URL! Check it out!

posts dated from: september 2014

Doodle Post

Image

Doodle Post

Image

Platforming Nudging Assistance

Platforming Nudging Assistance
Making a solid feeling platformer isn't as simple as setting up horizontal movement, jumping, and gravity. There are a lot of tricks and behind the scenes magic involved in making something feel good to the player. In the past I've talked about ledge forgiveness, and input buffering, and now I'm going to add nudging assistance to the list!

Ledge forgiveness, input buffering are two tricks that let the player execute their intended action even if they screw it up slightly. Nudging assistance also falls into that category.

The Problem


My latest small game Starforger II is all about roaming around procedural levels. A lot of times the levels have one tile openings in walls that the player wants to navigate into. Take a look at what happens with just a typical platforming physics system when a player tries to navigate into a small tunnel like this.

Image


Even though the player really wants to slide into that hole as they fly by they simply cant because there is no frame in which the player is able to actually navigate into that tile. If their vertical speed is too great they will miss the hole every time even though they are holding down input that would make it seem like they should be able to squeeze into there.

Image


Image

Dev Log: Building Buildings

Dev Log: Building Buildings
I'm finally getting back to work on my main project which for now is called Stratoforce. Maybe StratoForce? Strato Force? I dunno, who cares for now.

A big part of the game is placing structures onto islands that you build, and for whatever reason I've been totally stuck in how I should be designing the structures. I had a couple of images in the game for the basic Power Generator and Power Node structures, but I hated how it looked over time. They looked too complex, so I decided to try to dial it back to something way simpler with big simple shapes.

Image


From left to right there's the Ammo Generator, the Power Node, and the Power Generator. I've been trying to find references for RTS structure and building design, but I found that a lot of them use 3d which is quite a bit different. I can see how this kind of thing would be waaay easier in 3d though. I do want to have my structures animate, and respond to things, and doing that in 2d is going to be a little challenging. I might be able to make something work with a bunch of tweens or something though... hopefully I'll be able to prototype some animation stuff for the structures soon!

Game Jam Procedural Generation Part IV

Game Jam Procedural Generation Part IV
The final part of this series about procedural generation for Starforger II will conclude with the last of the level generation code. In the last episode I talked about some of the details in generating rooms, tunnels, and other details in the level. In this final part I'll wrap it up by talking about how I place enemies, breakable blocks, and some final touches on the treasure room.

Image


The next thing in the generation of the level is the breakable blocks. These are blocks that the player can blow up using their bombs. I added these sort of at the last minute of the jam just to give some more interaction with the world, and it felt kinda fun to forge your own path through a big section of breakable blocks.

// put breakable blocks in random places I dunno
for (var yy = 10; yy < grid.TileRows; yy++) {
for (var xx = 0; xx < grid.TileColumns; xx++) {
if (CheckRect(xx, yy, 2, 2)) {
continue;
}
if (Rand.Chance(config.BreakableChance)) {
if (breakables < breakablesMax) {
Scene.Add(new BreakableBlock(xx * 16, yy * 16));
gridBreakable.SetRect(xx, yy, 2, 2);
breakables++;
}
if (config.Width > 1500) {
xx++;
}
if (config.Width > 1000) {
xx++;
}
}
}
}

I actually use a separate grid "gridBreakable" to keep track of where I've already placed blocks. This is less expensive in Otter. The alternative would be to do a collision check against all other breakable blocks which would take longer and longer if there are more breakable blocks being added. Whenever a block is added I add a 2 x 2 rectangle to the gridBreakable grid, and the function CheckRect() will check against the breakable grid and the ground grid, so I can't accidentally place a breakable block in the ground, or overlapping another breakable block.

Otter Updates

Otter Updates
Another quick round of updates to Otter this week. All of these changes are currently happening in the dev branch and will be moved to the default branch once I get some more documentation and testing done.

* Platforming Movement now supports jump through platforms
The PlatformingMovement component can jump through platforms now.

Image


The set up for this requires adding tags to the component that are to be used as jump through. The next step is adding a collider to the Entity that will act as the jump through platform detector. This collider should be only 1 pixel tall, and should be placed on the very bottom of the entity, and probably be the same width as the collider being used for the rest of the collisions. The component also allows for the player to push down + jump in order to drop through a platform.

* Tiny music changes
The Music class now keeps track of all of the created music objects in order to update them when the global volume is changed. Previously I was using the EventRouter but if the user ever decides to clear all of the event router subscriptions the music object would break.

* QuitKey has become QuitButton
The QuitKey has been replaced with a Button object. The default to quit is still the Escape key on the keyboard, but now it can be set to any key, mouse button, or joystick button.

* AutoTiling example
An example project has been added in the Examples folder which should show the basics on how to use the auto tiling system in Otter.

* Collider double-add bug fix
There was a bug in the Collider system that allowed a collider to be added to the internal collider list twice. If an Entity used AddCollider or SetCollider in its Added method those colliders would be added to the Scene twice. If one of those double-added colliders are then removed at some point then bad things would happen. This has been fixed by only allowing colliders to be added to the scene once.