## Completely Lua/Love2D based map editor and player

pauljessup
Party member
Posts: 141
Joined: Wed Jul 03, 2013 4:06 am

### Re: Completely Lua/Love2D based map editor and player

These are the tiles it's using:
http://opengameart.org/content/tiny-16-basic

pauljessup
Party member
Posts: 141
Joined: Wed Jul 03, 2013 4:06 am

### Re: Completely Lua/Love2D based map editor and player

Some more screenshots of some stuff I added...floodfill, eraser, layer moving/layer opacity changing
Attachments
maped2.png (68.17 KiB) Viewed 4911 times
maped1.png (64.02 KiB) Viewed 4911 times

pauljessup
Party member
Posts: 141
Joined: Wed Jul 03, 2013 4:06 am

### Re: Completely Lua/Love2D based map editor and player

Nuthen224
Citizen
Posts: 50
Joined: Sun Jul 28, 2013 9:40 pm

### Re: Completely Lua/Love2D based map editor and player

I get a stack overflow error when doing a floodfill that affects blocks at the edge of the screen. Anyways nice editor! I'd like to use this at some point.

pauljessup
Party member
Posts: 141
Joined: Wed Jul 03, 2013 4:06 am

### Re: Completely Lua/Love2D based map editor and player

Sadly I do know about that bug, and am working on it..lol

Yeah, It's still very much a WIP - I still need to fix some other nagging bugs and add in the object tool stuff...

And then document, document, document.

Awesome that you want to use it I'm hoping someone somewhere other than me might find it handy. Esp. since it looks like ATL is no longer being actively worked on

pauljessup
Party member
Posts: 141
Joined: Wed Jul 03, 2013 4:06 am

### Re: Completely Lua/Love2D based map editor and player

Added in map templates and the ability to choose a default tile when adding a new layer.

The map templates allow you to create a way that makes consistent maps (for layers, etc) that would be good across an entire game. Each time you make a new map, if you specify a template it uses the template you specify. For example, let's say I create a new map and use the example template. It then looks in the folder greentea/plugins/templates and finds the example.lua file and then loads that template.

Here is what the template basically looks like:

Code: Select all

local example_template=Class{}
--inherits from the base template.
example_template:include(gt_template)

--the main function we need to override.  We can also override and create others,
--but in order for it to do anything interesting, :create needs to be overridden.

function example_template:create(greentea)
--this example creates a ground, and then a second ground (for details).
--above that, it adds a fog layer that constantly scrolls.

opacity=255,
speed=1,
default_tile=13
})

opacity=255,
speed=1,
default_tile=80,
})

id="fog",
type="parallax",
opacity=155,
speed=2,
default_tile=1,
tileset={
id="fogtiles",
tile_height=16,
tile_width=16,
image="game/maps/fogtiles.png",
},
values={scroll_x=0, scroll_y=.2}
})

return greentea
end

return example_template

You can do some pretty interesting thing with templates- since each layer can have it's own tileset, you can feasibly create a series of layers to be used in the editor that have shadows, a night layer with lighting, fog/wind/rain, a layer for just houses, for just about anything. Because of the way it draws, you can have a large number of layers before anything slows down at all. I've had 150 layers for a speed test, and so far even that didn't slow down.

Right now the example is using 800x600 and scaling up x2. That's because I'm using 16x16 tiles, and want a kinda retro look. You can do any resolution with or without scaling. The only downside is right now, you need to use greentea:scale(x, y) to get the scaling done if you want to use the editor. This is because it needs to change the mouse positions and such by the amount it's scaled. So, for example, this might be difficult using something that automatically sets and changes the resolution, like TLfres. Am working on seeing if there is some way around this.

pauljessup
Party member
Posts: 141
Joined: Wed Jul 03, 2013 4:06 am

### Re: Completely Lua/Love2D based map editor and player

Okay, taking a break from this for a few weeks to rest my wheels.

When I return, I'm adding these features to the editor:
Object Dropping
Object Editing/moving up and down layers easily/opacity/deleting

Tiled Loading, using the Tiled -> Lua export from Tiled. When you save these maps, however, it will need to save them in the .gtmap format.
"light" version that just has the map player, not the editor. This will be good for when you want to do a release of your game and remove the ability to edit maps. It will make for a smaller upload/download/etc. Already supports the ability to make a light version, just need to roll it up and test it.

Fixing these bugs:
Randomly when creating a new layer it gives a nil errror.
A Flood fill that's more accurate.

Then documenting and slapping a release on it.

It shouldn't take me too long, but I need a break for a bit after this whirlwind week of coding.

pauljessup
Party member
Posts: 141
Joined: Wed Jul 03, 2013 4:06 am

### Re: Completely Lua/Love2D based map editor and player

Also: I plan on following this up with a few other projects I've been mulling about. These should pretty much use the same layout/concepts/etc, so that they can work together or apart pretty easily, and if you get used to using one library, the other ones are pretty simple.

Here they are, in order of "going to do them":
Chamomile- A paper doll sprite editor/player, for making paper doll style sprites in a game. This would make it easy to create NPC's, etc. When this is done a plugin for map objects will also be bundled with it, so you can use it very easily with Greentea (the mapeditor). So, in theory, you'll be able to visually create paperdoll npc's and drop them on the map.

Mint Tea- A return to the SNES Style GUI system I was working on awhile back. Refitting, rebuilding it, using all the stuff I learned with GT.

Dark Roast- A basic RPG workflow library, for building flags/setting flags/saving games/etc. Basically a data editor combined with plugins for Greentea and basic sprite systems (treasure chest, village NPC's, save spots, etc) for Chamomile. This will also have a controller/keyboard layout that will mimic NES/SNES emulators.

davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

### Re: Completely Lua/Love2D based map editor and player

This is looking very nice so far! I can't wait until you're finished! I think it's a good under-taking! Good luck and have fun!
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim

Ekamu
Party member
Posts: 171
Joined: Fri Sep 20, 2013 11:06 am

### Re: Completely Lua/Love2D based map editor and player

same here, I'm looking forward to this. really useful (^_^).

### Who is online

Users browsing this forum: Baidu [Spider] and 7 guests