Statistics | We have 1675 registered users The newest registered user is dejo123
Our users have posted a total of 30851 messages in 1411 subjects
|
Who is online? | In total there are 3 users online :: 0 Registered, 0 Hidden and 3 Guests None Most users ever online was 443 on Sun Mar 17, 2013 5:41 pm |
Latest topics | » THIS FORUM IS NOW OBSOLETE by NickTheNick Sat Sep 26, 2015 10:26 pm
» To all the people who come here looking for thrive. by NickTheNick Sat Sep 26, 2015 10:22 pm
» Build Error Code::Blocks / CMake by crovea Tue Jul 28, 2015 5:28 pm
» Hello! I can translate in japanese by tjwhale Thu Jul 02, 2015 7:23 pm
» On Leave (Offline thread) by NickTheNick Wed Jul 01, 2015 12:20 am
» Devblog #14: A Brave New Forum by NickTheNick Mon Jun 29, 2015 4:49 am
» Application for Programmer by crovea Fri Jun 26, 2015 11:14 am
» Re-Reapplication by The Creator Thu Jun 25, 2015 10:57 pm
» Application (programming) by crovea Tue Jun 23, 2015 8:00 am
» Achieving Sapience by MitochondriaBox Sun Jun 21, 2015 7:03 pm
» Microbe Stage GDD by tjwhale Sat Jun 20, 2015 3:44 pm
» Application for Programmer/ Theorist by tjwhale Wed Jun 17, 2015 9:56 am
» Application for a 3D Modeler. by Kaiju4u Wed Jun 10, 2015 11:16 am
» Presentation by Othithu Tue Jun 02, 2015 10:38 am
» Application of Sorts by crovea Sun May 31, 2015 5:06 pm
» want to contribute by Renzope Sun May 31, 2015 12:58 pm
» Music List Thread (Post New Themes Here) by Oliveriver Thu May 28, 2015 1:06 pm
» Application: English-Spanish translator by Renzope Tue May 26, 2015 1:53 pm
» Want to be promoter or project manager by TheBudderBros Sun May 24, 2015 9:00 pm
» A new round of Forum Revamps! by Oliveriver Wed May 20, 2015 11:32 am
|
|
| Compound system | |
|
+6jaws2blood Carnifex ido66667 The Uteen NickTheNick Seregon 10 posters | |
Author | Message |
---|
Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Compound system Wed Aug 15, 2012 9:41 am | |
| Personally, I'd like to simulate this as accurately as we can, while still keeping the game playable. As I mentioned before though, the implementation is seperate from the actual system of reactions we use, so if we need to simplify, we can do so later. Also note that we won't be showing all of this to the player, a lot of the detail simply gives the auto-evo (procedural evolution) system something to work with.
To my knowledge, aerobic respiration of glucose produces 38 ATP per glucose (2 from glycolysis, the rest from the electron transfer chain), with 2-3 of those being used transporting stuff into/out of the mitochondria. Having just had a look on wikipedia (not ideal, but I don't have my biochem books to hand right now), it's suggested that each 2 carbons in the fatty acid produce 4 ATP, in addition to the 12 ATP yield from electron transport, giving you a total of 48 per 6c's, versus 36-38 per 6c's of glucose. Presumably those extra 10-12 ATPs, probably plus some extra, must be invested when the fat is first synthesised? The real payoff to fat is the energy value per gram (~9Kcal/g vs. ~4Kcal/g for glucose), rather than per carbon molecule, which may be the 2x figure you recall?
Keep in mind that all of this is comming from an ecologist, not a biochemist or molecular biologist. If you disagree with me please say so, and I'll do some more reading to check my facts.
I had heard that the brain prefers either sugar or protein, I can't think which, though sugar would make more sense. I didn't know that muscles prefered fat, I'd assumed that sugar would be quicker and easier to process, making up for the lower energy yield, but I definately do not know enough about this, so I'll go with what you said.
Actually, something else we need to know is how quickly all these reactions can take place. I suspect this will be rather difficult to find out, but I would like to be proved wrong.
EDIT: Also, a really good source I've been using is this, especially page 124 about fat and amino acid respiration. I've also realised that I've so far neglected the glycerol in triglycerides. I'm not sure how that fits in yet, so I'll have to think about it. Is fat stored in any other form (besides triglycerides and phosphlipids) within the body/cell? | |
| | | Carnifex Newcomer
Posts : 37 Reputation : 8 Join date : 2012-08-13
| Subject: Re: Compound system Wed Aug 15, 2012 12:09 pm | |
| Yeah I know most of it is all done in the background, but still these are really complex biological systems which are pretty tough to simulate accurately. That being said, of course we can program is as accurately as we possible can so it's definitely a keeper. You might be right about the amounts of ATP generated, I will look this up in my biochemistry book once I get back from work. I'm not a biochemist/molecular biologist either, I have the basic knowledge and the deeper stuff I have to look up in my books as well so no worries. I'm pretty sure your brain prefers glucose as a fuel. (source: books and www .fi.edu/learn/brain/carbs.html) As far as I know, when the body is under large distress to the point where your body cannot supply enough oxygen for your muscles to produce energy the muscles divert to anaerobic pathways. A huge drawback from this though is that the body will deplete itself of all glucose it contains at which point you pretty much black out. Quote from wikipedia (/wiki/Triglycerides (yes I know)): - Quote :
- When the body requires fatty acids as an energy source, the hormone glucagon signals the breakdown of the triglycerides by hormone-sensitive lipase to release free fatty acids. As the brain cannot utilize fatty acids as an energy source (unless converted to a ketone), the glycerol component of triglycerides can be converted into glucose, via glycolysis by conversion into Dihydroxyacetone phosphate and then into Glyceraldehyde 3-phosphate, for brain fuel when it is broken down. Fat cells may also be broken down for that reason, if the brain's needs ever outweigh the body's.
also: /wiki/Lipid | |
| | | jaws2blood Newcomer
Posts : 62 Reputation : 3 Join date : 2011-12-18 Location : USA
| Subject: Re: Compound system Fri Aug 17, 2012 8:13 pm | |
| hmm. The realism thing is concerning me a bit. The effects of some of these processes will not be present to the player unless it involves ATP(energy) and probably protein(health? Organelles? Editor?) Yes, in real-life you don't get these things out of nowhere, but in gaming, anything is possible and the coding doesn't have to be done for allot of these background processes. I know it's possible, and not even very difficult to program these different processes realistically, but is it worth the memory? Are the results worth the processing? Who will notice these results? There's a bit to consider when dealing with these things. We don't want to make useless objects and classes, the results must justify the means. However, besides that I like the direction we're going in with compounds and things. This is my favorite thing about this post: | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Compound system Fri Aug 17, 2012 8:26 pm | |
| I realise the realism I'm aiming for might not be possible, but I think if we can pull it off, it'll be worth it. Also, as I said before, the implentation is completely seperate from the actual level of detail we use for the compounds. We create the classes to support the system (I've done an early version of this already), and the objects are created dynamically from xml data files. If we find out that the level of realism we wanted isn't computationally possible (or necessary for gameplay), we change the data files, not the code (which I realise isn't trivial either, but it's easier than rebuilding the engine).
I keep saying I'll post some implementation details soon, and things keep comming up. I'll try to finish it over the weekend, and will post it either Sunday or Monday. Until then, sorry for not making it entirely clear how I intended to make this possible. | |
| | | jaws2blood Newcomer
Posts : 62 Reputation : 3 Join date : 2011-12-18 Location : USA
| Subject: Re: Compound system Fri Aug 17, 2012 8:57 pm | |
| - Seregon wrote:
- I realise the realism I'm aiming for might not be possible, but I think if we can pull it off, it'll be worth it. Also, as I said before, the implentation is completely seperate from the actual level of detail we use for the compounds. We create the classes to support the system (I've done an early version of this already), and the objects are created dynamically from xml data files. If we find out that the level of realism we wanted isn't computationally possible (or necessary for gameplay), we change the data files, not the code (which I realise isn't trivial either, but it's easier than rebuilding the engine).
I keep saying I'll post some implementation details soon, and things keep comming up. I'll try to finish it over the weekend, and will post it either Sunday or Monday. Until then, sorry for not making it entirely clear how I intended to make this possible. I'm all for working with those process charts you provided. The player has several ways to gain ATP and protein. Each process will give different results but, have different requirements if you want those results. This will force the player to explore the in game microbial world for various required substances or cells with the DNA for special organelles the player needs/wants which they acquire by say, assimilating with that cell? Or I suppose we could have a game mechanic where after constantly collecting certain required substances, an organelle is evolved to generate this required substance for the cell so less energy is wasted wandering(imagine how rewarding that might feel to unlock after all your searching and gathering). | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Compound system Mon Aug 20, 2012 2:09 pm | |
| Sorry again for the delay in posting this, hopefully this makes it clear exactly how I propose the compound system is implemented, and what this means we need to do from here. I had intended to post some code and actual implementation specifics, but that will wait until we've decided on some coding standards later this evening. Instead, i'll concentrate on the actual algorithm, what it requires, and any code specifics I'm more confident on. So we know the basic components needed for the Cell stage Compound System (compounds, organelles, processes, and organisms), now lets see how each one works, how they fit together, and how all of this is implemented in code. There are two reasons for posting this, firstly to explain whats going on for those of you who are interested, and secondly to show just how much difference there is between a concept and an implementation, and just how much detail is needed for the latter. DefinitionsFirst of all a few definitions. For the purpose of this post only, component types are the different types elements which go to make the complete game system (e.g.: compound, organelle, organism, biome, niche), whereas components are examples of each of these types (e.g.: oxygen, water, chloroplast, creature a/b/c, tropical rainforest). Most of the numbers I use below are examples, the actual values will either need to be researched, or decided on, at some later point. These values will need balancing, to make the game playable, and fun (i.e.: not to difficult, not to easy). The exceptions to this are the molecular weights listed for compounds, these are scientific fact (unless I've made a mistake somewhere!). Any number followed by an 'x' indicates that that particular compound is divided into units. For example, polysaccharides (e.g.: starch, cellulose) are made up of many sugar units in a chain, that number could be anything from 2 to 50 or more. Each individual sugar is a unit, so that where it says that the molecular weight of a polysaccharide is 180x, that means the actual weight is 180 times the number of units. Similairly, if an organism has a storage capacity of 500x for starch, it means it can store a total of 500 starch units, regardless of how many individual molecules that starch is divided into (in fact, we don't bother keeping track of individual molecules at all, this total is all we need to know). Elements in the diagrams I give below are color coded along to the following key. Apologies to anyone whos colorblind, but the software I'm using to make these doesn't give me many alternatives for highlighting nodes, if this is a real problem, please let me know and I'll try to work on an alternative. The properties I've used for each component are simply examples, I don't yet know whether these are all the properties we'll want to use, or if we'll want to use all the properties I've listed, they're simply what I've started off with. ClassesEach component type is defined in code as a class (that is, a collection of properties and functions which act on those properties). You can use a class definition to create objects, which have the structure of that class, but their own data, which may or may not be unique to that obect (see a programming tutorial for more details). So, for example, we have the classes: Compound, Organelle, Process, and Organism. Example objects are Oxygen, Water, Glucose (Compounds), Mitochondrion, Chloroplast (Organelles), Aerobic respiration, Photosynthesis (Process). In this implementation, each object contains the constant data about a particular component, that is, the data which is the same for all examples of that component, in programming terms this data is 'static'. So, for compounds, their molecular weight will always be the same, as will their name and icon, other possibilities would be melting/boiling temperatures: What this definition doesn't include is information like how much of the compound a cell can store, as this is particular to the cell storing the compound, not the compound itself. Status classesIn addition to storing a reference to the static data about any component it uses, most components will also store some additional data about the used component alongside it. To clarify, here's an example. The process shown below has various properties. Alongside a name, it has a basic reaction rate, at which it is carried out. It then contains three lists of components: input compounds, output compounds, and organelles. For each compound it also lists the number of that compound which is either needed or produced by the reaction, this is the status of that compound for this particular process. In a more slightly complicated example, consider the compounds stored by a particular organism. For each compound, the organism has a particular capacity, and also a currently stored quantity of that resource, these values and others would be combined into a 'Compound Status' object for that organism. Process evaluationSo now we know how we're storing all this information, and how to access it, what do we do with it? At set time intervals, the entire game is updated, though different aspects of the game are updated at different rates. The fastest is the graphics you see, which are updated every frame, roughly (hopefully) 30-60 times per second (fps). Roughly twice a second we'll update the levels of each compound within the system (i.e.: the number of units we have of each), fast enough to appear smooth to the player, and slow enough to stop your computer melting. Somewhat less often (every 2-5 seconds) we'll update the rate at which these compound levels are changing (i.e.: the change in units per second), according to the processes being carried out in each organism. These updates are desynchronised, so that each frame only a small subset of all the updates is carried out, which helps to smooth the framerate. The only 'moving part' in the compound system as it is right now is the processes, which convert input compounds into output compounds, changing the quantities of each in whatever location that process is being carried out, which could be an organism, or the environment. For now then, process evaluation is the only thing we need to worry about in terms of actually doing anything. Here then, is the current algorithm for process evaluation: For each organism (o), for each process (p) that organism can perform:
- Fetch the basic rate (R_b,p) at which that process can be performed (static process object)
- Multiply that rate by the concentration (C_c) (current store / maximum capacity) of each input (P_ic,p) compound within that organism
- Multiply that rate by the inverse concentration (1-C_c) of each output compound (P_oc,p) within that organism
- Multiply that rate by the available space within the organelles (G_g) available in the organism, which are required by the process (P_g,p)
- We now have the total rate (R_p) at which the process is proceeding.
- Now, for each input compound used by the process, change the rate of change of that compound (R_c) by -1 x R x Pin_p,c (the quantity of that compound used by the process)
- For each output compound used, change the rate of change (R_c) by 1 x R x Pout_p,c
Now, at each compound update step, we use this rate of change (R_c), to modify the level of each compound within an organism. Excuse the variable naming, the level of nesting makes this rather awkward. Anyway, here are some formatted equations for the above: The reaction rate of each process within an organism: The resulting rate of change for each compound within an organism: Now, at each compound update step, we simply add R_c to the quantity of compound c stored in the organism... simple, really. Now, to anyone who thinks this is hugely complicated, your probably right, but as far as the computer is concerned this is really basic number crunching, and computers are *good* at number crunching. The result then, is that while this process is rather difficult to understand, it's fairly simple to code, and not excessively expensive to compute. SummaryThats pretty much it for now, theres a lot more details to work out, both on the concept and the implementation, but this roughly covers whats going on in the prototype posted in the OP. What I'd like to know from you (apart from any general comments or suggested changes), is whether you actually want posts like this in future, with actual implementation details. I'll continue posting maths along with concepts as and when I can, but I'm not sure whether it's worth explaining the program structure (everything before the 'Process evaluation' section) as I go along? Let me know what you think, and whether you'd like more. Also, if your having difficulty understanding any of this, let me know and I'll try and make my explanation clearer. The compound icons I used are borrowed from turbosquid, perhaps someone more artistically talented would like to have a go at comming up with some chemical icons, similair to these but using the thrive shard theme? (for an added challenge, keep them recognisable at 64x64 or 32x32 pixels). Here are few more to get you started, note that the angles between atoms in the icon doesnt really matter, so long as the order is kept the same: The same goes for the mitochondrion icon, which came from here. tl;dr; - understandable really, but now you know why it took over a week to write a simple prototype. | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Compound system Tue Aug 21, 2012 12:29 pm | |
| I missed a fairly important point in the post above. As I've said before, the actual compounds, organelles, and processes using the game are dynamically created from datafiles. These files are (currently) provided in XML fomat. If we (or future modders) ever decide to change the game chemistry (e.g.: to simplify it), all that needs to be done is to change these datafiles, not the game code. Similairly, this same system could be used to add products, resources, and production paths to later stages.
Example xml files are below, not that the properties included here are only what I've worked with so far, we'll likely add many more (for example those included in the images in the previous post). The actual xml structure used could probably be improved too, so if you know more about that than I do, please do offer any suggestions or comments.
Compounds.xml
Organelles.xml
Processes.xml | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Compound system Tue Aug 21, 2012 2:35 pm | |
| This all looks wonderful!
One question, however. Do the other programmers have other sources of accessing your compound system? If this is the only place where they can see the model then I think it is important to keep the implementation details as it would greatly help them become as adept with the whole model as you are. Otherwise, if they have alternative sources of accessing the details of the implementation of the compound system, I would refrain from posting the same details here unless someone requests it. I just think it is more important for you guys to do the coding than to take time/effort away from that to tell us how you are coding. | |
| | | ido66667 Regular
Posts : 366 Reputation : 5 Join date : 2011-05-14 Age : 110 Location : Space - Time
| | | | ~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: Compound system Thu Aug 23, 2012 5:58 pm | |
| I can take a crack at icons. You're doing great work, seregon. | |
| | | jaws2blood Newcomer
Posts : 62 Reputation : 3 Join date : 2011-12-18 Location : USA
| Subject: Re: Compound system Fri Aug 24, 2012 5:40 pm | |
| can you make and post more of these charts, it may come in handy when the creation of cells and their organelles may come about. With the numbers being there and all. | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Compound system Fri Aug 24, 2012 5:54 pm | |
| If you don't mind, could I provide them as XML's instead (see above post)? I'm happy to create any more charts like that to make explaining stuff easier, but they're a little too labour intensive to make one for each compound we'll need. | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Compound system Fri Aug 24, 2012 7:12 pm | |
| - Seregon wrote:
- If you don't mind, could I provide them as XML's instead (see above post)? I'm happy to create any more charts like that to make explaining stuff easier, but they're a little too labour intensive to make one for each compound we'll need.
Seregon, I would love to help! Do you think you could PM me the numbers for the different compounds and then I just compose them into a chart? Please PM me. | |
| | | jaws2blood Newcomer
Posts : 62 Reputation : 3 Join date : 2011-12-18 Location : USA
| Subject: Re: Compound system Fri Aug 24, 2012 7:21 pm | |
| - Seregon wrote:
- If you don't mind, could I provide them as XML's instead (see above post)? I'm happy to create any more charts like that to make explaining stuff easier, but they're a little too labour intensive to make one for each compound we'll need.
that is fine, xml isn't too hard to read. | |
| | | Carnifex Newcomer
Posts : 37 Reputation : 8 Join date : 2012-08-13
| Subject: Re: Compound system Sat Aug 25, 2012 3:59 am | |
| So far these charts look like they're spot on (don't quote me on that). Great work!
If you prefer XML than I'd suggest doing that because it's a lot quicker and easier indeed. | |
| | | ido66667 Regular
Posts : 366 Reputation : 5 Join date : 2011-05-14 Age : 110 Location : Space - Time
| Subject: Re: Compound system Sat Aug 25, 2012 9:07 am | |
| I myself don't know how to work with XML, Sorry. | |
| | | gdt1320 Newcomer
Posts : 24 Reputation : 3 Join date : 2012-09-23
| Subject: Re: Compound system Wed Oct 10, 2012 8:44 pm | |
| Hey this looks great and I really like all the detail that went into it, but I'm a little worried about the amount of calculations it takes, especially if you were going to be doing this for large numbers of cells So I'd like to propose an alternative system that can be used. Equation: (A modification of the monod equation to account for temperature changes, and cell death) u_net= (u_m*S/(K_s+S)*e^(-Ea/T)-kd Variable Descriptions - Spoiler:
u_net is the net growth of a cell with units of inverse time. (game variable) u_m is the maximum growth rate achievable by the cell. (arbitrary) S is the concentration or amount of a specific type of food source. (game variable) K_s is the saturation constant (arbitrary) E_a activation energy for thermal growth (arbitrary) T is the temperature (game variable) kd is the death rate of cells due to toxins, temperature, and other stuff. (vector, see below)
The doubling rate of the cell is defined as t=ln(2)/u_net (can be how fast the cell grows) If the u_net is negative, then the cell is dying. The energy available to the cell can be u_net/u_mm (might need to change this) where u_mm is the maximum growth for the "best" substrate or food source. How to account for multiple food sources and substrate selectivity. - Spoiler:
So obviously this only accounts for one type of food source at a time, S. And cells sometimes need more than one type of nutrient source to survive. (sugars, amino acids, etc. ) Or the cell might be able to consume multiple nutrient subsets I.E. glucose, lactose, fructose for simple sugars. I'm still working on how to account for multiple foods for growth. (it may just end up being something like S1/(k_s1+S1)*S2/(k_s2+S2) but I'm not sure if that is scientifically accurate. But since cells tend to favor one type of food source over another almost completely, (they will consume it until it is gone) we can use this to get a pretty decent model. By having the method just move down a list of preferred substrates and pick the one that has the greatest k_m and the amount of S is not zero, or a critical minimum.
Cell death rate , kd - Spoiler:
So kd is not a single term but rather a collection, and it would be collectively: kd=sum(k_di) where k_di is a death rate associated with a particular cause (temperature, toxins, maintenance etc) Examples:
Temperature: kd=A*e^(-kdt/T) where Ed is activation energy for thermal death
Toxins: kd = kd_toxin*C_toxin.
Cell maintenance (the amount of nutrients required to sustain a cell) can also be accounted for here as
kd = kd_m (this is a necessary value otherwise the cells would be able to live with no food, which is not realistic)
But what about oxygen? - Spoiler:
So oxygen is actually pretty easy to model, each cell species has a critical oxygen level, DO_crit, where if the oxygen falls below this point it inhibits cell growth.
This effect is actually linear and can be modeled as u_m=u_m*min(1 , DO/DO_crit)
How this equation can be used for auto evo at the cellular level - Spoiler:
Class structure for each cellular 'species' would need a u_m and K_s or kd for every compound it can interact with at the cellular level, as well as Ea, Ed, kd_m, and DO_crit.
An auto_evolution function can take a copy of a species profile, and modify it in a random but restricted way. (there must be both a benefit, and a cost. ) I.E. maybe increasing the u_m of one substrate or food source, but decreasing another, or increasing maintenance costs.
The temperature energies must be linked in some way, so that each species has a small preferred range of temperatures.
This will change how the cell is conditioned to live in each specific environment, and eventually cells with a better fit will outgrow the competition.
There would definitely have to be restrictions on what mutations are possible, (a food source should not also be a toxin).
The other thing is that this relies on diverging, and converging limitations. I.E. if there is always enough food, the system will keep generating mutations. In order to put a survival of the fittest situation there needs to be some type of stress on the biome. I.E. sudden loss of a substrate, dramatic temperature change, increase in toxins)
How to keep calculations simple but realistic - Spoiler:
Biome splitting. By assuming the conditions (T,S,Toxins) in each biome are relatively constant per update, the u_net calculation only needs to be done once per cell species, per biome per update. A major improvement over doing it with each and every cell.
Species Extinction: If the amount of cells of a species falls below a certain minimum threshold, it should be declared extinct, instances of it should be removed, and it should be cleared from further updates.
Exceptions: The player's cells should always go through the u_net so that it provides a more realistic experience for local environment.
Other issues to look into - Spoiler:
First and foremost, this equation does not account for how much substrate, S is being consumed. I'm looking into that, and there is a solution, but it requires experimental data which won't be available for theoretical mutations. I'll keep looking or hash together a reasonable model.
What happens on cell death? I'd imagine it would increase certain substrate concentrations locally, but how would the breakdown of complex molecules, back to simple substrates take place?
Oh definitions: I defined each 'species' as being separate by a single mutation, which isn't realistic, but I wanted to keep the terminology simple. I realize you guys have probably already put a ton of work into the cell stage, and that this probably doesn't fit, but I'd just like to mention it in case it might be useful. | |
| | | ~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: Compound system Wed Oct 10, 2012 11:54 pm | |
| Nice ideas there. Remember though, that only the cell you control is affected precisely by these variables. All other cells are run as populations through auto evo and a simpler population dynamics system. | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Compound system Thu Oct 11, 2012 7:29 am | |
| Your idea (gdt) comes close to my initial thoughts on that problem, something I've now started developing in the population dynamics thread. I'm not actually familiar with the monod equation, but it looks like details from this (and other equations) could be very useful. As Scio said, for most populations we'll be modelling the population, not the individual cells. The exception to this will be your own cell, and possibly (if computation allows) the other cells visible to you in your immediate surroundings. My approach to this is to represent each species as a collection of all the compounds it requires/uses/produces/etc, as well as the average size/energy/etc of its constituent individuals, we then simulate the interactions of these compounds, and their effect on the individual states, at the species level. In the simplest, crudest possible example, if the species has an excess supply of fat, some of this will be stored in its cells, and some will go towards producing larger cell membranes; if there is a deficit of oxygen, aerobic respiration becomes slow/impossible, anaerobic respiration takes place instead, lactic acid (or ethanol, or similiar) is produced and the cell suddenly requires a lot more sugar (or similair) to do what it was doing before. The major advantage of this system over yours is this (and I only came to this realisation by first attempting what you just did): by representing a species as a collection of compounds, all those compounds are represented equally, we don't need a special variable for oxygen, or energy (atp), they're all simply compounds. What makes each one different is its interactions with other compounds: 6o2 + c6o6h12 -> 6co2 + 6h2o + 38atp. Simply (and I mean that in the most sarcastic way possible) by determining these interactions between compounds we can control how the system behaves, it will effectively attempt to ballance itself (within the constraints of these interactions, as most aren't reversible), and in the process use the available compounds in the available interactions in order to grow its cell/population. Another advantage (solving the problem I think you ran into when trying to account for substrate consumption) is that the system ballances, there should be no loss of compounds between interactions, in effect the system is closed. This is a very crude explanation, and I'll be posting much more detail in the thread linked above at some point (hopefully in the next week or two). Where things become a lot more complicated is interactions between species, i.e.: what happens when one species predates another? Assuming that x individuals of species A (with total population X) just consumed y individuals of species B (with total population Y), we could simply say that y/Y of each compound in species B is evenly distributed among x individuals of species A (although, within the limits of our representation, they are effectively distributed among the entirety of species A). More than likely it won't be that simple, some of the compounds will be wasted and leak back into the environment, others won't be digestible by A and will be excreted back into the environment (this is already handled by the above system). This is only part of the system which is far from done, and will need a lot more work. Hopefully that answers your questions. Your ideas are very much appreciated, but your just a little way behind where we are (which is impressive enough, I've been working on this on and off for about 6 months). Where I think you could really help out is determining all the above interactions, as it seems you may already know of some specific equations which I don't. | |
| | | gdt1320 Newcomer
Posts : 24 Reputation : 3 Join date : 2012-09-23
| Subject: Re: Compound system Fri Mar 22, 2013 3:52 pm | |
| In the ideal of keeping the simulations as simple as possible (but still keeping to the realistic aspect) A general form for these reactions is: Substrates-->(Growth)+Products. This should simplify the need for keeping track of intracellular compounds that wouldn't be seen by the player in the course of normal game-play. I.E. 36*Food+12*O2-->0.2*X+CO2+[bio-waste]. If we can use this type of reaction for the main simulation and game play it would be great. To get the amount of detail required in the sense you were talking about (I'm not sure where we are exactly on this at the moment) you'd have to have the metabolic flux maps for each species (or simplified versions) The disadvantage of this method is I can't think of a way at the moment for regulatory constraints (like aerobic vs anaerobic) without writing multiple equations. (unless we relate the coefficients in front of the substrates to the products) (which might work!) I.E. instead of a*Food+b*O2 --> c*X+d*CO2 it would be a*Food+b*O2-->(b-Z)*X+(RQ)*CO2 where z is the oxygen starvation limit below which the organism X can't survive and starts to die, and RQ is a simply b/N where N is a number to specify the ratio between O2 uptake and CO2 excretion. Obviously we can add more things to the reaction. I also think these same equations can be used later in the game for cities/planets where X would be population, substrates would be food, material, tech, etc and the products can be things like units, more tech, etc. This could be done in the flux maps simply be adding or removing "reactions" or regulating them. Additionally, these all turn out to be linear equations. So you can use something like the simplex algorithm (or any linear optimization method) to say hey, "I want to optimize this city for research, growth, product of ___ etc. " and fluxes would be bound by what buildings were in the city/planet. This could also be useful for evolving species by adding/removing reactions, or modifying limits of fluxes. As I said before, using these simple equations should cut down on the computations the computer needs to run during game play. However for modifying and "evolving" the species having flux maps for them would give you as much detail as you want, help keep everything balanced, and give some insight to the user about how all of this stuff works biologically(I think it would also work nicely later in the game as well for city and planet production) Where I'm getting this from: - Spoiler:
I'm taking a metabolic engineering course where we do things like look at the effects of adding/removing reactions in metabolic pathways and mathematically predicting the outcome as well as using optimization tools to find optimal fluxes. I also know how to analyze "simple" flux maps and generate net equations (but I'd need to think of a way to do this with variables so that the computer doesn't have to load the flux map and recalculate every time the environment changes)
| |
| | | Koeng Newcomer
Posts : 8 Reputation : 0 Join date : 2013-02-24
| Subject: Re: Compound system Fri Mar 22, 2013 7:35 pm | |
| Hey I kind of lurk here sometimes and I just wanted to give my 2 cents on an actual project to simulate a cell (Since synthetic bio is what I do) Since it is an actual cell being simulated, it might get toooooooooo complex, but anyway here is the link
http://wholecell.stanford.edu
I can't gather anything from the stuff in the downloads except the virtual machine, but you coders are a lot better then me at that stuff
-Koeng | |
| | | gdt1320 Newcomer
Posts : 24 Reputation : 3 Join date : 2012-09-23
| Subject: Re: Compound system Fri Mar 22, 2013 8:09 pm | |
| - Koeng wrote:
- Hey I kind of lurk here sometimes and I just wanted to give my 2 cents on an actual project to simulate a cell (Since synthetic bio is what I do)
Since it is an actual cell being simulated, it might get toooooooooo complex, but anyway here is the link
http://wholecell.stanford.edu
I can't gather anything from the stuff in the downloads except the virtual machine, but you coders are a lot better then me at that stuff
-Koeng Thanks for the link, it was pretty interesting to watch. I've also found this E-Coli reaction map showing all the reactions and physical locations/groupings in a typical E-Coli cell. We probably won't do an entire cell simulation as that would take up way to many resources for an average person to play. | |
| | | ~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: Compound system Sat Jul 06, 2013 9:55 pm | |
| Seregon had me write a few compound processes. I've now written the pathways for Fatty Acid metabolism and synthesis. Also done (though still up for changes) are Agent and RpAse synthesis pathways. Here they are, in the .xml format needed. For reference: Fat=C 12H 26Oxygen=O 2Carbon Dioxide=CO 2Sugar=C 6H 12O 6Water=H 2O Protein=Amino Acid chain of length n (n=tbd) - Fat Respiration:
- Code:
-
<Process Name="Fat Respiration" TimeTaken="1"> <Inputs> <Input CompoundID="Fat" Amount="1"/> <Input CompoundID="Oxygen" Amount="37"/> </Inputs> <Outputs> <Output CompoundID="ATP" Amount="162"/> <Output CompoundID="Carbon Dioxide" Amount="12"/> <Output CompoundID="Water" Amount="13"/> </Outputs> <Organelles> <Organelle OrganelleID="Mitochondrion"/> </Organelles> </Process>
- Fat Synthesis:
- Code:
-
<Process Name="Fat Synthesis" TimeTaken="1"> <Inputs> <Input CompoundID="Sugar" Amount="6"/> <Input CompoundID="ATP" Amount="18"/> </Inputs> <Outputs> <Output CompoundID="Fat" Amount="2"/> <Output CompoundID="Carbon Dioxide" Amount="12"/> <Output CompoundID="Water" Amount="10"/> <Output CompoundID="Oxygen" Amount="2"/> </Outputs> <Organelles> <Organelle OrganelleID="Mitochondrion"/> </Organelles> </Process>
- Agent Synthesis:
- Code:
-
<Process Name="Agent Synthesis" TimeTaken="1"> <Inputs> <Input CompoundID="Sugar" Amount="2"/> <Input CompoundID="Fat" Amount="1"/> <Input CompoundID="Protein" Amount="3"/> <input CompoundID="ATP" Amount="12"/> </Inputs> <Outputs> <Output CompoundID="Agent" Amount="1"/> </Outputs> <Organelles> <Organelle OrganelleID="Agent Vacuole"/> </Organelles> </Process>
- RpAse Synthesis:
- Code:
-
<Process Name="RpAse Synthesis" TimeTaken="1"> <Inputs> <Input CompoundID="Sugar" Amount="6"/> <Input CompoundID="Fat" Amount="6"/> <Input CompoundID="Protein" Amount="6"/> <Input CompoundID="Oxygen" Amount="6"/> <Input CompoundID="ATP" Amount="6"/> </Inputs> <Outputs> <Output CompoundID="RpAse" Amount="1"/> </Outputs> <Organelles> <Organelle OrganelleID="Endoplasmic Reticulum" /> </Organelles> </Process> [edit by Seregon] minor fixes to xml code
Last edited by ~sciocont on Sun Jul 07, 2013 9:51 am; edited 1 time in total | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Compound system Sun Jul 07, 2013 12:11 am | |
| That looks great. What's more, it actually makes a lot of sense. The format it follows is very similar to the forum format, except with the angular brackets instead of the square ones. Also, it seems really easy to just copy and paste each process, and then just alter the names and quantities.
Using this, I could actually probably get started on writing up some of the processes for the Strategy Mode. Is XML just for the prototype? How easily is it translated into C++ or Lua?
| |
| | | Koeng Newcomer
Posts : 8 Reputation : 0 Join date : 2013-02-24
| Subject: Re: Compound system Sun Jul 07, 2013 1:21 am | |
| I saw "proteins" in the code and wanted to comment on a few things:D
I know a lot about systems biology, and seeing that you have the proteins for the code would you like me to dig up some files somewhere and give you EXACT amino acid numbers needed to create the biosynthetic pathway, for lets say, a cell wall? Also the the energy needed ect.
(Also, sorry for asking, but do you guys know anywhere I can learn to put it into the format for XML? If I ever get anymore ideas, I would like to put it into code that you guys can easily use)
EDIT: was looking at website (http://thrivegame.wikidot.com/microbe-stage) and saw reproductase. Would this kinda be like a bunch of enzymes necessary for division? To accumulate enough "reproductase" I really thought of this enzyme in real life. http://en.wikipedia.org/wiki/FtsZ
-Koeng PS: tryna catch up on everything in microbe stage!
Last edited by Koeng on Sun Jul 07, 2013 1:33 am; edited 1 time in total (Reason for editing : Added somethin bout reproductase) | |
| | | Sponsored content
| Subject: Re: Compound system | |
| |
| | | | Compound system | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |