Home
Name Modified Size InfoDownloads / Week
README 2011-09-29 6.4 kB
electronics2.zip 2011-09-29 1.3 MB
src electronics2.zip 2011-09-11 3.7 MB
Totals: 3 Items   5.0 MB 3
    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. Or use
makefile that comes with sauerbraten but comment ot #include "minereader.h" line at the end
of engine/octaedit.cpp.



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 just shoot it (eshoot must be set to 1)
   By shooting element with mouse2 or with /einfo in edit mode you can get selected parts
   properties.
 
4. - To run one step of simulation press o in non edit mode (while simulation is paused)
   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. Top 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. Initially pulse generator is off for
 n steps then on for n steps, repeat... n is defined by top texture id.
 By pushing its bottom face upwards it will read one cube bellow it for info. initially 
 it is off for n1 steps, then on for n2 steps where n2 is specified  by the below cube.
 If its bottom face is not pushed in n2 = n1 = element top face texture id.
- ENT MANIPULATOR : set n-th attribute of one nearby entity to value m. Here n is defined
 by number of pushes of bottom face, m by top texture id. Sets value while powered on.
Useful for doors, teleporters, jumppads, sound alerts, laser beams, anything entity (mapmodel, ammo,
lights, playerstarts, jumppads, etc) related ...


CHANGE LOG:
==================

09.29 - entity manipulator
09.20 - various fixes, pulse gen will now only reset while powering on 
09.12 - updated pulse gen (see demo map)
09.10 - elements can now also be toggled by shooting them (when eshoot = 1). Note that this will
also apply to other players in multiplayer game. By /escann you as well the other players
in multiplayer (re)scan selection. It is advisable that both players maps are synced to scan the same
circuits. 
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 (must be powered to be operational)
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
Source: README, updated 2011-09-29