ChunkyChunks - Configurable Gridlines

by Qon

Chunk aligned blueprints? Display chunk lines without the annoying tile lines that the debug option adds. Configurable grids at any sizes if your blueprints are substation, chunk, roboport or radar sized (or any other size)!

Utilities
22 days ago
0.17 - 2.0
8.40K

i [Implemented] Checkbox for "just turn on at the start, and I'll never turn you off again"

5 years ago

...as with the title, I'd love to be able to tell the mod to activate when I go into a game. I'm only 99 percent telling the truth about never turning it off - I think I have done that for, like, two minutes total since I installed it several hundred hours back.

Right now I hunt down the shortcut button in the "...." menu for them, press it once to turn on the gridlines, and move on. It'd be nice to automate that process. ;)

Something else automatically activates "alt mode" for me, which I like for the same reason, but I don't want to sync this and alt mode - I usually turn off alt mode so I can see the gridlines better, haha.

5 years ago

Not sure I understand you. It already stays on forever once it is turned on in each game if you never touch the grid key again and have "sync to alt mode": unchecked. That's what that option does, decouples the grid toggle from alt state changes. I think you will like that feature :)

5 years ago
(updated 5 years ago)

Ah, I'm lazy. I want to press zero buttons, not one. :)

Well, OK, one button in settings, once, and then no buttons in every future game.

5 years ago

There's no option in vanilla Factorio to have alt mode to start enabled. It seems like such an option would just qonfuse more people than it would help.
I'll qonsider it though. Maybe if I make it possible to enable individual grids that could be a feature. I wouldn't say it is likely though.

5 years ago

OK, fair enough. :)

4 years ago

ChunkyChunks v1.4.0 has some performance optimisations and features (global grid, zoom anywhere and see the grid!). To do this the code had to be partly re-written and changed a lot. And with the new way it worked it made more sense to change how grids are enabled or disabled. So now your feature requests is actually implemented. Just set the grids you want to have always on to "Enabled: Always". And the grids you only want to see when ALT-mode is on you set to "ALT-mode".

Version: 1.4.0
Date: 2020-08-01 13:23
Major Features:
- Global grid! Now you can pan anywhere on the map (when zoomed-to-world) and see your grids!
Optimisations:
- ChunkyChunks only does things when you change your settings now, so CPU time should drop to near 0
except for some seconds after changing your settings.
Changes:
- Toggling grids with shortcut and hotkey are removed. Instead a new setting is used:
Grids are enabled when ALT-mode is enabled, always on or the grid is simply disabled.

4 years ago

I don't agree with this change. The way I use this mod (similar to the vanilla debug grid view), is that I toggle it completely unrelated to ALT mode. I only use the grid occasionally when I'm building something large, so I don't want it on all the time or every time I turn on ALT mode. I used the shortcut button for toggling it, could you add that back in? What was the issue with having it?

4 years ago
(updated 4 years ago)

The issue with the old behaviour is technical. Now that it is map-wide any change means redoing the grid on the whole map. The render api does have a setting for only showing the graphics when ALT-mode is on, which makes it fast to toggle it with ALT-mode. But other methods are going to be slow.
For smaller worlds with only a few players and only a few tens of thousands of tiles and grids at least chunk sized the toggling is actually quite fast (like 0.2 seconds, spread over several ticks so the game doesn't freeze either) because of other optimisations.
But for the most massive worlds with many players toggling grids all the time the whole world would just freeze.

So maybe I'll reintroduce it since most players aren't playing on huge MMO megabase servers. But before when the grid was local and always destroyed it was trivial to toggle the grids and now it isn't. Might take some time to re-implement. I like it the way it is though...

The code was written so that both the old and new behaviour could kind of be used at the same time if you don't need map-wide grids. But to actually have a user friendly interface for both types of behaviours at once is something I haven't figured out either. And I kind of want the local grid gone since it is mostly just worse for performance and features.

4 years ago

If you use half transparent grids they become less distracting to have on all the time.

Factorio rendering API handles alpha values a bit weird so they don't really become transparent if you set any color value higher than the alpha value. I'm fixing that bit in v1.4.2.

4 years ago

Okay I see what you're saying with the performance concerns. The thing is, the way I use them is that I want them to be bright and visible when I need them, but most of the time I want them off and out of the way, and I use ALT mode way more than I use the grid lines. Is there some efficient way to just change the color of the lines and make them transparent on a toggle?

4 years ago

Sadly, nope. I think they might be modifiable after making them, but that still requires looping through all the lines and modifying them. I'm qonsidering options but it might stay like this for a while. I wish I wouldn't have to sacrifice the separate toggle button.

What kind of grids are you using? Sizes? How many? How often do you reconfigure them? Could be useful to know what impact it would have on your playstyle.

4 years ago

I just use a simple 32x32 grid which I color magenta ("1 0 1"). I never change it (except toggling it on and off). I might end up just turning it off in the mod settings while I'm not using it, then when I'm building something where it's helpful, turn it on for a bit, then off again.

4 years ago

I'm thinking of adding back the hotkey, but probably not the shortcut. The hotkey would toggle your player settings for all grids to 'Disabled' and all to 'ALT-mode' or 'Always', so you don't have to go through the menues. And you can of course set grid size to 0 for the grids you don't need enabled by the hotkey.

The shortcut button will just confuse people who are toggling with alt mode, so I think it's fine if it is gone. And to make it simpler for me the new hotkey toggle will just forget about which grids were enabled with 'Always' or 'ALT-mode' because I think most are fine with just 'ALT-mode' for grids they want to toggle.

Not sure if 'ALT-mode' or 'Always' is the best Enabled setting that the hotkey should set for all grids when it toggles on.

4 years ago

I've made a toggle feature, but I'm not releasing it yet because of technical issues with the mod API that makes it unwise to make toggling too easy. Basically, forcing players to go through the menues slows them down and makes the process painful enough that toggling happens infrequently enough that it's not really an issue. But if it's a hotkey then suddenly you can toggle it a thousand times faster (a few times per second instead of a few times per hour).

4 years ago
(updated 4 years ago)

I would really like the shortcut button back. I don't like having to remember hotkeys for everything and having to deal with conflicting hotkeys across the many mods I use. Stuff I use infrequently I like just having a little button for in the shortcut bar.

I would say the toggle should set it to Always, otherwise it might be confusing if you toggle it without ALT mode on and it does nothing.

If the main thing you're worried about with frequent toggling is performance, could you just make that known to the user and have them decide if it's an issue for them? For people playing on small single player maps it won't matter and they can toggle it as fast as they want, and people playing on large maps or in multiplayer just need to be aware that toggling it may slow things down so you should use it sparingly. Making it inconvenient to toggle seems like a bad compromise for people whom it doesn't affect.

4 years ago

Agreed with sonaxaton. The loss of the shortcut button has completely removed my use case for the mod, and I'm not updating it until it's returned. I don't want the chunk lines on 24/7 since I only use it to align production blocks when I'm placing a new one, and I play with alt mode enabled all the time. I'd honestly prefer to have the shortcut to the global grid.

4 years ago

I would really like the shortcut button back. I don't like having to remember hotkeys for everything and having to deal with conflicting hotkeys across the many mods I use. Stuff I use infrequently I like just having a little button for in the shortcut bar.

I agree, I think the same. I'm thinking about how to bring it back.

I would say the toggle should set it to Always, otherwise it might be confusing if you toggle it without ALT mode on and it does nothing.

True. I should have thought of that...

If the main thing you're worried about with frequent toggling is performance, could you just make that known to the user and have them decide if it's an issue for them? For people playing on small single player maps it won't matter and they can toggle it as fast as they want, and people playing on large maps or in multiplayer just need to be aware that toggling it may slow things down so you should use it sparingly. Making it inconvenient to toggle seems like a bad compromise for people whom it doesn't affect.

I'm not making it inconvenient. The hotkey and shortcut just aren't developed enough to be ready for release yet. And the performance problems that might occur are hard to communicate and debug, and many people don't read instructions that closely anyways. Software shouldn't have performance traps that are hard to be aware of and avoid. I'm trying to make it right.

There's also another thread for this discussion now.

4 years ago

Sounds good, just wanted to make sure you were aware of the way people use your mod. Thanks for the improvements so far and for your hard work!

4 years ago

Sounds good, just wanted to make sure you were aware of the way people use your mod.

Thanks for informing me, it's very useful. :)
For myself I found that one faint grid on 'Always' and another on ALT-mode was a sufficient alternative to the shortcut and hotkey now. But you reminded me of why I brought it in in the first place, when I first made it it wasn't configurable enough that having it on all the time was a good enough option. And I do want to support that even though it's a bit trickier now.

Thanks for the improvements so far and for your hard work!

:D

4 years ago

I'd honestly prefer to have the shortcut to the global grid.

I'm thinking about how to implement a blend of the 2 techniques, the old and the new, to enable a local grid with better performance than before and while having larger grids available across the surface.

4 years ago
(updated 4 years ago)

How do i turn the grid back on? Ever since the update they are all gone. Mod is installed as expected, i see same mod settings as before and this mod has no hotkeys in controls nor button in quickbar. I tried Alt on and off but nothing. In Per player settings the 3 grids are all in ALT-mode setting.

Edit: Oh... they are visible, maybe color calculations changed?

4 years ago

Edit: Oh... they are visible, maybe color calculations changed?

Yes.

Version: 1.4.2
Date: 2020-08-01 22:00
Bugfixes:
- Workaround for weird treatment of alpha values by Factorio rendering API.

Now you can have rgb values of 1 with alpha < 1. The mod multiplies rgb values with alpha so that you don't have to change rgb values every time you change alpha values. This does mean you need to increase the rgb values if you decreased them to account for the old behaviour, yes.

4 years ago

Version: 1.4.3
Date: 2020-08-17 19:34
Bugfixes:
- Fixed missing check for deleted surfaces, thanks HanBai for the report
https://mods.factorio.com/mod/ChunkyChunks/discussion/5f3abb45b7a232fc87dcb54e
Features:
- Shortcut and hotkey toggles are back. But they are not optimised yet, so don't spam them
too much ;> They kind of slipped in since they were kind of implemented and I had to fix the bug.

4 years ago

Awesome, thank you! For what it's worth, there's like maybe a 200ms delay when I toggle the grid off and basically no delay when I toggle it on. My map might just not be that big, but that's totally fine for me.

4 years ago

The delay is that the grids are built up across the entire explored map spread out over some ticks to not freeze the game. With just 2 simple grids > 32 tiles in sidelength the amount of lines if fairly small and the impact is not that big.

I'll get back to optimisations later then in hope of achieving excellent performance in the largest of worlds and enabling local grids close to you with smaller sizes.

New response