Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
-The line "float odoIncrementalDistance = Vector2.Distance(odoLastPosition, position2) * 1000" calculates the distance moved since the last frame.
-Change: "odoLastPosition = position2" - This updates the reference point to the current position, ensuring that the next frame's distance is always measured from the most recent position instead of an old, outdated reference.
-"odoContactDistanceInt += Mathf.RoundToInt(odoIncrementalDistance)" - This adds the calculated distance to the total odometer reading.
Sorry, didnt fit all in one comment.
Everything seemed extremely accurate during an attack last night. also might I add this doesnt mess at all with the estimated location/actual location. Its up to you where you choose your reference point for calculations!
float odoIncrementalDistance = Vector2.Distance(odoLastPosition, position2) * 1000;
odoLastPosition = position2;
odoContactDistanceInt += Mathf.RoundToInt(odoIncrementalDistance);
The distance calculation remains identical—it still measures only the distance between the last recorded position "odoLastPosition" and the current position "position2".
Original method of calculating distance:
odoIncrementalDistance = Vector2.Distance(odoLastPosition, position2) * 1000;
-"odoLastPosition" last recorded position of the submarine.
-"position2" is the current position.
-"Vector2.Distance(odoLastPosition, position2)" measures distance traveled since the last position update.
-This was then added to "odoContactDistanceInt", which keeps track of total traveled distance.
The mod measures distance between these two points and added it to the odometer total.
The problem is it only tracks distance between those 2 points, hence counting down when going back.
What I did keeps the same logic, but ensures "odoLastPosition" is properly updated before the next calculation:
Getting this to work was one of the planned updates-- have you tested whether its accurate?
I'm worried there could be an accumulation of small errors.