Home | Webstore
Latest News: OOTP 25 Available - FHM 10 Available - OOTP Go! Available

Out of the Park Baseball 25 Buy Now!

  

Go Back   OOTP Developments Forums > Out of the Park Baseball 25 > OOTP Mods > OOTP Mods - Database Tools
Register Blogs FAQ Calendar Today's Posts Search

OOTP Mods - Database Tools Do you need to take a dump? SQL gurus welcome

Reply
 
Thread Tools
Old 12-24-2009, 04:51 AM   #1
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Fictional Historical Databases

I've been around for a while, but since I'm not into historical play, I've never ventured into this field before. Now I've decided I'd like to create a fictional historical database to gradually add my fictional players into my league over several years.

Unfortunately, after searching and reading through numerous threads for half the night, I'm still confused. And there seems to be appallingly little pfficial information (or hardly any recent info, for that matter) about how to set one of these babies up.

If anyone could actually give me a concise step-by-step tutorial, that would fantastic. Barring that, perhaps I could just ask a few questions...

1. What are the necessary files? I assume Master, Batting, Pitching, and Fielding are all required. But what others are needed? Does it matter if I'm using fictitious teams or can I just set that up after league creation?

2. What fields are necessary in each file? I've noticed several of the databases over the years have slightly different headers. So which ones MUST I have for it to work? Can I leave some of them out altogether or should I just use "0" or "NULL" or a blank space for those I don't want to use? (And btw, how does OOTP utilize fields like "college" or any of the others that don't appear in the usual .csv and .txt files the game exports?)

3. Is it still true that all fictional databases must use AL or NL (or even FL) for leagues? I know this used to be the case, but is it still? And can they be changed once the game is set up?

4. Could you please explain the LahmanID and PlayerID formats? Do the LahmanID's have to correspond with specific real players? What format does the PlayerID need to be in? I know Lahman uses IDs like "aaronha01", but I've seen others with an arbitrary ID. So how do I have to format it?

I'm sure I'll have more, but if someone in the know can start me off by answering those questions, I should be well on my way. Thanks!

Last edited by Muzamba; 12-24-2009 at 04:56 AM.
Muzamba is offline   Reply With Quote
Old 12-24-2009, 07:50 AM   #2
Bristolduke
All Star Starter
 
Join Date: May 2006
Posts: 1,404
I do different historical set ups. It would be helpful to know exactly what you are trying to accomplish as that could affect the approach. E-mail may be better as we can work the particulars thru as needed. That being said, let me address your questions.

FIRST, you must be knowledgeable of Excel or simlar spreadsheet program. Two, you need the newer version of Excel (Office 7) which will accomodate more that 65,000 rows.

Files needed (again this depends on what you are doing)
Master, Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2, teams, Uninumbers.

Fields used (very dependent upon what you are trying to do)
You will use all the fields in Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2. You may have to modify season and/or team. Within Master, I leave all the fields alone except the ones I want to change. These are usually year of Birth, year of death, debut Year, last year. I have also changed the names/Nickname data. You would change teams if you are trying to tie some history to a new league structure. Uninumber needs to come along for the ride. I just copy all the files provided, even though I won't change them. Not a lot of space and saves headaches.

Is it still true that all fictional databases must use AL or NL (or even FL) for leagues?

I don't think this is true any longer. Certainly not something I've run into. You can change these at set up. Changing after you have started is not something I've tried but might be possible.

Could you please explain the LahmanID and PlayerID formats?

The files in OOTP use the lahmanID but call it playerID. That is the common key to all the .csv files. So aaronha01 is Hank Aaron. Now if I want him to be Tom Cruise, I leave the ID the same and change his name to Tom Cruise in the Master file. If you want Hank Aaron to play in 1920, then you change the DOB, DOD, debut year and last year in the master file and the season data for aaronha01 in the Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2 files. (you need a working tab on a spreadsheet which will handle all the yearly computations).




Clearly, you back up the original files before you start any of this. I actually add folders into the Stats folder so I can change where I am pointing, depending upon what league or format I'm trying.

The other consideration could be photos depending upon what you are trying to do.

As I indicated, I would need more detail on what you are trying to accomplish before I could produce a step by step instruction.

Hope that helps a little. Drop me a note and will be gled to work with you on your project.
__________________
Commish of the Home Nations Baseball Association
Commish of the Baseball Association League
Commish of the League of WAR
Commish of the On-Line Dynasty League
SIMBL2 - Westbury Cannons
Great Lakes Baseball - Toledo Neptunes
World Baseball - Guantanamo Marines
OMLB - Cincinnati Reds

Last edited by Bristolduke; 12-24-2009 at 07:54 AM.
Bristolduke is offline   Reply With Quote
Old 12-24-2009, 05:38 PM   #3
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Bristolduke,

Thank you VERY much for your help! I'm sure this will be a great resource for information on this subject, not just for me, but for others interested in setting up fictional databases.

Actually, I just have a few more quick questions and I should have all the info I need. E-mail may not even be necessary.

First, I'll respond to your question below to help better understand what I'm trying to do.

Quote:
I do different historical set ups. It would be helpful to know exactly what you are trying to accomplish as that could affect the approach.
I'm hoping to utilize historical databases for two projects.

As was suggested to me in another thread, I'd like to try using it to set up my "interstate" league that was one of the Most Creative League Idea contest winners. It uses real MLB players who play for their state of birth. Now, I'm assuming this could probably be done with the standard Lahman database, so I don't necessarily need to use an altered database for it.

The second is my own fictional league with made-up teams, stadiums, players... pretty much everything fictional. I'd like to try two things with this league: 1) Importing all the players into the league during a single season and 2) Importing the bulk of players in the first year and then have a handful of pre-created rookies join the league each subsequent year for about 10 years. (If you need any more info about these leagues, just let me know.)

Quote:
FIRST, you must be knowledgeable of Excel or simlar spreadsheet program. Two, you need the newer version of Excel (Office 7) which will accomodate more that 65,000 rows.
Check and check.

Quote:
You will use all the fields in Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2.
Since I'm thinking of starting the league in the first year of import (i.e. players would theoretically have no accumulated stats yet), would it be okay to leave the statistical fields blank or just insert a 0?

Quote:
Within Master, I leave all the fields alone except the ones I want to change. These are usually year of Birth, year of death, debut Year, last year.
So how does OOTP use some of this data? Year of birth, debut year, last year, etc. are obvious, but what about stuff like year/place of death, college, or state of birth? Will they show up somehow in the player's history or is this info just vaporized upon import?

Quote:
The files in OOTP use the lahmanID but call it playerID. That is the common key to all the .csv files. So aaronha01 is Hank Aaron. Now if I want him to be Tom Cruise, I leave the ID the same and change his name to Tom Cruise in the Master file. If you want Hank Aaron to play in 1920, then you change the DOB, DOD, debut year and last year in the master file and the season data for aaronha01 in the Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2 files.
Okay, let me see if I've got this straight. I was going by the fields in the master.csv when refering to the LahmanID and PlayerID. In the master.csv, the LahmanID is just a conventional number, like 1, 2, 3, 15, 25, 100, etc., while the PlayerID is the one in the "aaronha01" format. So does the LahmanID have to correspond with the PlayerID or does it matter? And I assume that the PlayerID must match an existing PlayerID and can't be a newly-created one, regardless of format. In other words, OOTP wouldn't recognize a new PlayerID like "cruiset01", right?

Quote:
(you need a working tab on a spreadsheet which will handle all the yearly computations).
I'm very confused about this statement. I have a basic knowledge of Excel, but I mainly use it for data entry, so I don't do that much calculating with it. Could you please elaborate on this a little?

Again, your response is immensely appreciated! I learned more from your above answers than I did from reading the manual and about 50 threads last night, plus nearly 10 years of OOTP experience. I'm confident that if you're able to answer my follow-up questions, I'll have all the info I need to successfully accomplish my goal.
Muzamba is offline   Reply With Quote
Old 12-24-2009, 09:14 PM   #4
jtb
All Star Reserve
 
jtb's Avatar
 
Join Date: Apr 2002
Posts: 596
I remember seeing a mod for a fictional database years ago---it might of been OOTP 4 or 5. I don't know if anyone would still have this file.
jtb is offline   Reply With Quote
Old 12-24-2009, 09:19 PM   #5
jtb
All Star Reserve
 
jtb's Avatar
 
Join Date: Apr 2002
Posts: 596
Now I remember, Ctorg created a fictional database. It must of been about 5 years ago or so. I doubt it would work with X, but you never know.
jtb is offline   Reply With Quote
Old 12-24-2009, 09:26 PM   #6
Spritze
OOTP Historical Czar
 
Spritze's Avatar
 
Join Date: Dec 2001
Location: Bothell Wa
Posts: 7,254
Quote:
Originally Posted by Muzamba View Post
And I assume that the PlayerID must match an existing PlayerID and can't be a newly-created one, regardless of format. In other words, OOTP wouldn't recognize a new PlayerID like "cruiset01", right?
Wrong, you can make up any new ID's you wish, the onliest rule is end with 2 numbers (dos numeroski's in russian). So bob74 is valid as is banana14 or spritzbu81.
Spritze is offline   Reply With Quote
Old 12-24-2009, 09:32 PM   #7
Spritze
OOTP Historical Czar
 
