|
||||
| ||||
|
|||||||
| Earlier versions of OOTP: General Discussions General chat about the game... |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Major Leagues
Join Date: Mar 2003
Posts: 453
|
How Was OOTP6 Made?
I was curious as to how the Out Of The Park games are made. I know NOTHING about programming games and was wondering how exactly it is done. Is it sort of a "drag and drop" type thing..or is it a bunch of numbers...or what?
Anyone know? |
|
|
|
|
|
#2 |
|
Hall Of Famer
Join Date: Apr 2002
Location: Ft Smith Ark. USA
Posts: 2,681
|
question
You seem to be asking, in part, what computer language the game is programmed in.
|
|
|
|
|
|
#3 |
|
Administrator
Join Date: Jul 1999
Location: S.E. TN - Georgia born and raised
Posts: 17,023
|
C++ primarily, though some others maybe used in areas.
__________________
Steve Kuffrey DABS Atlanta Braves - 2008 Eastern Division Champ *DBLC Atlanta Braves - 2011, 2014 East Division Champ, 2012, 2013 NL Wildcard Baseball Maelstrom-Montreal Expos-2013 Tourney winner, 2014 WC Team Sparky's League - Tampa Bay D'Rays Epicenter Baseball League - Astros 2014 The CBL Rewind - Phillies '95 |
|
|
|
|
|
#4 |
|
Hall Of Famer
Join Date: Mar 2002
Posts: 3,765
|
Sugar, Spice and everything nice...that's what OOTP is made of.
|
|
|
|
|
|
#5 |
|
Major Leagues
Join Date: Mar 2003
Posts: 453
|
I figuredit was written in C++...but what i wanted to know is how exactly does that work? I mean how,for instance,do you get the menu screen up...how do you get the names to be in the right places...etc...is Markus just looking at numbers to design it all...or is there some sort of method I'm not aware of.
I'm not asking for the secrets or anything...I was just curious as to how building a game like OOTP is done. |
|
|
|
|
|
#6 | |
|
Hall Of Famer
Join Date: Mar 2004
Location: Cleveland, Ohio
Posts: 2,251
|
If you're interested, and excellent and fairly comprehensive book would be C++: How to Program by Deitel and Deitel. It's long, but very accessible. C++ is what's called a "high level language," meaning that the symbols used are comprehensible by humans, although the sytax will be quite foreign to the uninitiated.
C++ is also an object-oriented programming language, as opposed to a procedural oriented programming language. What this means is that instead of someone sitting down and starting from fresh every time they want to make a program, they start out with a standard library of "classes" to use, and can add more "books" as they go. A better metaphor might be art: suppose you're wanting to paint a landscape. Instead of starting with a blank canvas, you can use a collection of pre-made mountains, hills, trees, and streams. Each of these would be a "class" that is located within the library. When you've made your basic painting, you can then go in and customize it to your liking. Hopefully this makes sense. - Dan
__________________
GM's RULE!!!!! Quote:
|
|
|
|
|
|
|
#7 |
|
Minors (Single A)
Join Date: Apr 2004
Posts: 93
|
very interesting
__________________
Just for the record: I'm a Reds fan |
|
|
|
|
|
#8 |
|
Hall Of Famer
Join Date: Apr 2002
Location: Ft Smith Ark. USA
Posts: 2,681
|
eff
How efficient are these classes? Can you make your own?
|
|
|
|
|
|
#9 | |
|
Hall Of Famer
Join Date: Mar 2004
Location: Cleveland, Ohio
Posts: 2,251
|
Yes, you can make your own. There's a "standard library" - going back to the book metaphor, consider it a collection of classics: Shakespeare, Dickens, etc.. Every person's library can take in new books - either written by that same individual, or gathered from other collections. Incidentally, this is one of the great things about OOTP joining SI: their classes may not work seamlessly with OOTP, but it gives Markus a chance to see what might be possibly incorporated into OOTP, and visa-versa.
As for efficiency, the standard library is fairly well optimized. However, there are a great many different ways to accomplish the same tasks. One person's version of a class is not always equal to another's. That's why some programmers make the big bucks and others don't - there's a style, an actual art to it all.
__________________
GM's RULE!!!!! Quote:
|
|
|
|
|
|
|
#10 |
|
Administrator
Join Date: Jul 1999
Location: S.E. TN - Georgia born and raised
Posts: 17,023
|
Dan has given you the basic idea, I'm not a programmer so not real sure.
__________________
Steve Kuffrey DABS Atlanta Braves - 2008 Eastern Division Champ *DBLC Atlanta Braves - 2011, 2014 East Division Champ, 2012, 2013 NL Wildcard Baseball Maelstrom-Montreal Expos-2013 Tourney winner, 2014 WC Team Sparky's League - Tampa Bay D'Rays Epicenter Baseball League - Astros 2014 The CBL Rewind - Phillies '95 |
|
|
|
|
|
#11 |
|
Banned
Join Date: Dec 2001
Location: louisville
Posts: 14,941
Infractions: 0/2 (101)
|
Elves, but not North Pole elves, mean little German elves.
|
|
|
|
|
|
#12 |
|
Hall Of Famer
Join Date: Dec 2001
Location: In front of some barbecue and a cold beer
Posts: 9,490
|
Elves write really terrible code. Surely you mean dwarves.
__________________
Senior member of the OOTP boards/grizzled veteran/mod maker/surly bastage If you're playing pre-1947 American baseball, then the All-American Mod (a namefiles/ethnicites/nation/cities file pack) is for you. |
|
|
|
|
|
#13 |
|
Hall Of Famer
Join Date: Jan 2002
Location: Orlando, FL
Posts: 3,827
|
Elves and dwarves collaborate to make OOTP. Unfortunately, there are a number of trolls who attempt to ruin it.
__________________
"Read books, get brain." |
|
|
|
|
|
#14 | |
|
All Star Starter
Join Date: Apr 2004
Location: Not Here
Posts: 1,226
|
Quote:
I have always figured that Dwarves were good Hackers, seeing as how they like to use axes so much.
__________________
Beer Snob and Baseball Sim Geek |
|
|
|
|
|
|
#15 |
|
All Star Reserve
Join Date: Dec 2001
Location: Canada
Posts: 574
|
I`ve only dabbled in programming, but it is something quite difficult to learn and especially to master. Not only does the code need to do what it`s supposed to, it also has to be efficient. C++ isn`t really a beginner`s language, if you are interested in programming, a language like Visual Basic would be a better place to start (I think the freeware classic Eastside Hockey Manager used it).
|
|
|
|
|
|
#16 |
|
Hall of Fame
Join Date: Dec 2001
Posts: 6,498
|
Just for the curious, here's a sample of C++ coding....
/*............................ MY_TOOLS.C .................. 4-1-95 ........*/ /* A collection of commonly used code. */ /*................................................. .........................*/ #include<dos.h> #include<stdio.h> #include<stdlib.h> #include<math.h> #include<limits.h> #include<time.h> #include<bios.h> #define MYTLS_VARS #include<my_tools.h> #include<vsa.h> #include<tiff.h> float SINE_LUT[1024]; /*................................................. .........................*/ /* Initialize sin look up table. */ /* Index 'i' goes from 0 to 1023 and is equivalent to 0 to 360 degrees. */ /*................................................. .........................*/ /*..... for(i=0;i<1024;i++) SINE_LUT[i] = sin(i*6.28/1024.0); .....*/ void gray_lut(void) { int i,start,count; unsigned char color_array[768]; for(i=0;i<256;i++) { color_array[3*i] = i/4; color_array[3*i+1] = i/4; color_array[3*i+2] = i/4; } start = 0; count = 256; vsa_write_color_block(start,count,color_array); return; } /*.......................... TRUE_COLOR_LUT.C ............. 5-15-94 ........*/ /* This routine generates a 'true color' LUT. An 8 bit index into the LUT */ /* represents 3 bits of RED, 3 bits of GREEN, and 2 bits of BLUE. The */ /* 3 msbs of the 8 bit index are the RED field, next 3 are GREEN, and */ /* the 2 lsbs are the BLUE field. */ /*................................................. .........................*/ void true_color_lut(void) { int i; unsigned char color_array[768]; for(i=0;i<256;i++) { color_array[3*i+0]= ((i & 0x00e0) >> 5) * 9; color_array[3*i+1]= ((i & 0x001c) >> 2) * 9; color_array[3*i+2]= (i & 0x0003) * 21; } vsa_write_color_block(0,256,color_array); return; } /*..... End true_color_lut .....*/ void rainbow_lut(void) { int i,start,count; unsigned char color_array[768]; for(i=0;i<224;i++) { color_array[3*i+2]=0; color_array[3*i+1]=0; color_array[3*i]=0; } /*................................ RED .....................................*/ for(i=0;i<56;i++) { color_array[3*i] = 63*sin((i*6.28)/112.0); } /*............................... BLUE .....................................*/ for(i=0;i<126;i++) { color_array[3*i+2] = 63*sin((i*6.28)/252.0); } /*............................... GREEN ....................................*/ for(i=96;i<210;i++) { color_array[3*i+1] = 63*sin(((i-90)*6.28)/252.0); } /*................................ RED .....................................*/ for(i=140;i<224;i++) { color_array[3*i] = 63*sin(((i-140)*6.28)/280.0); } start = 32; count = 224; vsa_write_color_block(start,count,color_array); return; } void special_lut(void) { int i,start,count; unsigned char color_array[768]; for(i=0;i<256;i++) { color_array[3*i+2]=0; color_array[3*i+1]=0; color_array[3*i]=0; } /*............................... BLUE .....................................*/ for(i=0;i<128;i++) { color_array[3*i+2] = 63*sin((i*6.28)/256.0); } /*............................... GREEN ....................................*/ for(i=48;i<240;i++) { color_array[3*i+1] = 63*sin(((i-48)*6.28)/384.0); } /*................................ RED .....................................*/ for(i=128;i<256;i++) { color_array[3*i] = 63*sin(((i-128)*6.28)/512.0); } start = 0; count = 256; vsa_write_color_block(start,count,color_array); return; } /*.............................. SHADED_LUT.C ............. 2-25-96 ........*/ /* This routine generates a lookup table holding 8 primary colors with 32 */ /* shades of "gray" for each. */ /* */ /* COLOR | INDEX RANGE */ /* ----------------------- */ /* Gray | 0-31 */ /* Red | 32-63 */ /* Orange | 64-95 */ /* Yellow | 96-127 */ /* Green | 128-159 */ /* Auqa | 160-191 */ /* Blue | 192-223 */ /* Purple | 224-255 */ /*................................................. .........................*/ void shaded_lut(void) { int i,j; unsigned char color_array[768]; float r[8]={1.0,1.0,0.917,1.0,0.0,0.0,0.0,1.0}; float g[8]={1.0,0.0,0.436,1.0,1.0,1.0,0.0,0.0}; float b[8]={1.0,0.0,0.000,0.0,0.0,1.0,1.0,1.0}; float k; for(j=0;j<8;j++) { for(i=0;i<32;i++) { if(i < 12) k = pow((i/31.0),1.0); else k = pow((11/31.0),1.0) + 0.645*pow(((i-9.0)/(31.0-9.0)),3.0); color_array[3*i+96*j+0]= (int)(k*63*r[j] + 0.5); color_array[3*i+96*j+1]= (int)(k*63*g[j] + 0.5); color_array[3*i+96*j+2]= (int)(k*63*b[j] + 0.5); i=i; } } vsa_write_color_block(0,256,color_array); return; } /*..... End shaded_lut .....*/ void color_bar(x0,y0) int x0,y0; { int i; unsigned xx,yy,a,b; float c; xx = XResolution; yy = YResolution; /*................................................. .........................*/ /* Draw outline for color bar. */ /*................................................. .........................*/ vsa_set_color(15); vsa_move_to(x0-1,y0-1); a = .75*xx; b = .065*yy; vsa_rect(x0+a+1,y0+b+1); c = (float)a/256; for(i=0;i<256;i++) { vsa_set_color((unsigned char)i); vsa_move_to(x0+(unsigned)(i*c),y0); vsa_rect_fill(x0+(unsigned)(c+i*c),y0+b); } return; } void image(int x,int y) { int i,j; long ii,jj,z1,z2; unsigned char array[1024]; unsigned xx,yy,a,b; xx = XResolution; yy = YResolution; a = .4*xx; b = .26*yy; z1 = 2*1024L/a; z2 = 1024L/b; vsa_move_to(x-2,y-2); vsa_set_color(250); vsa_rect(x+a+1,y+b+1); for(j=0;j<b;j++) { for(i=0;i<a;i++) { ii = (i*z1) & 0x000003ff; jj = (j*z2+256) & 0x000003ff; /*..... array[i] = 144+112*sin(i*6.28/c)*cos(j*6.28/c); .....*/ array[i] = 144+112.0*(SINE_LUT[ii]*SINE_LUT[jj]); } vsa_raster_line(x,x+a-1,y+j,array); } return; } /*.............................. ANY_KEY.C ............... 10-25-94 ........*/ /* This routine returns a 0 if NO key has been pressed. If a key has been */ /* pressed, this routine returns the key's value. Whats special about */ /* this routine is that it doesn't stop execution, it always returns even */ /* if no key was entered. */ /*................................................. .........................*/ int any_key(void) { int result=0; #ifdef _MSC_VER /*..... For Microsoft C, Use this line. .....*/ if(_bios_keybrd(_KEYBRD_READY)) result = (_bios_keybrd(_KEYBRD_READ)) & 0xff; #else /*..... For Borland C, Use this line instead. .....*/ if(bioskey(1)) result = (bioskey(0)) & 0xff; #endif return result; } /*............................. TONE_GEN.C ................. 1-29-94 .......*/ /* Tone generator sets up a tone of frequency = 'freq' (valid range = 19 */ /* to 65535 Hz, 0 for silence). */ /*................................................. .........................*/ void tone_gen(unsigned freq) { unsigned control; /*................................................. .........................*/ /* Prepare timer by sending 10111100 to port 43, and read speaker value. */ /*................................................. .........................*/ outp( 0x43, 0xb6 ); /*................................................. .........................*/ /* Divide input frequency by timer ticks per second and write */ /* (byte by byte) to timer. Note: timer is 16 bits, 1193180/64k */ /* = approx 19 Hz. (this is the lowest meaningful frequency value). */ /*................................................. .........................*/ if(freq != 0) freq = (unsigned)(1193180L / freq); outp( 0x42, (char)freq ); outp( 0x42, (char)(freq >> 8) ); /*................................................. .........................*/ /* Get current speaker byte. Change 2 LSBs to 0x3 to turn on tone. */ /* Change 2 LSBs to --- to turn off. */ /*................................................. .........................*/ control = inp(0x61); if(freq > 0) outp(0x61,control | 0x03); else outp(0x61,control & 0xfd); return; } /*................................ DELAY.C ................. 1-29-94 .......*/ /* This routine waits 'delay' milliseconds and then returns. */ /*................................................. .........................*/ void delay(unsigned delay) { clock_t start_time,delta_time; if((delay*CLOCKS_PER_SEC) < 1000) return; delta_time = ((long)delay*(long)CLOCKS_PER_SEC)/1000L; start_time = clock(); while((clock()-start_time) < delta_time); return; } /*.............................. ASK_VIDEO ................. 4-1-95 ........*/ /* This routine takes care of asking for video mode. */ /*................................................. .........................*/ void ask_video() { int vmode,err; /*................................................. .........................*/ /* Initialize video mode and VSA256 environment. */ /* Valid modes are: 100h, 101h, 103h, and 105h. */ /*................................................. .........................*/ printf("\n"); printf("\n"); printf("VESA standard Video Modes => Mode | Resolution\n"); printf(" (256 color) -----|-----------\n"); printf(" 100 | 640 x 400\n"); printf(" 101 | 640 x 480\n"); printf(" 103 | 800 x 600\n"); printf(" 105 | 1024 x 768\n"); printf(" 107 | 1280 x 1024\n"); printf("Input Mode: "); scanf("%x",&vmode); if((err = vsa_init(vmode)) != 0) { printf("Error Initializing Requested Video Mode!\n"); if(err==1) printf(" - Did You Load Correct VESA Driver (TSR) ??\n"); if(err==2) printf(" - VESA BIOS Extensions (Driver) Not Loaded !!\n"); if(err==3) printf(" - Requested Video Mode Not Supported by this Card!\n"); if(err==4) printf(" - Mode Not an SVGA Mode Supported by this Card!\n"); if(err==5) printf(" - VESA Driver Not Returning Mode Information!\n"); exit(0); } return; } |
|
|
|
|
|
#17 |
|
Hall Of Famer
Join Date: May 2003
Posts: 2,968
|
From my old programming days (when C was just C, no stinking pluses, and Basic was just Basic, nothing visual about it) the beauty of C lay in it's ability to link databases and subroutines together with relatively little effort. You would create a shell of basic logic commands and fill the shell in with subroutines and databases that do all the dirty work for you.
__________________
"The type and formula of most schemes of philanthropy or humanitarianism is this: A and B put their heads together to decide what C shall be made to do for D. The radical vice of all these schemes, from a sociological point of view, is that C is not allowed a voice in the matter, and his position, character, and interests, as well as the ultimate effects on society through C's interests, are entirely overlooked. I call C the Forgotten Man" - William Graham Sumner |
|
|
|
|
|
#18 | |
|
Hall Of Famer
Join Date: Jan 2002
Location: Orlando, FL
Posts: 3,827
|
Quote:
__________________
"Read books, get brain." |
|
|
|
|
|
|
#19 | |
|
Global Moderator
Join Date: Nov 2002
Posts: 11,798
|
Quote:
-functional programming -structured programming -procedural programming -imperative programming -objects -functions -data structures -methods -variables I've read definitions of these before, but never understood them very well. Perhaps I will be able to using your metaphor. What paradigms and languages are probably the best right now? I assume each has its own pros and cons though. I only know VB, but not very well I'm afraid. It is procedural, correct? If it was OOP, how would it be different?
__________________
|
|
|
|
|
|
|
#20 | |
|
Hall of Fame
Join Date: Dec 2001
Posts: 6,498
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
|
|