Primitive "Tiled" map loader and 2D game lighting

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
headchant
Party member
Posts: 105
Joined: Fri Sep 03, 2010 12:39 pm
Contact:

Re: Primitive "Tiled" map loader and 2D game lighting

Post by headchant »

The Editor looks interesting. Is this written with love?
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Primitive "Tiled" map loader and 2D game lighting

Post by thelinx »

User avatar
ninwa
Party member
Posts: 118
Joined: Tue Oct 12, 2010 1:21 am
Location: Metro Detroit
Contact:

Re: Primitive "Tiled" map loader and 2D game lighting

Post by ninwa »

Now featuring TechnoCat's "MessageInABottleLibrary."

Walk to the NPC in the upper left and press 'z'

Also, tidied up my lighting code. Feel free to peak around it. Also added "time of day" 1 minute = 1 hour, and the lighting changes based on this.

http://www.josephbleau.com/PlanetCute_miab.love

Thank you Technocat! <3
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Primitive "Tiled" map loader and 2D game lighting

Post by adrix89 »

About title loading you can set it to CVS in the edit preference and save
This should give you a file that you can reasonably transform into a text one
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
arquivista
No longer with us
Posts: 266
Joined: Tue Jul 06, 2010 8:39 am
Location: Insert Geolocation tag here
Contact:

Re: Primitive "Tiled" map loader and 2D game lighting

Post by arquivista »

Things are becoming very good ninwa. Was hard for you develop the XML Tiled reader?. "Tiled" webpage says that can be exported in Lua but I foundn't in Mac version that option.
--------------------------------------------------------
To Do: Insert Signature Here
--------------------------------------------------------
User avatar
ninwa
Party member
Posts: 118
Joined: Tue Oct 12, 2010 1:21 am
Location: Metro Detroit
Contact:

Re: Primitive "Tiled" map loader and 2D game lighting

Post by ninwa »

arquivista wrote:Things are becoming very good ninwa. Was hard for you develop the XML Tiled reader?. "Tiled" webpage says that can be exported in Lua but I foundn't in Mac version that option.
I didn't write an XML reader so much as a quick and dirty .tmx parser. It's limited in functionality, but it gets the job done. That said, no, not too bad. I just read in each line of the file and use a couple of flags to know which level of tags I should be in, and use :find() with captures to pull out data I need.

PS: The stable windows build only includes .xml also and is missing a few key features I needed. That's why I'm using their beta nightly build from a few weeks ago.
User avatar
arquivista
No longer with us
Posts: 266
Joined: Tue Jul 06, 2010 8:39 am
Location: Insert Geolocation tag here
Contact:

Re: Primitive "Tiled" map loader and 2D game lighting

Post by arquivista »

Yeah, it seems that the Java is the most advanced version. I was curious about the so called Lua Export when I saw in changelog (0.7.1)

Code: Select all

Fixed Lua export to increase firstgid of tilesets properly (by Jelle Geerts)
However I only experienced 0.5.1 Mac QT version and that option seems not there. But XML output and not some custom program output seems interesting. I will look further how to parse it and study the Tiled tags. I glad you use it, I got interested on this.

Edited: Experienced Java version. Here is your map in Lua Export option (with GZIP option on. plain one can't be posted here -excess of chars-).

Code: Select all

-- Generated by Tiled's Lua Exporter Plugin.
map = {
  ["label"] = "map";
  ["version"] = "0.99b";
  ["luaversion"] = "5.1";
  ["orientation"] = "orthogonal";
  ["width"] = 16;
  ["height"] = 16;
  ["tilewidth"] = 101;
  ["tileheight"] = 80;
  ["tilesets"] = {
    {
      ["label"] = "tileset";
      ["name"] = "PlanetCuteSpritesheet";
      ["firstgid"] = 1;
      ["tilewidth"] = 101;
      ["tileheight"] = 171;
      {
        ["label"] = "image";
        ["source"] = "PlanetCuteSpritesheet.png";
      };
    };
  };
  ["layers"] = {
    {
      ["label"] = "layer";
      ["name"] = "Ground";
      ["width"] = 16;
      ["height"] = 16;
      ["data"] = {
        ["encoding"] = "base64";
        ["compression"] = "gzip";
        ["content"] = "H4sIAAAAAAAAABNiYGAQgmIDErAQFkyKfmzmgPhmROLBqh8fprV+XHgo6edGw4T0o6unln5S3Y9LL6n6yQ0/cvUDAGPrfmAABAAA";
      };
    };
    {
      ["label"] = "layer";
      ["name"] = "Surface";
      ["width"] = 16;
      ["height"] = 16;
      ["data"] = {
        ["encoding"] = "base64";
        ["compression"] = "gzip";
        ["content"] = "H4sIAAAAAAAAAGNgoAwYAbEUlKbEjFEwOAAHGo0MTJEwMjAkwlxJIBZFwmJEukeSSvpBAJf7BysgJlwpBQAWQKvyAAQAAA==";
      };
    };
    {
      ["label"] = "layer";
      ["name"] = "collision";
      ["width"] = 16;
      ["height"] = 16;
      ["properties"] = {
        ["collision"] = "true";
      };
      ["data"] = {
        ["encoding"] = "base64";
        ["compression"] = "gzip";
        ["content"] = "H4sIAAAAAAAAAGNgQABhBtKBMBomBwij0eSC4aAfG6anm9DjQhhNDpub0NXg0k/ITloDcsIUn99orR/dreTqR/c3Mh8AWb+XlQAEAAA=";
      };
    };
    {
      ["label"] = "layer";
      ["name"] = "lightsources";
      ["width"] = 16;
      ["height"] = 16;
      ["properties"] = {
        ["lightsources"] = "true";
      };
      ["data"] = {
        ["encoding"] = "base64";
        ["compression"] = "gzip";
        ["content"] = "H4sIAAAAAAAAAGNgGAWjgHpAEI0eBYMbAAAsYCpAAAQAAA==";
      };
    };
  };
};
-- EOF

--------------------------------------------------------
To Do: Insert Signature Here
--------------------------------------------------------
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Primitive "Tiled" map loader and 2D game lighting

Post by adrix89 »

The pot edition
Just moved the tileset so as to give a pot with minor modifications(warning height is tile hight is now 170 instead of 171 so as to enter a 1024 sheet)
.tmx files can be easily made to work by chaining some values
the %10 and /10 represents how many tiles are in a row,change this if you have more/less
PlanetCute_pot.love
(792.9 KiB) Downloaded 233 times
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
ninwa
Party member
Posts: 118
Joined: Tue Oct 12, 2010 1:21 am
Location: Metro Detroit
Contact:

Re: Primitive "Tiled" map loader and 2D game lighting

Post by ninwa »

Oh hey, very cool! Thank you adrix. I have moved on to other projects, so if anybody wants to pick this one up and make it their own, feel free. :) I'm pretty excited though that you got it working. I think we did end up pinning down the problem to too big of a sprite-sheet, right? I'm using the tiled map parser in a new game, and though I haven't run into the problem, I should consider fixing it before I do.
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Primitive "Tiled" map loader and 2D game lighting

Post by adrix89 »

ninwa wrote:Oh hey, very cool! Thank you adrix. I have moved on to other projects, so if anybody wants to pick this one up and make it their own, feel free. :) I'm pretty excited though that you got it working. I think we did end up pinning down the problem to too big of a sprite-sheet, right? I'm using the tiled map parser in a new game, and though I haven't run into the problem, I should consider fixing it before I do.
Well I'm still not sure if it works for all depending on how love handles stuff
I wish there was a tester with really old hardware
Currently it works on my ati 1900 but I'm not sure about the previous series, although the tile map would probably work perfectly as there 1024 what I'm not sure is the character sprite which 171 by 101
I use Workflowy but you can check out Dynalist as its the better offer.
Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 59 guests