Spritze's Avatar
 
Join Date: Dec 2001
Location: Bothell Wa
Posts: 7,254
Quote:
Originally Posted by Muzamba View Post
So how does OOTP use some of this data? Year of birth, debut year, last year, etc. are obvious, but what about stuff like year/place of death, college, or state of birth? Will they show up somehow in the player's history or is this info just vaporized upon import?
State of Birthing is used as are Nicknames and other demographics data and but some fields are disused but even so must exist in the file so you cannot vaporize any fields but you can leave lots of them blank.
Spritze is offline   Reply With Quote
Old 12-24-2009, 09:38 PM   #8
Spritze
OOTP Historical Czar
 
Spritze's Avatar
 
Join Date: Dec 2001
Location: Bothell Wa
Posts: 7,254
Quote:
Originally Posted by Muzamba View Post
Since I'm thinking of starting the league in the first year of import (i.e. players would theoretically have no accumulated stats yet), would it be okay to leave the statistical fields blank or just insert a 0?
If you do that then do not attempt to use the historical recalc function and also be aware that zero players will play like their historical counter-parts. You will just be using the names in the master.csv to name fictional players with real player names.
Spritze is offline   Reply With Quote
Old 12-24-2009, 10:06 PM   #9
Bristolduke
All Star Starter
 
