Legend of Fordham Forest (Version 0.2 Demo Release)


  • *
  • Posts: 2693
I've uploaded Demo 2 a bit early. It's not the second release I intended, but I wanted release some more samples to go with the Physics Tools Extension.

Externally, not much in the game has changed. I added a few of the new art assets, but that's about it. Internally, though, there are some major changes. Namely, the enemy AI has been vastly improved.

Enemy AI now uses the physics extension to determine proper shots. Enemies will search through different combinations of firing angles, velocities, and targets.

I'm releasing the AI behavior that powers the enemies. The behavior can be downloaded from my site (see "Sample AI Behavior").

At this stage, the AI is pretty basic. The fundamentals work, though. If you find the AI behavior useful as a starting point, or even as-is, feel free to use it for whatever projects you wish (commercial or otherwise).


  • *
  • Posts: 2693
A* Path-finding Problem

I've ran into another problem that I'm happy to say I at least have a (partial) solution to.

Since I had mobile devices in mind for this game, I didn't really want the type of player control that is featured in the demo. In the demo, you use the arrow keys to move the player. For mobile, there is the virtual joystick, but I'd rather not use it. The game isn't about precision jumps. It's about strategy. So, the player should be able to tap/click on their desired location, and the player moves itself.

On top of that issue, the physics toolset doesn't address the entire enemy AI issue. I was successful in preventing the enemy from firing if it is impossible for it to hit the player--but then the enemy just sits there. I'd like the enemy to move to a better position.

The solution to both problems is everyone's favorite path-finding algorithm--A*!

Apparently the existing A* extension has been abandoned. Rather than figure out how to fix it, I just started from scratch.

I took a more general approach, since my goal is to be able to easily "program" an actor (e.g. "Walk 8 tiles left, jump 3 tiles high and one tile left, then turn and shoot"). However, path-finding and maze-solving on a map does work. Here's an interactive example. You can click on tiles to toggle walls.

<a href="http://anorthogonaluniverse.com/misc/loff/AStarTest.swf" target="_blank" class="new_win">http://anorthogonaluniverse.com/misc/loff/AStarTest.swf</a>

At least the implementation of the algorithm itself works--now I just need to get the rest of the code working.


  • *
  • Posts: 2693
With the A* extension working well enough to bring some enemies to life, I started adding more levels.

The latest addition is the bat, which will look for debris to drop on your characters' heads!

The bats mainly serve as a distraction. They don't do much damage and are easy to kill. They only become problematic if left unchecked... especially if they're in large numbers.

In later levels, they'll leave a trail of fire. You might be able to use that to your advantage, though. Later levels can get really dark.

One thing I need to keep in check is feature creep. I have about eight unique types of enemies sketched out, and 144 levels. I'm going to do my best to stick to that. On the programming side, A* and physics extensions are nearly complete.

The last significant task remaining is a dynamic lighting extension. I started work on this in the isometric game. In Thief of Vallas, I used blocks to program the lighting. I think it's time to re-write the code using regular Haxe.

The block interface works nicely for small scripts, but there comes a point where it's easier to manage code in text form. The logic is there and works, but it'll be easier to expand if written as an extension.

Last, but not least, I mapped out experience point values for each screen and how much it costs to level up. I'm not including all the usual RPG elements, but I wanted to have character levels and skills. I threw in a few bonuses to reward skillful players.  8)


  • *
  • Posts: 2693
Progress has been made on dynamic lighting.  8)

My goal is to implement something that produces an effect similar to what Sprite Lamp can produce--something I picked up in one of the Humble Bundles.

Sprite Lamp uses multiple images (an input image for each direction of lighting) to create normal and depth maps. These are then used to determine how an object is lit.

My approach trades some aesthetics and a dimension for simplicity--using an array of images and tweaking their opacity based on the direction and proximity of a light source.

I don't think the result is all that bad, given that I'm trading normal and depth computations for simple trigonometry. You can play with the result if you're interested: Dynamic Lighting Test

