Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to lacking engine #22

Merged
merged 99 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
f5f2417
wip: enhanced physics
mokiat Apr 7, 2020
e7a5dfd
use fixed steps in physics simulation
mokiat Apr 15, 2020
10653c0
add experimental constraints
mokiat Apr 15, 2020
16666f6
add jacobian-based constraint resolution
mokiat Apr 18, 2020
3e8cc10
add chandelier constraint
mokiat Apr 18, 2020
5fede41
refactor fixed position constraint
mokiat Apr 18, 2020
3558714
fix dual constraint drift formula
mokiat Apr 18, 2020
6ba2de1
refactor rope constraint
mokiat Apr 18, 2020
e14c644
use quaternion for orientation
mokiat Apr 19, 2020
4f58b93
rework debug shaders
mokiat Apr 19, 2020
a9f3cbb
add color and update to vertex array
mokiat Apr 19, 2020
044464f
fixed translation ignores small drifts
mokiat Apr 19, 2020
ab2d052
hinged rod ignores small drifts
mokiat Apr 19, 2020
159fd53
chandelier ignores small drifts
mokiat Apr 19, 2020
98969ab
fix chandelier drift calculation
mokiat Apr 19, 2020
526300e
add copy translation constraint
mokiat Apr 19, 2020
7d5c7a3
redesign copy rotation constraint
mokiat Apr 20, 2020
b248467
wip experimentation
mokiat Apr 20, 2020
05a58af
add dummy friction motion
mokiat Apr 21, 2020
7b3243b
fix rotation constraint offsets
mokiat Apr 22, 2020
2a35633
bump gomath dependency
mokiat Apr 23, 2020
f49bc59
remove old vehicle system
mokiat Apr 24, 2020
75ef833
introduce dedicated physics package
mokiat Apr 25, 2020
ba3e425
move constraint def to new physics package
mokiat Apr 25, 2020
3b1cdcf
wip (breaking): move constraints to physics package
mokiat Apr 25, 2020
6377619
switch to new physics package
mokiat Apr 25, 2020
43466d9
add hackish translation limits
mokiat Apr 25, 2020
746ec2b
add a dash of duct tape to get something working
mokiat Apr 26, 2020
ddb4868
relocate collision package
mokiat Apr 26, 2020
9174f5e
improve playground level
mokiat Apr 28, 2020
ff22190
move asset loading to controller
mokiat Apr 28, 2020
519eb79
wip: enhanced physics
mokiat Apr 30, 2020
ea61662
make more playable
mokiat Apr 30, 2020
631652c
fix match axis constraint
mokiat May 1, 2020
8714f75
improve match axis constraint
mokiat May 1, 2020
4b81621
switch to new shape package
mokiat May 2, 2020
f1d1e50
restore debug lines
mokiat May 2, 2020
22311f4
remove unused spring and damper constraints
mokiat May 2, 2020
df52c38
fix friction impulse
mokiat May 2, 2020
bf2951e
refactor single body jacobian
mokiat May 3, 2020
e4816c4
refactor double body jacobian
mokiat May 3, 2020
f8a24d3
cleanup car system
mokiat May 3, 2020
dcfbcb9
add coilover constraint
mokiat May 4, 2020
0436f53
remove unused constraint options
mokiat May 5, 2020
219ef6b
add physics context
mokiat May 5, 2020
7bb4b46
remove comment
mokiat May 5, 2020
6df539c
cleanup car component
mokiat May 5, 2020
c65e771
default to forest track
mokiat May 6, 2020
6154af5
relocate car system
mokiat May 6, 2020
82af94b
rename tire to wheel
mokiat May 6, 2020
bab4fe1
wip: tarnovo scene
mokiat May 10, 2020
97d7472
wip: make driving more stable
mokiat May 13, 2020
8ea6c54
add diffuse color geom shader
mokiat May 16, 2020
881fe82
migrate code to lacking engine
mokiat May 23, 2020
65c98af
migrate assets to lacking engine
mokiat May 23, 2020
fd9bc49
switch to new lacking engine features
mokiat May 26, 2020
c4bdfd2
remove unused resource models
mokiat May 27, 2020
13af741
remove rallyconv
mokiat May 27, 2020
158a099
use r11g11b10 normals
mokiat May 31, 2020
d23bf30
add manual gamma correction
mokiat May 31, 2020
530b62b
use gamma correction from lacking
mokiat May 31, 2020
6f091bc
remove framebuffer blit due to gamma correction limitation
mokiat May 31, 2020
0bbf525
wip pbr lighting shader
mokiat Jun 4, 2020
41226cb
improve car control
mokiat Jun 7, 2020
30955dd
bump lacking
mokiat Jun 11, 2020
42fd5a5
cleanup shaders
mokiat Jun 14, 2020
5d2fc27
cleanup shaders
mokiat Jun 14, 2020
8c2ead5
fix framebuffer race condition
mokiat Jun 14, 2020
ab30bd0
reduce accel/decel sensitivity
mokiat Jun 14, 2020
5a30e33
bump lacking
mokiat Jun 14, 2020
8930f96
bump lacking
mokiat Jun 15, 2020
57d2c54
remove unused shader
mokiat Jun 15, 2020
59a11c0
use reworked lamp model
mokiat Jun 15, 2020
e07afab
remove unused image
mokiat Jun 16, 2020
2f8e8f9
add new suv model
mokiat Jun 24, 2020
1a6c666
add normals to playground level
mokiat Jun 24, 2020
e3d73ce
adjust car control
mokiat Jun 24, 2020
5ce5e5d
smoother stand control
mokiat Jun 24, 2020
b33db4d
switch to new suv model
mokiat Jun 24, 2020
6a92166
remove old vehicle models
mokiat Jun 24, 2020
479e892
add leafy tree model
mokiat Jun 30, 2020
819f455
update forest & highway levels
mokiat Jun 30, 2020
975f187
increase ambient lighting
mokiat Jun 30, 2020
6bb4763
decrease trigger sensitivity
mokiat Jun 30, 2020
494d6a6
bump lacking
mokiat Jun 30, 2020
9efd103
remove unused asphalt texture
mokiat Jun 30, 2020
dfddfb8
remove unused finish model
mokiat Jun 30, 2020
9e280e7
remove unused tree model
mokiat Jun 30, 2020
3f3a880
remove old model generation
mokiat Jun 30, 2020
c0179b6
remove old model resource model
mokiat Jun 30, 2020
c6aa5b6
use data buffer from lacking
mokiat Jun 30, 2020
dcf9b96
improve vehicle system
mokiat Jul 1, 2020
69d65d6
bump lacking
mokiat Aug 21, 2020
4d675ba
bump lacking
mokiat Oct 25, 2020
ff39235
generate levels via lacking pack
mokiat Oct 26, 2020
2ed1ef0
update preview image
mokiat Oct 26, 2020
79cbcea
update scripts and readme
mokiat Oct 26, 2020
c0e646c
bump lacking
mokiat Oct 26, 2020
975b8e8
Merge remote-tracking branch 'origin/master' into lacking_master
mokiat Oct 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 5 additions & 227 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,229 +1,7 @@
RESOURCES_DIR=resources
ASSETS_DIR=assets
LEVEL_RESOURCES_DIR=$(RESOURCES_DIR)/levels
LEVEL_ASSETS_DIR=$(ASSETS_DIR)/levels
SHADER_RESOURCES_DIR=$(RESOURCES_DIR)/shaders
PROGRAM_ASSETS_DIR=$(ASSETS_DIR)/programs
MODEL_RESOURCES_DIR=$(RESOURCES_DIR)/models
MODEL_ASSETS_DIR=$(ASSETS_DIR)/models
MESH_RESOURCES_DIR=$(RESOURCES_DIR)/meshes
MESH_ASSETS_DIR=$(ASSETS_DIR)/meshes
CUBE_TEX_RESOURCES_DIR=$(RESOURCES_DIR)/textures/cube
CUBE_TEX_ASSETS_DIR=$(ASSETS_DIR)/textures/cube
TWOD_TEX_RESOURCES_DIR=$(RESOURCES_DIR)/textures/twod
TWOD_TEX_ASSETS_DIR=$(ASSETS_DIR)/textures/twod

.PHONY: assets
assets: levels programs models meshes cubetextures twodtextures

.PHONY: levels
levels: \
$(LEVEL_ASSETS_DIR) \
$(LEVEL_ASSETS_DIR)/forest.dat \
$(LEVEL_ASSETS_DIR)/highway.dat \
$(LEVEL_ASSETS_DIR)/playground.dat

$(LEVEL_ASSETS_DIR):
mkdir -p $(LEVEL_ASSETS_DIR)

$(LEVEL_ASSETS_DIR)/forest.dat: \
$(LEVEL_RESOURCES_DIR)/forest.json
rallygen level $+ $@

$(LEVEL_ASSETS_DIR)/highway.dat: \
$(LEVEL_RESOURCES_DIR)/highway.json
rallygen level $+ $@

$(LEVEL_ASSETS_DIR)/playground.dat: \
$(LEVEL_RESOURCES_DIR)/playground.json
rallygen level $+ $@

.PHONY: programs
programs: \
$(PROGRAM_ASSETS_DIR) \
$(PROGRAM_ASSETS_DIR)/diffuse.dat \
$(PROGRAM_ASSETS_DIR)/skybox.dat \
$(PROGRAM_ASSETS_DIR)/deferred-geometry.dat \
$(PROGRAM_ASSETS_DIR)/deferred-lighting.dat \
$(PROGRAM_ASSETS_DIR)/debug.dat