Join Date: May 2006
Posts: 1,404
My apologies in advance here. I am at my daughter's house for the next several days so I won't always be on and my files are back on my computer at home.

I'm still a little fuzzy on what you mean by "fictional historical database' based upon the description of your projects. The process I'm referring to assumes that the one wants to use player history of baseball to create their universe (e.g a universe based upon csv files). That may be random arrivals, different player names, different arrivals, different teams but that someone will have the data of Hank Aaron. You might use recalc, you may import only on on rookie year, or on career year. You may want historical data or you may want neutralized data. But the root of the data is the major league data.

You could augment this data with your own players, but we are talking a lot or work.


I say this because the csv files are only used when you create a 'historical' league. Thus you must have a set of csv files to 'import' both at start of season and during your universe. So when you say you want to import all the players into a single season, that's 17,839 players. Just seems odd.

If this is a fantasy league where you are trying to import a few selected players. I think there was a thread on that which basically said as slow as it would be, the easiest method is to import them 1 player at a time. It might be the only way as well, because a 'fictional' league doesn't use the csv files for player creation.


That being said a couple of more general items.

1) Excel expertise required would be IF statements, RND function and the VLOOKUP function. Also, you may need pivot tables for your states project (more on that later).

2) Files, structure and why.

I would create a folder in your 'data/stats' folder for each lwague you want to try. Call it 'States' or 'my league' or what ever. Copy all the file in the stats folder into each new folder. While you don't need to modify all the files, I find that if you leave all the file a program expects to see the software works better. Then in each new folder delete the historical_database.odb file. This file is a pre-compiled version of the csv files. The system will use that file if present, regardless of changes you make to the csv files. By deleting it you force the system to use your csv files.

WHY
I've spent 40 years in software and what appears logical to you may not be logical to the developer. It is always easier to leave things as they expect. Two expamples. When I did my first change in OOTP2007, I modified the Master, batting, pitching, fielding, fieldingof, after all this was the player data. Well, it didnt work and everyone indicated that it should be working and kept referring to the fact that I must have made an error in conversion. As soon as I added the team file to the folder, it worked. Didn't change the team file, just copied it. The same happened in X after patch 2. I took my working databases modified the pitcher data in the master file and suddenly they didn't work. After many questions and no responses, I stumbled on a thread that referenced that you had to include the new uninumber file. Sure enough, add the file and everything worked.


So my approach is to always include complete files. I'll change the data at will, but all the files and their structure stays the sane. One may think that you only need to change this data or that data, but the software doesn't tend to work that way. I should point out, that doesn't mean the software is broken, it just is what it is. It was developed to requirements which didn't say the end user can create any set of files he or she wishes.
__________________
Commish of the Home Nations Baseball Association
Commish of the Baseball Association League
Commish of the League of WAR
Commish of the On-Line Dynasty League
SIMBL2 - Westbury Cannons
Great Lakes Baseball - Toledo Neptunes
World Baseball - Guantanamo Marines
OMLB - Cincinnati Reds
Bristolduke is offline   Reply With Quote
Old 12-24-2009, 10:43 PM   #10
Bristolduke
All Star Starter
 
Join Date: May 2006
Posts: 1,404
Saw that Spritze replied while I was typing. He stated some of the same 'constraints' I hadn't gotten to the data, but it is consistent with what I was saying about structure. It doesn't matter if it is used or not. "Leave it be" just include it in the modified csv files.

So let's get stated a bit.

You should move have all the original data in the data/stats folder. You have a new folder called states with all the origincal files copied in and the .odb file deleted. You have another folder called 'my project' with all the original files copied in and the .odb file delete. When you create you universe, you will point to the appropriate master.csv.

So if you are doing a normal historical league you would point to ....../data/stats/master.csv.

If you are setting up your states league you would point to ......data/stats/states/master.csv

etc.

This is how you can have multiple databases within OOTP. at the same time.


Now it is important to realize that these must be .csv files NOT excel files. We will be modifying these files in Excel but we need to put them back as .csv files. The technique I use for that is to create my excel working files and then copy and paste particular columns back to the .csv files and ensure the save is still in .csv format.

So lets create a folder in My Douments called OOTP conversion (it can be called anything.). We will do our excel work in this folder and then copy the data into (one column at a time) into the csv files in either our states folder or my project folder. DO NOT UPDATE the original files.

So copy these files from the data/stats folder to you my docs/OOTP conversion folder
Master, Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2, teams

You now have backups if you need them.

I think Spritze answered your questions other than my comment of a working spreadsheet, which we will get to.

I sense we have two distinct project here, so the steps may vary.

States project

How do you intend to start the states league. Clearly some states have more players than others. Do you know the player distribution by state. Do you know the arrival by year by state? Are you even sure each state can produce a 25-man roster each season? If not then you have some analysis to do (This is where pivot table expertise will come in very handy). The first thing you need to know is number of player per state. Use Birth State to determine this. I am fairly confident Rhode Island will be hard pressed to consistently field a team. To to this copy the master.csv data into a blank excel spreadsheet and run a pivot table on the entire table organizing on birth state.

I suspect you may be left with a grouping of states and you will need that definition inorder to proceeed with player groupings.

My Project

I am not sure how you are thinking of adding players. The first season to add is 1871. If you are looking to start with another season, say 1950, is it your intent to add in year sequence (e.g. 1950, 1951, 1952, etc.) or do you have some other order in mind? Are you planning on importing all the players (incluing the cup of coffee guys) or do you have a filter in mind of 'significant' players.

As much specificity as possible on both projects will help.

I need to run tonight. I can talk about the basic set up of your working sheet tomorrow, but I would like to know your specific expectations.

Think of your working sheet as having copied each of the Master, Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2 files into tabs of one sheet. We will delete some columns, but that will depend on what we are trying to accomplish. You will than have a tab that holds the releationship of the data with the playerID key. That relationship will be used to create you new data for a particular column which you will then copy back to the csv files in your unique folder.

Depending on the size of your computer, we may have to break this up into separate files. I have a dual core 4GB machine and it does crunch a bit.

Hope this is still helpful.
__________________
Commish of the Home Nations Baseball Association
Commish of the Baseball Association League
Commish of the League of WAR
Commish of the On-Line Dynasty League
SIMBL2 - Westbury Cannons
Great Lakes Baseball - Toledo Neptunes
World Baseball - Guantanamo Marines
OMLB - Cincinnati Reds
Bristolduke is offline   Reply With Quote
Old 12-26-2009, 01:43 AM   #11
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Quote:
Originally Posted by jtb View Post
Now I remember, Ctorg created a fictional database. It must of been about 5 years ago or so. I doubt it would work with X, but you never know.
I do have a copy of ctorg's database that I've been comparing and contrasting to the Lahman database to try and understand how they worked, but I still wasn't able get it all figured out.
Muzamba is offline   Reply With Quote
Old 12-26-2009, 02:05 AM   #12
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Quote:
Originally Posted by Spritze View Post
Wrong, you can make up any new ID's you wish, the onliest rule is end with 2 numbers (dos numeroski's in russian). So bob74 is valid as is banana14 or spritzbu81.
Cool. I may or may not bother to change the original Player ID's in Lahman, but it's good to know I can. (Might make them easier to locate, but not sure if it's worth all the extra work to change them.)

Quote:
State of Birthing is used as are Nicknames and other demographics data and but some fields are disused but even so must exist in the file so you cannot vaporize any fields but you can leave lots of them blank.
Hmmm. Would be interesting to know this one. I wonder if it shows up in exported csv reports or data dumps? Btw, I'm glad the state info gets imported, but I guess since I'm using a "states-as-nations" nation database, it probably doesn't serve me much purpose.

Quote:
If you do that then do not attempt to use the historical recalc function...
Showing my historical newbiness here, but I'm not sure if I even understand the whole "historical recalc" concept.

Quote:
...and also be aware that zero players will play like their historical counter-parts.
For my fictional league, this is perfect, since I'm not actually interested in using any real players anyway (although I may leave the HoF'ers in.)

