Compare commits
13 commits
0.1.3_MAIN
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
ab03ad2106 | ||
|
1a0689d5d7 | ||
|
6ae93c4feb | ||
|
553e6d0c01 | ||
|
cc16329196 | ||
|
2b2b69a8e4 | ||
|
0ede542486 | ||
|
deb3d64bf8 | ||
|
8f1e0ddb3c | ||
|
f3336c0e34 | ||
|
3e342e4120 | ||
|
4f0d85fa51 | ||
|
2005c43822 |
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -1,3 +1,13 @@
|
||||||
|
/target
|
||||||
|
/lib
|
||||||
|
/classes
|
||||||
|
/checkouts
|
||||||
|
pom.xml
|
||||||
|
*.jar
|
||||||
|
*.class
|
||||||
|
/.lein-*
|
||||||
|
/.env
|
||||||
|
*.log
|
||||||
|
|
||||||
# Links to other places:
|
# Links to other places:
|
||||||
resources/public/docs/mw-*/uberdoc.html
|
resources/public/docs/mw-*/uberdoc.html
|
||||||
|
|
14
README.md
14
README.md
|
@ -1,6 +1,18 @@
|
||||||
|
## Part of the overall MicroWorld system
|
||||||
|
|
||||||
|
*mw-ui* is not a stand-alone project. To use it you also need at least
|
||||||
|
[mw-parser](https://github.com/simon-brooke/mw-parser) and
|
||||||
|
[mw-engine](https://github.com/simon-brooke/mw-engine). There will be other
|
||||||
|
modules in due course.
|
||||||
|
|
||||||
|
You can see MicroWorld in action [here](http://www.journeyman.cc/microworld/) -
|
||||||
|
but please don't be mean to my poor little server. If you want to run big maps
|
||||||
|
or complex rule-sets, please run it on your own machines.
|
||||||
|
|
||||||
## What this is about
|
## What this is about
|
||||||
|
|
||||||
<img alt="Screenshot" id="screenshot" style="float: left; padding-right: 2em;" src="img/screenshot_med.png"/>
|
<img alt="Screenshot" id="screenshot" alt="MicroWrold in action"
|
||||||
|
style="float: left; padding-right: 2em;" src="img/screenshot_med.png"/>
|
||||||
MicroWorld is a rule driven cellular automaton. What does that mean? Well, it's
|
MicroWorld is a rule driven cellular automaton. What does that mean? Well, it's
|
||||||
a two dimensional world made up of squares called **cells**. The world develops
|
a two dimensional world made up of squares called **cells**. The world develops
|
||||||
in steps, and at each step, each cell is modified by applying the rules.
|
in steps, and at each step, each cell is modified by applying the rules.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(defproject mw-ui "0.1.3"
|
(defproject mw-ui "0.1.5-SNAPSHOT"
|
||||||
:description "Web-based user interface for MicroWorld"
|
:description "Web-based user interface for MicroWorld"
|
||||||
:url "http://www.journeyman.cc/microworld"
|
:url "http://www.journeyman.cc/microworld"
|
||||||
:manifest {
|
:manifest {
|
||||||
|
@ -9,8 +9,8 @@
|
||||||
"Implementation-Version" "unset"
|
"Implementation-Version" "unset"
|
||||||
}
|
}
|
||||||
:dependencies [[org.clojure/clojure "1.6.0"]
|
:dependencies [[org.clojure/clojure "1.6.0"]
|
||||||
[mw-engine "0.1.3"]
|
[mw-engine "0.1.5-SNAPSHOT"]
|
||||||
[mw-parser "0.1.3"]
|
[mw-parser "0.1.5-SNAPSHOT"]
|
||||||
[lib-noir "0.8.4"]
|
[lib-noir "0.8.4"]
|
||||||
[ring-server "0.3.1"]
|
[ring-server "0.3.1"]
|
||||||
[selmer "0.6.8"]
|
[selmer "0.6.8"]
|
||||||
|
|
BIN
resources/public/img/heightmaps/test.heightmap.xcf
Normal file
BIN
resources/public/img/heightmaps/test.heightmap.xcf
Normal file
Binary file not shown.
1
resources/public/img/tiles/navigable.png
Symbolic link
1
resources/public/img/tiles/navigable.png
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
error.png
|
1
resources/public/img/tiles/river.png
Symbolic link
1
resources/public/img/tiles/river.png
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
water.png
|
1
resources/public/img/tiles/sea.png
Symbolic link
1
resources/public/img/tiles/sea.png
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
water.png
|
150
resources/public/rulesets/with-drainage.txt
Normal file
150
resources/public/rulesets/with-drainage.txt
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
# Human settlement
|
||||||
|
|
||||||
|
;; This rule set adds ideas aboutv rainfall and river drainage to the human settlement ruleset.
|
||||||
|
;; This depends on transforming the world with the drainage functions before starting running
|
||||||
|
;; the rule set, and that isn't done by default because it is computationally expensive.
|
||||||
|
|
||||||
|
;; hack to speed up processing on the 'great britain and ireland' map
|
||||||
|
if state is sea then state should be sea
|
||||||
|
|
||||||
|
;; nomads make their first significant camp near sea because of fish and
|
||||||
|
;; shellfish (kitchen-midden people)
|
||||||
|
if state is in grassland or heath and more than 3 neighbours are sea and generation is more than 20 then state should be camp
|
||||||
|
|
||||||
|
;; sooner or later nomads learn to keep flocks
|
||||||
|
if state is in grassland or heath and some neighbours are camp then 1 chance in 2 state should be pasture
|
||||||
|
|
||||||
|
;; and more herds support more people
|
||||||
|
if state is in grassland or heath and more than 2 neighbours are pasture then 1 chance in 3 state should be camp
|
||||||
|
if state is pasture and more than 3 neighbours are pasture and fewer than 1 neighbours are camp and fewer than 1 neighbours within 2 are house then state should be camp
|
||||||
|
|
||||||
|
;; the idea of agriculture spreads
|
||||||
|
if state is in grassland or heath and some neighbours within 2 are house then state should be pasture
|
||||||
|
|
||||||
|
;; nomads don't move on while the have crops growing. That would be silly!
|
||||||
|
if state is camp and some neighbours are ploughland then state should be camp
|
||||||
|
|
||||||
|
;; Impoverished pasture can't be grazed permanently
|
||||||
|
if state is pasture and fertility is less than 2 then 1 chance in 3 state should be heath
|
||||||
|
|
||||||
|
;; nomads move on
|
||||||
|
if state is camp then 1 chance in 5 state should be waste
|
||||||
|
|
||||||
|
;; pasture that's too far from a house or camp will be abandoned
|
||||||
|
if state is pasture and fewer than 1 neighbours within 3 are house and fewer than 1 neighbours within 2 are camp then state should be heath
|
||||||
|
|
||||||
|
;; markets spring up near settlements
|
||||||
|
if state is in grassland or pasture and more than 1 neighbours are house then 1 chance in 10 state should be market
|
||||||
|
|
||||||
|
;; good fertile pasture close to settlement will be ploughed for crops
|
||||||
|
if state is pasture and fertility is more than 10 and altitude is less than 100 and some neighbours are camp or some neighbours are house then state should be ploughland
|
||||||
|
|
||||||
|
if state is ploughland then state should be crop
|
||||||
|
|
||||||
|
;; after the crop is harvested, the land is allowed to lie fallow. But cropping
|
||||||
|
;; depletes fertility.
|
||||||
|
if state is crop then state should be grassland and fertility should be fertility - 1
|
||||||
|
|
||||||
|
;; if there's reliable food available, nomads build permanent settlements
|
||||||
|
if state is in camp or abandoned and some neighbours are crop then state should be house
|
||||||
|
if state is abandoned and some neighbours are pasture then state should be house
|
||||||
|
;; people camp near to markets
|
||||||
|
if state is in waste or grassland and some neighbours are market then state should be camp
|
||||||
|
|
||||||
|
;; a market in a settlement survives
|
||||||
|
if state is market and some neighbours are inn then state should be market
|
||||||
|
;; a market at a river mouth survives
|
||||||
|
if state is market and some neighbours are navigable and some neighbours are sea then state should be market
|
||||||
|
;; otherwise markets are transitory
|
||||||
|
if state is market then state should be grassland
|
||||||
|
|
||||||
|
;; a house near a market in a settlement will become an inn
|
||||||
|
if state is house and some neighbours are market and more than 1 neighbours are house then 1 chance in 5 state should be inn
|
||||||
|
;; but it will need some local custom to survive
|
||||||
|
if state is inn and fewer than 3 neighbours are house then state should be house
|
||||||
|
|
||||||
|
;; if there aren't enough resources houses should be abandoned
|
||||||
|
;; resources from fishing
|
||||||
|
if state is house and more than 2 neighbours are sea then state should be house
|
||||||
|
;; from farming
|
||||||
|
if state is house and some neighbours are pasture then state should be house
|
||||||
|
if state is house and some neighbours are ploughland then state should be house
|
||||||
|
if state is house and some neighbours are crop then state should be house
|
||||||
|
;; from the market
|
||||||
|
if state is house and some neighbours are market then state should be house
|
||||||
|
if state is house then 1 chance in 2 state should be abandoned
|
||||||
|
if state is abandoned then 1 chance in 5 state should be waste
|
||||||
|
|
||||||
|
|
||||||
|
## Vegetation rules
|
||||||
|
;; rules which populate the world with plants
|
||||||
|
|
||||||
|
;; Occasionally, passing birds plant tree seeds into grassland
|
||||||
|
|
||||||
|
if state is grassland then 1 chance in 10 state should be heath
|
||||||
|
|
||||||
|
;; heath below the treeline grows gradually into forest
|
||||||
|
|
||||||
|
if state is heath and altitude is less than 120 then state should be scrub
|
||||||
|
if state is scrub then 1 chance in 5 state should be forest
|
||||||
|
|
||||||
|
;; Forest on fertile land grows to climax
|
||||||
|
|
||||||
|
if state is forest and fertility is more than 5 and altitude is less than 70 then state should be climax
|
||||||
|
|
||||||
|
;; Climax forest occasionally catches fire (e.g. lightning strikes)
|
||||||
|
|
||||||
|
if state is climax then 1 chance in 500 state should be fire
|
||||||
|
|
||||||
|
;; Forest neighbouring fires is likely to catch fire. So are buildings.
|
||||||
|
if state is in forest or climax or camp or house or inn and some neighbours are fire then 1 chance in 3 state should be fire
|
||||||
|
|
||||||
|
;; Climax forest near to settlement may be cleared for timber
|
||||||
|
if state is climax and more than 3 neighbours within 2 are house then state should be scrub
|
||||||
|
|
||||||
|
;; After fire we get waste
|
||||||
|
|
||||||
|
if state is fire then state should be waste
|
||||||
|
|
||||||
|
;; waste near settlement that is fertile becomes ploughland
|
||||||
|
if state is waste and fertility is more than 10 and some neighbours are house or some neighbours are camp then state should be ploughland
|
||||||
|
|
||||||
|
;; And after waste we get pioneer species; if there's a woodland seed
|
||||||
|
;; source, it's going to be heath, otherwise grassland.
|
||||||
|
|
||||||
|
if state is waste and some neighbours are scrub then state should be heath
|
||||||
|
if state is waste and some neighbours are forest then state should be heath
|
||||||
|
if state is waste and some neighbours are climax then state should be heath
|
||||||
|
if state is waste then state should be grassland
|
||||||
|
|
||||||
|
|
||||||
|
## Rivers connected to the sea are navigable
|
||||||
|
if state is river and some neighbours are sea then state should be navigable
|
||||||
|
if state is river and some neighbours are navigable then state should be navigable
|
||||||
|
|
||||||
|
## Where navigable water meets the sea, ports are probable
|
||||||
|
if state is in grassland or heath or scrub and some neighbours are sea and some neighbours are navigable and some neighbours are house then state should be market
|
||||||
|
|
||||||
|
## Potential blockers
|
||||||
|
|
||||||
|
;; Forest increases soil fertility.
|
||||||
|
if state is in forest or climax then fertility should be fertility + 1
|
||||||
|
|
||||||
|
## Initialisation rules
|
||||||
|
|
||||||
|
;; Rules which deal with state 'new' will waste less time if they're near the
|
||||||
|
;; end of the file
|
||||||
|
|
||||||
|
;; below the high-tide line we have sea.
|
||||||
|
|
||||||
|
if state is new and altitude is less than 10 then state should be sea
|
||||||
|
|
||||||
|
;; above the high-tide line, there's a threshold of water pressure above which we have rivers
|
||||||
|
;; the actual threshold will need tuning, 30 is a guess.
|
||||||
|
if state is new and flow is more than 30 then state should be river
|
||||||
|
|
||||||
|
;; above the snowline we have snow.
|
||||||
|
if state is new and altitude is more than 200 then state should be snow
|
||||||
|
|
||||||
|
;; otherwise, we have grassland.
|
||||||
|
if state is new then state should be grassland
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<title>{{title}}</title>
|
<title>{{title}}</title>
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<div id="credits">
|
<div id="credits">
|
||||||
Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
|
Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
|
||||||
<img height="16" width="16" align="top" src="img/clojure-icon.gif"> Powered by <a href="http://clojure.org">Clojure</a> ||
|
<img height="16" width="16" align="top" src="img/clojure-icon.gif" alt="λ"> Powered by <a href="http://clojure.org">Clojure</a> ||
|
||||||
Engineering and hosting by <a href="http://www.journeyman.cc">Journeyman</a> ||
|
Engineering and hosting by <a href="http://www.journeyman.cc">Journeyman</a> ||
|
||||||
World generated using <a href="http://git.journeyman.cc/?p=mw-engine;a=summary">MicroWorld Engine</a>
|
World generated using <a href="http://git.journeyman.cc/?p=mw-engine;a=summary">MicroWorld Engine</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue