Power System (Creating)

I do not quite understand why the game lit quarters. This game is one character, not Dwarf Fortress. Realistically, you can now assemble the generator in the game - and a solar-powered and gasoline, but connect it to refrigerators and other appliances can not. In principle, this can be realized, if we consider the house (24x24) as a large car, but whether it will add a lot to the game?

With data transfer in json also not going smoothly. Just look at here - https://github.com/CleverRaven/Cataclysm-DDA/pull/5909

Excuse me for my english.

Quick primer on map data:
Largest scale is an overmap, to get a quick idea of its size, do debug menu -> 4 to “reveal map”, then hit ‘m’, the revealed area is one overmap.
There IS a “city” data structure that is embedded in an overmap, you can lookup the “nearest” city and its size, which means you can determine which city a map tile is in, if any. (you also need to check the type of map tile, if it’s a field or something, not a city) If we really needed it we could add a flag to submap tiles indicating that they are in a city.
Next step down is what I call a “map tile”, this is roughly the size of the starting shelter, or a house. There are 180x180 map tiles per overmap. This is the unit the overmap operates on.
The next step down is a “submap”, which is 1/4 of a map tile, these are only really used for mapgen and save/load, so you can basically forget about them for most purposes. A submap is 12x12 squares.
Cutting across this is the “reality bubble”, which is an 11x11 submap square centered on the player. Again, for most purposes this is an implementation detail, but if you want to somehow update something outside this area (for example launching a nuke, or setting up a mission goal), you have to take special measures.

For events occuring outside the reality bubble, there are two-ish options:
One is to store your data in a submap, and update it when the submap is saved or loaded. This is how food spoilage works, and should be the default way of handling things.
The other is to move your data to the overmap and update it there. There are a few problems with this. First is that since overmaps are very large, you have to be careful about how much work you do, in case someone decides to fill an overmap with generators and lit houses. The second problem is that you still have the same problem as with a submap, if the player moves far enough away, the overmap will go inactive and you’ll have to do the same uppdate on save/load as you have to do there.

Basically you should keep things at the submap level unless you don’t have a choice. Unfortunately with power transmission, I don’t think you have a choice, because a single submap is just too small for that kind of effect, having to keep your generator within about 6 squares of anything that uses it is fairly unreasonable. So basically what you’re looking at is adding power data to the overmap, and adding a new hunk of code that brings old overmap data current when it comes in range, possibly in the new overmapbuffer module, but I’m honestly not sure.

Uh, I think this thread should be moved to Drawing Board?

Drawing board is for suggestions, this is for mods. this is a mod being created.

it seems like we need a good way of having power use on a small scale outside of vehicles in order to really use these sorts of changes properly. How hard would it be to add copper wires as constructions? or would that just replace anything you built on in the current system?
I wonder if the current vehicle system could just be adapted for buildings with power, etc. more easily than rewriting the current building system could be…