Quote:
You will just be using the names in the master.csv to name fictional players with real player names.
OK, wait. Are you saying that if I change the real names that are currently in the master.csv to fictional names, then the REAL NAMES will show up in the game or the FICTIONAL ones? (I'm hoping you mean the fictional names will, because that's really the main thing I'm wanting to do with all of this.)
Muzamba is offline   Reply With Quote
Old 12-26-2009, 02:49 AM   #13
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Quote:
Originally Posted by Bristolduke View Post
My apologies in advance here. I am at my daughter's house for the next several days so I won't always be on and my files are back on my computer at home.
No problem! I'm extremely grateful for any and all help you're able to provide.

Quote:
I'm still a little fuzzy on what you mean by "fictional historical database' based upon the description of your projects.
I'm not sure if the "fictional historical database' label I'm giving this is accurate or not.

The historical aspect, at least in terms of the real-life history of baseball, is relatively unimportant to my purposes. As I said in my response to Spritze above, I may end up importing real Hall of Famers to be included in my fictional league, but that's really the only "real" history I'm interested in for this project.

So when I use the term "historical" in describing a database, I'm talking more about the format that allows you to bring pre-existing (albeit fictional) rookies into the league each year. In other words, I want to start out with a brand new fictional league with no previous history or real players. I begin my league with, say, 2200 players in the initial season and then have a new batch of 120 players automatically imported as rookies the following year, and another 120 the year after that, and so on until I run out. (At that point, I either go on with game-generated rookies or discontinue my league.)

Now, having said all this, the ability to import pre-created rookies each season is only of secondary importance. It would be neat to try it this way, but I wouldn't be too disappointed if I couldn't, since I could always manually edit my amateur draft class each year and get the same results.

In fact, I may not even be dabbling with historical leagues at all if weren't for one primary issue: There's no way to import player names into a standard custom league via the Export/Import Rosters function. This is particularly the case with my "interstate" league. I already have the mlb_rosters.txt file altered that I exported from the MLB quickstart, but when I re-import them, everything shows up correctly except the players' names. And since I really didn't want to have to resort to manually changing 4000+ names in-game--especially after all the other work I'd done on the file--it sounded like using the historical league format may be the simplest way to get the names into the game.

So I'm not trying to import all the players in the original database at once, nor am I trying to import selected fantasy players. I'm almost exclusively going to be using fictional players I've already created.

(Sorry, I know this is probably confusing, since I'm talking about two entirely different types of leagues here.)

Quote:
That being said a couple of more general items.

1) Excel expertise required would be IF statements, RND function and the VLOOKUP function. Also, you may need pivot tables for your states project (more on that later).

2) Files, structure and why.

I would create a folder in your 'data/stats' folder for each lwague you want to try. Call it 'States' or 'my league' or what ever. Copy all the file in the stats folder into each new folder. While you don't need to modify all the files, I find that if you leave all the file a program expects to see the software works better. Then in each new folder delete the historical_database.odb file. This file is a pre-compiled version of the csv files. The system will use that file if present, regardless of changes you make to the csv files. By deleting it you force the system to use your csv files.

WHY
I've spent 40 years in software and what appears logical to you may not be logical to the developer. It is always easier to leave things as they expect. Two expamples. When I did my first change in OOTP2007, I modified the Master, batting, pitching, fielding, fieldingof, after all this was the player data. Well, it didnt work and everyone indicated that it should be working and kept referring to the fact that I must have made an error in conversion. As soon as I added the team file to the folder, it worked. Didn't change the team file, just copied it. The same happened in X after patch 2. I took my working databases modified the pitcher data in the master file and suddenly they didn't work. After many questions and no responses, I stumbled on a thread that referenced that you had to include the new uninumber file. Sure enough, add the file and everything worked.


So my approach is to always include complete files. I'll change the data at will, but all the files and their structure stays the sane. One may think that you only need to change this data or that data, but the software doesn't tend to work that way. I should point out, that doesn't mean the software is broken, it just is what it is. It was developed to requirements which didn't say the end user can create any set of files he or she wishes.
Aha! This is all very good info to know. You bring up a lot of points I never would have known or thought about.

