MODULE: Tilemap v1.0 - module for easing tile-based game creation.

Started by Wyz, Fri 28/03/2014 16:22:49

Previous topic - Next topic

Wyz




This module contains a set of useful functions for creating tile based games. It allows tilesets (a sprite containing tile images) to be defined and used to draw tilemaps (a map that defines which tile should be drawn where). It contains simple and a bit more advanced functionality and tries to ease the amount of work needed to make a tile based game with AGS. The module is self documented: that means when using a function in your code the autocompleter will popup with an hint what the function does and how to use it. All functions in this module start with "Tilemap" so they can be recognized easily. You can also check the script header file to see the complete list of available functions.

I will put useful code snippets in this post later but you can also request them!
If you have questions about how to use this module or have comments feel free to post here!

I hope that it will be useful to someone. :-D
Life is like an adventure without the pixel hunts.

Ghost

I bet there'll be some future games taking advantage of this! Thanks for sharing; I'll surely check it out (nod)

Taraka

Greetings, Wyz,

I'm trying to understand this module because I need it to create mini-games and turn-based battles like Heroes of Might & Magic.
I haven't succeded yet.
Could you please make any nebut sleek demo to make it easier to understand?

...Maybe one room where the tiles move and interact with each other.. 

Wyz

Sure, I'll whip something up. :-D

Update:
I tried to keep it simple but I might have gone a bit overboard with the scrolling. It is just a sample of what you could do but is not necessarily what you want or a good example what this module can do. It needs AGS 3.2.1.
Tilemap example v1.0.0
Life is like an adventure without the pixel hunts.

DoorKnobHandle

Nice work, should help a lot of people out, especially those interested in making an RPG with AGS! Also, that is the best 8x8px stickman sprite and walkcycle I've ever seen! :)

Baron


miguel

Working on a RON game!!!!!

Wyz

Life is like an adventure without the pixel hunts.

Tournk

 Nice. I'll soon find a use for this module after learning how.  :)
Reaction is always funny.

Tournk

This module is amazing! But how do you create the map from the tiles? I don't see any in the room script. Or the .TMX file that does it? ???
Reaction is always funny.

Wyz

Well, I did this manually by just typing in the values but I can see how that is inconvenient. ;) But if you want I can write an exporter. :)

Btw the TMX files can be opened with Tiled.
Life is like an adventure without the pixel hunts.

Wyz

So I've wrote an exporter, or actually a converter to be more precise.
It takes TMX files and turns it into something you can load into your project. Ok so how does this work? Well first you make a map with one of your favourite tile editors and save it as a .tmx-file. This is a pretty wide supported format so I expect most editors can do this; Tiled can for sure.
Then you select that file in the converter and hit 'Convert' (more detailed instructions are in the readme file of the zip). What tis does is create an image file you can import into you project as a sprite. The module as a few functions to handle maps in sprite format: convert it to regular tilemaps so you edit them in game or directly draw it on a surface. That's about it, so check it out!
Life is like an adventure without the pixel hunts.

arj0n


ArgyBoi

Sorry to bump this... Can you upload the Convertor again, please?

Wyz

Sure no problem, I've updated the link in the first post. :)
Life is like an adventure without the pixel hunts.

goopscoop

Quote from: Wyz on Thu 26/06/2014 02:14:04
So I've wrote an exporter, or actually a converter to be more precise.
It takes TMX files and turns it into something you can load into your project. Ok so how does this work? Well first you make a map with one of your favourite tile editors and save it as a .tmx-file. This is a pretty wide supported format so I expect most editors can do this; Tiled can for sure.
Then you select that file in the converter and hit 'Convert' (more detailed instructions are in the readme file of the zip). What tis does is create an image file you can import into you project as a sprite. The module as a few functions to handle maps in sprite format: convert it to regular tilemaps so you edit them in game or directly draw it on a surface. That's about it, so check it out!

Quick question. If I make my maps in Tiled and use the converter, will the collisions and layers be converted as well, or just a flat image?

Wyz

The exported maps contain a single layer each but the converter lets you select a layer so you can convert them all separately if you want to. As far as I can tell collisions are just layers so that should work as well.
A limitation of the module is it only supports one tileset per map so if you're planning maps that is something to keep in mind. It also does not support objects at all unfortunately. :)

I hope that helps. :)
Life is like an adventure without the pixel hunts.

jamesreg

Would anyone accept a commision to add features to this existing module or create a new tile engine with additional features?

SMF spam blocked by CleanTalk