Sensors.tdf crash and seeing beyond hills.

Sensors.tdf crash and seeing beyond hills.

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Sensors.tdf crash and seeing beyond hills.

Post by zwzsg »

For my racing mod, I needed to remove the fog of war.

Since it's not possible, I tried to make unit with map sized sight.

First of all, I changed the SightDistance and RadarDistance to very high values. However:
a) Not matter how high they were, ingame the brighest sight disk stays capped to a not so great value. The darkest disk stayed capped to a value about the size of my map, so capped too but large enough value for me not to care.
b) Sight and radar both are affected by terrain. So when the unit is behind a hill, it doesn't see what's on the other side of the hill.

To solve b), I tried to make the unit more tall, thinking that maybe taller units see better. So I changed the the model radius and model height in the s3o. It appears that the radar ability to see beyond hill is affected by the the unit height, I gave my s3o a very tall unit height and then its radar range went unaffected by hill, and the only side effect I noticed was that the health bar was moved up the sky. However, the unit height didn't change the sight. Then I changed the model radius, made it ultra big, and this time the sight became able to see behind hills. However, that model radius is also used for collision, and units became blocked by the collision sphere of another unit three screen aways. So I couldn't keep this solution.

So, with this, I was able to make my unit have an all covering radar, which is better than having blind spots, but not as good as seeing the actual models and not the radar blobs anywhere.

Then I was told about sensors.tdf, and that it allowed me to control the sight map resolution and that lower map resolution allowed greater sight maximum. I thought that maybe by having an extremely low sight map resolution, I could make it so the whole map would be only one pixel in the sightmap, and so units would see all without caring about relief.

So I tried values such as 50 for the LosMipLevel and AirLosMipLevel. This made Spring crash. The highest value I could use without Spring crashing were somewhere about LosMipLevel=16; and AirLosMipLevel=32; I'm under the impression the unit SightDistance and RadarDistance in the FBI also affected whether it crashed or not.

Somehow the current values used in Spring Racers v5 makes car see all the map without being blocked by hill, and seeing models and not radar dot, but I'm really not sure why, and don't dare changing anything in case I break it.

The same mod make the SVN Spring crash. So for SVN Spring, I have to reduce the sensors.tdf's LosMipLevel & AirLosMipLevel values, and then my unit can't see behind hills any more.

Also, the presense of commented out LosMul and AirLosMul in sensors.tdf that I'm told I should not use intriguate me.

So my questions are:
- Is there any valid reason why high values in sensors.tdf's LosMipLevel & AirLosMipLevel makes the game crash, or is it just a bug?
- What method would you advise to use to disable the fog of war entirely?
- What method would you use to make tall thin watchtowers that see behind hills?

I am aware that Spring wasn't made as a racing engine and won't ever properly support it, and that fog of war is an important element of RTS that forumers would argue should never be removed.

However, I'm pretty sure even some real, balanced and playable, Spring RTS mods could want to have large los unit, or a unit that sees behind mountain. So a way for greater sight is a valid feature request.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

I'm not sure what it is that you are trying to achieve exactly, but this may help:

Spring.SetUnitAlwaysVisible(unitID, boolean)

This call-out can be used from the synced side of LuaRules or LuaCob, and will
make it such that the designated unit is always visible in the viewport and in the
minimap.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Well, there is actually three questions:
  • How to make units always visible, to which you just gave me an satisfying answer.
  • Why does Spring.exe crash with high value in sensors.tdf?
  • How to make a thin tall watchtower?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I don't know exactly why it crashes with high values in sensors.tdf, but I'm pretty sure the max of 32 is because it's used as a bit shift: if you set it to 5 map width and height are divided by 2^5 (shifted 5 bits to right) to make the resolution of the LOS/radar map. There may be another factor in this after/before the bitshift.
Post Reply

Return to “Feature Requests”