Subversion Repositories Games.Carmageddon

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
# Dethrace Contributing Guidelines
2
Thank you for investing your time in contributing to our project! Contributions can be in the form of bug reports or code
3
additions / fixes. Please read this document to learn how to contribute as effectively as possible. If you have any
4
questions or concerns, please ask in #dethrace channel on our [Discord chat](https://discord.gg/f5StsuP)
5
 
6
## Reporting bugs
7
To report a bug, ensure you have a GitHub account. Search the issues page to see if the bug has already been reported.
8
If not, create a new issue and write the steps to reproduce. A screenshot or a video can often be useful. 
9
Please state which architecture and version of the game you are running, e.g.
10
```
11
Harness_Init version: v0.4.0-15-g31afabc
12
Windows (x86-64)
13
```
14
 
15
## Project goals
16
 
17
- Faithfully reproduce the original gameplay from Carmageddon 1
18
- Provide documentation in the form of code and docs of the internal workings of the Carmageddon 1 engine
19
- Fix bugs in the original game logic
20
- Provide quality of life improvements (eg support for modern platforms, higher resolutions, higher framerates, increased limits for cars/tracks etc)
21
 
22
In contrast, extending or altering the gameplay of the base game is not encouraged.
23
 
24
### I do not agree with the goals, what can I do instead?
25
 
26
Fork us!
27
 
28
Many of these will never be accepted into main, but we love seeing creative and interesting ways to modify Dethrace.
29
 
30
Please post your work (screenshots, videos etc) in our [Interesting Forks](https://github.com/dethrace-labs/dethrace/discussions/categories/interesting-forks) discussion thread.
31
 
32
 
33
## Legal stuff
34
 
35
### License
36
 
37
By contributing your code, you agree to license your contribution under [GPL v3](https://github.com/dethrace-labs/dethrace/blob/main/LICENSE).
38
 
39
 
40
# Contributing code
41
 
42
Join us in the #dethrace channel on our [Discord chat](https://discord.gg/f5StsuP). We'd love to talk!
43
 
44
## Code style
45
We expect code to be formatted with our [clang-format](https://github.com/dethrace-labs/dethrace/blob/main/.clang-format) style. 
46
 
47
We recommend to configure your IDE to run clang-format on save. Heres how to enable it in Visual Studio Code for example:
48
![image](https://user-images.githubusercontent.com/78985374/200776372-8d5ec29d-8f39-4970-be69-7cc2abaf724d.png)
49
 
50
## Fixing a bug in the original logic
51
Please wrap fixes for bugs in the original game logic.
52
```c
53
#if defined(DETHRACE_FIX_BUGS)
54
  // describe the original logic bug
55
  <code to fix bug>
56
#endif
57
```
58
 
59
## Function and variable names
60
Functions and global variables and local variables are all generated from a symbol dump and captured in our [codegen-output](https://github.com/dethrace-labs/codegen-output). In very uncommon cases, it is required to add extra local variables in cases where the retail code differs from the code at the time of the symbol dump (the symbol dump does not match the retail binary). If this is required, please clearly mark those variables as being added.
61
 
62
```c
63
// Added by dethrace
64
float velocity;
65
 
66
```
67
 
68
## Inline BRender functions
69
Please use the [inline BRender functions](https://github.com/dethrace-labs/dethrace/blob/main/src/BRSRC13/include/brender/br_inline_funcs.h) where possible. 
70
 
71
Instead of
72
```c
73
vector_a->v[0] = vector_b->v[0] * 6.0f;
74
vector_a->v[1] = vector_b->v[1] * 6.0f;
75
vector_a->v[2] = vector_b->v[2] * 6.0f;
76
```
77
 
78
it should look like 
79
```c
80
BrVector3Scale(&vector_a, &vector_b, 6.0f);
81
```
82
 
83
## Magic values
84
Many "magic" values are already defined as enums from the code-gen. 
85
 
86
Before adding something like `#define DEPTH_EFFECT_WATER 1`, look at [dr_types.h](https://github.com/dethrace-labs/dethrace/blob/main/src/DETHRACE/dr_types.h) and try to find the existing enum. For example:
87
 
88
```c
89
typedef enum tSpec_vol_depth_effect {
90
    eSpec_dep_acid = 0,
91
    eSpec_dep_water = 1,
92
    eSpec_dep_slight_fog = 2,
93
    eSpec_dep_med_fog = 3,
94
    eSpec_dep_thick_fog = 4
95
} tSpec_vol_depth_effect;
96
```
97
 
98
In this case, can just replace the "1" with `eSpec_dep_water`.
99
 
100
## Modern platform code
101
If you need to add new code to interface with modern platforms or cross-platform (for example, audio, rendering, get system time), please add this code into `src/harness`. `harness` contains only new code written by the dethrace project, and its goal is to provide a simple cross-platform interface to `BRSRC13` and `DETHRACE`. We want to keep the code in `BRSRC13` and `DETHRACE` as faithful to the original as possible, and not be polluted with extra modern code or dependencies. Instead, that code goes into `harness`. 
102
 
103
Why is it called `harness`? Good question! It contains the _real_ `main` function, so harness starts up first, reads the command line, configures a few things, then calls into the _original_ main function in `src/DETHRACE`. The original game calls harness functions for platform services like audio and display. In this way, it acts like a harness for the original game engine.
104
 
105
## Language
106
This is a C project. No C++ please.