Saturday, November 4, 2023

In OOTP schedule, how do numbers in file correspond to teams in league?

An Out of the Park (OOTP) Baseball schedule uses numbers (1 through however teams in the league).  If you want to get to specific matchups between teams, you need to know how those numbers match up with the teams in the league.

To do that you need see into the details of the league structure.  You can get that by looking at the export of the structure.

In the game, go through...  League Settings > League Actions button > Import / Export > Export MLB structure (or whatever your league abbreviation is if not "MLB")

Will show message like, "The league structure has been written to the '<league folder.lg>/import_export/league_structure.xml'", but I am not sure that is quite right...

The file ends up in my Windows 11 setup under Documents > Out of the Park Developments > OOTP Baseball 24 > saved_games > [LEAGUE].lg > import_export > league_structure.xml

Anyway, open that file in a text editor.  Down in the structure you will see lines for teams like <TEAM name="Baltimore" nick_name="Orioles" abbr="BAL" id="3"...

That "id" value...  It is NOT the number that matches up to what is in the schedule file.  At least not exactly, but it does relate.

To figure out how the league teams align with the numbers in the schedule file you have to walk through the league structure and compile the teams in the order of the SUB_LEAGUES, DIVISIONS, then TEAMS by their respective id values.

In a given league, go through the subleagues in the order of their id values - the first may be 0 or 1, or it could be whatever.  Just go through them in numerical order.  Do the same with the divisions in each subleague.

Do the same for the teams, and compile the teams in the order that walking through everything.  The file as you view it may have things in the order of their id values going down, but it may not in all cases.  Make sure to follow the id values.

Here is an example structure, with excess info stripped for illustration purposes...

<LEAGUE name="Major League Baseball" abbr="MLB" id="200" ...>
  <SUB_LEAGUES>
    <SUB_LEAGUE name="American League" abbr="AL" id="0">
      <DIVISIONS>
        <DIVISION name="East Division" id="0">
          <TEAMS>
            <TEAM name="Baltimore" nick_name="Orioles" abbr="BAL" id="3" .../>
            <TEAM name="Boston" nick_name="Red Sox" abbr="BOS" id="4" .../>
            <TEAM name="New York" nick_name="Yankees" abbr="NYY" id="18" .../>
            <TEAM name="Tampa Bay" nick_name="Rays" abbr="TB" id="27" .../>
            <TEAM name="Toronto" nick_name="Blue Jays" abbr="TOR" id="29" .../>
          </TEAMS>
        </DIVISION>
        <DIVISION name="Central Division" id="1">
          <TEAMS>
            <TEAM name="Chicago" nick_name="White Sox" abbr="CWS" id="5" .../>
            <TEAM name="Cleveland" nick_name="Guardians" abbr="CLE" id="8"... />
            <TEAM name="Detroit" nick_name="Tigers" abbr="DET" id="10" .../>
            <TEAM name="Kansas City" nick_name="Royals" abbr="KC" id="13" .../>
            <TEAM name="Minnesota" nick_name="Twins" abbr="MIN" id="17" .../>
          </TEAMS>
        </DIVISION>
        <DIVISION name="West Division" id="2">
          <TEAMS>
            <TEAM name="Los Angeles" nick_name="Angels" abbr="LAA" id="14" .../>
            <TEAM name="Oakland" nick_name="Athletics" abbr="OAK" id="20" .../>
            <TEAM name="Seattle" nick_name="Mariners" abbr="SEA" id="24" .../>
            <TEAM name="Texas" nick_name="Rangers" abbr="TEX" id="28" .../>
            <TEAM name="Houston" nick_name="Astros" abbr="HOU" id="12" .../>
          </TEAMS>
        </DIVISION>
      </DIVISIONS>
    </SUB_LEAGUE>
    <SUB_LEAGUE name="National League" abbr="NL" id="1">
      <DIVISIONS>
        <DIVISION name="East Division" id="0">
          <TEAMS>
            <TEAM name="Atlanta" nick_name="Braves" abbr="ATL" id="2" .../>
            <TEAM name="Miami" nick_name="Marlins" abbr="MIA" id="11" .../>
            <TEAM name="New York" nick_name="Mets" abbr="NYM" id="19" .../>
            <TEAM name="Philadelphia" nick_name="Phillies" abbr="PHI" id="21" .../>
            <TEAM name="Washington" nick_name="Nationals" abbr="WSH" id="30" .../>
          </TEAMS>
        </DIVISION>
        <DIVISION name="Central Division" id="1">
          <TEAMS>
            <TEAM name="Chicago" nick_name="Cubs" abbr="CHC" id="6" .../>
            <TEAM name="Cincinnati" nick_name="Reds" abbr="CIN" id="7" .../>
            <TEAM name="Milwaukee" nick_name="Brewers" abbr="MIL" id="16" .../>
            <TEAM name="Pittsburgh" nick_name="Pirates" abbr="PIT" id="22" .../>
            <TEAM name="St. Louis" nick_name="Cardinals" abbr="STL" id="26" .../>
          </TEAMS>
        </DIVISION>
        <DIVISION name="West Division" id="2">
          <TEAMS>
            <TEAM name="Arizona" nick_name="Diamondbacks" abbr="AZ" id="1" .../>
            <TEAM name="Colorado" nick_name="Rockies" abbr="COL" id="9" .../>
            <TEAM name="Los Angeles" nick_name="Dodgers" abbr="LAD" id="15" .../>
            <TEAM name="San Diego" nick_name="Padres" abbr="SD" id="23" .../>
            <TEAM name="San Francisco" nick_name="Giants" abbr="SF" id="25" .../>
          </TEAMS>
        </DIVISION>
      </DIVISIONS>
    </SUB_LEAGUE>
  </SUB_LEAGUES>
</LEAGUE>

First subleague in the order of the subleague ids is the AL (id=0).  The first division in the order of the division ids in that subleague is the East (id=0).

Walking through the teams in the division the order by team ids is Baltimore (id=3), Boston (id=4), New York (id=18), Tampa Bay (id=27), Toronto (id=29).  Those are the first 5 teams as far as the schedule file is concerned.  So in the schedule Baltimore will be 1, Boston 2, New York 3, Tampa Bay 4, Toronto 5.

Next division in the AL is Central.  Again walk through the teams in their id order and add them to the compilation for the schedule order - Chicago 6, Cleveland 7, Detroit 8, Kansas City 9, Minnesota 10.

And so on.  The AL West has Houston shown below Texas, but Houston is first in id order, so it is 11, then Los Angeles 12, Oakland 13, Seattle 14, Texas 15.

The NL is all shown in the order they end up counting from 16 through 30 for the rest of the teams.  Atlanta 16, Miami 17, New York 18, Philadelphia 19, Washington 20.  Chicago 21, Cincinnati 22, Milwaukee 23, Pittsburgh 24, St Louis 25.  Arizona 26, Colorado 27, Los Angeles 28, San Diego 29, San Francisco 30.

The alphabetical order of the teams will often match up with the alphabetical order of the teams, especially for the pre-made leagues in the game.  But that does not have to be true.  E.g., you could change in the above "Arizona" to be called "Phoenix", which would move that team from first to third in its division alphabetically.  But assuming the id does not change, it will still be first in that division by id, which is what matters for the schedule.

No comments:

Post a Comment