More of a game...

Friday, 14 September 2007 | Labels: , , , | 0 comments |

Everything is the engine can now be destroyed (not the landscape thought) - some things are just tougher than others. At the moment the turrets and some of the doors only take a few hits - for test purposes.

Other improvements:

  • New Weapon system + light rocket launcher implemented.
  • Multi sampling between game objects (not landscape at the moment). This ensures high speed collisions always impact (the rocket should never tunnel through a door).
  • Massive internal restructure. The code is now halfway into its release form.
  • Improved Aiming

Additional keys:
1: Default blaster
4: Light rockets

Demo

Why am I writing this Engine?

Tuesday, 11 September 2007 | Labels: , , , | 2 comments |

It is after all, quite distinct in its capabilities. Well the answer is a game called Exile, originally written of the BBC Micro in the 80's.

I wont repeat what is already written about this game, probably the best summary is this fantastic tribute site: http://exile.acornarcade.com/

The Game Development page is a great read.

This engine is my attempt to re-create this game, 20 years on, in the browser.

Exile Engine Demo

Note: This version (the .exe) uses the latest player + hardware accelerated full screen

WASD : Thrust
Mouse : Aim
Left Click : Fire
R : Remember Teleport Location
T : Teleport to last remembered location
Cursor : Pan map

There are two types of enemy turrets here. The one the surface to the right is a heat seeker, the other 3 are standard ballistics. I have plans for over 10 different ammunition types (that's the fun part to write!)

Latest Demo - Large Level with doors & swich system

Sunday, 9 September 2007 | Labels: , , | 0 comments |

Latest demo is available here. Controls are WASD, mouse to aim, click to fire. The door and switch system are in place and working. This level is 100x100 but its been tested with 2000x2000, with a 48x48 pixel tile that's a level of 96,000 x 96,000 pixels....

This demo, with a 100x100 level (the bitmap data is generated in code) is only 23Kb

Line of sight demo

Tuesday, 4 September 2007 | Labels: , , , , | 0 comments |

I've switched track for a bit. This time working on the AI. This demo shows some line of sight testing. The code calculates 3 rays from an eye that intersect with the two limits and centre of an AABB. If the object is visible the the turret calculates a firing solution and fire. At the moment this is all done every frame (30fps). I'll spread this calculation out over a series of frames. The current enemy AI plan is:

  1. Create a list of target candidates within range (1.5x the firing range of the turret)
  2. Prioritize list
  3. Lock target
  4. Check visibility
  5. Calculate firing solution and fire.
  6. Reload
  7. Goto 4

The controls are the same. WASD to move the player, click to fire in the direction of the mouse.

Demo

Almost there...

Sunday, 2 September 2007 | Labels: , , , , | 0 comments |

I wanted to get a version with source ready this weekend - unfortunately I didn't make that target. I did however fully incorporate the grid object cache (tested with 1000x1000 tiles), a new map definition method and a physics constraints system into the code base.

Demo

New Demo - Refactored Tile Engine + Rotating Grid

Saturday, 1 September 2007 | | 0 comments |

Whilst graphicly nothing new this demo shows the rotating grid concept in the tile engine. First I'll summarize the how the engine works with regard to level layout and design.

The Engine itself is a Sprite that has 3 Sprite Children.

  • Lowest Sprite - the particle engine
  • Middle Sprite - the world object sprite, this contains the player, enemies, the demo 'boxes'
  • Top Sprite - the level itself
I use the scrollRect method on the Engine sprite to scroll the entire display list. One of my requirements was very large levels > 1000x1000 tiles. Whilst this can be draw a series of bitmaps and displayed at once I would not recommend it: I tested a 500x100 level with 48x48 pixel bitmaps merged into 8x8 super tiles ( 576Kb bitmap ) = 63x13 super tiles = >471Mb of bitmap data. It actually did work but I would not recommend it...


Another option would have been to iterate over my map array, and use copyPixels to draw the level. This is probably the most common method of scrolling bitmap level. However, you still need to efficiently manage your Bitmap & BitmapData objects - that's where the grid comes in. In the example (link at the end of this entry), there is only ever the same 9x9 Bitmaps on the sprite ever. As the grid is rotated, the bitmap object is repositioned and its bitmapData member set to a new values based on an update. You could think of it as a recycling object cache.

Demo

2D Circular Linked List Data Grid

Thursday, 30 August 2007 | Labels: , , , | 0 comments |

In order to manage the visible bitmap data in the tile engine, I wrote this 2D Circular Linked List Data Grid. Once initialized the grid can hold n x n data items. The grid can be shifted left, right, up and down. As the grid is shifted, the items that fall off once side are added to the other, and automatically updated with new information. This demo illustrates the code. The red rectangle simulates the scroll window of the Tile Engine. The black/grey 4x4 grid represents the Bitmap Data Grid (Each smaller square would be a super tile of, say 5x5 normal tiles). As you move the red rectangle around with the cursor keys, the grid updates correspondingly. The important thing here is that there is only ever 4x4 Bitmap and BitmapData objects that get rotated around, updated and recycled.

Source.