$(PROGRAM_ASSETS_DIR):
mkdir -p "$(PROGRAM_ASSETS_DIR)"

$(PROGRAM_ASSETS_DIR)/diffuse.dat: \
$(SHADER_RESOURCES_DIR)/diffuse.vert \
$(SHADER_RESOURCES_DIR)/diffuse.frag
rallygen program $+ $@

$(PROGRAM_ASSETS_DIR)/skybox.dat: \
$(SHADER_RESOURCES_DIR)/skybox.vert \
$(SHADER_RESOURCES_DIR)/skybox.frag
rallygen program $+ $@

$(PROGRAM_ASSETS_DIR)/deferred-geometry.dat: \
$(SHADER_RESOURCES_DIR)/deferred-geometry.vert \
$(SHADER_RESOURCES_DIR)/deferred-geometry.frag
rallygen program $+ $@

$(PROGRAM_ASSETS_DIR)/deferred-lighting.dat: \
$(SHADER_RESOURCES_DIR)/deferred-lighting.vert \
$(SHADER_RESOURCES_DIR)/deferred-lighting.frag
rallygen program $+ $@

$(PROGRAM_ASSETS_DIR)/debug.dat: \
$(SHADER_RESOURCES_DIR)/debug.vert \
$(SHADER_RESOURCES_DIR)/debug.frag
rallygen program $+ $@

.PHONY: models
models: \
$(MODEL_ASSETS_DIR) \
$(MODEL_ASSETS_DIR)/tree.dat \
$(MODEL_ASSETS_DIR)/lamp.dat \
$(MODEL_ASSETS_DIR)/finish.dat \
$(MODEL_ASSETS_DIR)/suv.dat \
$(MODEL_ASSETS_DIR)/hatch.dat \
$(MODEL_ASSETS_DIR)/truck.dat

$(MODEL_ASSETS_DIR):
mkdir -p "$(MODEL_ASSETS_DIR)"

$(MODEL_ASSETS_DIR)/tree.dat: \
$(MODEL_RESOURCES_DIR)/tree.json
rallygen model $+ $@

$(MODEL_ASSETS_DIR)/lamp.dat: \
$(MODEL_RESOURCES_DIR)/lamp.json
rallygen model $+ $@

