Sidetracked

Need to get back to work on the project – been a bit distracted as of late. It’s coming along, though, and the next step will be a big one: Helper objects, which will handle melee attacks and other effects which need to be synced to and overlaid on the character objects.

What’s been distracting me? Arkham Origins, for one thing, which I got for my birthday from my best friends. It has its flaws (weak plot, lots of glitches, and not much new in the combat/gadgets department), but it’s still Batman, dammit. Just wrapped that one up. Otherwise, been getting sucked into Gungrave, which is much better overall than the first episode would suggest. Plotwise, it’s essentially Berserk, but replace ‘medieval’ with ‘mafia’. Action’s decent, and the plot is pretty good.

Anyway, guess I should toss out a copy of what I’ve got so far for a demo. Just need to clean up the source a touch and include licensing, and I’ll post it here.

QuadTree

Got all fired up to do collision detection for some reason, so I wrote a QuadTree implementation in Lua. Performs pretty well, especially when tuned right – it handles 256 objects bouncing around a 3×3 screen area at around 75% of one core on my desktop, and doesn’t start even dropping frames until I drop in 512 objects. In the scenario above (256 objects, 32x32px in size, bouncing around an area 960x720px in size), the engine is doing between 600 and 1000 collision checks per cycle; for comparison, brute-force checking for that many objects would require around 33,000 (and when I try it, the framerate drops from 60 to around 4).

Working with Tiled maps got me experimenting with XML formatting for my object definitions, too. I’ve already worked out a document style which encapsulates the animation and some basic logic, giving me a nice, compact way to sketch out player and enemy behavior. Next up: terrain collisions and physics.

Backgrounds revisited

A while back, I mentioned that Bits & Bots performs pretty poorly: at the title screen, with just two parallax scrolling backgrounds and nothing much else going on, it was using a HUGE amount of CPU time. I had tracked it down to my brute-force background rendering, and I finally got around to implementing the background buffering that I used for my NDS project (one of the few things I did right).

Basically, the background library creates a canvas twice the dimensions of the viewport and renders a chunk of the map to it; as the camera scrolls around this area, a viewport-sized chunk of the canvas is rendered to the active window. When the camera breaks the boundaries of the canvas, the background library renders another chunk of map, centered on the camera. Instead of looking up and rendering every visible tile each frame, it does one simple operation most frames, and only actually renders the background from raw tiles when it’s absolutely needed. Between that and the efficiency of Love2D for everything else, I’m down to only 3% of one core, which I’m pretty happy with.

As an added bonus, thanks to the direction of Ghoulsblade and Co. and the excellent documentation on the Lua Wiki, I built in Tiled map support at the same time. It’s an elegant suite with a lot of cool features, and a hell of a lot easier than trying to constantly fix LIV every time Firefox breaks it.

Unflattener

Another random sighting of one of my things in the wild (yes, I was Googling myself again), this time a project called Unflattener. It’s a Python library which allows the user to easily create normal maps for dynamic lighting effects; the author, dbohdan, used one of the robots from Bits & Bots as a test case and illustration. Pretty cool stuff, and something I might look into for The Project down the road (once I’ve gotten the basics down, anyway).

Also, another mockup with my latest WIP tileset:

Much better than the last stab at it, I think, though the background is still pretty blah (just one tile, needs some variety). Using the DB32 palette helps a lot, and I spent a bit of time studying some of the old Frogatto tilesets on OGA to get a feel for things like lighting and scale. It’ll be up on OGA, under CC0, whenever I get around to finishing it.

*Edit: Mockup includes UI Pieces licensed under CC0, courtesy of Buch at OGA.

**Edit: Aaand here it is.

Goblin

Starting another sprite, the Goblin. I’m planning to make a naked base, then layer a few different outfits on (Grunt, Warrior, and Shaman, to start). Won’t be quite as complex as the last few – no crouch frames, probably no jumping attacks, maybe twenty frames total. Progress so far:

**Edit: Updated the image with a few more concepts for Goblin costumes. Left to right: Base, Grunt, Soldier, Knight, Assassin, Mage. Now to animate it.

