PC We Need More Wire Colors!

Themail

Terrarian
Just a rant from a project I've been working on, its a real burden to keep using junction boxes.
 
A wise man once told me: DEAL WITH IT

tbh once you can't solve a wire mess even with junction boxes then you should worry about extra wire colors.
also I read somewhere that all of the ingame layers are now occupied and there wouldn't even be space for more. (not 100% sure about this)
 
I think that four wires is enough, reading more than four would be hell.
And no matter how much wire colors you have, you will still need to use junction boxes sometimes because of 2d space.
MAJswuc.png
 
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.
 
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.
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.
 
no performance hit? that is absolutely wonderful. I'll spam them with impunity only being limited by my coin now. Good stuff.
Looks like the steampunker will be seeing a fair amount of my money, in addition to the Goblin and the Mechanic.
 
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 ^_~
 
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.
 
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.
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.
 
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.
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.
 
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 ^_~

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.
That's not actually how it works at all.

Each tile is a Tile object, which contains members to store various relevant data: the type of tile placed there, the type of wall placed there, how much liquid is present, the X and Y frames of the tile (for animated tiles, things that take up more than one tile e.g. statues, and also sometimes used to store extra data e.g. for weapon racks, the frameX values of each piece helps determine exactly which item is stored in the rack), and finally, the "header" data. The "header" is actually several variables (a short and three bytes) which act as bitfields; some bits are used to store the color of the tile/wall (for painting), 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), whether or not the tile is "active", things like that.

Four bits (spread between multiple header variables) determine which colors of wire are present on that tile. That's what they mean when they say there's no room for more wire colors; there are no more unused bits in the tile header. Adding a single new color would require adding another tile header byte, which would mean an additional byte would need to be stored for every single tile; for a large map, that's 2400x8400 tiles, or 20,160,000 bytes. 20 additional megabytes before you can add so much as a single additional wire color (but on the bright side, you get the exact same memory footprint increase if you add 8 additional wire colors, so you can "sort of" get 7 wire colors for free).

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.
 
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.
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.
 
Are you sure that's it? From my understanding of things, each wire color in the game is given it's own interaction layer. This allows wires to overlap any other object in the game as well as each other (and other mechanical/wiring items) without cross-connecting. The method you're detailing sounds more like just a method of storing tile placement/information only and not how the game processes how objects interact with one another.

I admit I could very well be wrong. I'm not a developer nor do I have any experience with XNA and the way Terraria is designed. My understanding from development posts to date is that the devs have tapped all available interaction layers with the addition of yellow wire. (And again, that each wire color uses up an entire layer by itself.)

Storing data can be simplistic compared to how it gets manipulated and/or behaves with one another. If you're just going by what the world data file structure looks like, I'd have to cast doubt unless you have a reference to how Terraria processes object interact during run-time. Looking at the data structure of a storage file doesn't always tell you much about how that data gets used. How data is stored and how it's processed are two different things.

I did try looking up the dev post that mentions the layer exhaustion, but the forum search isn't robust enough and my google-fu isn't good enough to get a decent search string. (Though it'd probably help if I could recall more details besides vaguely remembering reading about it. I'm pretty sure it was a post in relation to the Mechanics patch.)

I'm REALLY curious now. It'd be nice if a dev could help clarify all this.
 
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.
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.

Are you sure that's it?
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.
 
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.
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.
 
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.
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.
 
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)
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.
 
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.
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.
Also, performance-wise, junction boxes affect performance every time a signal is run through them, whereas nulling Tiles would affect performance when placing something in that space (or running liquid through it) for the first time, which will generally only happen once.

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.
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.
 
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.
Quite.

performance-wise, junction boxes affect performance every time a signal is run through them
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.

That being said, anybody not running Terraria on a toaster isn't going to notice either way.
 
Back
Top Bottom