Tuesday, 28 September 2010

Phone 7 XNA Tile Engine Base Solution

A lot of the game ideas I have require a tile engine as a base. I've had a few ideas for Phone 7 games but thus far I've given up at the first hurdle - a tile engine.

I've now resolved that issue by creating a base solution with a ready-to-go tile engine that is suitable for side scrollers, top down and RPG-style maps. I've decided to release it so that anyone else in my position should be able to pick up this base solution and get cracking on tile-based games.

The solution imports maps created with Tiled.

Here's a video of the engine in motion:



And a handy list of all the features of the solution:
  • Suitable for side-on and top-down games
  • Good for platformers, RPGs, shooters, racers, adventures - anything that needs tiles!
  • Works in landscape or portrait with one line change.
  • Built on the Windows Phone 7 XNA Gamestate Management engine sample.
  • Uses Nick Gravelyn's content pipeline extension for the "Tiled" editor.
  • Simple but flexible camera class that clamps to the map boundaries.
  • Draw the whole map at once, or one layer at a time for flexibility.
  • Parallax scrolling simply by adding a couple of properties to a layer in Tiled.
  • An overload to draw a layer as "shadows" by drawing offset+black+semi-transparent.
  • Per-pixel colour-based collision detection on specified layers/tilesets.
I've added a whole bunch of comments to hopefully help some beginners along the way. Please note that this is just a base engine for a game, and won't help you magically write your actual game mechanics!

This is the first time I've released some code with the intention of helping other developers, so please leave comments below. I'll address any questions in future posts. If anyone with a real device reads this, please consider giving it a run on a real phone - I'd love to know how it performs (if it runs at all!). Take some video as well!

A few screenshots next, download link is at the bottom of the post!



Tiles used in the solution are released freely at Lost Garden.

Please note that the solution is built on XNA 4.0 and will not compile using older versions of the XNA SDK.


Monday, 6 September 2010

7Cache - New screenshots

Lots of work done this weekend. .GPX importing from Windows is working (in theory!). Also implemented direction and bearing to both the active cache and any cache you select from the map. Distances can be displayed in metric (km/m) or imperial (mi/ft).

Edit (Tues 7th): Added Cache Radar screenshot!



Friday, 3 September 2010

7Cache - Planned Features

Work continues on 7Cache - my Windows Phone 7 Geocaching application. I've compiled a list of features that will make it into the first release:

  • Import of .GPX pocket queries via a companion desktop application.
  • Offline storage of around 2-3000 caches, including descriptions, hints and recent logs. You won't need a data signal to find caches you've pre-imported!
  • Bing Maps integration. View caches on a pan/zoomable world map, find caches near your location quickly.
  • Full details of each cache: descriptions, recent logs, hints, cache size/terrain/difficulty, distance and direction to cache.
  • Cache Radar - similar to the radar function in GCzII and Geocache Navigator, shows distance and direction to cache, along with your direction of travel. Will have an optional audio "click" as you get closer.
Some of the must-have features that will make it into the app in the future, as soon as it's possible to do so:
  • Download caches directly from Geocaching.com with a "find caches near me" feature, fully integrated with the Cache Map.
  • Log your finds directly to Geocaching.com.
  • Integrate phone compass with cache radar so there's no doubt about which way to head.
  • Import .GPX files from Skydrive, Windows Live's online storage facility that will be used to share content with all your Windows devices.
I'll be posting some more screenshots this weekend. I'd like to hear suggestions from any prospective Windows Phone 7 Geocachers about features that you'd like from a mobile 'caching app. Leave a comment!