Rationale for a tile based engine in AGS

Started by Calin Leafshade, Fri 13/07/2012 05:20:14

Previous topic - Next topic

Calin Leafshade

Morning gents,

Can someone give me a good reason why, if making a tile based game (in AGS), I should make a tile based engine to do so rather than just using a static image file for the background.

Historically this was done to save memory but i can't see that that is a good argument here since in order to get AGS to draw the tiles quickly the best way to do it is to cache the map to an object and move the object around to simulate camera movement. So since the whole map is cached anyway we dont save any memory.

Any thoughts?

Terrorcell

I personally think that it depends on what you want to do with the game. If you want people to be able to make their own maps or something like that, then you may benefit from a tile based engine (initially), but later stitch all the tiles together to make a single image if you'd prefer it that way (saves having to draw each tile over and over). If it's something that doesn't really change dramatically, and its something that you want the player to have no control over, then I don't really see much of a point in a tile engine (it could all be hard coded). Whether or not it makes things easier to code for yourself is up to how you would like to make it. Making a tile engine, however, may make for some easily reusable code if you wish to go down that path again in other projects.
Just my two cents.

Crimson Wizard

While writing an editor (inside AGS game or as a separate tool) takes time, this approach still have certain benefits. They may or may not have importance depending on what you are trying to achieve:

1. Extendability, especially if levels can be read from disk rather than from data file/game exe. Easier to create small demo/test maps, allow players to make their own levels.
2. Much, much easier to fix/replace certain tile graphic without a need to redraw everything.
3. An easier way to bind certain tile types to game data (passability, location properties); actually I have no idea how people do this without tile engine - using regions and walkable areas sounds hell of a work.

Terrorcell

Quote from: Crimson Wizard on Fri 13/07/2012 07:43:18
3. An easier way to bind certain tile types to game data (passability, location properties); actually I have no idea how people do this without tile engine - using regions and walkable areas sounds hell of a work.
Writing your own plugins makes those kinds of things much much easier. But then again, you need to learn how to use the plugin API :P

Khris


Shane 'ProgZmax' Stevens

Quote
Historically this was done to save memory but i can't see that that is a good argument here since in order to get AGS to draw the tiles quickly the best way to do it is to cache the map to an object and move the object around to simulate camera movement. So since the whole map is cached anyway we dont save any memory.

There aren't a huge list of advantages to using tiles now that memory constraints are pretty much a thing of the past, but here are some points to consider:

1.  By constructing a tile engine you can also define collision areas right into the tile properties, so when a player interacts with them the logic to block/slow/allow them to pass or whatever is there without the need for drawing walkable areas over the background and blocking out trees, fences, etc.

2.  Similar to the above, but with a tile engine you can also define DRAW ORDER so you can automatically make some things appear in front of the player and some things behind without the need for drawing walk behinds.  This is provided that you allow tile layering so more than one image can occupy the same space.

3.  You can avoid using regions by specifying a 'region tile' and then drawing it on the top layer of your tiled background.

4.  Tilesets make it much easier to construct/edit backgrounds.

5.  A tile editor would make expanding the game trivial from an artistic standpoint or making a sequel using the same assets, etc.

6.  Can produce a variety of backgrounds rapidly with even a modest tileset, which is particularly useful if you hate designing backgrounds or are on a time limit.

Also, if you don't want to bother with making an engine but want some of the benefits of tiles, some art programs will allow you to draw with tiles and then save the complete background.  You'll have to do the regions and walkbehinds manually but it's a step between all or nothing.

SMF spam blocked by CleanTalk