A game engine for top-down 2D RPG games.
rpg game-engine raylib c99
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clean up build system and readme

Emmeline 9c66deb5 23877352

+98 -118
+33 -37
readme
··· 11 11 Motive 12 12 ------ 13 13 14 - There's already a large number of quality game engines 15 - and frameworks in the wild, so what does Keraforge do 16 - differently? 17 - 18 14 Design: 19 - Keraforge is designed with a specific kind of game in 20 - mind: top-down, story-driven, handcrafted RPGs. If your 21 - dream game fits in this category, then Keraforge aims to 22 - help make it a reality. 15 + Keraforge is designed with a specific kind of game in mind: 16 + top-down, story-driven, handcrafted RPGs. If your game fits 17 + in this category, then Keraforge aims to help make it a 18 + reality. 23 19 24 20 Simplicity: 25 - Game engines and frameworks always have a learning 26 - curve. Keraforge is no exception. What I can aim for, 27 - though, is keep the learning curve from being exponential 28 - and overwhelming users. I want Keraforge to allow anyone 29 - to share their story with an engine that gives them the 30 - ability to pour love into their work. 21 + Game engines and frameworks always have a learning curve. 22 + Keraforge is no exception. What I can aim for, though, is 23 + keep the learning curve from being exponential and 24 + overwhelming users. I want Keraforge to allow anyone to 25 + share their story with an engine that gives them the 26 + ability to pour love into their work. 31 27 32 28 Cost: 33 - Keraforge is 100% free (BSD 3-Clause), zero royalties, 34 - no up-front costs, and no paywalls. I want to give people 35 - the chance to create something beautiful, not to take 36 - their money. 29 + Keraforge is 100% free (BSD 3-Clause), zero royalties, no 30 + up-front costs, and no paywalls. I want to give people the 31 + chance to create something beautiful, not to take their 32 + money. 37 33 38 - It's also important to discuss the cons of Keraforge. 39 - It's going to be fundamentally different from any other 40 - engine since it's made for a very specific style of game. 41 - This means that if your game does not fit this style, you 42 - might have more trouble. 34 + It's also important to discuss the cons of Keraforge. It's 35 + going to be fundamentally different from any other engine 36 + since it's made for a very specific style of game. This 37 + means that if your game does not fit this style, you might 38 + have more trouble. 43 39 44 40 Usage 45 41 ----- 46 42 47 - Pre-built binaries are not *yet* distributed. I'll start 43 + Pre-built binaries are not *yet* distributed. I'll start 48 44 publishing binaries once the engine reaches a stable state. 49 45 For now, you can compile it yourself. See the section on 50 46 development below. 51 47 52 - If you want to see my development progress, see <todo>. 48 + If you want to see my development progress, see <todo>. 53 49 54 50 Develop 55 51 ------- 56 52 57 - Libraries (Debian): 58 - Raylib: 59 - libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev 60 - Keraforge: 61 - liblzma-dev 53 + Libraries (Debian): 54 + Raylib: 55 + libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev 56 + Keraforge: 57 + liblzma-dev 62 58 63 - Initialise a development environment: 64 - `sh run.sh init` 59 + Initialise a development environment: 60 + $ sh run.sh init 65 61 66 - Build "system" is contained in a folder of shell scripts, 67 - `scripts`. You can run these with the `run.sh` script to 62 + Build "system" is contained in a folder of shell scripts, 63 + <scripts>. You can run these with the <run.sh> script to 68 64 run multiple tasks in order. Generally: 69 - `sh run.sh build run` 65 + $ sh run.sh build/debug run/gdb` 70 66 is all you'll need to run while developing. 71 67 72 - Please note that I will be hesitant to accept PRs to this 68 + Please note that I will be hesitant to accept PRs to this 73 69 codebase. I am very nitpicky with my code style and if your 74 70 PR does not match it (or if it goes out-of-scope, adds 75 71 useless/redundant functions, further pollute global scope, ··· 79 75 contact information on my website. I don't want you wasting 80 76 your time or effort! 81 77 82 - Additionally, please read through <etc/style.txt> before 78 + Additionally, please read through <etc/style.txt> before 83 79 attempting to contribute. It'll make your life much easier 84 80 if you understand my style *before* attempting a PR. 85 81
+5 -2
scripts/_config.sh
··· 10 10 export KF_DEBUG_CFLAGS="-g -DKF_SANITY_CHECKS" 11 11 export KF_DEBUG_LFLAGS="-g -rdynamic" 12 12 13 - export CFLAGS="-Wall -Wextra -Werror -std=c99 -Iinclude/ -Iraylib/src/ -c -DKF_GNU $KF_DEBUG_CFLAGS" 14 - export LFLAGS="raylib/src/libraylib.a -lm -lGL -lpthread -ldl -lrt -lX11 -llzma $KF_DEBUG_LFLAGS" 13 + export KF_INCL="-Iinclude/ -Iraylib/src/" 14 + export KF_LIBS="-lm -lGL -lpthread -ldl -lrt -lX11 -llzma" 15 + 16 + export CFLAGS="-Wall -Wextra -Werror -std=c99 $KF_INCL -c -DKF_GNU $KF_DEBUG_CFLAGS" 17 + export LFLAGS="raylib/src/libraylib.a $KF_LIBS $KF_DEBUG_LFLAGS"
-3
scripts/build-prod.sh scripts/build/prod.sh
··· 6 6 export CFLAGS="$CFLAGS -O3" 7 7 export LFLAGS="$LFLAGS -O3" 8 8 9 - sh scripts/functions/init.sh 10 9 sh scripts/functions/compile.sh 11 - sh scripts/functions/link.sh 12 - sh scripts/functions/cleanup.sh
-27
scripts/build-tools.sh
··· 1 - #!/usr/bin/env sh 2 - set -e 3 - 4 - . scripts/_config.sh 5 - 6 - mkdir -p build/tools/ 7 - 8 - echo ": compiling keraforge" 9 - for f in `find src/ -name '*.c'` 10 - do 11 - ff=$(echo "$f" | tr '/' '_') 12 - gcc $CFLAGS $f -o build/${ff%.c}.o 13 - done 14 - 15 - echo ": compiling tools" 16 - for f in `find tools/ -name '*.c'` 17 - do 18 - ff=$(echo "$f" | tr '/' '_') 19 - o=build/tools/${ff%.c}.o 20 - echo ": tool: $f->build/tools/${ff%.c}" 21 - gcc $CFLAGS $f -o $o 22 - gcc \ 23 - -o build/tools/${ff%.c} \ 24 - `find build -maxdepth 1 -name '*.o' ! -name '*src_main.o'` \ 25 - $o \ 26 - $LFLAGS 27 - done
-9
scripts/build.sh
··· 1 - #!/usr/bin/env sh 2 - set -e 3 - 4 - . scripts/_config.sh 5 - 6 - sh scripts/functions/init.sh 7 - sh scripts/functions/compile.sh 8 - sh scripts/functions/link.sh 9 - sh scripts/functions/cleanup.sh
+6
scripts/build/debug.sh
··· 1 + #!/usr/bin/env sh 2 + set -e 3 + 4 + . scripts/_config.sh 5 + 6 + sh scripts/functions/compile.sh
+20
scripts/build/tools.sh
··· 1 + #!/usr/bin/env sh 2 + set -e 3 + 4 + . scripts/_config.sh 5 + 6 + mkdir -p build/tools/ 7 + 8 + echo ": compiling tools" 9 + for input in `find tools/ -name '*.c'` 10 + do 11 + output=$(basename $input) 12 + output=build/tools/${output%.c}.o 13 + echo ": tool: $input->$output" 14 + gcc $CFLAGS $input -o $output 15 + gcc \ 16 + -o ${output%.o} \ 17 + `find build -maxdepth 1 -name '*.o' ! -name '*main.o'` \ 18 + $output \ 19 + $LFLAGS 20 + done
+18
scripts/fetch/raylib.sh
··· 1 + #!/usr/bin/env sh 2 + set -e 3 + 4 + RAYLIB_VERSION=5.5 5 + 6 + if [ ! -e "raylib.tar.gz" ] 7 + then 8 + curl -Lo raylib.tar.gz https://github.com/raysan5/raylib/archive/refs/tags/$RAYLIB_VERSION.tar.gz 9 + fi 10 + 11 + if [ ! -e "raylib/" ] 12 + then 13 + tar -xkf raylib.tar.gz && mv -v raylib-$RAYLIB_VERSION raylib 14 + fi 15 + 16 + cd raylib/src 17 + make 18 + cd ../..
-5
scripts/functions/cleanup.sh
··· 1 - #!/usr/bin/env sh 2 - set -e 3 - 4 - echo ": cleaning up" 5 - rm build/*.o
+11 -3
scripts/functions/compile.sh
··· 1 1 #!/usr/bin/env sh 2 2 set -e 3 3 4 + echo ": cleaning up" 5 + mkdir -p build/ 6 + rm -f build/keraforge 7 + rm -f build/*.o 8 + 4 9 echo ": compiling" 5 - for f in `find src/ -name '*.c'` 10 + for input in `find src/ -name '*.c'` 6 11 do 7 - ff=$(echo "$f" | tr '/' '_') 8 - gcc $CFLAGS $f -o build/${ff%.c}.o 12 + output=$(basename $input) 13 + gcc $CFLAGS $input -o build/${output%.c}.o 9 14 done 10 15 16 + echo ": linking" 17 + gcc -o build/keraforge build/*.o $LFLAGS 18 +
-9
scripts/functions/init.sh
··· 1 - #!/usr/bin/env sh 2 - set -e 3 - 4 - mkdir -p build/ 5 - 6 - if [ -e "build/keraforge" ] 7 - then 8 - rm build/keraforge 9 - fi
-5
scripts/functions/link.sh
··· 1 - #!/usr/bin/env sh 2 - set -e 3 - 4 - echo ": linking" 5 - gcc -o build/keraforge build/*.o $LFLAGS
+1 -17
scripts/init.sh
··· 1 1 #!/usr/bin/env sh 2 - 3 2 set -e 4 3 5 - RAYLIB_VERSION=5.5 6 - 7 - if [ ! -e "raylib.tar.gz" ] 8 - then 9 - curl -Lo raylib.tar.gz https://github.com/raysan5/raylib/archive/refs/tags/$RAYLIB_VERSION.tar.gz 10 - fi 11 - 12 - if [ ! -e "raylib/" ] 13 - then 14 - tar -xkf raylib.tar.gz && mv -v raylib-$RAYLIB_VERSION raylib 15 - fi 16 - 17 - cd raylib/src 18 - make 19 - cd ../.. 20 - 4 + sh scripts/fetch/raylib.sh
scripts/run-valgrind.sh scripts/run/valgrind.sh
scripts/run.sh scripts/run/gdb.sh
+4 -1
todo
··· 9 9 10 10 . Core 11 11 . World 12 - x Tiles 12 + / Tiles 13 + . Interactions 14 + . Animations 13 15 / Actors 14 16 x Rendering 15 17 x Serialization 16 18 . NPC paths (i.e, walking to/from locations. Stardew Valley style) 19 + . Interactions 17 20 x Compression 18 21 . Compress without saving the world binary as an intermediate step. 19 22