This is a follow-up to the post on Relic Forums:
Sensors Manager - Show actual model of ships other than Cruiser and Mothership? which is being tracked by
Make Sensor Manager rendering of object meshes configurable.
In short: whether to display large objects as 3D-meshes in the sensor manager is determined by a hard-coded list in src/Game/Sensors.c. This should really be configurable by an entry in the appropriate .shp file - or should it...
Whilst looking into this it occurred to me that this isn't great behaviour either. For example, if a mod were to provide vessels with cloaking devices, say, then the class-configuration is no longer appropriate; it's specific to the object in question. Also, why should you have to declare which objects are visible at all? I've always assumed that the "real world" reason objects show up as meshes is because they're so large/massive that sensors have no trouble determining what they were or what they were doing (however, I'm unable to find any documentation that supports this). If this behaviour is applied, then anything over a certain mass should be drawn as a mesh unless overridden by the object for some reason (e.g. cloaking device). Looking at the mass distribution and mesh configuration to see if there is an appropriate threshold, we have:
Code:
derelicts/planetoforigin_scarred 10000000.0
derelicts/planetoforigin 10000000.0
derelicts/homeworld 10000000.0
resources/asteroids/asteroid4 1000000.0
r2/headshotasteroid 200000.0 (SM_Mesh)
r1/headshotasteroid 200000.0 (SM_Mesh)
traders/miningbase 100000.0 (SM_Mesh)
traders/floatingcity 100000.0 (SM_Mesh)
r2/mothership 100000.0 (SM_Mesh)
r1/mothership 100000.0 (SM_Mesh)
p3/p3megaship 100000.0 (SM_Mesh)
p3/p3frigate 100000.0
derelicts/scaffoldfingerb_scarred 100000.0 (SM_Mesh)
derelicts/scaffoldfingera_scarred 100000.0 (SM_Mesh)
derelicts/scaffold_scarred 100000.0 (SM_Mesh)
derelicts/scaffold 100000.0
derelicts/prisonshipold 100000.0
derelicts/prisonshipnew 100000.0
derelicts/prisonship 100000.0
derelicts/m13panelc 100000.0
derelicts/m13panelb 100000.0
derelicts/m13panela 100000.0
derelicts/junk3_boilercasing 100000.0
derelicts/junk3_boiler 100000.0
derelicts/angelmoon_clean 100000.0
derelicts/angelmoon 100000.0
r2/heavycruiser 10000.0 (SM_Mesh)
r2/carrier 10000.0 (SM_Mesh)
r1/heavycruiser 10000.0 (SM_Mesh)
r1/carrier 10000.0 (SM_Mesh)
p2/p2mothership 10000.0 (SM_Mesh)
p1/p1mothership 10000.0 (SM_Mesh)
r2/cryotray 4000.0 (SM_Mesh)
r1/cryotray 4000.0 (SM_Mesh)
resources/asteroids/asteroid3 2000.0
r2/standarddestroyer 1800.0
r1/standarddestroyer 1800.0
traders/researchstation 1000.0 (SM_Mesh)
traders/junkyardhq 1000.0
r2/missiledestroyer 1000.0
r1/missiledestroyer 1000.0
p3/p3destroyer 1000.0
derelicts/shipwreck 1000.0
derelicts/junk2_shipwreck 1000.0
derelicts/junk2_paneld 1000.0
derelicts/junk2_panelc 1000.0
derelicts/junk2_panelb 1000.0
derelicts/junk2_panela 1000.0
derelicts/heavycruiser 1000.0 (SM_Mesh)
derelicts/fragmentstrut 1000.0 (SM_Mesh)
derelicts/fragmentpanel3 1000.0 (SM_Mesh)
derelicts/fragmentpanel2 1000.0 (SM_Mesh)
derelicts/fragmentpanel1 1000.0 (SM_Mesh)
derelicts/fragmentpanel0c 1000.0 (SM_Mesh)
derelicts/fragmentpanel0b 1000.0 (SM_Mesh)
derelicts/fragmentpanel0a 1000.0 (SM_Mesh)
derelicts/fragment 1000.0
derelicts/carrier 1000.0 (SM_Mesh)
r2/resourcecontroller 600.0
r1/resourcecontroller 600.0
traders/ghostship 500.0
derelicts/lifeboat 500.0
derelicts/junk1_strut 500.0
derelicts/junk1_shell 500.0
derelicts/junk1_partb 500.0
derelicts/junk1_parta 500.0
derelicts/junk0_sensors 500.0
derelicts/junk0_panel 500.0
derelicts/junk0_gunammo 500.0
derelicts/junk0_fin2 500.0
derelicts/junk0_fin1 500.0
derelicts/junk0_antenna 500.0
derelicts/crate 500.0
resources/asteroids/asteroid2 450.0
traders/junkyarddawg 400.0
r2/standardfrigate 400.0
r2/salcapcorvette 400.0
r2/resourcecollector 400.0
r2/ioncannonfrigate 400.0
r2/gravwellgenerator 400.0
r2/dfgfrigate 400.0
r2/cloakgenerator 400.0
r2/advancesupportfrigate 400.0
r1/standardfrigate 400.0
r1/salcapcorvette 400.0
r1/resourcecollector 400.0
r1/ioncannonfrigate 400.0
r1/gravwellgenerator 400.0
r1/dddfrigate 400.0
r1/cloakgenerator 400.0
r1/advancesupportfrigate 400.0
p2/p2multibeamfrigate 400.0
p2/p2fuelpod 400.0
p1/p1ionarrayfrigate 400.0
derelicts/standardfrigate 400.0
derelicts/resourcecontroller 400.0
derelicts/ioncannonfrigate 400.0
derelicts/dddfrigate 400.0
derelicts/advancesupportfrigate 400.0
resources/dustclouds/dustcloud3 350.0
r2/sensorarray 300.0
r2/researchship 300.0
r1/sensorarray 300.0
r1/researchship 300.0
r2/repaircorvette 150.0
r2/multiguncorvette 150.0
r2/minelayercorvette 150.0
r2/lightcorvette 150.0
r2/heavycorvette 150.0
r1/repaircorvette 150.0
r1/multiguncorvette 150.0
r1/minelayercorvette 150.0
r1/lightcorvette 150.0
r1/heavycorvette 150.0
p1/p1standardcorvette 150.0
p1/p1missilecorvette 150.0
resources/nebulae/nebula0 40.0
resources/dustclouds/dustcloud2 40.0
traders/junk_sgun 30.0
traders/cargobarge 30.0
resources/asteroids/asteroid1 30.0
r2/targetdrone 25.0
r2/proximitysensor 25.0
r2/probe 25.0
r1/targetdrone 25.0
r1/proximitysensor 25.0
r1/probe 25.0
derelicts/salcapcorvette 25.0
derelicts/repaircorvette 25.0
derelicts/multiguncorvette 25.0
derelicts/minelayercorvette 25.0
derelicts/lightcorvette 25.0
derelicts/heavycorvette 25.0
traders/junk_lgun 20.0
resources/asteroids/asteroid0 10.0
r2/heavyinterceptor 10.0
r2/heavydefender 10.0
r2/defensefighter 10.0
r2/attackbomber 10.0
r1/heavyinterceptor 10.0
r1/heavydefender 10.0
r1/cloakedfighter 10.0
r1/attackbomber 10.0
p2/p2advanceswarmer 10.0
p1/p1fighter 10.0
resources/gasclouds/gascloud1 8.0
resources/dustclouds/dustcloud1 8.0
r2/mine 8.0
r2/lightinterceptor 8.0
r2/lightdefender 8.0
r1/lightinterceptor 8.0
r1/lightdefender 8.0
p2/p2swarmer 8.0
r1/drone 2.0
resources/gasclouds/gascloud0 1.0
resources/dustclouds/dustcloud0 1.0
r2/missile 0.0
r1/missile 0.0
r1/mine 0.0
p1/missile 0.0
At first glance, it looks promising with a cut-off threshold of a mass of 1000 units. However there are some gotchas:
1) Exceedingly large objects (planets/moons) need to be filtered (> 1,000,000, say). These are usually drawn outside the game "volume" anyway so this isn't too bad.
2) There are a lot of objects with a mass of 100,000 which don't get drawn. Most are "junk" objects but there are lighter junk objects which do get drawn so this cannot be a filtering criteria on its own.
3) Resource asteroids are never drawn even if they are very big (to be honest, this has always annoyed me since it would be nice to know where the highest resource density regions on a map are).
4) Standard/missile destroyers are massive enough to be drawn but are not.
Now the original configuration is almost certainly attempting to do two things:
1) Highlight objects of interest (major threats; provide 3D reference points)
2) Reduce the polygon count to prevent slow down when the entire map volume is in view
I'm somewhat hesitant to just draw a whole load of other stuff because of point 2. However, I'll have a go at implementing this and see what happens but I'm curious if anyone has a good idea how to automate the "massive enough to be drawn but not important enough to warrant it" filtering. (A possible compromise/solution might be a mass-divided-by-distance threshold instead so only relatively nearby, large masses are drawn as meshes.)