[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4509: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4511: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4512: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4513: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
Cubic Matter • View topic - TeX Electronics

TeX Electronics

Other creations.
Scripts, Textures, Code, Sky-boxes, Models, ...

TeX Electronics

Postby Ac » Sun Jul 24, 2011 5:10 pm

*august 16th
for minecraft like version (working significantly faster on larger circuits) see

As a continuation of "sauer electronics 0.4a" i remade it using sauer octree and textures. Instructions, example map electronic.ogz, win binary and source cpp file (to be included in octaedit.cpp) is inside zip.

refreshed july 29th
texelectronics.zip
(1.23 MiB) Downloaded 269 times





short instructions (or included readme.txt): add selection to circuit with /escan (dont need to add wires), delete cube & remove element or reset with /eclear 0/1/2, toggle selected element state state with /eset,
run one step of simulation with /estep, make simulation run 10x/s with /sim = [estep; sleep 100 [sim]]; sim
Its easiest if you just bind keys like /editbind o [eset].

important: you need to add active elements for simulation to work, otherwise they are just cubes and dont "exist".

You can either use included win binary or
compile instructions: put electronics.cpp in /src/engine/ and put line #include "electronics.cpp" in your octaedit.cpp


Black block with light is switch in on state, black block is switch in off state. Green parts are uncharged wires, charged wire is red, discharging wire is yellow. Gray/red parts directly near switch have similar function as minecraft "redstone torches". There is also delay element and LED for display.

basic_logic_gates.jpg
basic_logic_gates.jpg (136.33 KiB) Viewed 7626 times


signal_on_2d_plane.jpg
signal_on_2d_plane.jpg (114.54 KiB) Viewed 7626 times
Last edited by Ac on Wed Aug 31, 2011 7:01 am, edited 23 times in total.
User avatar
Ac
 
Posts: 264
Joined: Tue Sep 07, 2010 10:46 pm

Re: TeX Electronics

Postby Ac » Sun Jul 24, 2011 5:13 pm

Simulation is unique and interesting since wire lenghts matter (as they do in real world). You can also see the signal moving in real time. It works quite fast. Biggest slowdown with several thousand active elements comes (again)
because of unnecessary sauer visibility calculations (would be very fast even then if only texture redraws were changed). But even this can be managed with erender set to 1 or 0.

pulse_generator.jpg
pulse_generator.jpg (141.53 KiB) Viewed 7625 times


interesting_patterns.jpg
interesting_patterns.jpg (204.36 KiB) Viewed 7625 times
Last edited by Ac on Thu Jul 28, 2011 1:38 pm, edited 2 times in total.
User avatar
Ac
 
Posts: 264
Joined: Tue Sep 07, 2010 10:46 pm

Re: TeX Electronics

Postby chris0076 » Sun Jul 24, 2011 7:52 pm

ZOMG! EPIC!

Testing right now. ^^

EDIT: AAAAHHHHH the function "returncube" is not defined, anticipation is getting to me. =( I guess for the time being I'll look over the code. ^^

Chris
"It is unworthy of excellent men to lose hours like slaves in the labour of calculation which could safely be relegated to anyone else if machines were used."
---Gottfried Wilhelm Leibniz
User avatar
chris0076
 
Posts: 501
Joined: Sun Oct 17, 2010 9:34 pm

Re: TeX Electronics

Postby Ac » Mon Jul 25, 2011 6:50 am

new:
-ability to scan and add parts from selection
-eclear (0) now deletes 1 selected cube in addition to removing the associated element
-fixed basic logic gates on example map electronics.ogz

EDIT:

- added erender variable to control forced texture redraws ( enormous speed boost with circuits containing lots of wire parts since you can disable rendering of wire changes). default value 3 renders all parts, 2 drops rendering of "wires turning off", 1 in addition drops rendering of wires turning off/on, 0 disables all rendering.


Recomended for large circuits is \erender 1 ( only torches will get force texture render). Note that simulation runs the same no matter what erender is set too, only display of texture redraws is affected.
Last edited by Ac on Mon Jul 25, 2011 7:58 pm, edited 3 times in total.
User avatar
Ac
 
Posts: 264
Joined: Tue Sep 07, 2010 10:46 pm

Re: TeX Electronics

Postby chris0076 » Mon Jul 25, 2011 6:57 am

lol ok, d/ling/installing/compiling/testing now ^^

Chris
"It is unworthy of excellent men to lose hours like slaves in the labour of calculation which could safely be relegated to anyone else if machines were used."
---Gottfried Wilhelm Leibniz
User avatar
chris0076
 
Posts: 501
Joined: Sun Oct 17, 2010 9:34 pm

Re: TeX Electronics

Postby Ac » Tue Jul 26, 2011 12:34 am

How to make binary counter:

i was able to build pulse generators that toggle torch every 6 and 12 steps. Just by this you get counter that counts to 4 (in binary). By playing around with correct wire length and attaching this 2 counters to AND gate you can construct toggler for 24 steps, hence you can count to 8. By similar procedure you get 16 and so on ...

6 step toggle consists just of torch and wire of length 5:
6.jpg
6.jpg (134.67 KiB) Viewed 7593 times

12 step toggle of torch and wire of length 11 (black block is just switch for reset):
12.jpg
12.jpg (131.96 KiB) Viewed 7593 times


Chris made 4 bit ALU, wrack was working on digit display counter and i also made digit display (plus states of 7 switches to display all digits 0,1,2,3,4,5,6,7,8,9):
Attachments
electronics.ogz
(72.25 KiB) Downloaded 261 times
User avatar
Ac
 
Posts: 264
Joined: Tue Sep 07, 2010 10:46 pm

Re: TeX Electronics

Postby chris0076 » Tue Jul 26, 2011 2:56 am

ok, yeah with erender 1 the ALU takes 20-30 secs for me to propagate all the way through. And then the NOT parts do not work because for some reason it is sending the current very broken up so it just cycles through all the output without holding on any one of them.

Chris
"It is unworthy of excellent men to lose hours like slaves in the labour of calculation which could safely be relegated to anyone else if machines were used."
---Gottfried Wilhelm Leibniz
User avatar
chris0076
 
Posts: 501
Joined: Sun Oct 17, 2010 9:34 pm

Re: TeX Electronics

Postby Ac » Tue Jul 26, 2011 5:45 am

30 seconds; how many steps would that be (around 300) ?

First reason for NOT parts not working would be excess of working parts reached (currently set with const int circuit_size=10000; // max circuit size). But when this happens (after addition of new active wire part) you get "Maximum number of ... elements reached) . Manually or not, it doesnt even let you add active parts over max number; it does nothing.

Second reason could be you messed up torches inputs(all sides but up) or outputs (only top).
Also be careful not to make two cubes neighbors if that is not desired. Check if example not gate works.

Third reason is i f*** up with erender. But remember, only bottom texture of cube counts as texture identification;
that is c->texture[4] in program.

Fourth reason would be: during setting of vtxarray data in sauer vaupdate strange quantum anomaly occurs with large number of updates (good luck with fixing this one hehe)

But seriously, the most likely reason for "broken" signal is you didnt take signal travel time into account and hence
desynchronization happens (remember my "hardcore" comment heh, this is not minecraft. think of it as programming in assembly vs programing in c :). Even one miscalculated wire length will screw it up. )

On the positive side im working on delay element. It will be defined by texture number 833 (=blue), will output from from face marked by non 833 texture number, which will also set delay delay for received charged input by number of steps^^
User avatar
Ac
 
Posts: 264
Joined: Tue Sep 07, 2010 10:46 pm

Re: TeX Electronics

Postby chris0076 » Tue Jul 26, 2011 7:48 am

awesome. ^^

I did not mean to come across as angry, I was just saying the status on the ALU. ^^ anyways, I have it fixed now, lots of mental slip ups when making this kind of stuff on such a large scale. =P

EDIT: and the file if you want it. ^^
electronics.ogz
(66.44 KiB) Downloaded 287 times

Also, got a way to stop it once you start it in a sim loop?

Chris
"It is unworthy of excellent men to lose hours like slaves in the labour of calculation which could safely be relegated to anyone else if machines were used."
---Gottfried Wilhelm Leibniz
User avatar
chris0076
 
Posts: 501
Joined: Sun Oct 17, 2010 9:34 pm

Re: TeX Electronics

Postby Ac » Tue Jul 26, 2011 8:00 am

Chris: im quite impressed with 4 bit alu. nice work ^^. New /escan now reports 1371 active parts and 19115 wire parts in your alu. Max peak working part count is around 8800; which is still less then current maximum of 10000.
(you can see this data in new version). Now for some eye candy :

Chris Pentium stepping 0:

screenshot_1284948.jpg
screenshot_1284948.jpg (88.54 KiB) Viewed 7576 times


screenshot_1369478.jpg
screenshot_1369478.jpg (124.07 KiB) Viewed 7576 times


screenshot_1185162.jpg
screenshot_1185162.jpg (117.71 KiB) Viewed 7576 times



new:
-Implemented some basic statistic info when you do /escan as well as /estat command which reports
current and peak part usage during last simulation run.
-when erender = 0 : removed unnecessary commitchanges() so now its even faster; only circuit related memory
reads now.

Did erender 0 and used sim = [estep; estat; sleep 10 [sim]]; sim, so theoreticaly around 100 steps/second or
0.1 kHz or 0.0000001 GHz hehe (in reality my computer tops at around 50 steps/second). Adding of 2 numbers took around 10 secs for me so around 400-500 steps probably. If you select part that your interested in and copy it, texture redraw is refreshed on that part. That way you can see the results when you want even with erender = 0, plus its
very fast.
User avatar
Ac
 
Posts: 264
Joined: Tue Sep 07, 2010 10:46 pm

Next

Return to Misc

Who is online

Users browsing this forum: No registered users and 1 guest

cron