Eventually I'll package up everything into an extension. Getting light requires that an object be drawn as lit from all sides, but I think the effect is worth the extra effort.


  • *
  • Posts: 82
Hi merrak, this is developing quite nicely now, well done! I like your art style and I especially enjoy the dark theme with the light sources. Looking forward to seeing the extension once you release it :)


  • Posts: 131
Yo Merrak!

 This is absolutely brilliant!  But I don't want to see the code because I know it is super complex.  :-[ I hope you share this in the future when everything's done.

-Renegade Gamez


  • *
  • Posts: 2693
Thanks! :)

I think this will turn into a nice tool. "Extension" is the wrong word at the moment. The component I'm working on is a behavior you attach to any object you want illuminated.

The artist supplies an array of the actor lit from different directions (2, 4, 8, etc.). Here's the brick array used in the demo--"normal" state and lit from 4 different directions.

You can then choose between two different drawing modes. Discrete, which does not blend multiple light directions (should save CPU cycles and work for small objects)

and continuous, which is what the demo is set to.

I don't think colors, or other options, would be that difficult to include--Most of the work would be on the artist's end, since each color, option, and each light direction would have to drawn.


  • *
  • Posts: 2693
I think the dynamic lighting behavior is starting to make a real difference in the appearance. CPU usage has halved, while there is much more detail in the light.

Bricks and iron are lit in the image below. I was going to light the plants, but I spent several hours recovering the system from a failed disk drive (word to the wise--always backup!)

I'll have to think about tiles some more. I'm not sure I want to replace all of them with actors, but I could use tiles for the parts that would never be lit--then use actors for grass, etc.


  • Posts: 733
When it was getting closer to christmas, I started singing "upper left, upper left" to the tune of jingle bells to remind myself where 0,0 was. It helped me remember that 0 degrees was facing right, because left is the opposite of right and that is how my mind works.


  • Posts: 504
I'll have to think about tiles some more. I'm not sure I want to replace all of them with actors, but I could use tiles for the parts that would never be lit--then use actors for grass, etc.

Hey merrak. For the tiles, my current game , War of the Guilds, I have managed to create a fog of war system using tiles and if instance is at tile. It removes the tile to show the underlay. I don't know if this game has that portion in it there now. I did try to replace the current file in the arcade.  It might be a way for lighting for no actors. My game currently uses only 4 actors.

PS: I have been reading your isometric adventure, which is awesome. The portion for basic calc had me reorganizing code. That's for the inspiration with this portion.



  • *
  • Posts: 2693
Hi-- I don't have fog of war in this game, and probably won't implement it. What I have already is pushing the limits of what my tablet can render efficiently.

Lighting and fog of war are two slightly different problems... and I may have misused "fog of war" in the isometric journal. An overlay wouldn't work for the isometric game, but I think it's a great idea for top-down, like you've done. Have you gotten in farther since May? Would be neat to see what you've done since then if you have anything uploaded.

The lighting problem is one of computing which faces of an object are lit, and to what degree... and then loading the correct animation in response. I think it would be simpler in your game, just due to the scale. Most lights your characters could hold wouldn't light more than a couple tiles' length radius.


  • *
  • Posts: 2693
I'm slowly updating all the graphics to light up, and while I'm at it, squashing a few bugs. Level 9 is one of my favorite levels for demos, since it includes a little bit of all the basic features of the game, so I focused on getting that level to a playable state. It also includes the redesigned water (that now reflects light!) You can play it below, but it takes a while to load (14MB). Basic instructions are below the last screenshot.

I've been feeling under the weather all week, so I'm a bit surprised at myself that I got anything done at all.

<a href="http://static.stencyl.com/games/32275-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/32275-0.swf</a>

Basic instructions:

On army select screen, click on the icons to select your team. In Level 9, you can have up to three combatants. There's really no advantage to selecting fewer since there's only one level to play.

In play: Click on the currently active combatant to bring up options. Romy (the firefly) can fly, but walking is not working correctly. However, jump does work--so you can still move around if you need to. Clear all the demons--basically, anything that flickers red.

