sauerbraten circuit simulator Code
Status: Alpha
Brought to you by:
ac-sauer
| File | Date | Author | Commit |
|---|---|---|---|
| bin | 2011-09-07 |
|
[f727a8] 09.06 - added progress bar display when scannin... |
| packages | 2011-09-07 |
|
[f727a8] 09.06 - added progress bar display when scannin... |
| src electronics2 | 2011-09-07 |
|
[f727a8] 09.06 - added progress bar display when scannin... |
| README | 2011-09-07 |
|
[f727a8] 09.06 - added progress bar display when scannin... |
| autoexec.cfg | 2011-09-07 |
|
[f727a8] 09.06 - added progress bar display when scannin... |
| electronics.cfg | 2011-09-07 |
|
[f727a8] 09.06 - added progress bar display when scannin... |
| electronics2.bat | 2011-09-07 |
|
[f727a8] 09.06 - added progress bar display when scannin... |
| readme_source.txt | 2011-08-30 |
|
[3ebbc8] switched to sauerbraten svn |
S a u e r e l e c t r o n i c s 2
Copyright (C) 2011 cm|ac
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
1. Installation (windows):
==========================
Install Sauerbraten Justice Edition.
copy everything into main sauerbraten directory. Only file that might be overwriten
is autoexec.cfg. Afterwards run electronics2.bat.
Compile instructions: (windows & linux)
-----------------------
Install Sauerbraten Justice Edition (needed for media files, maps, sounds).
Download source (git or zip). Open code::blocks project sauerbraten.cbp in
code::blocks and compile (on linux you need some dependencies installed; see
http://cube.wikispaces.com/Building+and+Compiling)
Then copy One file (sauerbraten binary) into sauerbraten/bin and run the game.
If you want to use make on linux you will have to correct make file to include libraries
inside lib/mylib (only needed for minecraft level loading) into build process.
Minecraft loading: type /loadminecraft in sauerbraten game console and follow instructions
------------------
2. Electronics Usage:
=====================
Example map electronics2.ogz with parts legend included in zip (do /map electronics2 to
load it inside game). It is necessary to know the basics of editing in Sauebraten
(selecting, creating cubes, changing texture for one face/all faces, copy, paste).
1. - To start draw selection around circuit in editmode (using gridsize >= 4) and press o.
Parts will be automatically loaded (or updated) and wire recognition will link parts
together. To reset elements/textures to scan state type /escan 1
2. - To clear all circuit data and scan selection into new circuit press p in edit mode.
So to just clear select empty cube.
3. - To manually toggle element point to it in non edit mode and press middle mouse button.
with /einfo you can get selected parts information (edit mode).
4. - To run one step of simulation press o in non edit mode.
To run simulation in realtime (un)pause it by pressing p in non edit mode.
notes. - simulation run by default every 100 msecs (so not faster then 10x/s). This can
be adjusted ingame by changing "simspeed" variable in cubescript.
- only cubes with bottom wire texture (green) act as wires for transmitting signal;
other cubess are ignored when recognizing wire
Basic description of circuit:
-----------------
parts:
- active circuit parts: torch AKA "minecraft redstone torch", pulse generator
- passive circuit parts: wire, LED
- manually controled parts : switch, torch
mechanics:
- parts are identified by their bottom textures only. Other side textures might define
additional properties (like period for pulse generator)
- current propagation through wires: wire part1 is connected to wire part2 if part2 face has
full contact with full cube defining part1:
this is connected:
**********
* 1 ** 2 *
**********
this is not connected:
***** ****
* 1 * * 2*
***** ****
- torch on outputs its signal from its top face only
- if torch receives signal it turns off
- if torch doesnt receive any signal it turns on
- LED is on if signal is present; otherwise its off
- pulse generator must be powered to be active (from any side but top).
it outputs signal from its top face only. pulse generator is off for n steps
then on for n steps, repeat... n is defined by top texture id.
CHANGE LOG:
==================
09.06 - added progress bar display when scanning elements/wires
09.04 - recursive octree scanning for elements works correctly when using larger>4 gridsizes now;
even When several elements are joined after remip in one bigger cube
09.03 - neighbor wires can be isolated from each other (target wire part is connected only if it
has full contact on its face; i.e. no gaps in target element)
08.30 - switched to sauebraten svn; using sauerbraten vectors now instead of standard c++ ones
08.27 - custom open gl rendering of cubes for faster display
08.25 - addition of pulse generator element
08.14 - start: element/wire recognition, torches, switches, LEDs, simulation,
manual toggle (eset), clearing (eclear), scanning (escan), simulation (estep)
ADDITIONAL CREDITS:
===================
- 4 bit alu in the example map made by cm|chris.
- custom open gl rendering for cubes adapted from cm|wrack
- minecraft importer extracted and adapted from the minecraft viewer "Minutor" made by the Sean Kasun