Home
2012/01/25
EnemyBehavior
I've been thinking about the EnemyBehavior interface and it's tricky. I'm trying to plan for several future enemy types, but not having those spec'd out makes it hard to design the interface. Ideally, I'd code up a few very different kinds of enemies and then figure out their common interface.
Most likely an EnemyBehavior base class will have these functions:
- move() // enemy changes position and facing direction
- act() // enemy uses a power if appropriate
Enemy position, animation frame, and power usage would be public. Most other behavioral variables could be private, allowing completely different "black-box" implementations for creatures. E.g. some creatures might follow specific patterns (think Mega Man boss) instead of taking random %-based actions like the current creatures do. Even the enemy's "state" could be done inside the behavior object, as it should be irrelevant to the rest of the game (as long as state and animations are sufficiently decoupled).
When finalized, I'd like there to be several base enemy behavior types. Imagine a Melee type, a Ranged type, a Flying/Swooping type, and several boss types. There will be many configuration options to build a variety of creatures within each type. To add a completely new type (e.g. to design a unique boss unlike any existing creatures) would require adding a new behavior implementation in C++. Though this should be extremely rare, only for ambitious projects that are already content with hacking around in the source to do new things. Great new fan-made behavior types could be contributed back to the main Flare code base.
This is the main feature we want for v0.16 (now that A* and enemy spawning are complete). If you have ideas for enemy behavior types, or interesting pointers for implementation, drop me a note!
2012/01/09
Code Diagram
I drew up a quick diagram of how Flare's code is structured. This mainly shows parent/child/sibling relationship of the main objects. Not all objects and relationships are shown, but this should give you a rough idea of how the game is structured.
Before we reach Beta there will be just a few more classes added. At that point I'll make an interactive diagram that explains how all the moving pieces work together. Here's a quick rundown:
Flare's timing is frame-based instead of ms based, capped to 30fps. This is fine for the low demands of old 2D sprites, and for a single-player game. The main game loop is a typical 2D game loop:
- wipe screen
- perform logic on all objects
- perform render on all objects
- wait until 1/30th of a second has passed.
Most objects have a logic() and render() routine that handles a single frame. Parent objects call the logic/render routines of their children.
2011/12/31
Two Years of Flare
If you check the archives you'll see that Flare v0.01 was released on Jan 1, 2010. That means I started work on Flare a bit over two years ago. Have a nostalgic peek at the v0.01 preview video.
Interesting historical notes about this project:
- The art was originally created for turn-based combat and tile-based movement.
- Started as a Java applet, but I switched to C++ early on.
- Originally named "OSARE" (open-source action roleplaying engine), renamed after a nice conversation with Richard Stallman.
Two years is a hell of a time for one person to work on a project. Even after greatly narrowing down the project scope (2D, no multiplayer, static maps, etc) it's still a frighteningly huge project. I wouldn't have made it (sanity intact) this far without help from many contributors. Thanks crew!
Version 0.16 info
v0.16 "Advanced Enemies" will be devoted to making enemies better all around. Contributor "nojan" has already added A* pathfinding, the first major new feature for enemy AI. Try the latest master branch, you'll find that enemies handle obstacles much better now.
Next task we'll want to tackle is allowing powers to spawn enemies. The actual code shouldn't be too bad; it's mostly a matter of adding new art. Most creatures will get a spawning animation. Perhaps I'll start with the Antlion, get it burrowing out from the ground. We'll add map events where antlions burst up all around the hero. We'll add Queen antlions that summon hatchlings as a ranged power. Once all that is acceptable, I'll work on spawn animations for the other creatures.
Finally, the major work in v0.16 will be separating my messy tangle of Enemy::logic code. Enemies will gain base types that explain their basic movement/behavior. The starting types will be melee, ranged, and flying. We'll probably also create one "boss" type to demonstrate how new one-off behaviors can be added by modders.
2012 Plans
Time permitting, here's how I'd like to see Flare shape up in 2012: a release every 3 months while we march towards Beta.
- v0.16 "Advanced Enemies" target March 31st, 2012.
- v0.17 "Menus Config" target June 30th, 2012.
- v0.18 "Power Enhancements" target Sept 30th, 2012.
- v0.19 "Alpha Polish" target Dec 31, 2012, marks the Beta feature freeze
2011/12/25
Flare v0.15.1 for Linux
I've tagged v0.15.1 especially for Linux users. It fixes a couple issues (build flags, random enemy groups) that weren't an issue on Win or OSX. Those of you working on packages: thanks for your work!
2011/12/23
Flare v0.15 "Translations and Mods"
Screenshots
Download
Release Notes
It's been a long road! Finally we're at the v0.15 release with a nice amount of new content. Enjoy!
- Now using TTF for fonts
- All game data can be overwritten/added via mods
- Translation support for the core engine and mods
- New Grassland tileset
- New questing areas: Frontier and Living Bones
- Redesigned creatures are tougher and more varied
Special thanks to the following contributors:
- Thane Brimhall "pennomi" - Living Bones mod and plenty of code
- Manuel A. Fernandez Montecelo - code and Debian/Ubuntu packaging
- Igorko: code and Win build features
- Hennr - Debian/Ubuntu packaging
- Remaxim - composer of Magical Theme
- Brandon Morris - steps foley, new level up sound
- Justin Nichol - character portraits
- Stefan Beller - Tiled flare export mod and automapping help
- Thorbjorn Lindeijer - Tiled tileset offset feature
- AMDmi3 - Build help
- acieroid - Display power cooldown timer and various mouse/menu fixes
And thanks to the following translators:
- (by) Belarussian by mikhailSaTuRn
- (de) German by Thomas 'CruzR' Glamsch
- (es) Spanish by Juan Pablo 'morris989' Tamayo
- (fi) Finnish by Timo Sievänen
- (fr) French by acieroid and Bonbadil
- (gl) Galacian by Gallaecio
- (ja) Japanese by Paul Wortmann
- (ru) Russian by Sbasalaev
- (sv) Swedish by Andreas Berheim Brudin
- (uk) Ukrainian by igorko
(I'm sure I'm missing someone -- drop me a note and I'll add you to the list! If you'd like to list your real name instead of your github username, let me know. Also, if you'd like me to add a link to your website here or in the credits, drop me a note. -Clint)
Community Links
2011/12/19
I'll be without consistent Internet access until Wednesday night, Dec 21. I'll catch up on Pull Requests etc. then. Thanks for understanding!
2011/12/16
Font Rendering BugFix
We were seeing drastic lag when trying to render Cyrillic text (maybe any multi-byte utf8?) in real-time. After digging around and making my algorithms as speedy as I could, it's still slow. At this point I'm assuming rendering text (vector to raster) is expensive (much more so than blitting the rastered font to screen).
So the solution is to hold onto that rasterized text instead of rendering it each frame. This may sound obvious, but it wasn't an issue when we were using a bitmap font. And isn't an issue with ASCII characters and the particular font I'm using. So maybe there's still a bug somewhere, but buffering the rendered font works.
We have lots of translations rolling in (keep them coming!) so I want to make sure those users get a great experience. This tiny bug fix has turned into refactoring many menus and widgets. I don't want to drop v0.15 right after I've introduced a ton of new code. So, v0.15 may be delayed up to a week (!). The new release target date is around Friday, Dec 23.
2011/12/13
v0.15 String Freeze - Time for Translations
If you are interested in translating Flare, now's the time! There will be no string changes between now and the v0.15 release (coming soon).
Take a look at Flare's github page, inside the mods folder. Each mod can contain its own translation. Here are the five main translation files:
- mods/fantasycore/languages/engine.pot - UI text. If you can only translate one file, I suggest putting a priority on this one. If players can read the basic UI they can at least play some of the game.
- mods/fantasycore/languages/data.pot - Core data text. Second highest priority translation file, though it's a big one (lots of item names, in particular!)
- mods/frontier/languages/data.pot - Proper names and a small amount of quest text for the overworld areas
- mods/averguard/languages/data.pot - Text for the Averguard Keep quest area
- mods/living_bones/languages/data.pot - Text for the Living Bones quest area
Flare uses a simplified subset of GNU gettext, where only simple msgid, msgstr pairs are used. Take a look at existing translation files to see how it works.
Thanks to everyone who is helping translate!
2011/12/12
Flare v0.15 RC 1
Playing on Windows? Try out the Release Candidate for Flare version v0.15.
Translations
Tomorrow (Dec 13th) there will be a String Freeze for version 0.15. If you are interested in translating the current content of Flare, please check in tomorrow for instructions.
What's Left
- Test the encampment quest, especially out of order
- Add new zombie death sound
- Add new level up sound
- Assign appropriate music to zones
- New NPC art for important town NPCs (at least one for Martigan)
- Update monster placement in Averguard Hold for level 3-5 range
- Bug Fixes
- Update the Credits page
- Clean up the Tiled folder
2011/12/08
Creature Updates
Every time we add a lot of new content, everything we've done as far as balance goes out the window. As time goes on, though, this balance will start to settle into the right groove.
Many of the current monsters are too easy or boring, so I'm doing a small revamp here. Mainly this is needed because the content will be more spread out: rather than cramming levels 1-6 into the same old dungeon+cave, we now want different areas to contain a small window of creatures.
When possible, we want creatures to be unique rather than just having more stats than the last creature. So here's what we're trying.
Goblins
Problem with goblins was they were just too easy. Not scary at all.
- Goblin (level 1) - just hops around and stabs, more hp than before
- Goblin Charger (level 2) - runs fast, special attack that causes bleeding
- Goblin Charger Elite (level 2) - rare and more powerful version
- Goblin Spearman (level 3) - throws spears, so more dangerous to more players
- Goblin Spearman Elite (level 3) - rare and more powerful version
- Goblin Shaman (level 4) - casts shield and shock
Zombies
Problem with zombies is they didn't feel like zombies, just walking cannon fodder. Now the low level zombies have a much more devastating bite attack, and the higher level zombies have intimidating abilities.
- Rotting Zombie (level 1) - more hp than before, small chance to bite for big damage
- Zombie (level 2) - more hp, much higher chance to bite (possible to one-shot a player)
- Zombie Brute (level 3) - high hp for its level, fast speed and very fast attack rate
- Icegrip Zombie (level 4) - melee attack causes the player to be immobilized for 5 seconds
- Bloodthirsty Zombie (level 5) - melee attack heals the zombie for 50% of dealt damage
Skeleton
The skeletons were decent, just need some number tweaking and maybe some power shifts (e.g. take crossbows away from regular skeletons, place more archers). Eventually the skeletal warrior should block and counterattack; that will make him more interesting in v0.16.
- Skeleton (level 2) - much more hp, no ranged attack
- Skeletal Archer (level 3) - generic ranged attack skeleton
- Skeletal Mage (level 4) - casts ice missile, causes slow
- Skeletal Warrior (level 5) - high defenses, heavy attacks, armor-piercing special
- Skeletal Sniper (level 6) - level-appropriate upgrade to Archer
- Skeletal Occultist (level 7) - level-appropriate upgrade to Mage
- Skeletal Knight (level 8) - level-appropriate upgrade to Warrior
Antlions
The spitting antlions were by far the best: their high damage and rate of fire made them always intimidating. We're going to make the other antlions much more interesting to bring the creature up to a mid-range enemy.
Also we'll decrease the average HP for their levels, but greatly increase their armor absorption. They will become very weak to fire, ice, or both.
- Antlion Hatchling (level 3) - mostly dangerous because they're found in swarms
- Antlion (level 4) - will get much higher health/damage
- Antlion Blinker (level 5) - will also spit a poison that stuns the player
- Antlion Slasher (level 6) - will get a higher rate of attack for poison damage
- Antlion Spitter (level 7) - ice and fire versions will have tweaked numbers to match other creatures, mostly satisfied with these guys
- Antlion Burster (level 8) - will self-detonate for insta-kill level damage
Minotaurs
Undecided, we're not using these guys much yet. They'll be a higher level creature, so we'll put them to more use once we get more content in.
The Numbers
It's a bit tricky to spell out the right formula for now. Ideally a creature +2 levels is hard and a creature -2 levels is easy. For now I'm basically doing playtesting to see what vaguely feels right. Once we get a few creatures ready we'll have updated formulas (e.g. a level X creature should have about Y health).
Maps Updates
Because of all the number shifts, we might have to go back and repopulate old maps with new level-range-appropriate creatures. Also the new maps should be constrained to specific levels. Creatures +/-2 levels are acceptable in small doses (e.g. mini-bosses might be +2 lvl).
- Frontier Plains - level 1 (mostly goblins, some patches of zombies)
- River Encampment - level 2 (goblins)
- Ydrakka Pass - level 3 (goblins early on) and level 6 (antlions in the second half)
- Goblin Warrens - level 3 (high-end goblins, and ukkonen)
- Averguard Atrium - level 3
- Averguard Prison - level 4 (showcase the new zombies)
- Averguard Academy - level 4 (skeletal mages and warriors, some zombies)
- Averguard Temple - level 3 (before locked area), level 5 (after lock)
- Averguard Complex - level 5 (lots of warriors)
We'll probably detach the antlion caves and move them to a new place. Those will be level 6.
The new Living Bones module will feature level 7 or 8 content.







