Format fix 2005/vik/README.md
This commit is contained in:
1 parent
67dd64aaab
commit
979706129b
1 file changed
+72
-44
+72
-44
@@ -1,10 +1,9 @@
|
|||||||
# Most circuitous walk
|
# Most circuitous walk
|
||||||
|
|
||||||
Daniel Vik
|
Daniel Vik
|
||||||
926 Genter Street
|
US
|
||||||
La Jolla Ca 92037
|
<daniel@vik.cc>
|
||||||
US
|
<https://www.vik.cc>
|
||||||
daniel@vik.cc
|
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
@@ -26,50 +25,70 @@ make
|
|||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
An amazing use of the X libraries with twisty code passages,
|
An amazing use of the X libraries with twisty code passages, all different. One
|
||||||
all different. One risks running in code path circles as main is
|
risks running in code path circles as `main()` is called again and again. Be
|
||||||
called again and again. Be sure to pay attention to commas! :-)
|
sure to pay attention to commas! :-)
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
This entry is a Wolfenstein style graphics engine where a user can navigate in
|
This entry is a [Wolfenstein](https://en.wikipedia.org/wiki/Wolfenstein) style
|
||||||
a 3D world. The maze has walls with bitmap textures. The application contains
|
[graphics engine](https://en.wikipedia.org/wiki/Rendering_(computer_graphics))
|
||||||
a default world with textures, but the power of the engine is exposed through
|
where a user can navigate in a
|
||||||
user configured maps. User defined worlds support up to 26 different wall
|
[3D](https://en.wikipedia.org/wiki/3D_computer_graphics) world. The
|
||||||
textures that can even be animated. One example of a user defined world is
|
[maze](https://en.wikipedia.org/wiki/Maze) has walls with [bitmap
|
||||||
submitted with the entry.
|
textures](https://en.wikipedia.org/wiki/Bitmap_textures). The application
|
||||||
|
contains a default world with textures, but the power of the engine is exposed
|
||||||
|
through user configured [maps](https://en.wikipedia.org/wiki/Map). User defined
|
||||||
|
worlds support up to 26 different wall textures that can even be animated. One
|
||||||
|
example of a user defined world is submitted with the entry.
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
This program is a complete 3D engine with
|
This program is a complete 3D engine with
|
||||||
|
|
||||||
* Easy configurable maze maps
|
* Easy configurable maze maps.
|
||||||
* Up to 26 different bitmap textures in a maze
|
* Up to 26 different bitmap textures in a maze.
|
||||||
* Support for animated bitmap textures
|
* Support for animated bitmap textures.
|
||||||
* Uses default bitmaps in case the configured bitmaps can't be found
|
* Uses default bitmaps in case the configured bitmaps can't be found.
|
||||||
* A default map in case no one is specified
|
* A default map in case no one is specified.
|
||||||
* Configurable window size
|
* Configurable window size.
|
||||||
* Navigation using cursor keys (rotate left and right, move forward and
|
* Navigation using cursor keys (rotate left and right, move forward and
|
||||||
backward)
|
backward).
|
||||||
|
|
||||||
### Build and Run
|
### Build and Run
|
||||||
|
|
||||||
Compile the source code and link x libraries if necessary. The program takes
|
Compile the source code and link [x
|
||||||
|
libraries](https://en.wikipedia.org/wiki/Xlib) if necessary. The program takes
|
||||||
three options which have to be typed in a specific order as described below.
|
three options which have to be typed in a specific order as described below.
|
||||||
|
|
||||||
Usage: prog [-w <width>] [mapfile]
|
```
|
||||||
|
Usage: ./vik [-w <width>] [mapfile]
|
||||||
width - Specifies the width of the window
|
width - Specifies the width of the window
|
||||||
mapfile - Filename containing a map
|
mapfile - Filename containing a map
|
||||||
|
```
|
||||||
|
|
||||||
Here are a few examples:
|
#### Examples
|
||||||
|
|
||||||
> | Command line: | Description: |
|
Start the engine using a built in labyrinth and texture bitmaps:
|
||||||
> | ------------------------ | ---------------------- |
|
|
||||||
> | $ ./prog | Starts the engine using a built in labyrinth and texture bitmaps |
|
|
||||||
> | $ ./prog maze.map | Starts the engine and loads the labyrinth defined in the file maze.map |
|
|
||||||
> | $ ./prog -w 400 maze.map | Starts the engine using maze.map in a window that is 400 pixels wide |
|
|
||||||
|
|
||||||
Note that the mapfile has to be the last argument and the -w option if present
|
```sh
|
||||||
|
./vik
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the engine and loads the labyrinth defined in the file
|
||||||
|
[maze.map](maze.map):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./vik maze.map
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the engine using [maze.map](maze.map) in a window that is 400 pixels wide:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./vik -w 400 maze.map
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that the `mapfile` has to be the last argument and the `-w` option if present
|
||||||
has to be the first. The map definition files and the bitmap files should be
|
has to be the first. The map definition files and the bitmap files should be
|
||||||
located in the current directory.
|
located in the current directory.
|
||||||
|
|
||||||
@@ -78,10 +97,11 @@ Use the cursor keys to navigate through the labyrinth.
|
|||||||
### Creating mazes
|
### Creating mazes
|
||||||
|
|
||||||
A maze consist of a map file and texture bitmap files. The map file is an
|
A maze consist of a map file and texture bitmap files. The map file is an
|
||||||
ascii text file where lower case letters represent walls. The letter tells the
|
ASCII text file where lower case letters represent walls. The letter tells the
|
||||||
engine what bitmap texture file to use. The `'*'` character lets the engine know
|
engine what bitmap texture file to use. The `*` character lets the engine know
|
||||||
where to position the user. The example below shows how a map file can look:
|
where to position the user. The example below shows how a map file can look:
|
||||||
|
|
||||||
|
```
|
||||||
aaaaaaaaaaaaa
|
aaaaaaaaaaaaa
|
||||||
a a
|
a a
|
||||||
a * a
|
a * a
|
||||||
@@ -89,7 +109,9 @@ where to position the user. The example below shows how a map file can look:
|
|||||||
c c
|
c c
|
||||||
cccccccccccccccccccc
|
cccccccccccccccccccc
|
||||||
|
|
||||||
The engine loads the map, and creates walls. When a character 'a'-'z' is found,
|
```
|
||||||
|
|
||||||
|
The engine loads the map, and creates walls. When a character `a`-`z` is found,
|
||||||
the engine will load the corresponding texture bitmap. The bitmap file must be
|
the engine will load the corresponding texture bitmap. The bitmap file must be
|
||||||
named `*.bmp` where `*` is substituted with the letter of the wall in the map.
|
named `*.bmp` where `*` is substituted with the letter of the wall in the map.
|
||||||
|
|
||||||
@@ -99,24 +121,30 @@ current directory).
|
|||||||
|
|
||||||
### Obfuscation
|
### Obfuscation
|
||||||
|
|
||||||
The program is obfuscated in several ways, bad use of variables, use of the `?`
|
The program is obfuscated in several ways:
|
||||||
operator, recursive calls to main, bad use of for variables and the comma
|
|
||||||
operator. To make the final obfuscated touch I ran indent which really made
|
* Bad use of variables.
|
||||||
the program unreadable (I guess that is not really the intent with indent ;)
|
* Use of the `?` operator.
|
||||||
|
* Recursive calls to `main()`.
|
||||||
|
* Bad use of for variables and the comma operator.
|
||||||
|
* To make the final obfuscated touch I ran indent which really made the program
|
||||||
|
unreadable (I guess that is not really the intent with indent ;) )
|
||||||
|
|
||||||
### Compiler warnings
|
### Compiler warnings
|
||||||
|
|
||||||
There are no compiler warnings when compiling with -ansi but there are quite
|
There are no compiler warnings when compiling with `-ansi` but there are quite
|
||||||
many warnings from lclint. Mainly because the program is very optimized for
|
a few warnings from `lclint`. Mainly because the program is very optimized for
|
||||||
code size.
|
code size.
|
||||||
|
|
||||||
### Limitations
|
### Limitations
|
||||||
|
|
||||||
The program only compiles and runs on X based systems.
|
The program only compiles and runs on [X based
|
||||||
|
systems](https://en.wikipedia.org/wiki/X_Window_System).
|
||||||
|
|
||||||
The program does not run that smooth under cygwin. It seems to be a priority
|
The program does not run that smooth under
|
||||||
issue with cygwin and it can easily be solved by increasing the priority of
|
[Cygwin](https://en.wikipedia.org/wiki/Cygwin). It seems to be a priority issue
|
||||||
the application a little bit.
|
with Cygwin and it can easily be solved by increasing the priority of the
|
||||||
|
application a little bit.
|
||||||
|
|
||||||
## Copyright and CC BY-SA 4.0 License:
|
## Copyright and CC BY-SA 4.0 License:
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user