OSDN Git Service

翻訳, 文字変換を修正
[lcs-jp/lcs-jp.git] / LINUX_README.txt
1 ================================================================================
2                       Liberal Crime Squad Linux Notes
3 ================================================================================
4 2004-08-17 - Kevin Sadler (sadler@geodude.eclipse.co.uk)
5 2009-02-22 - Jonathan Stickles (jonathansfox@gmail.com)
6 2011-07-26 - Christian Sergelius (cribozai@member.fsf.org)
7 2013-09-13 - Rich McGrew (mcgrew_rich@yahoo.com)
8
9 Updated notes for compiling and playing under Linux for 4.xx.x versions
10 =======================================================================
11
12 Thanks to the Bay12Games forums user named xczxc who rightly pointed out the
13 need to update this document.
14
15 To compile LCS under Linux you will need to obtain the tools for building
16 under your specific distribution. You will also need to development libraries
17 for ncurses. The ncursesw version with wide character support should also
18 work.
19
20 To do this under Ubuntu (and most likely Debian too) issue the following
21 commands:
22
23 sudo apt-get install build-essential autoconf libncurses5-dev
24
25 The actual compilation will be done by changing your working directory to the
26 lcs folder and issuing:
27
28 chmod 744 bootstrap
29 ./bootstrap
30 ./configure
31 make
32
33 If the compilation was successful no errors should be issued but you will
34 see a myriad of warnings displayed all of which are safe to ignore.
35
36 At the moment due to continuous development of the game it is probaby
37 safer to not install the game systemwide and thus the best option is to
38 play it from the games own directory that resides in your home folder.
39
40 To do this with little trouble issue the following command while in
41 the LCS game folder:
42
43 cp src/crimesquad .
44
45 To run the game just type:
46
47 ./crimesquad
48
49 To make everything display properly you should resize your terminal to 80x25
50 because the default of 80x24 sometimes makes the last lines information
51 appear in the wrong place.
52
53 Other good to know information
54 ==============================
55
56 The savefile and highscores are independent of the game folder and reside
57 in a hidden folder on your home are with the name .lcs and you can navigate
58 there using your newly aquired terminal skills with the cd command as follows:
59
60 cd ~/.lcs
61
62 Build notes for Mac OS X
63 ========================
64 (written by shibby1295 at bay12forums.com, Sep. 2013)
65
66 I just got the latest version of LCS running on my Macbook Pro. It took just a
67 smidgeon of doing, so I thought I'd document what I did. It's mostly the same
68 as building on Linux, with just a few changes.
69
70 This is on OSX 10.84, 64 bit intel. Your mileage may vary. Also, I haven't
71 played very much yet, so there could be bugs hiding in specific gameplay areas.
72
73 To get SVN:
74   Install XCode via the App Store
75   Open XCode, then go to the Downloads tab of the preferences menu
76   Click the 'install' button next to "Command Line Tools"
77 To get autoconf: (in terminal):
78   ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
79   brew install automake
80 To build LCS:
81   svn co http://svn.code.sf.net/p/lcsgame/code/trunk lcsgame
82   cd lcsgame/
83   ./bootstrap
84   LIBS="/usr/lib/libiconv.2.dylib" ./configure
85   make
86 To play:
87   src/crimesquad
88
89 Troubleshooting
90 ===============
91
92 My game does not compile properly, what is wrong?!
93
94 The problem can be one of many and depends on too many things to give
95 a simple answer. You can get help by contacting me (email address in
96 the beginning of this document). Just copy the last screen of output
97 that you were given and I will see what I can figure out.
98
99 ---------------------------------------------------------------
100
101 My games runs smoothly and everything worked out fine untill I wanted to
102 load a saved game. All I got was a screen with errors and my terminal
103 seems messed up somehow. What gives?
104
105 This is a problem that is distribution and compiler version dependant.
106 The reason is quite complicated and as of yet I have had no time nor
107 want to figure out exactly what the problem is. But luckily there is
108 an easy fix that does not make you lose the saved game!
109
110 While in the game folder issue the following:
111
112 make clean
113 ./configure CFLAGS=-g CXXFLAGS=-g
114 make
115 # Wait for it to compile, check your email and take a sip of your beverage
116 cp src/crimesquad .
117
118 Then run the game again. Hope it worked for you. 
119
120
121 Important Update as of Version 3.18
122 ===================================
123
124 This file hasn't been updated in a long time, so I'll try to give a few
125 key notes that will update the information contained below.
126
127 BUILDING THE GAME
128 If you have this file, it's probably because you checked out the source
129 code from SVN. The new build commands are:
130
131   bootstrap
132   ./configure
133   make
134
135 GRAPHICS AND TERMINAL SIZE
136 The graphics for the Linux version of LCS are unaltered since 3.09. I have
137 endeavored to ensure that future updates of LCS use strictly portable ASCII
138 so that futher problems are not created for the port. The note below about
139 terminal size remains important.
140
141 FLAG BURNING
142 The flag burning bug was fixed, and you can now safely burn flags in Linux.
143
144 AUTOSAVING
145 The game still autosaves, but instead of autosaving to autosave.dat, it
146 autosaves directly to save.dat.
147
148 ADDITIONAL REQUIRED FILES
149 There are several new files that you must keep accessible to the LCS
150 executable. These are found in the /workspaces directory that you probably
151 checked out from SVN alongside this file. The list is below:
152
153   sitemaps.txt
154
155
156 Linux Notes for Version 3.09
157 ============================
158
159 New features in this version (Windows and Linux):
160
161 Autosave - The game is automatically saved each turn (after wait is pressed)
162            to a file called autosave.dat. If crimesquad crashes you can
163            rename this to save.dat to recover (you may want to rename the
164            original save.dat in case the autosave.dat contains something
165            which causes a repeatable crash, so you can revert to that one.
166            (but send Tarn Adams and me the bad save file so we can work on
167            the bug!)). See below for details on Save Files.
168            
169 Cursor Keys     Use the cursor keys to move your squad. Once you've been
170                 playing for a bit the WADX keys become a bit of a habit,
171                 but the cursor keys should make it easier for new players.
172
173 New Features for Linux:
174
175 Curses Graphics The DOS CP437 graphics characters did not display correctly
176                 on Linux so a fix has been worked on (3.08 works if you
177                 install a font as described below). An "ASCII Hack" is
178                 now used where either the source code specifies a character
179                 by name rather than value or where a CP437 value gets converted
180                 to the native value. The conversion isn't perfect as there
181                 are a lot of characters that are not available (half blocks
182                 for example) and so are represented by a character that looks
183                 vaguely like it - you can tell what it's supposed to be now...
184                 In the future we can use Unicode/UTF-8 and we should be able
185                 to use exactly the same symbols. See the "Fonts" section 
186                 below.
187
188 Bugs for Linux:
189
190 Flag Burn       If you burn a flag under Linux the game will hang.
191
192 Terminal Size   Not really a bug but... the LCS screen size is 80x25
193                 the size of a DOS window, your default xterm window
194                 may be 80x24, the size of a VT100 screen, and so this
195                 may result in the last line of the display being misplaced.
196                 Simply increase the size of the terminal by resizing it
197                 by one or more lines (With the KDE Konsole from the
198                 menu select Setting > Size > 80 x 25 (IBM PC) to set the
199                 right size).
200
201                 
202                 
203 LCS Linux History
204 =================
205
206 Version 3.08 of Liberal Crime Squad (LCS) was ported to Linux and compiled 
207 with the GNU g++ compiler (GCC 3.3.2) and linked with the ncurses library 
208 (rather than the pdcurses library used on the Windows version).
209
210
211 LCS on UNIX
212 ===========
213
214 It is likely that this code will compile on other versions of UNIX, but this
215 has not been verified yet. Provided you have a g++ compiler and ncurses you
216 should be in with a fighting chance. Read the header of the Makefile for some
217 clues for what to do.
218
219
220 LCS on Cygwin
221 =============
222
223 LCS compiles on Cygwin (a free Linux-like API/Environment for Windows 
224 http://www.cygwin.com ) with the Makefile supplied exactly as it does
225 for Linux, use PLATFORM=Linux in the Makefile. Cygwin will need to have
226 packages for development (eg. the gcc compiler and make) and the ncurses
227 library.
228
229
230 LCS on MinGW32
231 ==============
232
233 MinGW32 is is a free Minimalist GNU compiler for Windows. 
234 ( http://www.mingw.org ) It compiles with MinGW32 and the Msys
235 enviroment and PDcurses. There is a section for MinGW32 in the Makefile,
236 just uncomment it (and comment out the section for Linux above it). 
237
238
239 Build
240 =====
241
242 Unpack the tar archive into a suitable directory (e.g. /usr/local/src),
243 in the examples below assume nnn is the version number, eg 3.08:
244
245   cd /usr/local/src
246   tar -zxvf lcs_source_nnn.tgz 
247
248   cd lcs_nnn
249   
250   make
251   
252 This will compile the crimesquad executable. 
253
254
255 Installation
256 ============
257
258 Currently the make file does not install LCS but it is very
259 simple.
260
261 LCS can be installed in two steps:
262
263 1. Copy the crimesquad executable to a suitable bin directory that is
264    specified in PATH. If you have suitable permissions you may wish
265    to copy it to /usr/local/bin, or to a bin directory in your home
266    directory.
267
268 2. Install the art directory. The source directory has a subdirectory
269    called art which contains some files used by the game. The game needs
270    to know where these files are and will look in the following
271    locations:
272    
273    /usr/share/lcs
274    /usr/local/share/lcs
275    
276    To install the directory in /usr/local/share do the following:
277    
278    mkdir -p /usr/local/share/lcs
279    cp -R art /usr/local/share/lcs/.
280    
281    Alternatively LCS will look for art in the current directory, or
282    the environment variable LCS_ART_DIR may be set to the directory.
283    An example of this using the bash shell:
284    
285    export LCS_ART_DIR=/usr/local/src/lcs_nnn/art
286    
287    Typically one would set this in .profile or .bashrc files.
288
289 3. Install the init.txt configuration file (optional, but lets you set
290    additional configuration options). The game looks for this file in the
291    current directory.
292   
293 Fonts
294 =====
295
296 The first port, 3.08, output the DOS style CP437 codes for the curses graphics
297 which came out as accented characters and looked rather screwed up. The work
298 around for this was to install a CP437 font on UNIX as described below.
299
300 With 3.09 the "ASCII Hack" was developed which maps the CP437 codes onto
301 either curses alternative character set characters (the ACS_ macros) or
302 onto characters that (vaguely) look like what we need, it works reasonably
303 well.
304
305 The "perfect" solution is to use Unicode. This would require the use of
306 ncursesw (wide) which may need some code changes. The Unicode translation
307 is coded up but some more work is probably needed.
308
309 See cursesgraphics.h for more info.
310
311 By default the ASCII Hack is now used for Linux, if you have the CP437
312 fonts and like using them you could hack the code to define CH_USE_CP437
313 instead of CH_USE_ASCII_HACK.
314
315
316 CP437 Fonts
317 -----------
318
319 LCS uses DOS CodePage 437 characters for it's graphics (the flag, the map,
320 and the newspaper headlines). Linux doesn't support this as is, however
321 you can download some fonts from Emil Mikulic's website that you can use:
322
323 http://dmr.ath.cx/misc/cp437/
324
325 http://dmr.ath.cx/misc/cp437/fonts.tar.bz2
326
327 It is suggested that they be installed to /usr/share/fonts/cp437
328
329 The following line should be added to /etc/X11/XF86Config:
330
331     FontPath   "/usr/share/fonts/cp437"
332
333 To run crimesquad in an xterm with these fonts type:
334
335 xterm -fn cp437-8x12 -e crimesquad
336
337
338 Why are the fonts different?
339 ----------------------------
340
341 In simple terms the graphics characters binary codes lie above the portable
342 ASCII values and the character set that you are using on Linux renders
343 this as a different "glyph" to that which appears under DOS using CP437.
344 The fonts are just a hack - they change the glyphs under Linux to look
345 like those under DOS.
346
347 The "proper" way to fix this is to use unicode, or UTF-8, and ncursesw 
348 (ncurses for wide characters) and remap the CP437 values to their UTF-8
349 values. This will mean that LCS could be played on Linux in your favourite
350 font. The downside, apart from the porting required, is that not all Linux
351 boxes may be configured with UTF-8 support or have the ncursesw library
352 installed, though most of the latest distros should be able to cope.
353
354
355 Save Files
356 ==========
357
358 The Windows crimesquad save files (save.dat) are binary compatible with
359 Linux on ix86 (don't expect them to work on PowerPC (eg. Macs, RISC) due
360 to endianess).
361
362 Under Linux/UNIX LCS creates a sub-directory in the user's home directory
363 called .lcs in which the save.dat file is stored. To transfer your file
364 to another user just create that directory:
365
366         mkdir ~/.lcs
367
368 and copy the file into it.
369
370 With version 3.09 LCS creates an automatic save just before the "wait"
371 command is processed (before the days activities, such as squad raids
372 are carried out). This file is called autosave.dat and is stored in the
373 same place as the save.dat file (~/.lcs on UNIX or the game directory on
374 Windows). In the rare event that the game should crash ;) you may rename
375 the autosave.dat file to save.dat to recover, under UNIX:
376
377         mv -f ~/.lcs/autosave.dat ~/.lcs/save.dat
378
379 SDL2 and SDL2_mixer
380 ===================
381
382 Liberal Crime Squad can use SDL 2.0.3 and SDL_mixer 2.0 for audio.
383 The headers and libraries for those are included in the /src/sdl
384 directory. However the libraries to link against only work with
385 Microsoft Visual C++ (32-bit) and MinGW-GCC (32 bit), the 2 main
386 compilers used on MS Windows. On other platforms such as Linux and
387 Mac OS X you will probably need the SDL2 and SDL2_mixer libraries to
388 link against as dependencies, in order for it to compile correctly
389 with audio support. Currently this is used for MIDI or Ogg Vorbis
390 background music.
391
392 So you have a couple alternatives:
393
394 1) Compile with SDL2 and SDL2_mixer. You will need a MIDI device.
395 Both Windows and Mac OS X have native MIDI that is supported by
396 SDL_mixer, along with support for Timidity. On Linux you have several
397 options for MIDI support: Timidity, which uses Gravis UltraSound
398 Patches (NOT Timidity++, which uses SoundFonts), is built-in, but
399 you'll need to put the Gravis UltraSound Patches in the location
400 specified by the SDL2_mixer documentation. That location is
401 Win32 in C:\timidity, and on UNIX in /usr/local/lib/timidity/.
402 There also might be native MIDI support on Linux but only with some
403 sound drivers and not others.
404
405 2) Use FluidSynth or JACK. Both of them are external programs but if
406 you install them, SDL2_mixer can use them for MIDI support.
407 FluidSynth is recommended if you want the best sound quality. It uses
408 SoundFonts. Personally I am fond of the Arachno SoundFont 1.0 which
409 you can find here: http://www.arachnosoft.com/main/soundfont.php. It
410 is designed to sound very nice with video games, but it takes up
411 148 megabytes. There are plenty of other great SoundFonts, including
412 many that take up less disk space, that one's just my personal
413 favorite, you might like a different one better.
414
415 I am not quite sure about how the MIDI support in JACK works. Maybe
416 it is just an alternative for ALSA, for the people on *BSD systems,
417 since SDL and SDL_mixer don't support the native OSS on *BSD. Anyway,
418 if you are on something like FreeBSD, OpenBSD, or NetBSD, you will
419 need JACK along with either the built-in Timidity or an external
420 FluidSynth. If you are on Linux rather than some other UNIX you have
421 ALSA so you don't need JACK, since SDL and SDL_mixer can use either one.
422 And as for Mac OS X/Darwin, it might be BSD-based but it has CoreAudio
423 and CoreMIDI, both supported natively by SDL and SDL_mixer. Well actually
424 CoreMIDI is just on iOS but SDL and SDL_mixer support both Android and
425 iOS.
426
427 3) Use Ogg Vorbis instead of MIDI if you wish. Along with SDL2 and
428 SDL2_mixer, you should have libogg, libvorbis, and libvorbisfile installed.
429 Ogg Vorbis has better sound quality than MIDI but larger file size.
430
431
432 4) If all else fails, uncomment the line that says #define DONT_INCLUDE_SDL
433 in common.h. This will disable SDL, SDL_mixer, and audio, and let
434 you compile and build Liberal Crime Squad without any SDL dependencies.
435 The only downside to this is you don't get any audio.