Simple, unique...just...awesome in my opinion.
Ok, now onto GM stuff. I am calling for help, your help...yes...you. If this stuff interests you, make suggestions here, code, reactions, etc. etc. But first, we need a base:
Download 27.3KB gmk
Contains 2 objects, the molecule/atom (obj_mole) and the possible bond between 2 of them (obj_bond). The molecule/atom (just going to call it 'mole' from here on) is a circle, so rotations are not an issue. Each mole can be a different type (it could be hydrogen, oxygen, methane, a, b, c, whatever letters), and with each type a different state (a number). It also has an energy value. If you right-click a mole, you effectively "drag" it toward the mouse until you let go of the right mouse button. There is a 4 point collision check that does a poor job at "bouncing" mole's off each other, while at the same time it "shares" its energy with each other (adding them together and dividing evenly), this shows transfer conservation of energy.
The room creation code contains the chemical reaction code, which right now looks like:
ac_bond_rule("a0+a1->a3#a2"); ac_bond_rule("a2+a0->a4#a5"); ac_bond_rule("a3+a5->a7#a6"); ac_bond_rule("a7+a0->a8#a9"); ac_bond_rule("a9+a6->a10#a11"); ac_bond_rule("a11#a8->a12+a4"); ac_bond_rule("a12#a10->a6#a7");
When you left click a mole, it will change it's state to "1", and they all start with type "a" as default. The above code when run for a length of time will continually add "a0" mole's to a cellular membrane mass.
So...this is my WIP. It's crude and barely has any code that is useful, BUT this is where YOU come in. I need help:
* Proper physics (so that mole's properly bounce and properly transfer kinetic energy conserving all forces).
* Better bond coherence (along with physics so that mole's can't accidentally "slip through" but allowing fluid movement).
* Better/faster code maybe? (it's pretty fast code, but there might be an easier way to do it)
* More bonding rules (right now it is only either bond, disbond, or change type with 2, I'd like coupling and decoupling rules too like "x1+y1->z0" and "z1->b0+c0")
* More bonding types maybe (like polar attraction, gravity, etc.)
* As the last proof-of-concept test, a working cell structure as best we can (membrances, enzymes, dna, etc. etc).
The last one will probably be the culmination of everyone who helps out, each piece can be made separately and introduced together. The other things I would like to have done before the end, so that it looks more realistic. I'm not here to take all of your credit, every piece of code, every rule, everything will be documented on who did it, and it will be ALL of our work, and I'll be helping out when I can.
To make a rule, you call "ac_bond_rule" script with a string, the string is a specific format depending on what you want to do (try not to have any spaces in it):
a0+a0&10->a1#a1&0This is a fusion reaction. It says "if 'a0' mole collides with another 'a0' mole and they both together have at least '10' points of energy, then bond them together and change their states to '1' and '1', take away their '10' points of energy and give them '0' back". Although energy is possible, it is not required (defaults to 0 for both sides of the equation).
a2#a2&20->a0+a0&0This is a fission reaction. It says "if there are 2 mole's bonded 'a2' and 'a2' with 20 energy between them, break their bond, take away their energy and change their states to 'a0' and 'a0'"
a1#a1&10->a2#a2&0 a0+a1&10->a1+a2&0I think you're getting the hang of it, the last 2 are above. First is the transform, if 2 moles are bonded, they stay bonded but change their states accordingly (along with energy drain/gain). The second one is ionization, if 2 moles are not bonded and they collide, they don't bond, but their state changes accordingly (this is similar to "passing an electron" in photosynthesis and other chains).
Types cannot have numbers, and only numbers can come after a type, so: "a42802f" is not a valid type:state mole, and "co2" would mean it is type="co":state="2", so be careful when naming moles. You can have very long names and numbers (they are both stored as strings), so "fjdklsahfudishafdshafj372894673284632784632" is perfectly fine.
I hope I get some responses from a mature knowledgeable crowd who is into this kinda stuff at least half as much as I am. *crosses fingers* Here's to hoping.
Edited by sabriath, 07 November 2011 - 04:44 AM.