Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable custom grid sizes or guidelines #368

Open
ghost opened this issue Feb 20, 2013 · 21 comments
Open

Enable custom grid sizes or guidelines #368

ghost opened this issue Feb 20, 2013 · 21 comments
Labels
feature It's a feature, not a bug. usability Generally about making something more intuitive or efficient.

Comments

@ghost
Copy link

ghost commented Feb 20, 2013

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.

@bjorn
Copy link
Member

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.

@ghost
Copy link
Author

ghost commented May 24, 2013

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.

@ghost
Copy link
Author

ghost commented May 24, 2013

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

@bjorn
Copy link
Member

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.

@ghost
Copy link
Author

ghost commented May 25, 2013

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
Copy link

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?

@bjorn
Copy link
Member

bjorn commented Mar 8, 2015

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

@kdrnic
Copy link

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.

@bjorn
Copy link
Member

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
Copy link

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
Copy link

alwex commented Sep 25, 2016

It is exactly what I need, looks great

@firas-assaad
Copy link
Contributor

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.

@HariEdwin
Copy link

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

@not-surt
Copy link

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.

@bjorn
Copy link
Member

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 Generally about making something more intuitive or efficient. label Jan 2, 2017
@firas-assaad
Copy link
Contributor

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.

@reidrac
Copy link

reidrac commented Nov 27, 2018

The new multi-map world functionality in tiled 1.2 is nice, but there are some use cases that really require one single map split in "screens", so this would be really good.

I know few people using tiled that have this same use case and the usual workaround is basically adding one top layer with rectangles to provide a visual cue of the screen boundaries.

@RPGHacker
Copy link
Contributor

What's the current status on this issue? If it's still open, I could try implementing it for at least orthogonal maps, since it's something that's currently relevant to me.

My idea would be to add an "enable extra grid" setting with an "extra grid properties" dialog (or something similar), where you could change the width and height of the grid (potentially also set an X and Y offset, which I assume could be useful to have in some cases).

@zocky
Copy link

zocky commented Apr 10, 2021

As a stopgap, I've been using a big .png file with a grid in an image layer for this, and it's sort-of OK. It'd be much easier if the image layer could repeat the image, so I could use a small file and not worry about map size.

bjorn added a commit that referenced this issue Apr 26, 2021
Useful for rendering larger sectors or simply making it easier to see
the distance in tiles. By default, there's a major grid line every 10
tiles.

Resolves part of #368, though the goal is to eventually be more
flexible.

Closes #3032 (this patch is based on that pull request)

Co-authored-by: Ilya Arkhanhelsky <ilya.arkhanhelsky@vizor-games.com>
@anrikun
Copy link

anrikun commented Apr 25, 2022

Any progress on this? My map is also divided into screens and I'd like grid to reflect this.

EDIT: Sorry, I've just found the setting in Preferences. I guess this issue can be closed then?

@bjorn
Copy link
Member

bjorn commented Apr 25, 2022

EDIT: Sorry, I've just found the setting in Preferences. I guess this issue can be closed then?

I've kept this issue open because that feature only addressed a specific use case, while it would still be nice to provide something more flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug. usability Generally about making something more intuitive or efficient.
Projects
None yet
Development

No branches or pull requests

10 participants