Thank you again for taking the time to help me out, especially on a holiday! It is greatly appreciated.

(Read on... I have an idea I want to run by you in the next post and I want to see if you think it'll work.)
Muzamba is offline   Reply With Quote
Old 12-26-2009, 03:30 AM   #14
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Ok, Bristolduke, Spritze, or anyone else...

This is for my "interstate" league, which uses appx. 4000 real-life American MLB and minor league players playing for their respective state of birth (each state having its own team)

Before I start, keep in mind that I'm using altered nations.txt and cities.txt databases when I create the new league. I have already exported the mlb_rosters.txt file from the MLB quickstart and adjusted the nation, city, and team ID codes for each player.

Here's what I'm going to attempt. Please tell me if you think this will work:

1. I make a copy of the Lahman dB's master.csv file, open up the copy, and cut out all but the top ~4000 lines (matching the number of players I'll be using in this league)
2. I copy all the players' first/last names in the mlb_rosters.txt and paste them over the remaining players' first/last names in the Lahman Copy master.csv.
3. I give each player a debut year of 2010.
4. I fill in all the necessary fields in the Lahman Copy dB's teams.csv to create the league structure.
5. I enter "0"s for every data field and either fill in or copy/paste any necessary text in the Lahman Copy dB .csv files (and of course save them all)
6. I open OOTPX and create a new custom game. Once loaded, I add a new Historical Major League, select the Lahman Copy master.csv, choose my league options (including a Season Year of 2010), and click Import League.
7. Once imported, I go to the Game/League Setup screen and click Export Rosters. (We'll label the exported file "LCDB_rosters.txt" to avoid confusion.)
8. I change both the old mlb_rosters.txt and the new LCDB_rosters.txt files to .csv files and open them each side by side on my screen.
9. I sort the players in both files alphabetically, then copy the Player ID's in the LCDB_rosters file over those in the mlb_rosters file. I then make the proper formatting adjustments and save mlb_rosters.
10. Finally, I go back to Game/League Setup, click Import Rosters, and re-import mlb_rosters.

So if I've done this all correctly, wouldn't all my players now show up in the game with their new teams and with their ratings and stats intact?

Last edited by Muzamba; 12-26-2009 at 03:34 AM.
Muzamba is offline   Reply With Quote
Old 12-26-2009, 07:59 AM   #15
Bristolduke
All Star Starter
 
Join Date: May 2006
Posts: 1,404
I still have questions but will try to address the plan. I'll defer to Spritze on the internal workings of the sim on using the DB, so what I'll say may not be the only way to approach the problem and may have incorrect assumptions.

I am assuming you want the 4000 real life players to stay real life. Are you anticipating that they will perform similar to real life or are you only using their names? (what follows below is true regardless, just looking for clarification)

So let me see if I have this correct?

You are going to start a universe in 2010 which has a league structure based upon states and the players will play for those states. This may include all 4000 at year 1 or a smaller sub set, but the others would come in later. You have a roster set you intend to import after you create the league (I’ve never done this myself, but I don’t see any inherent problem here).


Looking at the approach you outlined, I don't think your approach will work because, if you are importing players from the csv files the year you are importing must match ALL the csv files. So you can't just change the debut year in master.csv. In fact I'm not sure the game uses debut year in importing. I use it to control the modifications for all the other files.

When the sim imports an historical player, it pulls the data from Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2. So all these csv files must match. Therefore the sim is looking for Aaron in 2010 in all the files, which of course he isn’t, if all you change is debut year. I don’t believe the sim will then import the player.

You are correct in your step 9 and it is a step I would do now. Take you real-life players and find their PlayerIDs. You can do this a couple of ways. Take you first name/last name from your roster file and use that as a lookup table for the master.csv file. Second would be to create the ID yourself and compare it to the master file and find the ones that don’t match and correct them manually. The formula for the player ID is first 5 characters of last name + first two characters of first name + sequence number (01-99). The seq numbers is used when the first 7 characters are the same. You could default 01 to start and will find most of your players that way.

Once you have matched your rosters to PlayerIDs, then we can work thru the other details. I believe you are going to have to change all the statistical files to make your plan work.
__________________
Commish of the Home Nations Baseball Association
Commish of the Baseball Association League
Commish of the League of WAR
Commish of the On-Line Dynasty League
SIMBL2 - Westbury Cannons
Great Lakes Baseball - Toledo Neptunes
World Baseball - Guantanamo Marines
OMLB - Cincinnati Reds

Last edited by Bristolduke; 12-26-2009 at 08:01 AM.
Bristolduke is offline   Reply With Quote
Old 12-26-2009, 08:55 AM   #16
Bristolduke
All Star Starter
 
Join Date: May 2006
Posts: 1,404
Quote:

Quote: You will just be using the names in the master.csv to name fictional players with real player names.
You will just be using the names in the master.csv to name fictional players with real player names.

OK, wait. Are you saying that if I change the real names that are currently in the master.csv to fictional names, then the REAL NAMES will show up in the game or the FICTIONAL ones? (I'm hoping you mean the fictional names will, because that's really the main thing I'm wanting to do with all of this.)
Yes it should be the fictional.

So for example, you can change all the names in the master.csv file and you will have a players which can be generated off real data with "fictional names". This as opposed to a "fictional league" where the sim generates players each season.

So what I envison on your states league is that you could
1) randomize all the player names in the databases execpt for the 4000 you intend to use.
2) then create a set of csv files which start in 2010 with 4000 and import the rest of the fictional players using the rest of the database with their fictional names, at so many per season (200, 300 whatever.)
__________________
Commish of the Home Nations Baseball Association
Commish of the Baseball Association League
Commish of the League of WAR
Commish of the On-Line Dynasty League
SIMBL2 - Westbury Cannons
Great Lakes Baseball - Toledo Neptunes
World Baseball - Guantanamo Marines
OMLB - Cincinnati Reds