Skeleton

Got a few frames done over the weekend. WIP:

What dungeon is complete without the ubiquitous Skeleton? It presents a paradox in itself, as deep within every Adventurer lurks a Skeleton, yet every novice Adventurer has a deep-seated fear of them. What Skeletons themselves fear are blunt weapons, silver, and fire – indeed, a Flaming Silver Mace would be enough to make a Skeleton loose its bowels in its trousers (if Skeletons either wore trousers or had bowels).

**Edit: Done as it’s going to get, I guess. Spritesheets are available at OGA, licensed as CC0.

Satyr sprite

New sprite!

Satyrs are woodland creatures with the upper body of a man and the legs, ears, and horns of a goat. They are generally playful and mischievous, though they tend to be territorial and will attack men on sight. Like any denizen of nature, they cannot abide the touch of iron, and instead fight with weapons of wood or stone. The strongest satyrs are gifted in the art of Wind Magic, and can summon other woodland creatures to help them in battle.

A bit messy, but usable for my needs. Posted it under a CC0 license on OGA. Next up, I’m going to recolor it and tack on some bat wings to make a Demon enemy.

*Edit: Wings is hard. Also none too crazy about the brown outline on gray/black body parts – might switch to a charcoal gray for the outline, or something.

Random Sighting!

Stumbled across my bird sprites in the wild! It’s a game called Fall Guy, where you control a man plummeting toward the earth and need to use your wits and a few special abilities to avoid enemies. Really cool to see my work being used in a game – even if it takes a long time to get my own game off the ground, I’m still contributing to the indie scene in small (but useful) ways. Gameplay video:

Almost back on track

Still chopping through a few ‘must-play’ games (State of Decay and Chronicles of Mystara), then I’ll be getting back into my hobby dev work. My next task is either to refine my tileset (or find a suitable replacement), or come up with a few simple enemies to add in so my hero isn’t just chopping up bats and ninjas. Ideas:

- Ghostly Hand (just what it sounds like – a floating hand)
- Kobold
- Troll
- Mud Golem
- Goblin (though I’d like this to follow the Humanoid template eventually, to be playable as a race)
- Skeleton (always a classic, and easy to mod into multiple enemies – Skel Archer, Skel Mage, Skel Knight..)
- Spider
- Scorpion
- Slime (!)

Anyone have other ideas for fairly simple creatures? Looking for common platformer tropes which I can (hopefully) animate fairly easily – things with a standard walk/fly animation, maybe one main attack, nothing overly complex.

Game Idea: Grandpa’s Tale

Genre: Platformer or Zelda-style overhead adventure

Inspiration: The Princess Bride.

Premise: An old man tells his grandson a tale from his youth, but as always, he may be exaggerating a little..

Setup: The game switches viewpoints periodically; one view is in the family home, where the grandfather tells the tale around the fire. The second view is from the grandfather’s POV within the story; you control him in his adventure as he relates it to the grandson.

Hook: Every once in a while, the grandson will call BS on parts of the story; in the middle of fighting a werewolf, say, the action will be interrupted by his dialogue, asking a question or poking a hole in the story. When this happens, the view may switch to the home; your character becomes the old man, and instead of swinging a sword at a werewolf, you are instead swinging a cane at a coat rack; when the action resumes, you may be fighting a mangy dog instead. Three towering bandits become a single pickpocket, etc. This might be a player-triggered event – a given key might cause the boy to interrupt, changing the nature of the fight you’re in (and the difficulty of it).

Twist: Partway through the tale, the old man’s son (the boy’s father) walks in and contradicts parts of the story. The setting and characters in the action sequence change to reflect this, as the son remembers events differently. Where the battle begins with the old man’s memory of a valiant fight against a werewolf, when the son resumes the tale it’s completely different – the father thumped his head and fell unconscious, and the boy instead repelled a mangy old wolf by throwing rocks at it (you, of course, control the boy).

Not sure how this would actually play out, but I like the idea of details changing on the fly due to an old man’s faulty recollection and tendency to exaggerate. Might be a fun one to try someday.