]> icculus.org git repositories - taylor/freespace2.git/blob - doc/guided_tour.txt
fix issue with looping audio streams
[taylor/freespace2.git] / doc / guided_tour.txt
1 Copyright (C) Volition, Inc. 1999.  All rights reserved.
2
3 All source code herein is the property of Volition, Inc. You may not sell
4 or otherwise commercially exploit the source or things you created based on
5 the source.
6
7 A guided tour of the FS2 source code,  by DaveB
8 -----------------------------------------------
9
10 Within this code you will find both razor sharp coolness and horrifying
11 atrocities. I'm hoping it'll serve not just as tool for learning how to
12 do things, but also for learning how _not_ to do things. Have fun with it.
13
14
15 Overview
16 --------
17 FS2 is an MsDev 6.0 project. Within the workspace are several subprojects.
18
19 - Ac. This is the animation conversion utility for generating FS2's
20   custom .ani files.
21
22 - CFileArchiver. A very simple command line utility for quickly packing
23   files into .vp files.
24
25 - code. 99% of all FS2 code exists in this module. Many of the utility
26   projects have this library as a dependancy and it is organized as a
27   simple set of code folders.
28
29 - Cryptstring. A command-line tool for generating super-secret codes from
30   input text. More of a curiosity than anything else ;)
31
32 - Fonttool. A simple utility for generating and kerning the font files
33   FS2 uses.
34
35 - Fred2. The FS2 mission editor. A giant mass of MFC code - it references
36   plenty of stuff from the code library.
37
38 - Freespace2. This generates the FS2 executable. There are only a
39   handful of files in this subproject - most of the game comes from the
40   code library.
41
42 - Nebedit. An old utility used for generating FS1 style background nebulae
43   patterns. Not used directly in FS2, but the code to display the old
44   nebulae still exists in the FS2 codebase.
45
46 - Pofview. A simple MFC app for viewing POF files as they would appear
47   ingame.
48
49 - Scramble. Top-secret Canadian encryption program. Guaranteed to be 
50   unbreakable for at least 20 to 25 minutes.
51
52 The critical subprojects most people will be concerned with are code, 
53 Freespace2, and Fred2. All of these subprojects have Debug and Release
54 (optimized) builds. pstypes.h also contains quite a few conditional
55 build switches. 
56
57 All source safe checkin headers have been left in for maximum comedy.
58
59 This is code-only. You cannot run without having a full copy of the game 
60 to supply the data.
61
62
63 Stuff that doesn't exist
64 ------------------------
65
66 Several bits of the game have been removed from this release. Nothing
67 of major importance. They include the launcher, the movie player, the
68 auto-updater, and all code related to PXO and squadwar (for obvious
69 reasons).
70
71
72 Project settings (Msdev 6.0)
73 ----------------------------
74
75 All of the subprojects that rely on the FS2 data tree to run (code, fred2,
76 freespace2, nebedit, pofview) are all currently targeted at
77
78 e:\games\freespace2\  
79
80 which is the directory I had on my local hard drive for putting this together.
81 Before you'll really be able to do anything, you'll need to point the targets
82 at wherever your local FS2 install is (make sure to make a copy of your 
83 installed executables so you can backtrack!).
84
85 To change the destination in MsDev, you'll need to change
86 settings->debug->executable for debug session
87 settings->debug->working directory
88 settings->link->output file name
89
90 All projects have been verified as compiling and running properly. So, unless
91 I screwed something up between the time of checking everything and building
92 the zip file (entirely possible) you should just be able to load the workspace
93 and hit F7. If not, hey, just one more thing to play with ;)
94
95
96 Post-release addition
97 ---------------------
98
99 I hacked in very quick-and-dirty windowed support for Direct3d mode. 
100 The way FS2 was developed, we always could rely on running Glide
101 on a second monitor. Trying to do any kind of serious debugging in full
102 screen Direct3D is just a recipe for agonizing pain. So windowed D3D 
103 should make debugging a whole lot easier for the average guy. I make no
104 guarantees about completeness or stability since it was hacked together
105 in 3 hours - however it does appear to function properly in both resolutions,
106 in both 16 and 32 bit desktops. Depending on your 3d card and your driver
107 settings, you may get some texture coordinate wackiness (particularly
108 visible on interface screens) but for the purpose of debugging/development
109 it should be sufficient. Fiddling with your driver settings in Control Panel
110 can make this go away.
111
112 You can run the game in windowed mode by adding -window on the command-line.
113
114
115
116 Interesting projects
117 --------------------
118 There's a bunch of cool things that could be done with the code.
119
120 - It uses directX 5. It might be fun to bring that whole thing up to
121   speed with DX8.
122
123 - The lighting and model rendering code works, but is much more expensive
124   than it needs to be on average. With even a little bit of work, it 
125   wouldn't be too hard to probably triple the throughput of that part of
126   the pipeline (taking advantage of the guard band present in almost all
127   modern 3d cards, maybe even a dash of T&L). 
128
129 - The multiplayer code is huge and scary. Its nor particularly "modern" in
130   terms of motion prediction and lag compensation. It could use some taming.
131
132 - With the higher fillrates available on video cards today, I'm sure the 
133   full nebula effect could be improved/changed quite a bit. 
134
135 - The FS community has been clamoring for higher ship counts and object limits.
136   It would be a pretty trivial matter to have a commandline option that lets
137   you specify MAX_SHIPS and similar constants. The internal stuff could be
138   changed from a static array to a dynamically allocated array at startup. A 
139   few #defines would be need to changed to ints, but beyond that it should be 
140   pretty trivial.
141
142 - The Ai code is another huge, intimidating system. There's plenty of room for
143   cool AI functionality.
144
145 - There's a mostly empty opengl implementation of the low level graphics code.
146   Might be fun to complete. Although I doubt it would be nearly as fast as D3D
147   or Glide, you never know.
148
149 - Fred2 is the omega of all giant unwieldy pieces of code. Its big, its horrifying,
150   and it just doesn't care. View it at your own risk.
151
152 - The physics library is pretty well partitioned and lives in its own little
153   world. If you want to add newtonian motion, that's where you'd start.
154
155 - The particle system code, while also functional is a bit old fashioned. A
156   little elbow grease could really bring it up to speed and make it able to
157   handle much higher particle counts.
158
159 - Mods. Have at it.
160
161 - Multi-res interface. For all the masochists out there. 
162
163 - There was a demo recording/playback system I half-heartedly was playing with at
164   one point. Its still in there, in very incomplete form.
165
166 - The math library is very powerful. Not necessarily a "project" on its own, but
167   its very sophisticated.
168
169 - Bmpman is rather brutish. It could be made far more elegant.
170
171 - The sexpression code is some of the more elegant and powerful code in the game.
172   Its very extensible and fairly easy to work with. Much functionality can be
173   added with these.
174
175 - For every bug you can find, I'll give you $5. No, I'm kidding. I don't have
176   that much money.