$(MODEL_ASSETS_DIR)/finish.dat: \
$(MODEL_RESOURCES_DIR)/finish.json
rallygen model $+ $@

$(MODEL_ASSETS_DIR)/hatch.dat: \
$(MODEL_RESOURCES_DIR)/hatch.json
rallygen model $+ $@

$(MODEL_ASSETS_DIR)/suv.dat: \
$(MODEL_RESOURCES_DIR)/suv.json
rallygen model $+ $@

$(MODEL_ASSETS_DIR)/truck.dat: \
$(MODEL_RESOURCES_DIR)/truck.json
rallygen model $+ $@

.PHONY: meshes
meshes: \
$(MESH_ASSETS_DIR) \
$(MESH_ASSETS_DIR)/quad.dat \
$(MESH_ASSETS_DIR)/skybox.dat

$(MESH_ASSETS_DIR):
mkdir -p "$(MESH_ASSETS_DIR)"

$(MESH_ASSETS_DIR)/quad.dat: \
$(MESH_RESOURCES_DIR)/quad.json
rallygen mesh $+ $@

$(MESH_ASSETS_DIR)/skybox.dat: \
$(MESH_RESOURCES_DIR)/skybox.json
rallygen mesh $+ $@

.PHONY: cubetextures
cubetextures: \
$(CUBE_TEX_ASSETS_DIR) \
$(CUBE_TEX_ASSETS_DIR)/city.dat

$(CUBE_TEX_ASSETS_DIR):
mkdir -p "$(CUBE_TEX_ASSETS_DIR)"

$(CUBE_TEX_ASSETS_DIR)/city.dat: \
$(CUBE_TEX_RESOURCES_DIR)/city_front.png \
$(CUBE_TEX_RESOURCES_DIR)/city_back.png \
$(CUBE_TEX_RESOURCES_DIR)/city_left.png \
$(CUBE_TEX_RESOURCES_DIR)/city_right.png \
$(CUBE_TEX_RESOURCES_DIR)/city_top.png \
$(CUBE_TEX_RESOURCES_DIR)/city_bottom.png
rallygen cubetex --dimension 512 $+ $@

.PHONY: twodtextures
twodtextures: \
$(TWOD_TEX_ASSETS_DIR) \
$(TWOD_TEX_ASSETS_DIR)/loading.dat \
$(TWOD_TEX_ASSETS_DIR)/tree.dat \
$(TWOD_TEX_ASSETS_DIR)/lamp.dat \
$(TWOD_TEX_ASSETS_DIR)/finish.dat \
$(TWOD_TEX_ASSETS_DIR)/hatch_body.dat \
$(TWOD_TEX_ASSETS_DIR)/hatch_wheel.dat \
$(TWOD_TEX_ASSETS_DIR)/suv_body.dat \
$(TWOD_TEX_ASSETS_DIR)/suv_wheel.dat \
$(TWOD_TEX_ASSETS_DIR)/truck_body.dat \
$(TWOD_TEX_ASSETS_DIR)/truck_wheel.dat \
$(TWOD_TEX_ASSETS_DIR)/concrete.dat \
$(TWOD_TEX_ASSETS_DIR)/road.dat \
$(TWOD_TEX_ASSETS_DIR)/barrier.dat \
$(TWOD_TEX_ASSETS_DIR)/grass.dat \
$(TWOD_TEX_ASSETS_DIR)/gravel.dat

$(TWOD_TEX_ASSETS_DIR):
mkdir -p "$(TWOD_TEX_ASSETS_DIR)"

