Enable custom grid sizes or guidelines #368

Open
nickgravelyn opened this Issue Feb 20, 2013 · 16 comments

Comments

Projects
None yet
7 participants

I'm building a game where a map contains one or more screens. Each screen in my game is 16x10 and the game scrolls screens (Zelda style) as you move around.

My main world map is going to be along the lines of 10x10 screens (give or take) and it would be extremely helpful if I could easily customize the grid or turn on an additional set of grid lines every 16 tiles horizontally and 10 tiles vertically.

Owner

bjorn commented Feb 22, 2013

Yeah, that would be nice.

The sad thing is that somebody did a patch for this once, but it bitrotted for whatever reason (usually it's a time thing) and now I don't even know where it may be located.

So I started working on this today because it's one of the two big missing features from Tiled that's really hindering my productivity (the other is reloading maps after running commands, something that I'm also going to be looking at). I'm very new to Qt so the UI aspect will be pretty rough but I've already got it more or less working for ortho maps. Still need to test iso and staggered.

When I do get done I'll submit a pull request with all of it. I'll need someone to help with all the UI and localization support, but otherwise it should be working.

Ok staggered and isometric grids are much harder than orthographic. :) While I wish I could have gotten them, I need to work on my game. I can do a pull request if you want, even though guide lines don't render on anything but orthographic maps (but the support is in there to implement them). You can see the changes I've made here: https://github.com/nickgravelyn/tiled/commit/cbd041cbdaea5a6cbd7e107b5f77627c0c27bd26

Owner

bjorn commented May 25, 2013

Opening a pull request would make discussing the change a little easier.

I think isometric should not be much of an issue, but staggered isometric is indeed a little trickier.

Not sure if there was a way to nicely link this bug to the pull request, but I've got one. Still quite new to a lot of how git and github work. :) #441

alwex commented Mar 8, 2015

It is an old issue but it seems that the pull request has not yet been accepted. This feature would be very helpfull in my case and for all game with subdivised level into shape of same size.
Is there any chance to see this feature out someday?

Owner

bjorn commented Mar 8, 2015

@alwex Sure, it all depends on how much time I'll be able to spend on Tiled.

kdrnic commented Jun 15, 2015

I too would love this feature. It is fundamental when editing levels where the features are usually 16x16 but the tileset is 8x8 as happens with retro development and elsewhere.

Owner

bjorn commented Jul 4, 2016

Lactamid suggested this on the forum and provided a mockup of what it could look like:

y3ea7m9

I'll try to get around to this in coming months. Implementation wise, I would consider introducing this as a "major grid line" feature where every Nth line is drawn either at higher opacity. I'm not sure yet how I would handle staggered maps (including hexagonal), but I could leave this feature unsupported for those maps for now if it turns out to be complicated.

kdrnic commented Jul 4, 2016

I believe that would be satisfactory, yes.
On the mockup, it seems the major lines are not sufficiently distinguishable enough (but that is just a matter of adjusting the colour).

alwex commented Sep 25, 2016

It is exactly what I need, looks great

Contributor

firas-assaad commented Dec 29, 2016

I implemented something similar (but probably more basic) years ago because we wanted to use a standard tile size for most things (16x16), but allow smaller variations (8x8) to be mixed and matched within each tile. If this is still a good way to implement this feature I can work on a new PR for it.

Still interested in this, some of the previous suggestions look perfect.

I was looking into adding a Grid Layer layer type, as then one would be able to have as many custom girds as desired, but the code to add a new layer type is strewn throughout so many files all over the project it has rather turned me off the idea.

Owner

bjorn commented Jan 2, 2017

I implemented something similar (but probably more basic) years ago because we wanted to use a standard tile size for most things (16x16), but allow smaller variations (8x8) to be mixed and matched within each tile. If this is still a good way to implement this feature I can work on a new PR for it.

While your secondary grid implementation would be one way to solve this issue, I don't see how it would help to use 8x8 tiles for details on a map using 16x16 tiles, which is rather covered by issue #149.

I was looking into adding a Grid Layer layer type, as then one would be able to have as many custom girds as desired, but the code to add a new layer type is strewn throughout so many files all over the project it has rather turned me off the idea.

It's an interesting idea, but I'm not sure if it makes sense to add the grid settings into the map file and to place them in between other layers, as opposed to always rendering grids on top of the rest. I think more likely you'll want to configure various grids on a project level.

Design-wise I never had a reason to support a very large amount of layer types, so I'm sure you're right that adding a new type would touch quite a bit of files. Though mostly in a trivial way I think.

@bjorn bjorn added the usability label Jan 2, 2017

Contributor

firas-assaad commented Jan 2, 2017

I don't see how it would help to use 8x8 tiles for details on a map using 16x16 tiles, which is rather covered by issue #149.

We were actually using 8x8 tiles on the map, but the artist would design most tiles in 16x16 blocks. Most of the time you'd paint with a group of 4 tiles, but it was still possible to add details at 8x8 level. The 16x16 grid was just there as a visual guide.

The issue you mentioned is indeed a more natural fit, but adding a second grid to Tiled was a simpler approach that worked very well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment