PRECISION OIL 1.4 - SHIPPING AN OIL MAP WITH YOUR FS25 MAP
==========================================================

Precision Oil works on every map. When a savegame starts, it picks the oil map in this order:

  1. The oil map that YOUR MAP MOD ships (this document).
  2. An oil map built into Precision Oil (Montana 4X, M-Tex Permian Basin).
  3. Otherwise a RANDOM oil map. It is made once per savegame (seeded), stored in the savegame's precisionOil.xml
     and read back exactly from then on. A new savegame gets a different one.

If you do nothing, players on your map get option 3. Ship an oil map if you want the oil in places you chose.


1. WHERE TO PUT IT
------------------
Option A (recommended): point at the file from your map's modDesc.xml, anywhere inside <modDesc>:

    <precisionOil file="config/precisionOil.xml"/>

    The path is relative to your map mod folder.

Option B: no modDesc entry. Put the file under one of these names in your map mod folder (first one found wins):

    precisionOil.xml
    config/precisionOil.xml
    map/config/precisionOil.xml

Your map's oil map always wins over the ones built into Precision Oil. Your map works without Precision Oil installed:
the file is simply ignored.


2. FILE FORMAT
--------------
Coordinates are FS25 world metres: x = east, z = south, (0,0) = map centre. On a 4x map (4096 m) x and z run from
-2048 to 2048. In the GIANTS Editor, use the X and Z of any node you place where you want the oil.

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<precisionOil layoutId="mymap_oil_v1" surveyFee="35000" surveyRadius="400" minDeclineFactor="0.25" surveyMode="auto">

    <!-- polygon: as many x,z points as you like, in order around the outline -->
    <pocket id="N1" name="North Field" depthFt="7400" reserveBbl="1300000" productivity="1.10">
        <points>-1800,-1700 -1200,-1750 -900,-1400 -1100,-1000 -1700,-1100</points>
    </pocket>

    <!-- circle: centre x / z plus radius in metres -->
    <pocket id="S1" name="Creek Pocket" depthFt="4200" reserveBbl="60000" productivity="0.8" x="500" z="-400" radius="150"/>

    <!-- ellipse: rx / rz half-widths in metres, rotation in degrees -->
    <pocket id="E1" name="Big Lake Field" depthFt="8100" reserveBbl="900000" productivity="1.2" x="-300" z="200" rx="400" rz="220" rotation="30"/>
</precisionOil>

Root attributes (all optional):
  layoutId          name of this oil map. Saves remember it. CHANGE it when you move pockets in an update.
  mapIds            leave it out. (Only needed in a file that is NOT inside the map mod, e.g. "FS25_MyMap.MapUS".)
  surveyFee         geologist fee in $ (default 35000)
  surveyRadius      survey radius in m (default 400)
  minDeclineFactor  output of a nearly empty pocket, 0..1 (default 0.25)
  surveyMode        auto (default: PV-235 test bores when that mod is loaded), testBore, instant

Pocket attributes:
  id           short unique id (letters/digits). Never reuse an id for a different pocket.
  name         shown to players after a well strikes it
  depthFt      depth of the top of the pocket in feet. The M-Tex rig drills to 9,500 ft, so stay below about 9,400.
  reserveBbl   barrels in the pocket, shared by every well in it. Game balance: ~1,000,000 bbl per km2 for a big
               field, 50,000 - 150,000 for a small pocket.
  productivity output multiplier for wells in it (1.0 = the pad's rated output)

Pockets do not need to avoid roads or towns (they are underground), but players can only drill where they own the
land or hold the mineral rights, so put most oil under buyable farmland. If two pockets overlap, a rig strikes the
shallower one.


3. OTHER OPTIONS
----------------
Let Precision Oil generate random oil on your map, but with your settings (file as above, no pockets):

    <precisionOil mode="random" coverage="0.22" minDepthFt="3500" maxDepthFt="9300" reserveScale="1.0"
                  maxPockets="60" mainRadius="635" satelliteRadius="193" edgeMargin="330"
                  satellitesMin="1" satellitesMax="3" surveyFee="35000"/>

    coverage         share of the map over oil, 0.02 - 0.6 (default 0.22)
    mainRadius       radius in m of the large fields (default grows with map size, 635 m on 4x)
    satelliteRadius  radius in m of the smaller pockets around each field (default 193 m on 4x)
    edgeMargin       no field centre closer than this to the map edge, in m (default 8 % of the map)
    reserveScale     multiplies all generated reserves

Switch Precision Oil geology off on your map (rigs and wells then work like without the mod; mineral rights stay):

    in modDesc.xml:   <precisionOil mode="off"/>
    or as the file:   <precisionOil mode="off"/>


4. HOW THE RANDOM OIL MAP IS MADE (when you ship nothing)
---------------------------------------------------------
- Clusters: one large field plus 1-3 smaller satellite pockets lined up along the field's long axis.
- Pocket size grows with the square root of the map size; the number of clusters fills about 22 % of the map
  (about 6 pockets on a 2 km map, 7-12 on a 4x map, ~27 on a 16x map, at most 60).
- Field centres sit on buyable farmland (fields preferred), each main field on a different farmland, at least 8 % of
  the map size from the edge. Pockets that would lie mostly under water, roads or town land (farmland 0) are
  rejected; outline points are pulled back from water and from the outer 3 % of the map.
  Water and roads are found with downward raycasts (WATER / ROAD collision flags), so make sure your water planes and
  road meshes carry those flags. Painted-only roads count as "not road" but usually lie on farmland 0.
- Depths 3,500 - 9,300 ft, reserves from the pocket area. All values are game balance, not real geology.


5. UPDATING YOUR OIL MAP LATER
------------------------------
Saves keep their reserves per pocket id. If you move or reshape pockets in a map update:
  - give the file a new layoutId and list the old one:  previousLayoutIds="mymap_oil_v1"
  - keep pocket ids that are still the same pocket
  - for a removed pocket, add <retiredPocket id="N1" name="North Field" depthFt="7400" reserveBbl="1300000"/> so wells
    that savegames already drilled into it keep their remaining oil (nothing new can be drilled there).
If a savegame used a random oil map and your map later ships one, Precision Oil keeps the random pockets as retired
pockets automatically.


6. CHECKING IT
--------------
Start a NEW savegame on your map with Precision Oil and look in log.txt for:
    [PrecisionOil] map 'FS25_YourMap.MapXX' ships its own oil map: ...
    [PrecisionOil] map 'FS25_YourMap.MapXX': Precision Oil ACTIVE
In the console (~):  poOilMap   -> which oil map is used (never shows where the pockets are).
