It just hits that level of detail that is currently rendered.
lowest-loaded = Blocks -> damages blocks.
lowest-loaded = Chunk -> damages chunk; Not generated chunks have an average HP value.
Or just make a crater in the high-map and modify the damage overlay colour for this part. This affects how lower detail is generated once visited.
lowest-loaded-detail-level = 16*16 Chunk (see above)
If you want exact orbital fire, you have to load the chunks by zooming in.
To see something in high-resolution from distance, you have to pay :
2D resolutionIncrease = (scanTime * (scannerPower)^diminishingReturns )
2D resolutionIncrease = (scanTime * (scannerPower)^diminishingReturns )^0.5
They are generated based on parameterized input from damage|resource|modification-overlays.
damage|resource|modification = 0..16 or 0..255 per "raster-unit"
The raster may store time of last visit and erase damage as result of earth-quakes or natural growing plants, ...
Craters may influence the distribution of high below the highmap, but the planet may regenerate from some damage.
Another idea would be to make the orbit >2km thus preventing ships from firing at the surface.
There could be ballistic fire which can only be fired at loaded blocks.
If you or an projectile enters/leaves the planet radius :
JavaScript:
float3 lp := lastPosition
float3 cp := currentPosition
float3 cpr := cp^2 - planetPosition^2 // current position relative to the planet
..enter if(( ~inPlanet && planet.radius^2 > cpr{x*x + y*y + z*z} ))
// subtract sector rotation
// divide through sector scale (*1/factor == faster *1*multiplier)
lpr := lp^2 - planetPosition^2 // last position relative to the planet
// multiply with sector scale
// add sector rotation
..enter
..leave else if(( inPlanet && planet.radius^2 < cpr{x*x + y*y + z*z} ))
// subtract planet rotation
// divide through planet scale (*1/factor == faster *1*multiplier)
lpr := lp^2 + planetPosition^2 // last position relative to the planet
// multiply with sector scale
// add planet rotation
..leave
// commented out parts (green) are calculated when entering planet sectors
// or not needed as scale will probably be 1.
Usually the glitches happen by dividing. Multiplying with the 1/factor value could help.
Else try to get the position of the planet relative to the ship by
- NOT getting the planet in the ship's coordiante system
- but the ship into the planet's coordinate system (same calculations as with projectiles fired at the planet)
Then you need to translate the ship's position and rotation with (-value) to the planet's position relative to the ship
2nd are calculations which don't produce glitches like a divsion does.
That should put the very same glitches on the planet position on your screen as it does on projectiles entering it, thus negating the effect of glitches.
As it is not reasonable to hit a static target on a rotating+moving planet orbiting a rotating+moving sun with all the gravity influences from other planets, moons and the universe, I think it is realistic to just ignore the ability to exactly hit from outside a planet's orbit (said orbit, not gravity sphere
)
I hope this gives some new Input