Every tile, from dirt to air to junction boxes, takes up the same amount of memory. There is no performance impact to placing junction boxes.I think some people are against spamming junction boxes because of concerns of memory. That's my main issue with overuse of them. the boxes are wonderful and all. but would littering your world with them have adverse effects on game performance? Not everyone has a beastly computer and resources are more valuable than ever, especially with people's digital needs becoming more sophisticated. That being said, I personally think that 4 is enough unless wires get enough content added that makes the complexity up to 11. Highly unlikely, but the Terraria engine is being pushed quite a bit these days. In light of the wiring update, its highly unlikely that wires would get such complexity any time soon. Especially considering many people are not exactly comfortable with the logic gates yet.
That's a shame, because I was thinking of suggesting decals.If I'm not mistaken, the layers are all full:
Walls
Furnature/Solid Block
Character
Actuator
Red Wire
Blue Wire
Green Wire
Yellow Wire
They only can have 8 layers of depth.
Decals are still doable, technically. Blocks currently show wear when being mined. Plus there's the effects from being hammered. Decals would just be alternate brick sprites. It's not like you need a whole layer for graphical changes. Look at paint: it's probably just color shifting relevant blocks. Layers are needed mainly for gameplay mechanics and entity interactions. Visual/graphical aspects have viable workarounds.That's a shame, because I was thinking of suggesting decals.
Like a cracked decal, for weathered/damaged surfaces, and so on...
I knew they were at their limit for wire colors, just not the ins and outs of it.
Doesn't matter what you thoughts on the number of wire colors are. The devs mentioned back during the development of the Mechanics update that they tapped out the usable number of layers Terraria can support. (I think it's an XNA platform limitation.) Each wire color is on its own layer. That's how they don't interact with one another directly when crossed/overlayed normally and how you can stack several items on one location. (e.g. Brick, BG Wall, Actuator, 4 wires, and a junction.)
Anyway, 4 colors is the perfect balance between convenience and practicality. One color was simple but limiting. Wiring was unwieldy enough with 3 colors (with the 3 separate wrenches). Four colors is manageable with the inclusion of the Grand Design. Any more and the interface would just get messy.
The challenge isn't just making a circuit design; it's also laying it out... just like real life! And all within certain limitations... Again, just like in reality ^_~
That's not actually how it works at all.If I'm not mistaken, the layers are all full:
Walls
Furnature/Solid Block
Character
Actuator
Red Wire
Blue Wire
Green Wire
Yellow Wire
They only can have 8 layers of depth.
Well, I'm not sure how Terraria handles this (never really looked at the save/load part of the code), but if I'm not mistaken, empty tiles aren't actually loaded, but set to null instead, so part of the world (caves, hell and area above ground) wouldn't be affected by this. Of course, most of a regular world isn't empty, but it should be possible to put the "header" as you called it into one type, nullable, so that an unpainted tile/wall without liquids, wires or actuators would take up less space.Technically, nothing stops somebody from adding this header byte and going ahead and giving us more wire colors... except that the developers don't want to make large worlds take up an additional 20 MB in memory. They'd much rather decrease the memory footprint, if at all possible.
How the world is stored in the world file is not how the world is stored in memory; once loaded, every single coordinate is its own Tile.Well, I'm not sure how Terraria handles this (never really looked at the save/load part of the code), but if I'm not mistaken, empty tiles aren't actually loaded, but set to null instead, so part of the world (caves, hell and area above ground) wouldn't be affected by this. Of course, most of a regular world isn't empty, but it should be possible to put the "header" as you called it into one type, nullable, so that an unpainted tile/wall without liquids, wires or actuators would take up less space.
100%. I have decompiled (almost) every version of Terraria since 1.3 just so I could track the differences and (briefly) worked on the (now-defunct) Prism mod framework; if you're really curious, I could walk you through the code for placing, removing, rendering, and/or processing (as in sending impulses and activating devices) wiring.Are you sure that's it?
Yeah, I know, the world file is compressed anyways IIRC, but I was wondering whether Terraria actually creates Tile objects for empty space, since there are tile == null checks in some methods.How the world is stored in the world file is not how the world is stored in memory; once loaded, every single coordinate is its own Tile.
AFAIK, they can only be null when netmode == 1 (multiplayer client), and most of those checks tend to immediately replace the null with a new Tile object. For servers/singleplayer, every single block, including empty space, is comprised of full-fledged Tile objects. Even if they weren't, placing wire in that empty space would, by necessity, result in the creation of a Tile object anyway, since the only way Terraria knows wire is present (in order to process signals) is by checking the header of the tile, so worrying about the performance impact of junction boxes is especially pointless.Yeah, I know, the world file is compressed anyways IIRC, but I was wondering whether Terraria actually creates Tile objects for empty space, since there are tile == null checks in some methods.
Actually,while others determine the type of liquid (water, honey, or lava; since that's only three types of liquid, taking up 2 bits (which can store 2^2 or 4 different values), there's actually room for another type of liquid without taking up additional memory)
Ah alright. Still, there's nothing saying that can't change. Would probably need a heap of additional checks, but it could reduce memory usage in largely-empty worlds. Probably not worth it in the long run though.AFAIK, they can only be null when netmode == 1 (multiplayer client), and most of those checks tend to immediately replace the null with a new Tile object. For servers/singleplayer, every single block, including empty space, is comprised of full-fledged Tile objects. Even if they weren't, placing wire in that empty space would, by necessity, result in the creation of a Tile object anyway, since the only way Terraria knows wire is present (in order to process signals) is by checking the header of the tile, so worrying about the performance impact of junction boxes is especially pointless.
No, 00 means water, 01 lava and 10 honey. The amount of liquid is stored additionally, and no liquid simply means the amount is set to 0.Actually,
00 means no liquid in tile,
01 means the liquid is water,
10 means the liquid is lava,
11 means the liquid is honey.
Always thought like that, am I wrong here, and there's really some space for another liquid? Probably not.
Quite.No, 00 means water, 01 lava and 10 honey. The amount of liquid is stored additionally, and no liquid simply means the amount is set to 0.
Technically true, but meaningless in context; you get a performance impact by making your wire runs longer, too, so avoiding junction boxes (almost always via longer, more spread-out wiring runs) is ultimately counterproductive... and introducing extra wire colors would result in even more overhead.performance-wise, junction boxes affect performance every time a signal is run through them