Clean up a bit

This commit is contained in:
Miloslav Ciz 2025-06-19 02:28:51 +02:00
parent 610c1df0b0
commit a104a12cc4
14 changed files with 207 additions and 62 deletions

View file

@ -1,5 +1,3 @@
WORK IN PROGRESS
'-._-'"'-_.-'"'-._.-'"'-._.-'"'- LICAR MANUAL -'"'-._.-'"'-._.-'"'-._.-'"'-._.-'
libre racing video game by drummyfish (drummyfish@disroot.org)
@ -83,9 +81,9 @@ right). There are two additional keys, A and B (depending on your platform these
may be e.g. K and L keys, RETURN and ESCAPE etc.), for restarting runs and
handling menu.
~~~~~ GAMPLAY TIPS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~ GAMEPLAY TIPS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here are some tips:
Here are some tips for playing:
- It's possible to stop the car from rotating mid-air by pressing brake.
- Similarly, holding down brake in air will slow down the car's horizontal
@ -150,30 +148,34 @@ different settings.
~~~~~ REPLAYS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If your platform supports it, Licar can save and play back recorded runs as
"replays" (sometimes also called "demos"), which are just exact records of game
inputs (so that replays, unlike videos, take very little space). Replays can
also be used to spawn a ghost car to race against.
"replays" (sometimes also called "demos") which are nothing else than exact
records of game input keys (so that replays, unlike videos, take very little
space). Replays can also be used to spawn a ghost car to race against. There
are special tabs in the menu to view a replay or race against a replay ghost.
Replays are saved in the data file.
Replays are saved in the data file (see the section about data file for
details).
Whenever a map's target time is beaten, replay is automatically saved. It's also
possible to save a replay manually by opening the menu and selecting
"save replay".
"save replay" after finishing a map. To share or add replays you can simply copy
replay strings to/from the data file with any text editor. Similarly to delete a
replay you just delete it in the data file.
~~~~~ GHOSTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The game supports ghost cars to race against (note that this may be unsupported
on some weaker platforms). A ghost car is created from a replay and will race
in real time against the player, without being able to collide with him. This is
on some weaker platforms). A ghost car is created from a replay and will race in
real time against the player, without being able to collide with him. This is
very useful when attacking someone else's (or one's own) achieved time, to see
where exactly time losses against the opponent occur.
~~~~~ MAKING CUSTOM MAPS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Maps are stored in the data file. For its simplicity the original game doesn't
come with a user-friendly map editor, the maps are hand-written directly in the
text format that's stored in the data file, however there is a helper file for
Blender that facilitates this process.
come with a user-friendly map editor (perhaps some will be made over time), the
maps are hand-written directly in the text format that's stored in the data
file, however there is a helper file for Blender that facilitates this process.
In the game a map is represented as a 64x64x64 grid, with each cell one unit in
width, one unit in depth and HALF a unit in height. In the cell blocks can be
@ -195,12 +197,12 @@ details you won't find here. In summary:
First, if the map is preceded by another data string in the data file, remember
to start it with the `#` character (to separate it from the previous string).
Then there must be the letter `M` (for map), and the immediately the map's name
Then there must be the letter `M` (for map), and then immediately the map's name
terminated with `;`. For example a map named "mymap" will in the data file
start with "#Mmymap;". Then the map string itself follows.
This string starts with a decimal number saying the target time in physics
ticks, then a space (` `) follows, then a single digit saying the map
ticks, then a space (` `) follows, then a single digit specifying the map
environment (`0`, `1` or `2`), and then the string of map blocks follows.
Each map block starts with `:`, then immediately follows the type of the block
@ -213,9 +215,9 @@ this:
I.e. number 11 will be encoded as `b` etc. After the coordinates an optional
decimal digit MAY follow, which defines the block material (`0`, `1`, `2` or
`3`, `0` being default). Finally there MAY follow the transformation string,
which may consists of characters `|` (flip horizontally), `-` (flip vertically),
which may consist of characters `|` (flip horizontally), `-` (flip vertically),
`L` (rotate by 90 degrees), `I` (rotate by 180 degrees and `J` (rotate by 270
degrees). For example ":^5dA1-L" represents a ramp (`^`) placed on coordinates
degrees). For example ":^5dA1-L" represents a ramp (`^`) placed at coordinates
5, 13, 36, having material 1 (grass), flipped vertically (`-`) and rotated by
180 degrees (`I`).
@ -282,15 +284,40 @@ A few tips for making maps:
~~~~~ COMPILING AND MODIFYING ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mods are highly recommended to be distributed as diff files that will apply
changes to the source code. This is inspired by suckless programs.
Mods are highly recommended to be distributed as context-aware diff files that
will apply changes to the base source code. This is inspired by suckless
programs. Distributing software in source form (preferably licensed as free
software), as opposed to compiled binaries, is highly advised, in Licar and
elsewhere :)
TODO
Compiling the code depends on platform, but in general is done by simply
compiling the platform's front end. For example the SDL2 frontend is compiled
just by handing frontend_sdl.c to any C99 compiler (of course with appropriate
flags, e.g. linking the SDL library). There is a Unix script that helps with
compiling: make.sh. On many systems you can compile the game just by running
the script. Otherwise read the script to learn about the details (flags etc.).
Understanding the code: the code is highly commented and meant to serve as its
own documentation, so first read the code. There is also a Doxygen file that can
help you easily generate reference pages. Otherwise the code is pretty
straightforward and shouldn't be too hard to understand (there is no OOP, no
3rd party libraries, ...). It is in some ways unique, but always in a way that
makes it easier to work with: for example the whole game is implemented solely
in header files so that you compile only a single file: your frontend. I.e. no
headaches with linking etc. The code follows the suckless philosophy and also
what's called LRS (less retarded software): check these out to learn more.
Porting and making your own frontends is quite easy, you just write a program
in C (or a compatible language such as C++) in which you include the game's
backend code (literally just #include "game.h") and implement a few basic
functions such as a function for drawing pixels or reading keyboard. Exact
details about this are documented in game.h.
~~~~~ CREDITS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Everything was created by drummyfish. Special thanks goes to my friends Blitz
and Ramon for help with testing <3
Everything was created by drummyfish, down to making own photo textures and
recording own samples for music in the soundtrack. Special thanks goes to my
friends Blitz and Ramon for help with testing and providing some ideas <3
~~~~~ FAQ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -314,7 +341,7 @@ that's meant to help the people.
Q: Can I still voluntarily donate money?
A: Currently it is possible, donation info is somewhere on my website, but I am
not dependant on donations and am sometimes doubting if it's a good thing to
not dependent on donations and am sometimes doubting if it's a good thing to
accept them, but if you still insist, I'll be very grateful, thank you very
much.