need some advice on how to design this.

Started by
3 comments, last by freeworld 13 years, 7 months ago
I've always had this idea of mixing the chemistry and gameplay together and after some a little research I found what I hope is a rather simple way to ... simplify it.

heres a quick link to the pdf I'll be talking about, the diagram is at the bottom of page 5

I want to make a game were little balls representing electrons will be flying around and when they collided with other electrons then can bond together and create atoms, same thing goes with atoms. For the gameplay, they player is given a certain amount of electrons and the computer the same amount, the goal is to push the electrons and atoms around to combine your colors into more complex atom and cause different reactions to destroy or steal the opponents electrons until you control all the electrons left.

If you look at the diagram, I figured I define my atom and a single object that has 8 slots 2 on each side, that can be filled by free moving electrons or those from other atoms.

My problems is the transformation between being a single electron to being an atom. I was thinking of just doing a tree type of structure, so that electrons could be atoms aswell.

When they first combine, one of the electrons becomes the parent and the other become a sibling of that electron and fills in a slot. Then the only way to combine with that electron from then on is to be a free moving electron or a parent electron with the right open close slot pattern.

Sorry if that sounds like gibberish, any thoughts are more than welcome.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
Advertisement
Moved to Game Design.

-- Tom Sloper -- sloperama.com

Re: Chemistry

Quote:Original post by freeworld (Editted)

I want to make a game where little balls representing electrons will be flying around and when they collided with an orbital they can form ions, same thing goes with atoms to form molecules. For the gameplay, the player and the computer are given the same amount of electrons, the goal is to push the electrons and atoms around to combine your colors into more complex molecules and cause different reactions to steal the opponents electrons until you control all the electrons.


Re: Programming

Quote:If you look at the diagram, I figured I define my atom as a single object that has 8 slots 2 on each side, that can be filled by free moving electrons or those from other atoms.

My problems is the transformation between being a single electron to being an atom. I was thinking of just doing a tree type of structure, so that electrons could be atoms aswell.

When they first combine, one of the electrons becomes the parent and the other become a sibling of that electron and fills in a slot. Then the only way to combine with that electron from then on is to be a free moving electron or a parent electron with the right open close slot pattern.


I think what you need is a class that represents any ownable moving object. A moving object has position, velocity, orientation and spin. An ownable moving object (OMO) is a moving object with a flag to signify whether it is owned by the player, the computer, or no one. An OMO can be a free electron, an atom, or a molecule. The player interacts with OMOs by pushing them.

An electron is an OMO.

An atom is an OMO that points to at most four Orbitals. Each Orbital points to at most two atoms and two electrons. When an electron joins an Orbital, its OMO becomes disabled, and its position is implied by the Orbital.

A molecule is an OMO with a list of atoms. When two atoms form a molecule, the two OMOs of the atoms are disabled, and an OMO for the molecule is created. When an atom joins a molecule, the atom's OMO is disabled and that of the molecule is updated. When two molecules combine, one of the OMO is removed, and the OMO of the other is augmented. Analogous rules exist for the breaking apart of a molecule and oxidation of atom.


Example: Water H2O

For the water molecule, there are 12 OMOs and 4 Orbitals.

The 12 OMOs are:

1x H2O molecule, enabled
1x Oxygen atom, disabled
2x Hydrogen atoms, disabled
8x Electrons, disabled

The 4 Orbitals are:

Orbital1: Associated with Atom1(first Hydrogen), Atom2(Oxygen), Electron1 and Electron2
Orbital2: Assoc. with Atom2, Atom2, Electron3, Electron4
Orbital3: Assoc. with Atom2, Atom2, Electron5, Electron6
Orbital4: Assoc. with Atom2, Atom3(second Hydrogen), Electron7, Electron8


Re: Gameplay

The player moves the OMOs he controls and attack the Orbitals of other OMOs. To break a bond, the attacker knocks off an electron or an atom associated with an Orbital by either power or attraction. To defend a molecule, the player could evade the enemy influence by moving or rotating the molecule so that the weaker bonds are not exposed.