The boulder does the most damage against blocks, and the spear ("throwing stinger") does the most damage against the enemies. Click + drag to throw something.

If you click and hold the edges of the playing area, you can scroll the camera around. This works even when you're setting a shot, so you can aim at distant targets.

« Last Edit: January 10, 2016, 12:08:07 am by merrak »


  • *
  • Posts: 1397
Is this in the demo1 link?


  • *
  • Posts: 2693
Is this in the demo1 link?

It was  :)  I just finished updating the graphics in the rest of the levels. So, the demo link should no longer say "World 1 Scene 9". If it does, the page may need a hard-reload.

Some updated screenshots:

I implemented a "rain of fire" hazard. I think it's pretty cool to see the lights go by the walls--but it totally destroys your army, so hopefully you don't see it  :P

I still have the temporary character art, so they look a bit out of place.

I got to the point where I couldn't play through the existing levels just to test the new ones, so I put together a cheat code  8)

On the intro screen, press 'r' to skip the sequence. (If you accidentally start the sequence, you can press 'r' to skip the rest, but you'll have to let the screens finish transitioning before the scene change will work).

To cheat, on the main menu screen, press tilde + x (the tilde key has to be pressed first). You'll see a flashing "0" in the upper left corner of the screen. Then hit "new game".

This puts you in the "army select" screen. Hold down tilde + up or tilde + down to select the level to play. I've built up through level 17.

Hold down tilde + right or tilde + left to change the character's levels. The intended character level is one-fifth of the scene number. The max level you can earn is 20, but you can set a higher level by cheating.

Once you're done changing parameters, hit "rest restore" button to refresh the screen. In higher levels you can put more characters into play, so you'll have to refresh the screen to be able to do that. You also get new characters to choose from at levels 7 and 13.

« Last Edit: January 14, 2016, 09:49:52 pm by merrak »


  • *
  • Posts: 2693
Now that the bulk of the core code is more or less working fine, I've been coding the fun parts--special events, tricks, and traps. The typical layout of the levels is six screens, then a "boss screen", then the scenery changes. I try to introduce a new major feature with every scenery change... so the player gets something new to look at every 7 levels.

Level set 4 has been one of my favorites to work on. Set 4 has our heroes nearing a volcano, trekking through fields of sulfur. Every so often the volcano throws fireballs into the sky, which come raining down. Set 4 doesn't introduce the rain of fire, but it is the theme. Set 4 also introduces the necessity of moving your army. For the first 21 levels, you don't necessarily have to move anyone (although by Set 3 it is challenging to stay in one spot). Levels in Set 4 are too long to reach targets at the other side without moving to at least the midpoint.


Lonely sulfur-demon guarding a field. He is still badly drawn and in need of an update.

I got most of the block stability issues resolved, so I'm able to build taller towers. The taller ones are tougher to destroy, since there's quite a bit of framework holding them up. Still--many of them have a weakness if you need to bring them down.

Some towers have gates that let you enter and protect yourself from the rain of fire. This introduces a new game play mechanic. You don't necessarily want to level everything in your path. Later levels get longer, so you may need to maintain some shelter as you progress to the other side of the level.

Level set 5 will take our heroes up and then into the volcano. Then... that's it!-- at least, that's it for the demo. I've decided to include 36 levels in the Flash-based demo, which is a quarter of the 144 that are planned. It's also a good place to break the story with a cliffhanger.  Once I hit that point, I'll tackle the long todo list of bug  fixes, feature updates, sprite updates, etc., so that I have a complete game to build the remaining 108 levels off of.

I was afraid I'd have a hard time coming up with ideas for all those levels. 144 is a lot! But so far I haven't had too many issues with "level designer's block". I'm able to build about two levels a day. That's not the pace I'd like to have, but it's the best I can do with the short amount of free time I have available.

Set 5 will introduce earthquakes, which opens up another strategy--waiting it out. Earthquakes may take care of the bad guys for you, but only if you can reach a safe haven so that you're not taken out along with them.

« Last Edit: January 19, 2016, 11:21:55 pm by merrak »