Reorganised resources, to differentiate between original and third party
6
.gitignore
vendored
|
@ -54,3 +54,9 @@ src/cc/journeyman/the_great_game/cloverage.clj
|
|||
.DS_Store
|
||||
|
||||
.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/
|
|
@ -1,10 +1,12 @@
|
|||
# Architecture
|
||||
|
||||
OK, the basic idea is this
|
||||
|
||||
Everything (every game object, including the world) is a map.
|
||||
|
||||
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.
|
||||
|
|
@ -11,7 +11,14 @@
|
|||
:output-path "docs/codox"
|
||||
:source-uri "https://github.com/simon-brooke/the-great-game/blob/master/{filepath}#L{line}"}
|
||||
: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"]
|
||||
[hiccup "2.0.0-RC3"]
|
||||
[jme-clj "0.1.13"]
|
||||
|
|
43
resources/jme3/README.md
Normal 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.
|
3
resources/original/README.md
Normal 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).
|
Before Width: | Height: | Size: 261 KiB After Width: | Height: | Size: 261 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 249 KiB |
Before Width: | Height: | Size: 349 KiB After Width: | Height: | Size: 349 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
25
resources/polyhaven/README.md
Normal 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.
|
Before Width: | Height: | Size: 62 KiB |
|
@ -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
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 174 KiB |
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 70 KiB |
|
@ -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
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 488 KiB |
Before Width: | Height: | Size: 172 KiB |
|
@ -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
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 261 KiB |
Before Width: | Height: | Size: 519 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 485 KiB |
Before Width: | Height: | Size: 208 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 45 KiB |
|
@ -34,32 +34,36 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(def cli-options
|
||||
;; An option with a required argument
|
||||
[["-p" "--port PORT" "Port number"
|
||||
:default 80
|
||||
: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"
|
||||
"I haven't yet thought out what command line arguments (if any) I need.
|
||||
This is a placeholder."
|
||||
[["-v" nil "Verbosity level"
|
||||
:id :verbosity
|
||||
:default 0
|
||||
:update-fn inc] ; Prior to 0.4.1, you would have to use:
|
||||
;; :assoc-fn (fn [m k _] (update-in m [k] inc))
|
||||
;; A boolean option defaulting to nil
|
||||
:update-fn inc]
|
||||
["-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)
|
||||
(let [grass (set* (load-texture "textures/terrain/splat/grass.jpg") :wrap Texture$WrapMode/Repeat)
|
||||
dirt (set* (load-texture "textures/terrain/splat/dirt.jpg") :wrap Texture$WrapMode/Repeat)
|
||||
rock (set* (load-texture "textures/terrain/splat/road.jpg") :wrap Texture$WrapMode/Repeat)
|
||||
mat (material "Common/MatDefs/Terrain/Terrain.j3md")
|
||||
height-map-tex (load-texture "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))]
|
||||
(let [grass (set* (load-texture "jme3/textures/terrain/splat/grass.jpg")
|
||||
:wrap Texture$WrapMode/Repeat)
|
||||
dirt (set* (load-texture "jme3/textures/terrain/splat/dirt.jpg")
|
||||
:wrap Texture$WrapMode/Repeat)
|
||||
rock (set* (load-texture "jme3/textures/terrain/splat/road.jpg")
|
||||
:wrap Texture$WrapMode/Repeat)
|
||||
mat (material "Common/MatDefs/Terrain/Terrain.j3md")
|
||||
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
|
||||
(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* :float "Tex1Scale" (float 64))
|
||||
(set* :texture "Tex2" dirt)
|
||||
|
@ -73,7 +77,7 @@
|
|||
(add-to-root)
|
||||
(add-control (terrain-lod-control terrain (cam))))))
|
||||
|
||||
(defsimpleapp app :init init)
|
||||
(defsimpleapp game :init init)
|
||||
|
||||
(defn -main
|
||||
"Launch the game."
|
||||
|
@ -81,7 +85,9 @@
|
|||
(parse-opts args cli-options)
|
||||
|
||||
;; 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))
|
||||
|