# Solar radiation {%hackmd @ZeWaka/dark-theme %} The idea of [Solaris Station](https://hackmd.io/@Tyrant/Solaris) is that it's being bombarded with solar radiation very strongly. This doc outlines in great detail what that entails. ## The actual radiation Current idea involves new turfs/walls. Assume the star is to the south of the map. * Hot space, which is unshielded space. * The diffraction shock cone, which separates hot space and cold space with a boundary. It would also have to curve inwards using some funky maths in order to accurately simulate the behaviour of light diffracting around solid objects. Non Knife edge diffraction is what applies here. * cold space (regular space) which would have to interact with the diffraction shock cone in new ways. * Heat Shielding, which is a plasma cooled solid wall which blocks the radiation coming from the South of the map * Every other tile which is not boxed within the refractive shock cone and heat shielding (and the north edge of the map) needs to be either hot space or violently changed by radiation in some way. This involves basically igniting most items, vaporizing a lot of things, and burning turfs. A lot of work. ![](https://i.imgur.com/PJuccRq.png) ## the diffractive shock cone Essentially it would be a boundary between hot and cold space, but it also needs to bend inwards. Light refracts around solid objects depending on frequency (hence why shadows of objects further away are more fuzzy) and 'curvature' depends on the intensity of the wavelengths of light. Typically, for passing through a narrow slit, the diffraction depends on the width of the slit, and spreads out most when the gap is similar to the wavelength. What we need to consider is the opposite case, diffracting around a solid object. Higher frequencies of light get diffracted more by edges, so the shock cone would be sort of the area between where the light gets scattered. In real life this would probably not be noticeable, but there should be a very very narrow band of rainbow scattered light, just like in a prism. ### so whats the actual angle The actual angles involved are a bit harder to work out. It's by definition somewhere in the range `0 < theta < pi/2` (radians), being closer to pi/2 radians with higher frequencies (like xrays and gamma rays and all the nasty stuff) and closer to 0 with lower frequencies (like radio waves). For ease of the game's calculation, let's assume that the maximum is approximately **pi/6** radians inwards. Or for those who dont study maths or physics, **30 degrees**. This is up for change, but in terms of calculating the shock cone's turf tile placements, it's a good nice number, and by tweaking it slightly to ***26.65 degrees*** you can tile it with a nice and simple to calculate pattern with regular tiling. ![](https://i.imgur.com/HF6HTmt.png) ### An example Using an angle of 26.65 degrees gives us diffractive shock cones in red, safe areas in blue, and exposed unsafe areas in yellow ![](https://i.imgur.com/aauTBc3.png) Looking at this now it's kind of a steep angle, especially if you consider each pixel to be a turf. The angle could possibly be made shallower, or the shield just has to be really wide, and the station sort of triangular to avoid the diffraction cone. ### the process: 1. heat shields are placed (in the map or built in runtime). The destruction or creation of a heat shield wall is what triggers this proc. 2. calculate how many separate heat shields there are. Some kind of pathing algorithm to determine the connections. They have to be able to connect diagonally too.![](https://i.imgur.com/i2V2YSj.png) 3. You then determine the most eastern/western edges and draw the shock cone turf straight up from it. See the edge detection section further down. 4. Everything to the north of each heat shield is unmarked as being in view of the sun, and the hot space is made cold. 5. The very outermost layer of cold space is all turned into shock cone turf. * i.e. imagine you have a shock cone four tiles wide, at coordinates `101,100` to `104,100`. All the tiles at coordinates `101,y` and `103, y` where `100 < y <= highest y coord`. Alternatively, the outer layer of shock cone could also be made to taper in at a lesser angle like 5 degrees, and turning shock cone turfs back into hot tiles. 6. Within the cold areas, the refractive shock cone tapers inwards at an angle of 30 degrees, i.e. on every 2nd row, go inwards by one tile. 7. do this for all separate heat shields. This has fascinating consequences for antags punching a hole through the heat shield with a bomb, as this streak of light would punch through the station setting everything in it's path ablaze. Even if there was only one tile removed. Which is not at all how slit diffraction works but we'll take it. The diffractive shock cone acts like hot space basically. It's just a different turf of it. ## What happens in hot space: Cases * If a turf should be a diffractive shock cone but isn't a `/turf/space` (i.e. it's a simulated floor tile of some kind), treat it like you would objects placed in hot space. * Hot space sits at `SUN_TEMP` which is the ambient temperature near the sun. At the moment it's sitting at 3,300 Kelvin. Which in irl terms is really quite hot (Tungsten melts at 3,695K). * This can be adjusted lore wise by lowering or raising the radius of the orbit. * Walls and reinforced walls can stand up to solar radiation like heat shield walls do, but not for extended periods. They accumulate damage and eventually break. This prevents a hole in the heat shield blasting a scorched hole through the entire station in an instant. Reinforced walls should last longer, obviously. * Each Heat shield has a temperature, which is shared along all of the heat shield walls. Kind of like the hellburn chamber of a regular TEG, they should have atmos pipes flowing through them in order to carry the heat away and back to the TEG. They gradually heat up and attempt to reach `SUN_TEMP`. * Nanotrasen puts a lot of funds into these shield walls, they're made of a ceramic material that's infused with plasmastone in order to have a massive heat capacity. They'll last a lot longer than regular walls, but if they're not actively cooled, they'll melt as well. They'll melt (start taking damage) at a temperature close to but not quite at `SUN_TEMP`, around 2,900 Kelvin or therabouts. The higher the temp of course the faster the damage. * As contructible atmos does not exist, the heat shield walls are extremely conductive and all of the connected ones have the same temperature and at the same time. Special 'heat sink walls' have the plasma pipes physically running through them and the heat sink walls similarly connect to the rest of the shield. It's the mechanism by which the TEG hot loop can siphon heat. * The heating of each individual shield as a whole should be relative to its surface area. * In reality, there really should be two kinds of shields at play, the true shield being bilayered. On the inner side of the heat shield itself, there should be that kind of wall that can block radiation, like in donut2 and 3. Having a look at the map file though, I can't actually tell what is blocking radiation, the crystal wingrilles or the shutters. * The heat shield will be hollow in order to allow for maintainence, with at least two layers, possibly three, for safety reasons (if one wall melts, the shield walls behind should continue to block the sun and protect the station, even if the interior of the shield becomes a pyromaniac's dream). Obviously, the side facing the sun deteriorates first, so some eva would be needed to repair it. * The path of the diffractive shock cone and the cool zone behind walls should be calculated at runtime. * any flammable objects should be ignited instantly. * Mobs should start taking severe burn damage, possibly at a rate of 2 dmg/s or higher. Radiation damage should also be incurred, but at a lower rate, such as 0.5 dmg/s. The special solar emergency space suits that'll be provided will protect the mob from both kinds of damage. Firesuits and regular eva spacesuits won't prevent the rad damage, and radiation suits won't protect (as well) against burn damage. Radiation suits could potentially also burn up. * Rad resist and heat resist should be able to protect you from this. * looking directly at the direction where the sun is (`SOUTH`) should stun and blind. Sunglasses and solar eva suits should block this effect. If it can block a flash let's assume it can block the sun. * The gas of any air simulated tile should be heated strongly when exposed to air, until it reaches `SUN_TEMP`. * Airless non space tiles should be heated up in some way. * Tiles that can be scorched should become scorched. * Possibly the tiles themselves can slowly take damage as they begin to heat, similarly to walls, before being destroyed. ## Edge Detection How do you detect the edge of a shield? Well, i drew out some examples using some pixel art, and i figured out a pattern. You'd have to use use an 8 bit bitmask for it though Let the grey tiles be the one you're checking, the red be the start of a shock cone, and yellow be anything else. ![](https://i.imgur.com/Tnj2SII.png) There is a pattern. If we let `surr` be the bitmask, the code would look something like this: ``` if (surr & NORTH) return else if (surr & (EAST + NORTHEAST_UNIQUE + SOUTHEAST_UNIQUE)) if (surr & (WEST + NORTHWEST_UNIQUE + SOUTHWEST_UNIQUE)) return else shock_cone_marker at NORTH shock_cone_marker.taper_direction = EAST else if (surr & (WEST + NORTHWEST_UNIQUE + SOUTHWEST_UNIQUE)) if (surr & (EAST + NORTHEAST_UNIQUE + SOUTHEAST_UNIQUE)) return else shock_cone_marker at NORTH shock_cone_marker.taper_direction = WEST else shock_cone_marker at NORTH // taper_direction doesnt get touched and stays null ``` There's a definite pattern available. Also, to detect long vertical lines, there'd have to be some kind of variable that gets passed 'up' the line that tells the heat shield wall at the very back 'yeah we do actually be in the sun right now'. Otherwise you'll get heat shields behind heat shields generating shock cones for no reason. It'd check something like this ``` var/in_light=FALSE ... if (surr & NORTH) if (SOUTH has shock cone || hotspace) wall_above.in_light = TRUE ``` ![](https://i.imgur.com/BjikZwx.png) The shock cone itself then continues upwards in a straight line until it hits a wall, then goes up two, across one, and places a new marker. The problem then lies in figuring out which bloody direction it's supposed to taper in, which is hopefully done by the edge detection anyway, but there could be edge cases (lol) that i have missed as well.