Shield facets design #1002
Replies: 8 comments 9 replies
-
Roy:
|
Beta Was this translation helpful? Give feedback.
-
Not a vector. A map. And we store the number of facets separately, alongside the map, as we already do today. And then have a switch statement wherever we need one, that can handle two, four, perhaps six, or eight facets and figure out the behavior automatically based on the number of facets and what's in the map. |
Beta Was this translation helpful? Give feedback.
-
Agreed -- we will need to make changes to vdu.cpp. And we won't allow an arbitrary number of facets, Just three or four possibilities -- 2, 4, 8, or perhaps 6 for a cube shape. (But probably not that last one.) |
Beta Was this translation helpful? Give feedback.
-
I am glad that we took a closer look at this aspect of the code. The shield stuff did need to change. It was too brittle, among other problems. |
Beta Was this translation helpful? Give feedback.
-
I created a draft PR: #1003 . Only the last commit is relevant to this discussion. |
Beta Was this translation helpful? Give feedback.
-
Well, for shield "I am glad that we took a closer look at this aspect of the code. The shield stuff did need to change. It was too brittle, among other problems." which I also said, since I had to slog through the code when I refactored it. For armor, my argument was marginal utility against playability. 8 facets sound cool but they implemented it wrong (IMO). The implemented a two layered diamond. The current VDU can't show that. Instead it can show this form: But the most important argument was - it's marginal utility. Yes, we can write 8 facet armor. We can implement 32 facets. Should we?! Will that make the engine really better?
Agreed. Damageable_layer.h:
The version you have is probably
Again, strongly agree. Take a look at #877. I was waiting for the upgrade to boost::json to also start implementing this. Then shield would be:
You would pass this sub-object to the shield component, cleaning up the code even more.
I'm working on that. |
Beta Was this translation helpful? Give feedback.
-
Hi there. Ships like a Mule, Clydesdale or even my lovely Goddard has shields that do not extend all around in a bubble like with the smaller ships. Instead, it is shaped to the contours of the ship. There are even bigger ships out there, and Vega Strike supports any size of ship, so in theory there could be a Death Star replica... Now, while designing shields and armor and things, it might just be a good idea to have an arbitrary large number of armor plate and shields. The reason that I am saying this is that this would allow us to map shields in a sort of honeycomb on these large capital ships... We could also then display a 3D view of the ship, with the shield or armor that is taking damage being highlighted and fading... or glowing in the case of armor. Yes, this will be a lot of work to implement, but it will be a lot easier if it is already possible to have an arbitrary number of armor and shields. When re-doing the shield and armor displays on the hud, it would also be a good idea to keep in mind that these arbitrarily large ships exit, and would also need their armor and shields displayed. Which is why I was thinking of moving away from a diagram of the ship, and rather have a wireframe of the ship displayed and the shields extending out from that in some sort of mathematical model. This would look super cool on small ships, and scale nicely to larger ones. Just something to keep in mind. |
Beta Was this translation helpful? Give feedback.
-
Oh, and if you are wondering if there is a formula for carving up a sphere into an arbitrary number of equally sized segments: Far beyond the scope of this discussion, though. I suppose the most practical way would be to imagine each shield generator's shield extends around it in a sort of bubble. So, in a dual shield, the forward shield is a bubble around the front of the ship, and the back shield is a bubble around the back of the ship, and if the radius of these bubbles are big enough, they would start intersecting. So, any shield inside an intersection just does not count. So, now if we want a quad generator, have four shield generator points, each "projecting" it's own bubble. Again the bubbles would intersect, and anything inside an intersection does not count. So, to then take a capship that might have 30 shield generators, each projecting its own bubble of shield, you would get a form-fitting almost honeycomb shape of shields around the ship. With this sort of model you could do collision detection on the shied spheres? But this is all pie in the sky thinking, something to do when all the bugs have been sorted out and you guys are looking for new features to add. :) |
Beta Was this translation helpful? Give feedback.
-
So I'm thinking that we need to reconsider our design for shield facets. When we reduced the number of shield facets from 8 to 4, we broke a bunch of code all over the place. And for what? To make the Vega Strike engine less capable. That doesn't sit well with me. I find myself again questioning why we made that choice.
I don't think the shield facets should be stored in a fixed-length array. Instead, they should be stored in RAM in an std::map<std::string, float>. And stored in JSON, on disk, as child keys (e.g., "front", "back", "left", "right") under a single parent key ("shield_facets"). And I think we should go back to allowing at least 8.
We should then change all the places in the code that reference shield facets to use these new data structures. No more fixed-length arrays, and no more hard-coded facet names. Instead, we will enumerate through the items (key-value pairs) in the map.
What do you guys think?
Beta Was this translation helpful? Give feedback.
All reactions