$(TWOD_TEX_ASSETS_DIR)/loading.dat: \
$(TWOD_TEX_RESOURCES_DIR)/loading.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/tree.dat: \
$(TWOD_TEX_RESOURCES_DIR)/tree.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/lamp.dat: \
$(TWOD_TEX_RESOURCES_DIR)/lamp.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/finish.dat: \
$(TWOD_TEX_RESOURCES_DIR)/finish.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/hatch_body.dat: \
$(TWOD_TEX_RESOURCES_DIR)/hatch_body.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/hatch_wheel.dat: \
$(TWOD_TEX_RESOURCES_DIR)/hatch_wheel.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/suv_body.dat: \
$(TWOD_TEX_RESOURCES_DIR)/suv_body.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/suv_wheel.dat: \
$(TWOD_TEX_RESOURCES_DIR)/suv_wheel.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/truck_body.dat: \
$(TWOD_TEX_RESOURCES_DIR)/truck_body.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/truck_wheel.dat: \
$(TWOD_TEX_RESOURCES_DIR)/truck_wheel.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/concrete.dat: \
$(TWOD_TEX_RESOURCES_DIR)/concrete.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/road.dat: \
$(TWOD_TEX_RESOURCES_DIR)/road.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/barrier.dat: \
$(TWOD_TEX_RESOURCES_DIR)/barrier.png
rallygen twodtex $+ $@

$(TWOD_TEX_ASSETS_DIR)/grass.dat: \
$(TWOD_TEX_RESOURCES_DIR)/grass.png
rallygen twodtex $+ $@
assets:
go run cmd/rallypack/main.go

$(TWOD_TEX_ASSETS_DIR)/gravel.dat: \
$(TWOD_TEX_RESOURCES_DIR)/gravel.png
rallygen twodtex $+ $@
.PHONY: play
play:
go run cmd/rallymka/main.go
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ Rally MKA is a really old game of mine ported to Go for fun and as a way to try

![Game Screenshot](preview.png)

**WARNING:** This repository is under heavy refactoring, experimentation and redesign and no branch is currently guaranteed to be stable or well documented! I am hoping to get things sorted out eventually and have feature branches contain experimental stuff.

## Remarks

Being a port of a very old project of mine, some remarks are in order:

* Though some parts of the code I have rewritten entirely, others I have left as they were originally. Hence, nasty variable names and difficult to understand formulas are to be expected. The project was originally written in Delphi, back when 'clean code' wasn't something I was aware of.
* Currently, the physics of the car is whacky. It was meant to be that way when I originally wrote it - I wanted a strange rally type drifting feel to it.
* Though some corrections on the art have been made, it is quite dated.
**WARNING:** This repository is under development, experimentation and redesign and is not guaranteed to be stable or well documented!

## Getting Started

This section describes how to setup the project and run the game locally. If you are interested in just running the game, check the [Releases](https://github.com/mokiat/rally-mka/releases) section of the repository.
This section describes how to setup the project and run the game locally.

### Prerequisites

* You need [Go 1.14](https://golang.org/dl/) or newer.
* You need [Go 1.15](https://golang.org/dl/) or newer.
* You need the [Git LFS](https://git-lfs.github.com/) plugin. As the project contains large images and models, this is the official way on how not to clog a repository.

### Setting Up
Expand All @@ -44,14 +36,6 @@ This section describes how to setup the project and run the game locally. If you
go mod download
```

1. Build the rallygen tool

```sh
(cd cmd/rallygen && go install)
```

**Note:** This tool is used to convert raw image and model resources into an optimized format for the game.

1. Generate game assets

```sh
Expand All @@ -61,7 +45,7 @@ This section describes how to setup the project and run the game locally. If you
1. Run the game

```sh
go run cmd/rallymka/main.go
make play
```

## Licensing
Expand All @@ -81,3 +65,4 @@ The following projects and individuals have contributed significantly to the pro
* **[GLFW for Go](https://github.com/go-gl/glfw)** for making it possible to use GLFW and OpenGL in Go.
* **[Bo0mer](https://github.com/Bo0mer)** for the panoramic image that was used to generate the individual `city` skybox images.
* **[Erin Catto](https://github.com/erincatto)** for all the presentations and articles that were used as reference.
* **[TextureHeaven](https://texturehaven.com/)** for the free images.
32 changes: 0 additions & 32 deletions bundle/Info.plist

This file was deleted.

Binary file removed bundle/Resources/AppIcon.icns
Binary file not shown.
Loading