Last edited by Bristolduke; 12-26-2009 at 10:43 AM.
Bristolduke is offline   Reply With Quote
Old 12-26-2009, 10:55 AM   #17
Bristolduke
All Star Starter
 
Join Date: May 2006
Posts: 1,404
Sorry to be doing this in pieces, but I need the grandkids to slow down enough for me to think and then type.

You indicated that you had changed the Teams.csv. I think you will need to change the teamfranch csv as well. With those changes made, you may not need your roster file but rather the sim may be able to pull the rosters automatically (after you have changed the database). I've done this for a league, but missed the teamfranch relationship and need for a full league structure. I ended up having an initial draft instead, but the data came across as I wanted.

TeamID would then be another key field around which the import works.

Do you have any fictional names you want to use? Is there any logic associated with them (e.g. pitchers, 1B, power hitter, you already have stats generated, etc)? How many leagues are in your universe, how many minors and how many new players per year do you need? How many seasons are you projecting you will run of your universe?
__________________
Commish of the Home Nations Baseball Association
Commish of the Baseball Association League
Commish of the League of WAR
Commish of the On-Line Dynasty League
SIMBL2 - Westbury Cannons
Great Lakes Baseball - Toledo Neptunes
World Baseball - Guantanamo Marines
OMLB - Cincinnati Reds
Bristolduke is offline   Reply With Quote
Old 12-27-2009, 04:45 PM   #18
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Bristolduke,

Continued thanks for taking the time to help me with this. Let me catch you up on what I've tried so far.

Before you responded, I had already begun editing the database in order to attempt an import using the method I described. I figured I could always revert back to the unaltered files if it didn't work. So after you responded that you didn't think it would work, I changed and switched back a few things based on what you said and attempted an import.

Not surprisingly, it didn't work. Of course, I didn't really expect it to, since these things never work for me on the first attempt.

However, as I started working my way back to see where I might have messed up, I found that no matter what I restored to the original, it still wouldn't work. Finally, I tried using the standard unaltered Lahman dB. To my chagrin, it didn't work either!

That's when I realized the problem. I restored my nations and cities database files back to the defaults and... voila! Successful import!

And so it seems historical databases don't want to work with different nations/cities database files. At least that's my read on it. I can't really understand why it would be a problem, though, as the Lahman dB files don't seem to use the nation/city ID codes that OOTP does.

Have you ever attempted a historical dB import with altered nations/cities database files?

So now I'm left wondering if all of this was for naught. If I can't get an import to work using my altered nations/cities databases, I don't see how I can accomplish what I'm trying to do using the historical league format.

You're absolutely right about the temperament of software! I'm not seeing the logic in the programming here. LOL

Anyway, I guess I'll keep plugging along until someone convinces me this is an exercise in futility and a complete waste of time.

Muzamba is offline   Reply With Quote
Old 12-27-2009, 05:41 PM   #19
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
I'm gonna go through this one point at a time to make sure I'm at least on the right track.

Btw, I'm applying all of this to my "interstate" league for now.

Quote:
I am assuming you want the 4000 real life players to stay real life. Are you anticipating that they will perform similar to real life or are you only using their names? (what follows below is true regardless, just looking for clarification)
Yes, I want the 4000 real life players to act/play like they would in real life.

