Reorganised resources, to differentiate between original and third party

This commit is contained in:
Simon Brooke 2024-04-23 11:15:18 +01:00
parent cb28151712
commit daa8e571f3
64 changed files with 119 additions and 70 deletions

6
.gitignore vendored
View file

@ -54,3 +54,9 @@ src/cc/journeyman/the_great_game/cloverage.clj
.DS_Store .DS_Store
.portal/ .portal/
# Excluding third party resources from the public repo;
# probably ought to list them in the README files.
resources/jme3/images/
resources/jme3/textures/
resources/polyhaven/textures/

View file

@ -1,10 +1,12 @@
# Architecture
OK, the basic idea is this OK, the basic idea is this
Everything (every game object, including the world) is a map. Everything (every game object, including the world) is a map.
Every object as an :id property; every :id property is distinct. Every object as an :id property; every :id property is distinct.
There is a master map - the `oblist` which contains every object, keyed by its :id. There is a master map - the `oblist` which contains every object, keyed by its :id. (Actually, there probably can't be such a map in working memory, because there will be too many objects. There will be such a map in the database -- but still keyed by :id).
Every object has a :run function, which returns either a new copy of itself or nil, and does not have side effects. Every object has a :run function, which returns either a new copy of itself or nil, and does not have side effects.

View file

@ -11,7 +11,14 @@
:output-path "docs/codox" :output-path "docs/codox"
:source-uri "https://github.com/simon-brooke/the-great-game/blob/master/{filepath}#L{line}"} :source-uri "https://github.com/simon-brooke/the-great-game/blob/master/{filepath}#L{line}"}
:cucumber-feature-paths ["test/features/"] :cucumber-feature-paths ["test/features/"]
:dependencies [[com.taoensso/timbre "6.5.0"] :dependencies [
;; sadly it seems SQL Korma is dead. I'm experimenting with Honey SQL,
;; but this is not a final decision yet.
[com.github.seancorfield/honeysql "2.6.1126"]
[com.github.seancorfield/next.jdbc "1.3.925"]
[com.simsilica/lemur "1.16.1-SNAPSHOT"]
[com.simsilica/sim-arboreal "1.0.1-SNAPSHOT"]
[com.taoensso/timbre "6.5.0"]
[environ "1.2.0"] [environ "1.2.0"]
[hiccup "2.0.0-RC3"] [hiccup "2.0.0-RC3"]
[jme-clj "0.1.13"] [jme-clj "0.1.13"]

43
resources/jme3/README.md Normal file
View file

@ -0,0 +1,43 @@
# README for jME3 sourced assets
These should hold assets sourced from jMonkeyEngine, which are under this
[BSD style license](https://jmonkeyengine.org/license/).
I'm excluding third party asset files from the public repository for now.
The files here at present are:
* images/Monkey.jpg
* textures/terrain/brickwall/BrickWall.dds
* textures/terrain/brickwall/BrickWall_dxt5.dds
* textures/terrain/brickwall/BrickWall_height.jpg
* textures/terrain/brickwall/BrickWall.j3m
* textures/terrain/brickwall/BrickWall.jpg
* textures/terrain/brickwall/BrickWall_normal.jpg
* textures/terrain/brickwall/BrickWall_normal_parallax.dds
* textures/terrain/brickwall/BrickWallPBR2.j3m
* textures/terrain/brickwall/BrickWallPBR.j3m
* textures/terrain/pond/Pond.dds
* textures/terrain/pond/Pond_dxt5.dds
* textures/terrain/pond/Pond.j3m
* textures/terrain/pond/Pond.jpg
* textures/terrain/pond/Pond_normal.png
* textures/terrain/rock/Rock.j3m
* textures/terrain/rock/Rock_normal.png
* textures/terrain/rock/Rock.PNG
* textures/terrain/splat/alpha1.png
* textures/terrain/splat/alpha2.png
* textures/terrain/splat/alphamap2.png
* textures/terrain/splat/alphamap.png
* textures/terrain/splat/dirt.jpg
* textures/terrain/splat/dirt_normal.png
* textures/terrain/splat/fortress512.png
* textures/terrain/splat/grass.jpg
* textures/terrain/splat/grass_normal.jpg
* textures/terrain/splat/mountains1024.jpg
* textures/terrain/splat/mountains128.png
* textures/terrain/splat/mountains512.png
* textures/terrain/splat/pools.png
* textures/terrain/splat/road.jpg
* textures/terrain/splat/road_normal.png
These are all taken from the [jME3 3.6.1-stable distribution zip](https://github.com/jMonkeyEngine/jmonkeyengine/releases/tag/v3.6.1-stable). Feel free to download it if you need them.

View file

@ -0,0 +1,3 @@
# README for original assets
These are assets original to The Great Game, and are under this [GNU General Public License, version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).

View file

Before

Width:  |  Height:  |  Size: 261 KiB

After

Width:  |  Height:  |  Size: 261 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

View file

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

View file

Before

Width:  |  Height:  |  Size: 349 KiB

After

Width:  |  Height:  |  Size: 349 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,25 @@
# README for assets sourced from Poly Haven
This directory should hold assets sourced from [Poly Haven](https://polyhaven.com/),
which are made available under
[Creative Commons Zero (CC0) license](https://creativecommons.org/publicdomain/zero/1.0/).
These are high quality, but they're also pretty big! For this reason they're
excluded from the public repository.
Files which are here at present are:
* from [Pine Bark](https://polyhaven.com/a/pine_bark)
* textures/pine_bark_4k.blend
* textures/pine_bark_diff_4k.jpg
* textures/pine_bark_disp_4k.png
* textures/pine_bark_nor_4k.exr
* textures/pine_bark_rough_4k.blend
* from [Sakura (cherry) bark](https://polyhaven.com/a/sakura_bark):
* textures/sakura_bark_4k.blend
* textures/sakura_bark_diff_4k.jpg
* textures/sakura_bark_disp_4k.png
* textures/sakura_bark_nor_gl_4k.exr
* textures/sakura_bark_rough_4k.exr
If you need these feel free to download them yourself.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

View file

@ -1,8 +0,0 @@
Material Pong Rock : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
Shininess : 2.0
DiffuseMap : Repeat Textures/Terrain/BrickWall/BrickWall.dds
NormalMap : Repeat Textures/Terrain/BrickWall/BrickWall_normal_parallax.dds
PackedNormalParallax : true
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

View file

@ -1,9 +0,0 @@
Material Pong Rock PBR : Common/MatDefs/Light/PBRLighting.j3md {
MaterialParameters {
Roughness : 1.0
Metallic : 0.0
BaseColorMap : Repeat Textures/Terrain/BrickWall/BrickWall.jpg
NormalMap : Repeat Textures/Terrain/BrickWall/BrickWall_normal_parallax.dds
PackedNormalParallax: true
}
}

View file

@ -1,8 +0,0 @@
Material Pong Rock PBR : Common/MatDefs/Light/PBRLighting.j3md {
MaterialParameters {
Roughness : 1.0
Metallic : 0.0
BaseColorMap : Repeat Textures/Terrain/BrickWall/BrickWall.jpg
ParallaxMap : Repeat Textures/Terrain/BrickWall/BrickWall_height.jpg
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

View file

@ -1,11 +0,0 @@
Material Pong Rock : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
DiffuseMap: Repeat Textures/Terrain/Pond/Pond.jpg
NormalMap: Repeat Textures/Terrain/Pond/Pond_normal.png
UseMaterialColors : true
Shininess: 32.0
Ambient : 0.2 0.2 0.2 1.0
Diffuse : 0.8 0.8 0.8 1.0
Specular : 0.3 0.3 0.3 1.0
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

View file

@ -1,7 +0,0 @@
Material Rock : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
Shininess: 16.0
DiffuseMap : Textures/Terrain/Rock/Rock.PNG
NormalMap : Textures/Terrain/Rock/Rock_normal.png
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View file

@ -34,32 +34,36 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def cli-options (def cli-options
;; An option with a required argument "I haven't yet thought out what command line arguments (if any) I need.
[["-p" "--port PORT" "Port number" This is a placeholder."
:default 80 [["-v" nil "Verbosity level"
:parse-fn #(Integer/parseInt %)
:validate [#(< 0 % 0x10000) "Must be a number between 0 and 65536"]]
;; A non-idempotent option (:default is applied first)
["-v" nil "Verbosity level"
:id :verbosity :id :verbosity
:default 0 :default 0
:update-fn inc] ; Prior to 0.4.1, you would have to use: :update-fn inc]
;; :assoc-fn (fn [m k _] (update-in m [k] inc))
;; A boolean option defaulting to nil
["-h" "--help"]]) ["-h" "--help"]])
(defn init [] (defn init
"Again, placeholder. This initialises a bit of standard jMonkeyEngine
terrain, just to check I have things wired up correctly."
[]
(set* (fly-cam) :move-speed 50) (set* (fly-cam) :move-speed 50)
(let [grass (set* (load-texture "textures/terrain/splat/grass.jpg") :wrap Texture$WrapMode/Repeat) (let [grass (set* (load-texture "jme3/textures/terrain/splat/grass.jpg")
dirt (set* (load-texture "textures/terrain/splat/dirt.jpg") :wrap Texture$WrapMode/Repeat) :wrap Texture$WrapMode/Repeat)
rock (set* (load-texture "textures/terrain/splat/road.jpg") :wrap Texture$WrapMode/Repeat) dirt (set* (load-texture "jme3/textures/terrain/splat/dirt.jpg")
mat (material "Common/MatDefs/Terrain/Terrain.j3md") :wrap Texture$WrapMode/Repeat)
height-map-tex (load-texture "textures/terrain/splat/mountains512.png") rock (set* (load-texture "jme3/textures/terrain/splat/road.jpg")
height-map (->> height-map-tex image image-based-height-map load-height-map) :wrap Texture$WrapMode/Repeat)
patch-size 65 mat (material "Common/MatDefs/Terrain/Terrain.j3md")
terrain (terrain-quad "my terrain" patch-size 513 (get-height-map height-map))] height-map-tex (load-texture
"jme3/textures/terrain/splat/mountains512.png")
height-map (->> height-map-tex image image-based-height-map
load-height-map)
patch-size 65
terrain (terrain-quad "my terrain" patch-size 513
(get-height-map height-map))]
(-> mat (-> mat
(set* :texture "Alpha" (load-texture "textures/terrain/splat/alphamap.png")) (set* :texture "Alpha"
(load-texture "jme3/textures/terrain/splat/alphamap.png"))
(set* :texture "Tex1" grass) (set* :texture "Tex1" grass)
(set* :float "Tex1Scale" (float 64)) (set* :float "Tex1Scale" (float 64))
(set* :texture "Tex2" dirt) (set* :texture "Tex2" dirt)
@ -73,7 +77,7 @@
(add-to-root) (add-to-root)
(add-control (terrain-lod-control terrain (cam)))))) (add-control (terrain-lod-control terrain (cam))))))
(defsimpleapp app :init init) (defsimpleapp game :init init)
(defn -main (defn -main
"Launch the game." "Launch the game."
@ -81,7 +85,9 @@
(parse-opts args cli-options) (parse-opts args cli-options)
;; this isn't working, not sure why not. ;; this isn't working, not sure why not.
;; (.setSettings app (app-settings false :dialog-image "images/splash.png")) (.setSettings game
(app-settings false
:dialog-image "original/images/splash.png"))
(start app)) (start game))