Beginning work on integrating actual j3o objects

This commit is contained in:
Simon Brooke 2024-05-04 17:48:19 +01:00
parent fa21ba9b97
commit 66a7649a54
7 changed files with 106 additions and 8 deletions

7
.gitignore vendored
View file

@ -1,3 +1,4 @@
/resources/jme3
/target
/classes
/checkouts
@ -17,3 +18,9 @@ pom.xml.asc
.hg/
*.so
*.blend*
resources/model-prototypes/*male.glb
resources/model-prototypes/*male.j3o

View file

@ -2,7 +2,7 @@
"">
<html><head><meta charset="UTF-8" /><title>cc.journeyman.simulated-genetics.launcher documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch current"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var-app"><div class="inner"><span>app</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var-cli-options"><div class="inner"><span>cli-options</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var-init"><div class="inner"><span>init</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.simulated-genetics.launcher</h1><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Start an app into which generated characters can ultimately be rendered.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L83">view source</a></div></div><div class="public anchor" id="var-app"><h3>app</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L81">view source</a></div></div><div class="public anchor" id="var-cli-options"><h3>cli-options</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>I havent yet thought out what command line arguments (if any) I need. This is a placeholder.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L88">view source</a></div></div><div class="public anchor" id="var-app"><h3>app</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L86">view source</a></div></div><div class="public anchor" id="var-cli-options"><h3>cli-options</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>I havent yet thought out what command line arguments (if any) I need. This is a placeholder.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L37">view source</a></div></div><div class="public anchor" id="var-init"><h3>init</h3><div class="usage"><code>(init)</code></div><div class="doc"><div class="markdown"><p>Again, placeholder. This initialises a bit of standard jMonkeyEngine terrain, just to check I have things wired up correctly.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L46">view source</a></div></div></div></body></html>

View file

@ -1,6 +1,7 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>cc.journeyman.simulated-genetics.makehuman-bridge documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch current"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialise-makehuman.21"><div class="inner"><span>initialise-makehuman!</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.simulated-genetics.makehuman-bridge</h1><div class="doc"><div class="markdown"><p>Bridge to MakeHuman, in an attempt to use it to generate character models.</p>
<html><head><meta charset="UTF-8" /><title>cc.journeyman.simulated-genetics.makehuman-bridge documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch current"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialise-makehuman.21"><div class="inner"><span>initialise-makehuman!</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialize-makehuman.21"><div class="inner"><span>initialize-makehuman!</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.simulated-genetics.makehuman-bridge</h1><div class="doc"><div class="markdown"><p>Bridge to MakeHuman, in an attempt to use it to generate character models.</p>
<p><strong>NOTE</strong>: Currently not under active development. Ive failed to get this to work, but, even if I succeeded, it would be a very complex and fragile solution.</p>
</div></div><div class="public anchor" id="var-initialise-makehuman.21"><h3>initialise-makehuman!</h3><div class="usage"><code>(initialise-makehuman! mh-path)</code></div><div class="doc"><div class="markdown"><p>Initialise the local instance of MakeHuman. <code>mh-path</code> should be a valid path to the directory in which MakeHuman is installed, i.e. the directory which contains <code>makehuman.py</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/makehuman_bridge.clj#L46">view source</a></div></div></div></body></html>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/makehuman_bridge.clj#L41">view source</a></div></div><div class="public anchor" id="var-initialize-makehuman.21"><h3>initialize-makehuman!</h3><h4 class="type">macro</h4><div class="usage"><code>(initialize-makehuman! mh-path)</code></div><div class="doc"><div class="markdown"><p>For those who dont know how to spell…</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/makehuman_bridge.clj#L56">view source</a></div></div></div></body></html>

View file

@ -3,5 +3,5 @@
<html><head><meta charset="UTF-8" /><title>Simulated-genetics 0.1.0-SNAPSHOT</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 current"><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="namespace-index" id="content"><h1><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></h1><h5 class="license">Released under the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU General Public License,version 2.0 or (at your option) any later version</a></h5><div class="doc"><p>A lightweight simulation of genetics, intended for use in games only.</p></div><h2>Installation</h2><p>To install, add the following dependency to your project or build file:</p><pre class="deps">[simulated-genetics "0.1.0-SNAPSHOT"]</pre><h2>Topics</h2><ul class="topics"><li><a href="intro.html">Introduction to simulated-genetics</a></li></ul><h2>Namespaces</h2><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.genome.html">cc.journeyman.simulated-genetics.genome</a></h3><div class="doc"><div class="markdown"><p>lightweight simulation of a genome.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-create-genome">create-genome</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-ethnically-biased-feature-index">ethnically-biased-feature-index</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-expand-genome">expand-genome</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-extract-bits">extract-bits</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-gender-bit">gender-bit</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-genome-mask">genome-mask</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-male.3F">male?</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-rand-genome">rand-genome</a> </li></ul></div></div><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.launcher.html">cc.journeyman.simulated-genetics.launcher</a></h3><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var--main">-main</a> </li><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var-app">app</a> </li><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var-cli-options">cli-options</a> </li><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var-init">init</a> </li></ul></div></div><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html">cc.journeyman.simulated-genetics.makehuman-bridge</a></h3><div class="doc"><div class="markdown"><p>Bridge to MakeHuman, in an attempt to use it to generate character models.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialise-makehuman.21">initialise-makehuman!</a> </li></ul></div></div><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.utils.html">cc.journeyman.simulated-genetics.utils</a></h3><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialise-makehuman.21">initialise-makehuman!</a> </li><li> <a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialize-makehuman.21">initialize-makehuman!</a> </li></ul></div></div><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.utils.html">cc.journeyman.simulated-genetics.utils</a></h3><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-bits-in-genome">bits-in-genome</a> </li><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-create-binary-string-mask">create-binary-string-mask</a> </li><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-create-mask">create-mask</a> </li><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-long-from-binary-string">long-from-binary-string</a> </li></ul></div></div></div></body></html>

View file

@ -1,5 +1,66 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>Introduction to simulated-genetics</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 current"><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#introduction-to-simulated-genetics" id="introduction-to-simulated-genetics"></a>Introduction to simulated-genetics</h1>
<p>TODO: write <a href="http://jacobian.org/writing/what-to-write/">great documentation</a></p>
<h1><a href="#simulated-genetics" id="simulated-genetics"></a>simulated-genetics</h1>
<p>A clojure library (OK, at this moment its an app, but thats during development only) to generate character models for games, such that characters who are represented as related to one another will have systematically similar appearance, as creatures of natural species (including humans) do. This is specifically <strong>NOT</strong> simulating genetics on any deep or quasi-scientific level, just experimenting to see how adequate a solution can be achieved with simple code and limited data.</p>
<p>Part of <a href="https://simon-brooke.github.io/the-great-game/codox/index.html">The Great Game</a> project.</p>
<h2><a href="#status" id="status"></a>Status</h2>
<p>Very pre-alpha.</p>
<h2><a href="#concept" id="concept"></a>Concept</h2>
<p>If were going to have a world with a multi-generational population of hundreds of thousands of procedurally generated characters, and were to persuasively represent each character as being related to others, then we have to have a mechanism for making children look reasonably like their parents, to have family resemblances among cousins, and so on. We need to do this at reasonably low data storage and algorithmic cost, firstly because we have to store all these characters, and secondly because (especially when the player approaches an urban centre), we may need to instantiate models for a lot of them in limited time.</p>
<p>This note discusses how this might be done.</p>
<h3><a href="#the-pseudo-genome" id="the-pseudo-genome"></a>The pseudo-genome</h3>
<p>Suppose we have a binary vector of memory, such that when a child was born to two parents, bits were taken at random from the parents chromosomes to populate the childs genome which is sort of, very roughly, what happens in actual biology how big would that genome have to be? After all, the full data size of the human genetic code is enormous. But actually, we dont need to simulate anything like so large. After all, all our genome needs to encode is morphology, and only sufficiently to enable the player to recognise and distinguish characters.</p>
<p>My hunch is that a 64 bit genome is more than sufficient, if we code it carefully. So heres how such a genome might be structured:</p>
<table>
<thead>
<tr><th> Field </th><th> Bits </th><th> Interpretation </th></tr>
</thead>
<tbody>
<tr><td> Ethnic type </td><td> 4 </td><td> Ethnic type. Most significant bits both indicate dark skin, with <a href="??11">??11</a> indicating dark skin/curly hair and <a href="??01">??01</a> indicating dark skin/straight hair </td></tr>
<tr><td> Skin tone </td><td> 3 </td><td> Plus most significant bit from ethnic type (i.e. <a href="???1">???1</a>) as most significant bit. This means sixteen distinct tones, with the darkest tone of pale skinned ethnicities just very slightly lighter than the palest tone of dark skinned ethnicities. </td></tr>
<tr><td> Freckles? </td><td> 2 </td><td> <a href="11">11</a> means freckles, any other value means no freckles. Freckles wont be visible on very dark skin. </td></tr>
<tr><td> Hair colour </td><td> 3 </td><td> Plus most significant bit from ethnic type (i.e. <a href="???1">???1</a>) as most significant bit. Least significant bit does not contribute to tone but indicates red tint. Thus eight distinct degrees of darkness from pale blond to black, plus red tint which can affect any degree of darkness. </td></tr>
<tr><td> Eye colour </td><td> 2 </td><td> Plus most significant bit from ethnic type (i.e. <a href="???1">???1</a>) as most significant bit. Thus eight values: <a href="000">000</a> blue; <a href="001">001</a> hazel; <a href="010">010</a><a href="111">111</a> shades of brown lighter-&gt;darker. </td></tr>
<tr><td> Height </td><td> 3 </td><td> Height when adult; children will have a scaled proportion of their adult height, and the same height value in the genome will result in female body models 95% the height of an equivalent male body model. So <a href="000">000</a> codes for 150mm, <a href="111">111</a> codes for 200mm, with eight distinct values </td></tr>
<tr><td> Gracility/Robustness </td><td> 3 </td><td> Slenderness to stockiness of skeleton/armature build, with <a href="000">000</a> being very slender and <a href="111">111</a> being very broad/heavy. </td></tr>
<tr><td> Age-related change </td><td> 3 </td><td> People get white haired at different ages; some men go bald and some do not. The sons of the daughter of a bald man should have a chance of inheriting age-related baldness, although their mother wont express that gene. So Im allowing here for eight different profiles for age related change, although Im not yet clear what the exact values would mean. </td></tr>
</tbody>
</table>
<p>Thats twenty-nine of our sixty-four bits, leaving plenty for face models, gender and so on.</p>
<h3><a href="#whats-not-included-in-the-genome" id="whats-not-included-in-the-genome"></a>Whats not included in the genome</h3>
<p>Things which are cultural are not included in the genome; things which are lifestyle related are not included in the genome. So, for example, gracility/robustness, is not the same as skinniness/fatness, which are mostly lifestyle/diet related rather than genetic. There are some occupations (e.g., blacksmith) where youd be unlikely to be fat (but might be very robust). Also, the same character might grow fatter (or thinner) over time.</p>
<p>Similarly, hairstyle and beard-wearing are cultural (and occupational) rather than genetic, and closely related to choice of clothing. So while we do need to represent these things, theyre not things which should be represented in the genome.</p>
<p>Injury-related change which would especially affect soldiers and outlaws especially but could affect any character also needs to be encoded somehow (and may cause real problems), but this is also not a problem for the genome.</p>
<h3><a href="#what-additionally-might-be-included-in-the-pseudo-genome" id="what-additionally-might-be-included-in-the-pseudo-genome"></a>What additionally might be included in the pseudo-genome</h3>
<p>There is a variable Im proposing for non-player characters that Im calling <code>disposition</code>, which has a range of values between -5 (surly) and +5 (sunny), which stands in for the general friendliness of the character towards random strangers, their generosity, their optimism, their degree of compassion, and so on. I dont personally believe these things are genetic I believe theyre nurture, not nature but I believe that they are nevertheless inherited through families to some extent.</p>
<p>If we made a characters setting for <code>disposition</code> a function of their parents dispositions, then that would need to be an entirely unrelated value from the physical appearance values, because otherwise you would end up having some racial appearances being friendlier and more optimistic than others, which would lead to accusations of racism and other bad things. This is simulated genetics, not simulated phrenology!</p>
<p>I mean, you may be planning the sort of game in which there are races like orcs or kobolds or whatever which are systematically less friendly and generous than characters of other races, in which case you might want to fork this library and change this decision, but if so:</p>
<p>a. thats on you; and b. I politely suggest that you might want to examine your own attitudes.</p>
<h3><a href="#making-this-all-work" id="making-this-all-work"></a>Making this all work</h3>
<p><strong>NOTE:</strong> At this stage none of this works.</p>
<h4><a href="#the-python-ecosystem" id="the-python-ecosystem"></a>The Python ecosystem</h4>
<p><a href="http://www.makehumancommunity.org/">MakeHuman</a> exposes an <a href="https://github.com/makehumancommunity/community-plugins-mhapi/blob/master/docs/MHAPI.md">API</a> which allows at least many of the morphological changes required by the pseudo-genome to be applied to a human model.</p>
<p>Theres a well regarded library, <a href="https://www.futurile.net/2020/02/20/python-from-clojure-with-libpython-clj/">libpython-clj</a>, which allows calling of Python code from Clojure code. So in theory it should be possible to make this work.</p>
<p>If not, there are other human-model-morphing libraries out there, e.g. <a href="https://mb-lab-community.github.io/MB-Lab.github.io/">ManuelBastioniLab</a>, but theyre mainly also in Python. In the worst case, the heavy lifting is in the data, and it might be possible to rewrite the code thatmorphs the data into Clojure. However, development of ManuelBastioniLAB <a href="https://www.cgchannel.com/2018/11/manuel-bastioni-to-discontinue-manuel-bastioni-lab/">ceased in 2018</a>, and although there are forks available on GitHub and elsewhere, none of them seem to be active.</p>
<h4><a href="#maud" id="maud"></a>Maud</h4>
<p>While things in the Python ecosystem are very polished, getting them to play nicely with Clojure/Java is non-trivial. Theres a less-polished but apparently-functional character editor built using jMonkeyEngine frameworks called <a href="https://github.com/stephengold/Maud">Maud</a>. This might be an easier fit.</p>
<h2><a href="#installation" id="installation"></a>Installation</h2>
<p>You cant, it doesnt (yet) work.</p>
<h2><a href="#usage" id="usage"></a>Usage</h2>
<p>FIXME: explanation</p>
<pre><code>$ java -jar simulated-genetics-0.1.0-standalone.jar [args]
</code></pre>
<h2><a href="#options" id="options"></a>Options</h2>
<p>FIXME: listing of options this app accepts.</p>
<h2><a href="#examples" id="examples"></a>Examples</h2>
<p></p>
<h3><a href="#bugs" id="bugs"></a>Bugs</h3>
<p></p>
<h3><a href="#any-other-sections" id="any-other-sections"></a>Any Other Sections</h3>
<h3><a href="#that-you-think" id="that-you-think"></a>That You Think</h3>
<h3><a href="#might-be-useful" id="might-be-useful"></a>Might be Useful</h3>
<h2><a href="#license" id="license"></a>License</h2>
<p>Copyright © 2024 Simon Brooke</p>
<p>This Source Code is made available under the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at <a href="https://www.gnu.org/software/classpath/license.html">https://www.gnu.org/software/classpath/license.html</a>.</p>
</div></div></div></body></html>

View file

@ -0,0 +1,24 @@
# README for model prototypes
These files are the most basic human male and female characters created with the [MakeHuman](http://www.makehumancommunity.org/) [MPFB]() plugin for [Blender](https://www.blender.org/). At this stage, they're created by somone (me) who has absolutely no experience with Blender. They're here only to serve as proof of concept prototypes, to get the whole process bootstrapped.
The models are intended to be nude, and bald, so that hair and clothing can be applied later (although how this will work I don't yet understand), with eyes, eyebrows, eyelashes, teeth and tongue. The `.blend` files are the original files. The `.glb` files are exported by Blender. The `.j3o` files are created by reading the `.glb` files into [Maud](https://github.com/stephengold/Maud) and saving them. They are intended to have the standard MPFB 'rig helpers'.
At this stage, the (.glb) model when loaded into Maud, appears to be clothed, although there is nothing I have done to clothe it and the original `.blend` does not appear to be clothed in Blender. However, interestingly, when I import the `.glb` file back into blender I get only the rig, so I'm doing something wrong.
The model prototypes that should be here are
* female.blend
* female.glb
* female.j3o
* male.blend
* male.glb
* male.j3o
They're not included in the git repository at present because
1. They're large binary files;
2. They're really, really not very good;
3. You can do better yourself if you just do what I've described above.
Once I have all this working I will probably include model prototypes in the repository.

View file

@ -3,7 +3,7 @@
[jme-clj.core :refer [add-control add-to-root app-settings cam
defsimpleapp fly-cam get-height-map image
image-based-height-map load-height-map
load-texture material set* start
load-model load-texture material set* start
terrain-lod-control terrain-quad]]
[taoensso.telemere :refer [set-min-level! trace!]])
(:import (com.jme3.texture Texture$WrapMode))
@ -61,7 +61,12 @@
load-height-map)
patch-size 65
terrain (terrain-quad "my terrain" patch-size 513
(get-height-map height-map))]
(get-height-map height-map))
mat-default (material "Common/MatDefs/Misc/ShowNormals.j3md")
model (trace! (load-model "model-prototypes/male.glb"))]
(trace! (-> model (set* :material mat-default)
(set* :local-translation 0.0 -5.0 -2.0)
(add-to-root)))
(-> mat
(set* :texture "Alpha"
(load-texture "jme3/textures/terrain/splat/alphamap.png"))