>> Q: If a player's molecule forms a bond with the computer's molecule, who owns the electrons and the electrons?

[Edited by - Wai on August 24, 2010 2:26:34 PM]
If you're going to call things "atoms" and "electrons" then you should remember that an atom's made of more than electrons - there's also a positively-charged nucleus made of protons and neutrons. So as I see it there are two viable options: involve those somehow, or keep things as they are but preferably lose the name "electrons" in favour of something a bit more abstract or creative.

If you're going to add in positively-charged things, they don't have to be directly player-controlled; +s will naturally be attracted to -s and repelled by each other. Likewise, -s will naturally be attracted and repelled by each other. So in fact you could give the player control of a "source of charge", either positive or negative, which they could move around to attract opposite charges, repel similar charges and hopefully nudge things into becoming atom-like systems. Once you have atoms or other complicated objects, you'll be able to influence their movements by using your charge source to manipulate the individual components (electrons etc.) which in turn will have an effect on the whole atom or molecule, moving it or changing its shape.

If you want to stick with just one type of particle (electrons, as you've called them) then really anything goes. You'll have to do away with the basic attraction / repulsion rules though (since otherwise all electrons will either clump together or fly apart) and replace it with something more complicated - maybe there's no attraction or repulsion at long distances, but if two objects come close enough together - maybe with some extra conditions, such as their speed relative to each other - then they might combine into something else.

Just throwing some thoughts out there.
Quote:Original post by Wai
>> Q: If a player's molecule forms a bond with the computer's molecule, who owns the electrons and the electrons?


I decided to split things up so that they are all electrons, but electrons can be in different states, parent, sibling and free. When they bond together, they steal the owner ship of the electrons they collided with. Parent electrons steal sibling and free electrons but can't steal parent electrons. Sibling electrons can bond to parent atoms of the same owner ship and free electrons can bond with parent and free electrons but can only steal owner ship from free electrons.


Quote:Original post by Robin S
If you're going to call things "atoms" and "electrons" then you should remember that an atom's made of more than electrons - there's also a positively-charged nucleus made of protons and neutrons. So as I see it there are two viable options: involve those somehow, or keep things as they are but preferably lose the name "electrons" in favour of something a bit more abstract or creative.

If you're going to add in positively-charged things, they don't have to be directly player-controlled; +s will naturally be attracted to -s and repelled by each other. Likewise, -s will naturally be attracted and repelled by each other. So in fact you could give the player control of a "source of charge", either positive or negative, which they could move around to attract opposite charges, repel similar charges and hopefully nudge things into becoming atom-like systems. Once you have atoms or other complicated objects, you'll be able to influence their movements by using your charge source to manipulate the individual components (electrons etc.) which in turn will have an effect on the whole atom or molecule, moving it or changing its shape.

If you want to stick with just one type of particle (electrons, as you've called them) then really anything goes. You'll have to do away with the basic attraction / repulsion rules though (since otherwise all electrons will either clump together or fly apart) and replace it with something more complicated - maybe there's no attraction or repulsion at long distances, but if two objects come close enough together - maybe with some extra conditions, such as their speed relative to each other - then they might combine into something else.

Just throwing some thoughts out there.


That's exactly why I've decided to use only electrons. I'm using Box2D to simulate collision and movement of the electrons. Instead of using attraction and repulsion.

To form bonds what I basically do is wait for collisions between different particles, if their state and positions line up right. ie for an electron to join a parent electron it has to hit near an open slot, it can't just hit one of it's sibling electrons and expect to join. I then uses force to judge who wins in the collision, so say two free electrons hit each other. Whoever has the most force or velocity gains control of both electrons and they bond together, the one with most force becoming the parent electron.

I've spent the last 12 hours writing a rough draft for a design doc on the concept, and the only major problem I see and may scrap is the idea that two or more parent electrons( atoms ) can join together.



[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

This topic is closed to new replies.

Advertisement