1 /* params.hh 1.21 95/12/28 23:24:14 */
2 
3 
4 // xspacewarp by Greg Walker (gow@math.orst.edu)
5 
6 // This is free software. Non-profit redistribution and/or modification
7 // is allowed and welcome.
8 
9 
10 // this file contains most of the adjustable parameters used in the program
11 // for controlling speeds, lengths, locations, etc.
12 
13 #ifndef _PARAMS_
14 #define _PARAMS_
15 
16 // NOTE: parameters for controlling speeds of jovian attacks and jovian
17 // movement are defined in c_jovian_ai.hh
18 
19 
20 #define RANDMAX 32767L		// max value for rand(). probably most
21 				// generators go higher than this.
22 				// This value is used for generating
23 				// random numbers in [0,1].
24 
25 // millisec interval between jovian actions
26 #define JOVINT (unsigned long)app_data.jovian_action_speed
27 
28 // millisec interval for endever movement
29 #define MOVEINT (unsigned long)app_data.endever_thrust_speed
30 
31 // millisec interval for ship re-energizing
32 #define ERGINT (unsigned long)app_data.ship_energize_speed
33 
34 #define PAUSEINT 500UL		// When game is paused, all the timeout
35 				// routines will simply reset the timer
36 				// with this value and keep passing the
37 				// same client_data back every time.
38 #define FLASHINT 1000UL		// millisec to flash "base under attack" mesg
39 #define UNFLASHINT 500UL	// millisec to unflash "base under attack" mesg
40 #define SEEDINT 60000UL		// change the rand() seed after some random
41 #define SEEDINTRANGE 6000UL	// time ranging from SEEDINT - SEEDINTRANGE
42 				// to SEEDINT + SEEDINTRANGE millisecs.
43 				// time() provides the seed.
44 #define MINSKILL 1		// lowest skill level
45 #define MAXSKILL 10		// highest skill level
46 
47 // default faser/torpedo trajectory
48 #define DEFANGLE (double)app_data.default_firing_angle
49 
50 // endever code to self-destruct
51 #define SDESTRUCTCODE app_data.self_destruct_code
52 
53 // max number jovians in a sector
54 #define MAXJOVSECT app_data.max_jovians_per_sector
55 
56 // max number stars in a sector
57 #define MAXSTARSECT app_data.max_stars_per_sector
58 
59 // starting number of torpedoes
60 #define MAXTORPEDOES app_data.max_torpedoes
61 
62 // max energy possible for shields, thrust, warp or fasers
63 
64 #define ENDMAXERG 100		// for endever
65 #define JOVMAXERG 100		// for jovians
66 #define BASEMAXERG 500		// for bases (all energy devoted to shields)
67 
68 // endever min energy needed for faser to work
69 #define ENDMINFASERG app_data.endever_min_faser_energy
70 
71 // endever min energy needed for warp to work
72 #define ENDMINWARPERG app_data.endever_min_warp_energy
73 
74 // endever min energy needed for thrust to work
75 #define ENDMINTHRUSTERG app_data.endever_min_thrust_energy
76 
77 // jovian min energy needed for faser to work
78 #define JOVMINFASERG app_data.jovian_min_faser_energy
79 
80 // jovian min energy needed for warp to work
81 #define JOVMINWARPERG app_data.jovian_min_warp_energy
82 
83 // jovian min energy needed for thrust to work
84 #define JOVMINTHRUSTERG app_data.jovian_min_thrust_energy
85 
86 #define ENDMINERGRATE 1		// endever min rate of re-energizing (mean)
87 #define ENDMAXERGRATE 4		// endever max rate of re-energizing (mean)
88 #define ENDMINERGRATEDOCK 6	// endv min rate of re-erging when docked (mean)
89 #define ENDMAXERGRATEDOCK 12	// endv max rate of re-erging when docked (mean)
90 #define JOVMINERGRATE 1		// jovian min rate of re-energizing (mean)
91 #define JOVMAXERGRATE 4		// jovian max rate of re-energizing (mean)
92 #define BASEMINERGRATE 30	// min rate of re-energizing for bases (mean)
93 #define BASEMAXERGRATE 60	// max rate of re-energizing for bases (mean)
94 #define ENDERGVAR 3		// when re-energizing endever, this is the +/-
95 				// amount of rand variation in the re-erg rate.
96 #define ENDERGVARDOCK 6		// endever re-erg rate variation when docked
97 #define JOVERGVAR 3		// when re-erging jov, this is the +/- amount
98 				// of random variation in the re-erg rate.
99 #define BASEERGVAR 30		// when re-erging a base, this is the +/- amount
100 				// of random variation in the re-erg rate.
101 
102 // energy and parameters used in damage model
103 
104 // effect of faser intensity on damage (make larger for more damage)
105 // (use a value like 2.0 if fasers are represented as bursts)
106 #define INTENPARAM (double)6.0
107 
108 // effect of shield level on damage (make larger for more damage)
109 // this parameter is very sensitive to small changes.
110 #define SHIELDPARAM (double)0.04
111 
112 // probab a sector has a mask (percent)
113 #define PROBMASK  app_data.mask_probability
114 
115 // faser parameters
116 
117 //#define FASERLEN 30		// length of faser burst (pixels)
118 #define FASERLEN 15 // value to use when faser is a continuous line
119 #define FASERWTH app_data.faser_width	// width of faser burst (pixels)
120 #define FASERRVWTH  (FASERWTH+2) // width of reverse video faser burst (erasing)
121 				 // wider to remove stray pixels.
122 #define FASERSPD 15		// distance burst moves between time intervals
123 
124 // millisecs between faser movements (when faser represented as a burst)
125 //#define FASERINT 40UL
126 // millisecs between faser movements (when faser represented as continuous line)
127 #define FASERINT (unsigned long)app_data.faser_speed
128 #define FASERMAXDASH 50		// max number chars in faser dash pattern
129 
130 // torpedo parameters
131 
132 #define TORPLEN app_data.torpedo_length 	// length of torpedo (pixels)
133 #define TORPWTH app_data.torpedo_width		// width of torpedo (pixels)
134 #define TORPRVWTH (TORPWTH+2)   // width of reverse video torpedo (erasing)
135 #define TORPSPD 15		// distance burst moves between time intervals
136 
137 // millisecs between torpedo movements
138 #define TORPINT (unsigned long)app_data.torpedo_speed
139 
140 // surround the inside of the border of the sector with a margin and
141 // do not allow fasers or torpedoes to enter within this margin. This
142 // keeps fasers and torpedoes from eating away the sector border when
143 // fired at oblique angles.
144 
145 #define FASERMARGIN  FASERRVWTH/2  // use reverse video width to determine
146 #define TORPMARGIN   TORPRVWTH/2   // margins because it is wider.
147 
148 
149 #define RADIUS 17	// radius from icon center to begin faser/torpedo
150 
151 // these are the dimensions of a rectangle redrawn at the
152 // leading end of a faser after the faser shot over. this cleans
153 // up stray pixels and also redraws the shot target in case it
154 // got erased when the faser got erased (this sometimes happens
155 // if the target ship moves into the faser as the faser is being
156 // erased).
157 
158 #define CLEANUPW 54		// width
159 #define CLEANUPH 30		// height
160 
161 // explosion related parameters
162 
163 // explosion radius for fasers/torpedo hits
164 #define EXPLODERAD app_data.explosion_radius_small
165 // explosion radius for self-destruction
166 #define SDESTRUCTRAD  app_data.explosion_radius_big
167 
168 // timeout interval between expand() calls
169 #define EXPANDINT (unsigned long)app_data.explosion_speed
170 #define EXPANDRATE 5	// amount explosion radius increases between expansions
171 #define FRAGW  3	// width of an explosion fragment
172 #define FRAGH  5	// height of an explosion fragment
173 #define FRAGDENSITY 40		// number fragments per disk of current radius
174 
175 // When the endever leaps into a new sector, it gets placed at a
176 // random location inside that sector. The euclidean distance
177 // (in pixels) from this location to the jovians inside the
178 // sector is at least MINJOVDIST.
179 
180 #define MINJOVDIST app_data.min_jovian_distance
181 
182 // Number of rows/cols of Sectors in the universe matrix
183 
184 #define UROWS 9
185 #define UCOLS 9
186 
187 /**************** GRAPHICS DIMENSIONS ***************/
188 
189 // The game window is divided into rows/cols of 9x15 blocks.  In
190 // the style of the C/C++ convention, the first row/column is
191 // numbered 0.
192 
193 // number of rows/cols in a sector. make sure these dimensions
194 // are large enough to contain the scanner and summary displays
195 // specified below. SECTROWS & SECTCOLS should be the only
196 // parameters that need to be changed to resize the game window.
197 
198 #define SECTROWS app_data.rows
199 #define SECTCOLS app_data.columns
200 
201 // row/col position of sector display wrt game window.
202 
203 #define SECTROW 1
204 #define SECTCOL 1
205 
206 // max & min pixel dimensions of sector display
207 
208 #define SECTMAXX (9*(SECTCOL + SECTCOLS) - 1)
209 #define SECTMINX (9*SECTCOL)
210 #define SECTMAXY (15*(SECTROW + SECTROWS) - 1)
211 #define SECTMINY (15*SECTROW)
212 
213 // Sector display width and height in pixels
214 
215 #define SECTW (SECTMAXX-SECTMINX+1)
216 #define SECTH (SECTMAXY-SECTMINY+1)
217 
218 // Square of length of main diagonal of the sector display
219 
220 #define SECTDIAGSQ ((long)SECTW*(long)SECTW + (long)SECTH*(long)SECTH)
221 
222 // Dimensions of the game window measured in 9x15 blocks.
223 
224 #define GAMEROWS (SECTROWS+3)
225 #define GAMECOLS (SECTCOLS+2)
226 
227 // Dimensions of the game window in pixels:
228 
229 #define GAMEW (9*GAMECOLS)
230 #define GAMEH (15*GAMEROWS)
231 
232 // number of rows/cols in scanner display
233 
234 #define SCANROWS 20
235 #define SCANCOLS 47
236 
237 // row/col position of scanner display wrt game window
238 
239 #define SCANROW (GAMEROWS/2 - SCANROWS/2)
240 #define SCANCOL (GAMECOLS/2 - SCANCOLS/2)
241 
242 // dimensions of the summary display are set at runtime in
243 // draw_summary.cc: set_summary_size()
244 
245 // row/col position of the echo area
246 
247 #define ECHOROW (GAMEROWS-1)
248 #define ECHOCOL 1
249 
250 
251 
252 
253 
254 
255 #endif				// _PARAMS_
256 
257 // end
258