Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411522 Posts in 69377 Topics- by 58431 Members - Latest Member: Bohdan_Zoshchenko

April 28, 2024, 12:05:28 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallThe art of logic
Pages: [1]
Print
Author Topic: The art of logic  (Read 2453 times)
Maxim Schoemaker
Level 1
*


Bloh


View Profile WWW
« on: August 05, 2010, 01:31:55 AM »

Hi there!

I'm not too sure if this is the right place to post about this. I'm not even sure if this is the right forum, but I made this awesome thing and I really wanted to share it with you guys, so here it is:


What?
What this basically is, is a program to simulate electric circuits. It's editor would be, this is were the interesting part comes in, any pixel based graphics editor you like (for example paint). what happens is that you make your circuit in your editor, you save it as 'map.bmp' and put it in the same folder as the 'the art of logic.exe'. Then you run the exe and it runs your circuit.

Why?
Why the crap would I do this? well, in my opinion, art and programming (this is were the game part comes in) are too separated. I think they shouldn't carry each other (like in a game) but they should combine. In The art of logic this is possible.

How?
In the top left corner you define the colours you are going to use for the circuit. Any other colour can be used in the drawing without having effect on the circuit. In this way you can draw whatever you want, and use the circuit to do with it whatever you want. It's a combination of both's world's endless possibilities!



Stop the philosophical bull crap, explain how this works!

Defining stuff:
Okay, in the folder where the .exe is located you will find a file called map.bmp. Open this file in a graphics editor.
The the first colours you are going to define are the wire colours. So the pixel on position (0,0) is the colour of the wire you will use in your drawing. The pixel next to that (0,1) is the pixel the simulator will use to show the wire is 'on'.
Under that you will find the colour of the inverter (1,0) and next to that the colour of the inverter when it is on (1,1).
Then, one pixel lower (this might get a bit tricky) you find the colour you will use to define buttons. You define a button by picking a colour you want to use for the button and placing it somewhere in the drawing. Then place a pixel with the button define colour above it. Now you place a pixel with your button's colour anywhere and from there it will be used as an electric source when the button is pressed.

Using stuff
Okay, wire works like you would expect it. Use it to transfer power between stuff.
Inverter, invert the power they get. If they get nothing they give power, if they get power they don't give power anymore. An inverter gets power by having a wire go up to it and 'touch' it from a side (above, under, left, right, not adjacent!). Inverters give power by having a wire be one pixel away from it but only above, under, left or right and not adjacent!
Button's give power to wire that touches them, just like inverters get power. Buttons give power when the space bar is pressed. You switch between buttons (you can define multiple ^^) with the left and right arrow keys.

Press escape to exit

Don't worry if you don't get it all. In the 'map.bmp' file that you get with the download a very simple circuit has been set up to demonstrate what I have explained.

How did you come up with this?
Well, the system is mostly inspired by the reddust circuits from notch's game Minecraft (which is an awesome game everyone should play!).

I'll be writing some tutorials on my blog about what's possible with this program.

UPDATES:
1.1
-You can now move your circuit around with WASD
-You can now zoom in and out with E and Q

TUTORIALS:
-Logic Ports
-Memory Cells


looking forward to what you guys will create!

Cheers,

Maxim
« Last Edit: August 06, 2010, 06:12:25 AM by Maxim Schoemaker » Logged

Maxim Schoemaker
Level 1
*


Bloh


View Profile WWW
« Reply #1 on: August 05, 2010, 02:23:27 AM »

A first tutorial is up. It's on logic ports :D
http://maximschoemaker.tumblr.com/post/907123910/logic-ports

Cheers,

Maxim
Logged

Melly
Level 10
*****


This is how being from "da hood" is like, right?


View Profile
« Reply #2 on: August 05, 2010, 10:27:18 AM »

DevLogs is for projects still indevelopment, where the author will post constant updates about several aspects of the project, like mockups, artwork, music, etc. A completed project goes either in Feedback, if you want people's feedback in order to continue development and improve it, or Announcements if you just want to put it out there and tell people you made something.

Where do you want this?
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Maxim Schoemaker
Level 1
*


Bloh


View Profile WWW
« Reply #3 on: August 05, 2010, 11:08:56 AM »

I suppose Announcements would be best. Thanks ^^
Logged

moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #4 on: August 05, 2010, 11:13:10 AM »

Where do you want this?
Well, hello there!
Logged

subsystems   subsystems   subsystems
Chaoseed
Level 3
***



View Profile WWW
« Reply #5 on: August 05, 2010, 09:27:40 PM »

A first tutorial is up. It's on logic ports :D
http://maximschoemaker.tumblr.com/post/907123910/logic-ports

Cheers,

Maxim

So, basically...if two wires meet, they light up if either one lights up. So, they make an OR circuit.  And then inverters will invert stuff, like a NOT.  So basically we have NOT and OR, and from that you can construct anything.  However, the graph has to be planar, because as far as I can tell, you can't have wires "cross over" each other.  You could get around that to an extent with buttons, but...I wonder if it's possible to create the truly complicated circuits with this...

