I’m trying to wrap my head around a new topic for my game development: a minimap. In my game, it should be a top-down minimap as close as possible to this one:
I guess a new viewport, with an orthognal camera could get me far. Anyone with experience in doing a minimap?
Then comes my first ‘headache’ - players can have stealth, meaning they should not show up on the radar, but they should show up in the normal camera. And vice versa, players can have cloaking devices, where they are hidden from normal sight, but still show up on the minimap. Or they can have both or none of those combos.
If I do different cameras/viewports, can I cull them in one or the other by some means?
My level is entirely tilebased, if that makes any difference (perhaps when considering rendering ‘something’ to texture and displaying that texture - instead of doing another viewport…). Any and all input most welcome.
I don’t know if viewports are in any way more efficient than rendering the data that is already available to you in a map form. I’d be interested to know myself. I would have thought sampling the noise map for the terrain at a different scale and using the entity set (which is being iterated anyway) would be fine, with the benefit of full control over what and how it is seen.
Probably you want the scene in your minimap to be a different scene than the one the players see.
If you are using an ES, just use a different app state for those that doesn’t show invisible ships. Probably you want simplified models and stuff anyway.
I don’t understand what this means. A second ViewPort is like a second screen inside your screen. You can put whatever you want in it… different lighting, etc… So I don’t know what limitation you mean.
It’s got its own camera, scene, everything… if you want.
Ah, that I was not aware of. Good to know! I thought they ‘looked’ at the same scene.
When you mentioned this, do you mean
XRadar appstate: Retrieves all with Position/BodyPosition (yes, Sim-et-es based) and shows all (because Client has Xradar ability to see even stealthed)
Normal appstate: Retrieves both Position/BodyPosition and also Stealth components, to filter those ‘out from the view’.
I think he means rendering the same scene from a top down view (orthographic?) by adding an additional camera and rendering it like that, but I think we are all in agreement at this point, anyway.
…no, I mean two separate scenes. One rendered optimized for 3D view. Another rendered optimized for tiny 2D view. Two separate root nodes, two separate cameras, etc…
In an ES sense, for the 3D scene there is probably a MovelViewState or something that collects all of the positioned + modeled game objects and creates visuals for them. For the 2D map view, you will have a similar state that collects a different set of entities as necessary.
I opted for the texture path because I didn’t want the minimap to be camera looking down upon the scene - stylewise, the texture makes more sense to me.
If I can make another viewport+camera do that, then I’m in - but I simply can’t connect those dots just now.
For example, your entities could even have an Icon component or MapSymbol component that defines how they look on the map versus in a regular scene. Objects without that component wouldn’t even appear on the map. And that component could represent a dot, a little triangle, a flag, whatever.