Quote:
You are going to start a universe in 2010 which has a league structure based upon states and the players will play for those states. This may include all 4000 at year 1
Yes, this part is correct.

Quote:
...but the others would come in later. You have a roster set you intend to import after you create the league
Actually, I was just looking to do a one-time import.

This may be where some of the confusion is coming from. For my other project (my fictional league) I would be importing new players each year. However, for this (interstate) league, I'm really only using the "historical league" format as a workaround to get the names into the game. That's why in the 10-step method I described earlier, I'm using the Export/Import Rosters function. In other words, I don't need or even necessarily want the interstate league to work like a typical historical league. I simply want to get names in, which I can't do using just the Import Rosters function by itself. In subsequent seasons, I'd prefer to just have fictional rookies generated to populate the amateur draft.

Quote:
Looking at the approach you outlined, I don't think your approach will work because, if you are importing players from the csv files the year you are importing must match ALL the csv files. So you can't just change the debut year in master.csv. In fact I'm not sure the game uses debut year in importing. I use it to control the modifications for all the other files.

When the sim imports an historical player, it pulls the data from Batting, Pitching, Fielding, FieldingOF, Batting2, Pitching2, Fielding2, fieldiingOF2. So all these csv files must match. Therefore the sim is looking for Aaron in 2010 in all the files, which of course he isn’t, if all you change is debut year. I don’t believe the sim will then import the player.
Okay, but what if I change the years in each of the dB files to 2010? If I tell the game to start the league in 2010 during setup, shouldn't it recognize the year 2010 in the dB files and import all the players with info for 2010?

Quote:
You are correct in your step 9 and it is a step I would do now. Take you real-life players and find their PlayerIDs. You can do this a couple of ways. Take you first name/last name from your roster file and use that as a lookup table for the master.csv file. Second would be to create the ID yourself and compare it to the master file and find the ones that don’t match and correct them manually. The formula for the player ID is first 5 characters of last name + first two characters of first name + sequence number (01-99). The seq numbers is used when the first 7 characters are the same. You could default 01 to start and will find most of your players that way.
I think I did this correctly, although I didn't bother to change any of the Player IDs. So "aaronha01" is actually David Aardsma, I believe. I think this is what Spritze was saying, as well, that it doesn't matter what the ID is as long as it's formatted correctly.

I should also clarify here that when I refer to "Player ID" in Step 9 of my process, it's not the same as the Lahman dB Player ID. It's the OOTP Player ID that's used in the Export/Import Rosters file. (Man, this gets confusing! ) So when I'm talking about copying the Player IDs over from the old roster file to the new one, it's a different number. (I think this ID is based on the order the players are generated in the game.)

Quote:
Once you have matched your rosters to PlayerIDs, then we can work thru the other details. I believe you are going to have to change all the statistical files to make your plan work.
As I mentioned when describing my process, I went through and changed all the statistical fields within the necessary files (Batting, Pitching, Fielding, Batting2, etc.) to "0"s. In any column where there were already blank cells, I just cleared the contents of the entire column, since I assumed no data was necessary in these cells.

However, it also occured to me that since most of this data would theoretically be overwritten when I imported the new roster files, maybe it was unnecessary and perhaps I should have just left it alone.
Muzamba is offline   Reply With Quote
Old 12-27-2009, 05:49 PM   #20
Muzamba
Hall Of Famer
 
Muzamba's Avatar
 
Join Date: Apr 2002
Location: St. Louis, MO
Posts: 2,325
Quote:
Originally Posted by Bristolduke View Post
Yes it should be the fictional.

So for example, you can change all the names in the master.csv file and you will have a players which can be generated off real data with "fictional names". This as opposed to a "fictional league" where the sim generates players each season.

So what I envison on your states league is that you could
1) randomize all the player names in the databases execpt for the 4000 you intend to use.
2) then create a set of csv files which start in 2010 with 4000 and import the rest of the fictional players using the rest of the database with their fictional names, at so many per season (200, 300 whatever.)
Here's an important question I may be neglecting to ask: Is it necessary to keep all the players (lines) in a historical database? Will the database not import correctly if I only have the 4000 players in it?

Because if I'm understanding you correctly, it sounds like I need to leave them all in, but I can change their names to whatever so I have "fictional" players imported in subsequent years instead of real historical players.
Muzamba is offline   Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:11 AM.

 

Major League and Minor League Baseball trademarks and copyrights are used with permission of Major League Baseball. Visit MLB.com and MiLB.com.

Officially Licensed Product – MLB Players, Inc.

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.

COPYRIGHT © 2023 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright © 2020 Out of the Park Developments