It seems like buttons are "on" while you hold Space down.  Is that right?  I think it would be better if Space toggled the button state; that way you could set up complicated inputs.

Incidentally, I've noticed that if I put two inverter pixels touching vertically, then I make them invert, they will continue to be in the "on" color even though they're off.

Also, I'm having trouble with a circuit; one of the button colors just will not work (the yellow one).  I've tried other colors, I've tried moving the color defs around...it just does not work.  Or, it's possible I'm misunderstanding the whole color definition idea and I'm doing something wrong.  Can you help?  map_0.bmp

...And finally, couldn't you zoom in on the circuitry a bit? ^_^;  I mean, I like penciling in individual pixels, but it makes it hard to see what's happening at the end.  And also, some instructions should mention that Escape will exit the program.
« Last Edit: August 06, 2010, 07:08:49 PM by Chaoseed » Logged

Maxim Schoemaker
Level 1
*


Bloh


View Profile WWW
« Reply #6 on: August 05, 2010, 11:08:24 PM »

Allright,

You are right in saying that wires can't cross, which can indeed be a problem in building stuff. But I think with a little bit of effort, this could be overcome, you do have infinite space, so there is still a lot possible. But you're right, it is a problem...

I made buttons only go on when space is down, because that's the simplest for of a button. If you want to have a toggle button you should make one yourself. If you can't figure out how, I can send you one, cause I managed to make one. But the concepts needed for that will be explained in later tutorials ^^

This is a bit of crappy thing maybe, but inverter should never directly interact. There should always by at least 1 piece of wire between them. Because they give output one pixel further then directly around them, putting 2 inverters next to each means they can't give each other input. putting them 1 pixel away from each other means they keep inputting each other leading into a flickering device ^^. But that doesn't actually work cause I programmed it so that inverters would only affect wires and wires would affect inverters. (maybe this should be changed)

What happened with your buttons is that buttons are not designed to be used more then once. Apparently they do work when more are used, but not always. The blue input one button you made would work if you gave it a protruding pixel just like the yellow input one has. But, it's not the way to use buttons. Just use 1 pixel, and if you want a text saying input 1, you should make it out of a different colour. Making it in wire colour would result in quite a clear input, cause you could see when it's on :3.

Yeah, I suppose zooming in wouldn't hurt. I'll write a zoom in function right now, brb... xD Done! Gentleman

I hope that helped :3

Cheers,

Maxim

Ps. if you want some more (and clearer) info on logic ports and other constructions that could made with this electric system, you should look a the redstone circuits section in the Minecraft wiki.


[Edit]

I finished the second (short) tutorial on Taol. It's about memory cells ^^
http://maximschoemaker.tumblr.com/post/912570930/memory-cells

Cheers,

Maxim
« Last Edit: August 06, 2010, 05:02:56 AM by Maxim Schoemaker » Logged

Chaoseed
Level 3
***



View Profile WWW
« Reply #7 on: August 06, 2010, 07:12:14 PM »

Hey, check it out. Wires CAN cross.  Now we're not limited to planar graphs. Gentleman

(By the way, if you start the program without a map.bmp in the directory, it crashes messily. Who, Me? )
Logged

Laremere
Level 5
*****



View Profile
« Reply #8 on: August 06, 2010, 07:16:57 PM »

Two suggestions/requests:

I don't know if what you're using support system arguments (ie if you open it via command line the commands you put after the file of the .exe), but if it does if you make the first argument the file path of the image, I believe you can open up an image by just dragging the image to the .exe, which would be easier than renaming files.

Zooming in, please, pretty pretty please  Beg
Logged

If a tree falls in the forest and no one is around to hear it, is sound_tree_fall.play() called?

"Everything that is really great and inspiring is created by the individual who can labor in freedom."
-Albert Einstein
Maxim Schoemaker
Level 1
*


Bloh


View Profile WWW
« Reply #9 on: August 07, 2010, 12:17:56 AM »

Two suggestions/requests:

I don't know if what you're using support system arguments (ie if you open it via command line the commands you put after the file of the .exe), but if it does if you make the first argument the file path of the image, I believe you can open up an image by just dragging the image to the .exe, which would be easier than renaming files.

Yeah, I should just make a system were he ask for the file you want to use. The thing you say about system arguments, at the moment I wouldn't know how to do that, but I'll see if I could figure it out Coffee

Zooming in, please, pretty pretty please  Beg

Zooming in is already there ^^ (if you have version 1.1) it's with Q and E, and moving is with WASD.

Hey, check it out. Wires CAN cross.  Now we're not limited to planar graphs. Gentleman

(By the way, if you start the program without a map.bmp in the directory, it crashes messily. Who, Me? )


That is indeed very nice! =D
it's quite stupid that I hadn't thought of it myself yet xD


Btw, does anyone find my tutorials useful?
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic