www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - dtiled v0.2 - a library for tilemapped games

reply "rcorre" <ryan rcorre.net> writes:
dtiled v0.2 is out, and for better or worse, it got hit by a 
serious case of
feature creep.

v0.1 was simply an easy way to load maps created with Tiled 
(http://mapeditor.org).

v0.2 attempts to provide much of the functionality commonly 
needed by tilemapped games.

I like to hack around on tilemapped rpg/strategy games, and 
noticed I was
copying a lot of the same map-handling code everywhere, so I took 
a shot at
lib-ifying it.

The new tilemap modules (dtiled.grid and dtiled.map) are 
independent of the Tiled map-loading module (now called 
dtiled.data). You don't _have_ to load your map from a Tiled json 
file, any 2D array will work. However, as a whole, these modules 
should provide a nice road from creating a map in Tiled to 
working with it in a game.

You can check out:

The source: https://github.com/rcorre/dtiled
The dub package: http://code.dlang.org/packages/dtiled
The docs: http://rcorre.github.io/dtiled/index.html
The demo: https://github.com/rcorre/dtiled-example

dtiled is intended to be game-engine independent; the demo can 
currently be run using either DAllegro (requires allegro5) or 
DGame (requires sdl2) as a backend.

My next goals are pathfinding and a more interesting demo. I've 
considered
adding support for other Tiled map formats (tmx and csv), but I'm 
not sure that is
valuable as anyone using Tiled has the option to export to json, 
which should contain all of the necessary data.

Eventually, I may add support for isometric and hexagonal maps.
Jun 21 2015
parent reply Manu via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> writes:
Hey cool. I haven't thought about tiled for years!
I contributed the terrain painting system years ago ;)
Nice to see a lib in D!

On 22 June 2015 at 13:45, rcorre via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 dtiled v0.2 is out, and for better or worse, it got hit by a serious case of
 feature creep.

 v0.1 was simply an easy way to load maps created with Tiled
 (http://mapeditor.org).

 v0.2 attempts to provide much of the functionality commonly needed by
 tilemapped games.

 I like to hack around on tilemapped rpg/strategy games, and noticed I was
 copying a lot of the same map-handling code everywhere, so I took a shot at
 lib-ifying it.

 The new tilemap modules (dtiled.grid and dtiled.map) are independent of the
 Tiled map-loading module (now called dtiled.data). You don't _have_ to load
 your map from a Tiled json file, any 2D array will work. However, as a
 whole, these modules should provide a nice road from creating a map in Tiled
 to working with it in a game.

 You can check out:

 The source: https://github.com/rcorre/dtiled
 The dub package: http://code.dlang.org/packages/dtiled
 The docs: http://rcorre.github.io/dtiled/index.html
 The demo: https://github.com/rcorre/dtiled-example

 dtiled is intended to be game-engine independent; the demo can currently be
 run using either DAllegro (requires allegro5) or DGame (requires sdl2) as a
 backend.

 My next goals are pathfinding and a more interesting demo. I've considered
 adding support for other Tiled map formats (tmx and csv), but I'm not sure
 that is
 valuable as anyone using Tiled has the option to export to json, which
 should contain all of the necessary data.

 Eventually, I may add support for isometric and hexagonal maps.
Jun 22 2015
parent reply "rcorre" <ryan rcorre.net> writes:
On Monday, 22 June 2015 at 11:05:28 UTC, Manu wrote:
 Hey cool. I haven't thought about tiled for years!
 I contributed the terrain painting system years ago ;)
 Nice to see a lib in D!
Nice! I make use of Tiled's terrain tool regularly, its a huge time saver. I've considered adding some terrain functionality to dtiled for situations where the terrain can change in-game (e.g. the player can place walls, which affect how nearby walls are drawn). I may have to ask you about the implementation if I ever get around to that :)
Jun 23 2015
parent reply "Suliman" <evermind live.ru> writes:
Is it's possible to use this lib for tiling jpg?
I am planing to try to create online service that will load tiles 
depending on scale (zoom). Front and is js, but I think backend 
should be based on lib like this.
Jun 24 2015
parent "rcorre" <ryan rcorre.net> writes:
On Wednesday, 24 June 2015 at 12:16:56 UTC, Suliman wrote:
 Is it's possible to use this lib for tiling jpg?
 I am planing to try to create online service that will load 
 tiles depending on scale (zoom). Front and is js, but I think 
 backend should be based on lib like this.
Hmm... I'm not sure. Its hard to tell from your description. The readme and docs should make it clear what this library can do -- if not, let me know!
Jun 24 2015