Difference between revisions of "Talk:LOC.DAT"

From UFOpaedia
Jump to navigation Jump to search
 
(12 intermediate revisions by 4 users not shown)
Line 6: Line 6:
  
 
: As neither crash nor terror sites have meaningful destinations anyway (only start locations), there's no reason why these offsets can't be overloaded to mean something else in these cases.  -- [[User:Zaimoni|Zaimoni]] 14:32, 26 April 2008 (CDT)
 
: As neither crash nor terror sites have meaningful destinations anyway (only start locations), there's no reason why these offsets can't be overloaded to mean something else in these cases.  -- [[User:Zaimoni|Zaimoni]] 14:32, 26 April 2008 (CDT)
 +
 +
My experience confirm that offset 6-7 is time to count-down.
 +
If this is a terror or crash sub - time meeasure in hours. In example, if we show time  = 10 that means this site 'll disappear through 10 hours
 +
 +
If this is landed Alien Sub - that time 'll fly up. It time measuring in 5-seconds. 1 minute = value 12.
 +
When I checked time to lands Alien Subs, I 'll became to convince it.
 +
 +
As far as I see, offset 6 (word) indeed used for countdown, both set, updated and checked. But offset 8 is very weird. I haven't found use of this field value anywhere. Yes, it set, updated, but never checked. How's that?
 +
There are couple of places where ''field6=5400/speed'' and ''field8=5400%speed'' and another with ''field6=latitude/speed'' and ''field8=latitude%speed'', and I have no idea what are they doing this for...
 +
It looks like some companion field of offset6, but apparently not used.
 +
--[[User:Volutar|Volutar]] 06:59, 13 April 2011 (EDT)
 +
 +
=== Field 08 (vertical destination??) ===
 +
 +
I have found strange algo with weird formula of transferring data from offset8 to offset6 (countdown field)
 +
 +
  v44 = [0/5400/7560] + location->field_8;
 +
  location->field_6 = v44 / craft->CurrentSpeed;
 +
  location->field_8 = v44 % craft->CurrentSpeed;
 +
 +
This 0/5400/7560 value is calculated in function of craft position update.
 +
Any ideas?
 +
--[[User:Volutar|Volutar]] 08:03, 13 April 2011 (EDT)
 +
 +
I think I've found what this field_8 is and what these 5400/7560 values are.
 +
This is a fractional part of latitude/longitude coordinate which is accumulated when craft is flying (this is omnidirectional value of how much craft moved away from "grid" center). Say, 2880 units is whole 360 degrees (along equator). 8 units per one degree... That's too much really. So they've splitted up this coordinate grid into "subgrid" 5400 units long and 7560 along diagonal (1/1.4, quite close to 1/sqrt(2)) and logically connected with craft speed units.
 +
Thereby craft move from (300,300) to (302,303) will take 2 straight moves and one diagonal. Maximum craft speed is...? Right, 5400! So this craft will be flying right 1/8 degree per 1 game frame (which is 5sec). Slower crafts will require more game frames to fly through 1 xcom geographic unit.
 +
--[[User:Volutar|Volutar]] 12:11, 13 April 2011 (EDT)
 +
 +
 +
== field 06 & 08 ==
 +
So Field_6 is
 +
a) static object countdown timer until vanish
 +
b) moveable object "distance" to the next globe coord in game ticks (distance / speed).
 +
Field_8 is fractional part of distance (distance % speed).
 +
 +
Moving from one coord to another is discrete, i.e. can be either straight (5400 meters), or diagonal (7560 meters), only 8 directions. Each game tick this integer part is decreased, and when reaching 0 next coord taken (fractional part added to next portion of distance). Visually objects are moving by integer coordinates (2880x1440), and these frame-based intermediate values don't affect on visual representation, though they could.
 +
--[[User:Volutar|Volutar]] 13:33, 13 April 2011 (EDT)
  
 
===Multiple interpretations===
 
===Multiple interpretations===
Line 24: Line 62:
  
 
edit: Shot this idea down as soon as it came to me. An alien base's information is fairly static in loc.dat. I can only guess that the game randomly decides whether or not to create a supply ship each day at 00:00am, with the supply ship's being 'ping'ed for the first time by your radars at 00:30am. Had a few supply ships show up in the span of a few days in one game, then after reloading none appeared until close to the end of the month. -[[User:NKF|NKF]] 05:16, 30 April 2010 (EDT)
 
edit: Shot this idea down as soon as it came to me. An alien base's information is fairly static in loc.dat. I can only guess that the game randomly decides whether or not to create a supply ship each day at 00:00am, with the supply ship's being 'ping'ed for the first time by your radars at 00:30am. Had a few supply ships show up in the span of a few days in one game, then after reloading none appeared until close to the end of the month. -[[User:NKF|NKF]] 05:16, 30 April 2010 (EDT)
 +
:I think I wrote it somewhere, but once a day each base has a 5% chance of generating an alien supply mission. You can change the "6" there to increase the probability:
 +
.text:00441DC6 66 3D 06 00                  cmp    ax, 6
 +
:[[User:Seb76|Seb76]] 14:49, 30 April 2010 (EDT)
 +
 +
== TFTD/Mixed Crew ==
 +
 +
Byte 1: if contains 4, it means mixed crew. Of both types? Or the value of 5 for Mixed Crew Type 2?
 +
 +
[[User:Sherlock|Sherlock]] 19:10, 30 January 2013 (EST)
 +
 +
:Just given it a test, and it's indeed 5 for type two. I've edited the article to reflect that.
 +
 +
:If you're interested, [http://www.strategycore.co.uk/files/base-defense-toggler/ this tool] lets you send a battleship full of whatever race you want at one of your bases. It only "offers" racial choices of 0 to 4, but you can specify 5 anyways.
 +
 +
:One day I might update it to allow people to specify any mission type. - <span style="font-size:xx-small">&nbsp;[[User:Bomb_Bloke|Bomb Bloke]] ([[User_talk:Bomb_Bloke|Talk]]/[[Special:Contributions/Bomb_Bloke|Contribs]])</span> 19:45, 30 January 2013 (EST)

Latest revision as of 00:45, 31 January 2013

Altitude

Shouldn't the altitude be set in this file as well? Probably one of the Unknown values, and XCOM and Alien Bases might have rubbish data in them. --Pi Masta 15:27, 8 February 2007 (PST)

Count Down

I have some doubts about offset 6-7. The page says that it is the horizontal destination, it looks more like the time left before crash/terror site will disappear (or maybe the offset has two usages depending on the type of the location?). It is reset to 3 for as long as there is a craft targeting the site. Seb76 10:45, 26 April 2008 (PDT)

As neither crash nor terror sites have meaningful destinations anyway (only start locations), there's no reason why these offsets can't be overloaded to mean something else in these cases. -- Zaimoni 14:32, 26 April 2008 (CDT)

My experience confirm that offset 6-7 is time to count-down. If this is a terror or crash sub - time meeasure in hours. In example, if we show time = 10 that means this site 'll disappear through 10 hours

If this is landed Alien Sub - that time 'll fly up. It time measuring in 5-seconds. 1 minute = value 12. When I checked time to lands Alien Subs, I 'll became to convince it.

As far as I see, offset 6 (word) indeed used for countdown, both set, updated and checked. But offset 8 is very weird. I haven't found use of this field value anywhere. Yes, it set, updated, but never checked. How's that? There are couple of places where field6=5400/speed and field8=5400%speed and another with field6=latitude/speed and field8=latitude%speed, and I have no idea what are they doing this for... It looks like some companion field of offset6, but apparently not used. --Volutar 06:59, 13 April 2011 (EDT)

Field 08 (vertical destination??)

I have found strange algo with weird formula of transferring data from offset8 to offset6 (countdown field)

 v44 = [0/5400/7560] + location->field_8;
 location->field_6 = v44 / craft->CurrentSpeed;
 location->field_8 = v44 % craft->CurrentSpeed;

This 0/5400/7560 value is calculated in function of craft position update. Any ideas? --Volutar 08:03, 13 April 2011 (EDT)

I think I've found what this field_8 is and what these 5400/7560 values are. This is a fractional part of latitude/longitude coordinate which is accumulated when craft is flying (this is omnidirectional value of how much craft moved away from "grid" center). Say, 2880 units is whole 360 degrees (along equator). 8 units per one degree... That's too much really. So they've splitted up this coordinate grid into "subgrid" 5400 units long and 7560 along diagonal (1/1.4, quite close to 1/sqrt(2)) and logically connected with craft speed units. Thereby craft move from (300,300) to (302,303) will take 2 straight moves and one diagonal. Maximum craft speed is...? Right, 5400! So this craft will be flying right 1/8 degree per 1 game frame (which is 5sec). Slower crafts will require more game frames to fly through 1 xcom geographic unit. --Volutar 12:11, 13 April 2011 (EDT)


field 06 & 08

So Field_6 is a) static object countdown timer until vanish b) moveable object "distance" to the next globe coord in game ticks (distance / speed). Field_8 is fractional part of distance (distance % speed).

Moving from one coord to another is discrete, i.e. can be either straight (5400 meters), or diagonal (7560 meters), only 8 directions. Each game tick this integer part is decreased, and when reaching 0 next coord taken (fractional part added to next portion of distance). Visually objects are moving by integer coordinates (2880x1440), and these frame-based intermediate values don't affect on visual representation, though they could. --Volutar 13:33, 13 April 2011 (EDT)

Multiple interpretations

It turns out that LOC.DAT also contains/indexes key data for configuring alien bases. One of my attempts at manually constructing an alien base entry critically backfired.

For a Floater base, the Reapers are instantiated in a post-processing pass; they start out as Floaters at the *front* of the alien unit list. The game knew enough not to arm the would-be Reapers, but with key fields in LOC.DAT bungled the pass to convert would-be Reapers to Reapers did not execute. -- Zaimoni 21:34, 4 December 2008 (CDT)

Alien ranks higher than Soldier also are created in a post-processing pass; their equipment, however, was templated properly based on what their rank would have been from where the entries were in the file. The proto-Reapers did not have Soldier rank either. -- Zaimoni 21:51, 4 December 2008 (CDT)

Supply ship requests

Just to jot a thought down before I forget:

Since supply ships aren't scheduled to happen as such in ACTS.DAT/MISSIONS.DAT, and are instead requested directly by the alien base, would the base's loc.dat entry store a timer that counts down between the when it makes its next supply ship request? Or are supply ships just generated at fixed times during the month?

- NKF 04:41, 30 April 2010 (EDT)

edit: Shot this idea down as soon as it came to me. An alien base's information is fairly static in loc.dat. I can only guess that the game randomly decides whether or not to create a supply ship each day at 00:00am, with the supply ship's being 'ping'ed for the first time by your radars at 00:30am. Had a few supply ships show up in the span of a few days in one game, then after reloading none appeared until close to the end of the month. -NKF 05:16, 30 April 2010 (EDT)

I think I wrote it somewhere, but once a day each base has a 5% chance of generating an alien supply mission. You can change the "6" there to increase the probability:
.text:00441DC6 66 3D 06 00                   cmp     ax, 6
Seb76 14:49, 30 April 2010 (EDT)

TFTD/Mixed Crew

Byte 1: if contains 4, it means mixed crew. Of both types? Or the value of 5 for Mixed Crew Type 2?

Sherlock 19:10, 30 January 2013 (EST)

Just given it a test, and it's indeed 5 for type two. I've edited the article to reflect that.
If you're interested, this tool lets you send a battleship full of whatever race you want at one of your bases. It only "offers" racial choices of 0 to 4, but you can specify 5 anyways.
One day I might update it to allow people to specify any mission type. -  Bomb Bloke (Talk/Contribs) 19:45, 30 January 2013 (EST)