Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / electronics simulator

Author
Message
qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 21st Nov 2003 14:13
has anyone heard of or tried an electronics simulator in a basic language? or do you have any ideas?

i need a way to do wires in 3d mode (can i draw a line from xyz to xyz?) and i need a way to activate objects when they make a complete circuit

ill give more info after school if needed

thanks
chris
mimesis
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Norway
Posted: 21st Nov 2003 14:31
An electronic simulator should be possible in dbp.
Why not do it in 2D? It would be easyer for you to code and for the
user to draw schematics.
However I think this kind of project would be very tedious to code,
not to mention you need somme pretty fast/effective code to
calculate the simulation in realtime.

Me, You, DBP and everything else, were made in the same place. The Stars!
I wonder what kind of matter DBP bugs are made of ... antimatter ??
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Nov 2003 18:54
Here's an idea. Say you have a numb er of objects, each with a "powered" flag, defaulting to 0.

When you run the simulator, at the bettery the flag goes to 1, and then you work out what that's connected to. make them all one and so on until you've done that to all components.

"Help! My keyboard is stuckkkkkkkkkkkkkkkkkkkkkkkkkkkkk"

Mercenaries in Space demo @ http://www.davidtattersall.me.uk
Surreal Studio IanG
22
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Cyberspace...I think
Posted: 21st Nov 2003 19:22
are you thinking of a program like crocodile clips?

If you want my opinion don't go 3d go 2d, because diagrams for electronics are in 2d using animation for say LEDs, turning red when working and exploding when broken, animated explosion though.

Flick that switch...*BANG*...Not that one!
feiting
22
Years of Service
User Offline
Joined: 19th Oct 2003
Location:
Posted: 21st Nov 2003 20:06 Edited at: 21st Nov 2003 20:06
sounded like an ASM emulator...

I saw a similar program in physics. Was in 2D at beta. The author never finished, but it was pretty well done. (for the MAC though)

He who does not take the assassin job, will get killed by one who does.
qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 21st Nov 2003 22:33
the reason i would do it in 3d is because i wanted to someday use it in a program that would have u first person and u can see your elecronitcs manipulate things--for example you can place a motor, some gears and axles and wheels, power the motor, and it could propel itself forward, and you would see it in first person. then u could go even farther and make two robots, have them battle or something. or plenty of other possibilities.

thats far down the road. i just want what i do to be compatible with that, though.
i will do it in 2d and later make it so u can convert it to 3d or something

anyway
here's what i have worked out so far

type obj
inconnect
involt as float
kind
outvolt as float
outconnect
circuit
circuitid
endtype
inconnect is the object giving it current, outconnect is the object it gives current to, kind is what type of object it is, which would determine what it does when powered, involt and outvolt are hte amount of volts going in and out, circuit is which circuit it belongs to, circuitid is its identification for within that circuit

type circuit
inconnect
involt as float
outvolt as float
outconnect
endtype
same as before, only htis deals with a whole circuit
a circuit doesnt need its source ofpower to be a battery, it can also get power from another circuit. using this method there would be many circuits. for example the simplest "parallel circuit" would be seen as two circuits by the program.

any comments welcome

Login to post a reply

Server time is: 2026-07-26 17:34:31
Your offset time is: 2026-07-26 17:34:31