Merge branch 'develop' into random-orgs

This commit is contained in:
Max Robinson
2021-12-19 11:31:19 -06:00
committed by GitHub
19 changed files with 662 additions and 312 deletions

40
dist/css/style.css vendored
View File

@@ -37,7 +37,7 @@ body{
bottom: 0;
position: fixed;
background-color: #3a4b68;
display: grid;
display: none;
grid-template-columns: repeat(3, 1fr);
/* opacity: 0.8; */
}
@@ -57,11 +57,15 @@ body{
img {
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-crisp-edges;
image-rendering: pixelated;
image-rendering: crisp-edges;
width: 60%;
image-rendering: -webkit-crisp-edges;
image-rendering: pixelated;
image-rendering: crisp-edges;
object-fit: cover;
width: 85%;
max-width: 500px;
max-height: 40%;
border-radius: 10px;
overflow: hidden;
}
button {
@@ -75,10 +79,14 @@ button {
display: inline-block;
font-size: 16px;
min-width: 30px;
margin: 2px;
}
button:hover{
background-color: #81d2c7;
}
button:active{
background-color: #595e77;
}
.icon-links {
font-size: 35px;
@@ -130,6 +138,10 @@ button:hover{
background-color: #81d2c7;
color: black;
}
.open-tab {
background-color: #66a39b;
color: black;
}
.tab {
grid-template-columns: repeat(2, 1fr);
@@ -163,10 +175,7 @@ button:hover{
height: 30px;
margin-top: 5px;
}
.edit-mode-btn:hover{
background-color: #81d2c7;
}
.edit-mode-btn#drag-view {
.edit-mode-btn.selected {
background-color: #81d2c7;
}
.randomize-button {
@@ -239,7 +248,7 @@ button:hover{
position: fixed;
bottom: 10px;
padding-left: 10px;
display: none;
/* display: none; */
}
#headless-notification {
@@ -258,4 +267,15 @@ button:hover{
}
#maximize-hot-control {
right: 10px;
}
.grid-size-in {
width: 75px;
}
#video {
height: 200px;
margin: auto;
margin-bottom: 0;
padding-bottom: 0;
}

154
dist/index.html vendored
View File

@@ -19,78 +19,56 @@
<div class='control-panel'>
<div id='speed-controller' class='control-set'>
<div class='vertical-buttons'>
<button class="reset-view" title="Reset View"><i class="fa fa-video-camera"></i></button>
<button class="edit-mode-btn" id="drag-view" title="Drag View"><i class="fa fa-arrows"></i></button>
<button class="edit-mode-btn" id="wall-drop" title="Drop/Remove Wall"><i class="fa fa-square"></i></button>
<button class="edit-mode-btn" id="food-drop" title="Drop/Remove Food"><i class="fa fa-cutlery"></i></button>
<button class="edit-mode-btn" id="click-kill" title="Click to kill"><i class="fa fa-bolt"></i></button>
<button id="clear-walls" title="Clear All Walls"><i class="fa fa-window-close"></i></button>
<button class="reset-view" title="Reset View. Hotkey: A"><i class="fa fa-video-camera"></i></button>
<button class="edit-mode-btn drag-view" id="drag-view" title="Drag View. Hotkey: S"><i class="fa fa-arrows"></i></button>
<button class="edit-mode-btn wall-drop" id="wall-drop" title="Drop/Remove Wall. Hotkey: D"><i class="fa fa-square"></i></button>
<button class="edit-mode-btn food-drop selected" id="food-drop" title="Drop/Remove Food. Hotkey: F"><i class="fa fa-cutlery"></i></button>
<button class="edit-mode-btn click-kill" id="click-kill" title="Click to kill. Hotkey: G"><i class="fa fa-bolt"></i></button>
</div>
<h2>Simulation Speed</h2>
<img src="./img/title.png" alt="Life Engine">
<h3>Simulation Speed</h3>
<input id="slider" type="range" min="1" max="300" value="60">
<button class='pause-button'><i class="fa fa-pause"></i></button>
<button class="headless" title="Toggle rendering"><i class="fa fa-eye-slash"></i></button>
<button class='pause-button' title="Play/Pause. Hotkey: Spacebar"><i class="fa fa-pause"></i></button>
<button class="headless" title="Toggle rendering. Hotkey: H"><i class="fa fa-eye-slash"></i></button>
<p id='fps'>Target FPS: 60</p>
<p id='fps-actual'></p>
<button id='reset-env'>Reset Environment</button>
<label for="auto-reset">Auto Reset</label>
<input type="checkbox" id="auto-reset" checked>
<br>
<p id='reset-count'>Auto reset count: </p>
<br>
<h3>Grid Size</h3>
<label for="cell-size">Cell Size:</label>
<input type="number" id="cell-size" min="1" max="100" value=5 step="1">
<label for="fill-window">Fill Window</label>
<input type="checkbox" id="fill-window" checked>
<div class='col-row-input'>
<label for="col-input">Columns:</label>
<input type="number" id="col-input" min="1" value=100 step="1">
<br>
<label for="row-input">Rows:</label>
<input type="number" id="row-input" min="1" value=100 step="1">
</div>
<br>
<button id='resize'>Resize and Reset</button>
<button id='reset-env' title='Restarts simulation with default organism.'>Reset</button>
<button id='clear-env' title="Removes all organisms.">Clear</button>
</div>
<div id='tab-container' class='control-set'>
<div class="tabnav">
<p class='tabnav-item' id='about'>About</p>
<p class='tabnav-item open-tab' id='about'>About</p>
<p class='tabnav-item' id='editor'>Editor</p>
<p class='tabnav-item' id='world-controls'>World Controls</p>
<p class='tabnav-item' id='hyperparameters'>Simulation Controls</p>
<p class='tabnav-item' id='stats'>Stats</p>
<p class='tabnav-item' id='challenges'>Challenges</p>
<button id="minimize" title="Minimze Control Panel"><i class="fa fa-minus-square"></i></button>
<p class='tabnav-item' id='stats'>Statistics</p>
<!-- <p class='tabnav-item' id='challenges'>Challenges</p> -->
<button id="minimize" title="Minimze Control Panel."><i class="fa fa-minus-square"></i></button>
</div>
<div id='about' class='tab'>
<div class='left-half'>
<img src="./img/title.png" alt="Life Engine">
<p>The Life Engine is a virtual ecosystem that allows organisms to grow, spread, and compete.</p>
<p>Each organism is made up by a structure of cells, which provide different benefits based on their color.</p>
</div>
<div class='right-half'>
<h4>Cell Types</h4>
<h3>The Life Engine</h3>
<p>The Life Engine is a virtual ecosystem that allows organisms to reproduce, compete, and evolve.</p>
<p>Each organism is made up of different colored cells. Hover over each color to learn what it does.</p>
<div id='cell-legend'>
<div class='cell-legend-type' id='mouth' title="Mouth: Eats adjacent food."></div>
<div class='cell-legend-type' id='producer' title="Producer: Produces adjacent food."></div>
<div class='cell-legend-type' id='mover' title="Mover: Allows for movement and rotation."></div>
<div class='cell-legend-type' id='killer' title="Killer: Harms oranisms in adjacent cells."></div>
<div class='cell-legend-type' id='killer' title="Killer: Harms organisms in adjacent cells."></div>
<div class='cell-legend-type' id='armor' title="Armor: Negates affects of killer cell."></div>
<div class='cell-legend-type' id='eye' title="Eye: Observes cells and decides movement."></div>
<div class='cell-legend-type' id='food' title="Food: Not part of an organism. Once an organism has eaten enough food, it will reproduce."></div>
<div class='cell-legend-type' id='wall' title="Wall: Not part of an organism. Blocks movement and reproduction."></div>
</div>
<br>
<p>Hover over each color to learn what it does. For a more in depth explanation of the simulation, view the
<a href="https://github.com/MaxRobinsonTheGreat/EvolutionSimulatorV2#readme">readme</a> and you can explore the source code.
</p>
</div><br>
</div>
<div class='right-half'>
<iframe id="video" src="https://www.youtube.com/embed/iSAKEnRfles"></iframe>
</div>
<div class='icon-links'>
<a href="https://www.youtube.com/channel/UCwBhBDsqiQflTMLy2epbQVw"><i class="fa fa-youtube"></i></a>
<a href=https://github.com/MaxRobinsonTheGreat/EvolutionSimulatorV2 title='View the code'><i class="fa fa-github"></i></a>
<a href="https://twitter.com/max_romana"><i class="fa fa-twitter"></i></a>
</div>
</div>
@@ -98,10 +76,10 @@
<div id='editor' class='tab'>
<div class='left-half' id='editor-panel'>
<div class='editor-buttons'>
<button class="edit-mode-btn" id="select" title="Select organism from world"><i class="fa fa-hand-pointer-o"></i></button>
<button class="edit-mode-btn" id="edit" title="Edit organism"><i class="fa fa-pencil"></i></button>
<button class="edit-mode-btn select" id="select" title="Select organism from world. Hotkey: Z"><i class="fa fa-hand-pointer-o"></i></button>
<button class="edit-mode-btn edit" id="edit" title="Edit organism. Hotkey: X"><i class="fa fa-pencil"></i></button>
<button class="edit-mode-btn drop-org" id="drop-org" title="Drop organism in world. Hotkey: C"><i class="fa fa-plus"></i></button>
<button class="edit-mode-btn" id='randomize' title="Randomize"><i class="fa fa-random"></i></button>
<button class="edit-mode-btn" id="drop-org" title="Drop organism in world"><i class="fa fa-plus"></i></button>
</div>
<div id='editor-env'>
<canvas id='editor-canvas'></canvas>
@@ -113,7 +91,7 @@
<div class='cell-type' id='mover' title="Mover: Allows for movement and rotation."></div>
</div>
<div style='grid-column: 2;'>
<div class='cell-type' id='killer' title="Killer: Harms oranisms in adjacent cells."></div>
<div class='cell-type' id='killer' title="Killer: Harms organisms in adjacent cells."></div>
<div class='cell-type' id='armor' title="Armor: Negates affects of killer cell."></div>
<div class='cell-type' id='eye' title="Eye: Looks for cells to move away from or towards. Click again on a placed cell to rotate"></div>
</div>
@@ -144,6 +122,10 @@
<label for="move-range-edit" title='The number of cells to move before randomly changing direction. Overriden by brain decisions.'>Move Range:</label>
<input type="number" id="move-range-edit" min="1" max="100" value=3 step="1">
</div>
<div id='mutation-rate-cont'>
<label for="mutation-rate-edit" title='Probability that offspring of this organism will mutate'>Mutation Rate:</label>
<input type="number" id="mutation-rate-edit" min="1" max="100" value=3 step="1">
</div>
<br>
<div class='brain-details'>
<h4>Brain</h4>
@@ -190,6 +172,43 @@
</div>
</div>
</div>
<div id='world-controls' class='tab'>
<div class='left-half'>
<h3>Grid Size</h3>
<label for="cell-size">Cell Size:</label>
<input type="number" id="cell-size" min="1" max="100" value=5 step="1">
<label for="fill-window">Fill Window</label>
<input type="checkbox" id="fill-window" checked>
<div class='col-row-input'>
<label for="col-input">Columns:</label>
<input type="number" class="grid-size-in" id="col-input" min="1" value=100 step="1">
<label for="row-input">Rows:</label>
<input type="number" class="grid-size-in" id="row-input" min="1" value=100 step="1">
</div>
<br>
<button id='resize'>Resize and Reset</button>
<h3>Reset Options</h3>
<label for="start-state">Starting state:</label>
<select name="start-state" id="start-state">
<option value="simple-prod">Simple producer</option>
<option value="rand-orgs">Random organisms</option>
<option value="no-orgs">No organisms</option>
</select> <br>
<label for="auto-reset">Reset on total extinction</label>
<input type="checkbox" id="auto-reset" checked>
<p id='reset-count'>Auto reset count: </p>
<label for="auto-pause" title='Will override reset on extinction'>Pause on total extinction</label>
<input type="checkbox" id="auto-pause">
<br>
</div>
<div class='right-half'>
<button id='random-walls' title="Generates random walls.">Generate random walls</button> <br>
<button id="clear-walls" title="Clear All Walls. Hotkey: B">Clear all walls</button>
<br>
<label for="clear-walls-reset" title='When on, walls will be cleared when the environment resets'>Clear walls on reset</label>
<input type="checkbox" id="clear-walls-reset">
</div>
</div>
<div id='hyperparameters' class='tab'>
<div class='left-half'>
<h2>Simulation Controls</h2>
@@ -199,11 +218,8 @@
<label for="lifespan-multiplier" title='An organism lives for this many ticks per cell in its body.'>Lifespan multiplier:</label>
<input type="number" id="lifespan-multiplier" min="1" max="10000" value=100 step="1">
<br>
<label for="mover-rot" title='Movers rotate randomly when they change directions.'>Movers can rotate</label>
<input type="checkbox" id="mover-rot" checked>
<br>
<label for="offspring-rot" title='Offspring will randomly rotate'>Offspring rotate</label>
<input type="checkbox" id="offspring-rot" checked>
<label for="rot-enabled" title='Organisms rotate when born and while moving.'>Rotation Enabled</label>
<input type="checkbox" id="rot-enabled" checked>
<br>
<label for="insta-kill" title='When on, killer cells immediatly kill organisms they touch. When off, organisms have as much health as they have cells and only take 1 damage from killer cells.'>One touch kill</label>
<input type="checkbox" id="insta-kill">
@@ -213,6 +229,9 @@
<br>
<label for="food-drop-rate" title='Rate at which food is automatically generated and dropped in the world'>Auto food drop rate:</label>
<input type="number" id="food-drop-rate" value=0 max="1000">
<br>
<label for="extra-mover-cost" title='Additional food cost for movers to reproduce'>Extra mover reproduction cost:</label>
<input type="number" id="extra-mover-cost" value=0 max="1000" step="1">
</div>
<div class='right-half'>
@@ -236,7 +255,10 @@
<label for="food-blocks" title='When on, reproduction will fail if offspring intersect with food. When off, offspring will remove blocking food.'>Food blocks reproduction</label>
<input type="checkbox" id="food-blocks" checked>
<br>
<button id='save-controls'>Save</button>
<button id='load-controls'>Load</button>
<a id="download-el" style="display: none;"></a>
<input id="upload-el" style="display: none;" type="file">
</div>
</div>
<div id='stats' class='tab'>
@@ -280,20 +302,20 @@
</div>
</div>
<div class='hot-controls'>
<button class="reset-view" title="Reset View"><i class="fa fa-video-camera"></i></button>
<button class="edit-mode-btn" id="drag-view" title="Drag View"><i class="fa fa-arrows"></i></button>
<button class="edit-mode-btn" id="wall-drop" title="Drop/Remove Wall"><i class="fa fa-square"></i></button>
<button class="edit-mode-btn" id="food-drop" title="Drop/Remove Food"><i class="fa fa-cutlery"></i></button>
<button class="edit-mode-btn" id="click-kill" title="Click to kill"><i class="fa fa-bolt"></i></button>
<button class='pause-button'><i class="fa fa-pause"></i></button>
<button class="headless" title="Toggle rendering"><i class="fa fa-eye-slash"></i></button>
<button class="reset-view" title="Reset View. Hotkey: A"><i class="fa fa-video-camera"></i></button>
<button class="edit-mode-btn drag-view" id="drag-view" title="Drag View. Hotkey: S"><i class="fa fa-arrows"></i></button>
<button class="edit-mode-btn wall-drop" id="wall-drop" title="Drop/Remove Wall. Hotkey: D"><i class="fa fa-square"></i></button>
<button class="edit-mode-btn food-drop selected" id="food-drop" title="Drop/Remove Food. Hotkey: F"><i class="fa fa-cutlery"></i></button>
<button class="edit-mode-btn click-kill" id="click-kill" title="Click to kill. Hotkey: G"><i class="fa fa-bolt"></i></button>
<button class="headless" title="Toggle rendering. Hotkey: H"><i class="fa fa-eye-slash"></i></button>
<button class='pause-button' title="Play/Pause. Hotkey: Spacebar"><i class="fa fa-pause"></i></button>
</div>
<div id="headless-notification">
<i class="fa fa-eye-slash" ></i>
</div>
<div id='maximize-hot-control' class='hot-controls'>
<button id="maximize" title="Show Control Panel"><i class="fa fa-plus-square"></i></button>
<button id="maximize" title="Show Control Panel."><i class="fa fa-plus-square"></i></button>
</div>
</body>
</html>
</html>