Thrive Game Development
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Thrive Game Development

Development of the evolution game Thrive.
 
HomeHome  PortalPortal  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  
Welcome new and returning members!
If you're new, read around a bit before you post: the odds are we've already covered your suggestion.
If you want to join the development team, sign up and tell us why.
ADMIN is pleased to note that this marquee has finally been updated.
ADMIN reminds you that the Devblog is REQUIRED reading.
Currently: The Microbe Stage GUI is under heavy development
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Quick Links
Website
/r/thrive
GitHub
FAQs
Wiki
New Posts
Search
 
 

Display results as :
 
Rechercher Advanced Search
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 9 users online :: 0 Registered, 0 Hidden and 9 Guests

None

Most users ever online was 443 on Sun Mar 17, 2013 5:41 pm
Latest topics
» THIS FORUM IS NOW OBSOLETE
Compound system - Page 2 Emptyby NickTheNick Sat Sep 26, 2015 10:26 pm

» To all the people who come here looking for thrive.
Compound system - Page 2 Emptyby NickTheNick Sat Sep 26, 2015 10:22 pm

» Build Error Code::Blocks / CMake
Compound system - Page 2 Emptyby crovea Tue Jul 28, 2015 5:28 pm

» Hello! I can translate in japanese
Compound system - Page 2 Emptyby tjwhale Thu Jul 02, 2015 7:23 pm

» On Leave (Offline thread)
Compound system - Page 2 Emptyby NickTheNick Wed Jul 01, 2015 12:20 am

» Devblog #14: A Brave New Forum
Compound system - Page 2 Emptyby NickTheNick Mon Jun 29, 2015 4:49 am

» Application for Programmer
Compound system - Page 2 Emptyby crovea Fri Jun 26, 2015 11:14 am

» Re-Reapplication
Compound system - Page 2 Emptyby The Creator Thu Jun 25, 2015 10:57 pm

» Application (programming)
Compound system - Page 2 Emptyby crovea Tue Jun 23, 2015 8:00 am

» Achieving Sapience
Compound system - Page 2 Emptyby MitochondriaBox Sun Jun 21, 2015 7:03 pm

» Microbe Stage GDD
Compound system - Page 2 Emptyby tjwhale Sat Jun 20, 2015 3:44 pm

» Application for Programmer/ Theorist
Compound system - Page 2 Emptyby tjwhale Wed Jun 17, 2015 9:56 am

» Application for a 3D Modeler.
Compound system - Page 2 Emptyby Kaiju4u Wed Jun 10, 2015 11:16 am

» Presentation
Compound system - Page 2 Emptyby Othithu Tue Jun 02, 2015 10:38 am

» Application of Sorts
Compound system - Page 2 Emptyby crovea Sun May 31, 2015 5:06 pm

» want to contribute
Compound system - Page 2 Emptyby Renzope Sun May 31, 2015 12:58 pm

» Music List Thread (Post New Themes Here)
Compound system - Page 2 Emptyby Oliveriver Thu May 28, 2015 1:06 pm

» Application: English-Spanish translator
Compound system - Page 2 Emptyby Renzope Tue May 26, 2015 1:53 pm

» Want to be promoter or project manager
Compound system - Page 2 Emptyby TheBudderBros Sun May 24, 2015 9:00 pm

» A new round of Forum Revamps!
Compound system - Page 2 Emptyby Oliveriver Wed May 20, 2015 11:32 am


 

 Compound system

Go down 
+6
jaws2blood
Carnifex
ido66667
The Uteen
NickTheNick
Seregon
10 posters
Go to page : 1, 2  Next
AuthorMessage
Seregon
Regular



Posts : 263
Reputation : 37
Join date : 2011-08-10
Location : UK

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyWed 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?
Back to top Go down
Carnifex
Newcomer



Posts : 37
Reputation : 8
Join date : 2012-08-13

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyWed 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
Back to top Go down
jaws2blood
Newcomer
jaws2blood


Posts : 62
Reputation : 3
Join date : 2011-12-18
Location : USA

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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:
Compound system - Page 2 Thrive%20Compound%20Processes%20Alg
Back to top Go down
Seregon
Regular



Posts : 263
Reputation : 37
Join date : 2011-08-10
Location : UK

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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.
Back to top Go down
jaws2blood
Newcomer
jaws2blood


Posts : 62
Reputation : 3
Join date : 2011-12-18
Location : USA

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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).
Back to top Go down
Seregon
Regular



Posts : 263
Reputation : 37
Join date : 2011-08-10
Location : UK

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyMon 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.

Definitions
First 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.

Compound system - Page 2 Key

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.

Classes
Each 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:

Compound system - Page 2 Compounds

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 classes
In 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.

Compound system - Page 2 Processes

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.

Compound system - Page 2 Organism

Process evaluation
So 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:

  1. Fetch the basic rate (R_b,p) at which that process can be performed (static process object)
  2. Multiply that rate by the concentration (C_c) (current store / maximum capacity) of each input (P_ic,p) compound within that organism
  3. Multiply that rate by the inverse concentration (1-C_c) of each output compound (P_oc,p) within that organism
  4. 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)
  5. We now have the total rate (R_p) at which the process is proceeding.
  6. 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)
  7. 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:

Compound system - Page 2 Variables
The reaction rate of each process within an organism:
Compound system - Page 2 ReactionRate
The resulting rate of change for each compound within an organism:
Compound system - Page 2 CompoundRate

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.

Summary
Thats 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:

Compound system - Page 2 Molecules

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.
Back to top Go down
Seregon
Regular



Posts : 263
Reputation : 37
Join date : 2011-08-10
Location : UK

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyTue 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
Back to top Go down
NickTheNick
Overall Team Co-Lead
NickTheNick


Posts : 2312
Reputation : 175
Join date : 2012-07-22
Age : 28
Location : Canada

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyTue 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.
Back to top Go down
ido66667
Regular
ido66667


Posts : 366
Reputation : 5
Join date : 2011-05-14
Age : 110
Location : Space - Time

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyTue Aug 21, 2012 11:12 pm

Seregon wrote:

Compound system - Page 2 Variables
The reaction rate of each process within an organism:
Compound system - Page 2 ReactionRate
The resulting rate of change for each compound within an organism:
Compound system - Page 2 CompoundRate


tl;dr; - understandable really, but now you know why it took over a week to write a simple prototype.

Soooo....
The rate of change = The sum of the rate and Quantity of output - the sum of the rate and the Quantity of Input.
Back to top Go down
~sciocont
Overall Team Lead
~sciocont


Posts : 3406
Reputation : 138
Join date : 2010-07-06

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyThu Aug 23, 2012 5:58 pm

I can take a crack at icons. You're doing great work, seregon.
Back to top Go down
jaws2blood
Newcomer
jaws2blood


Posts : 62
Reputation : 3
Join date : 2011-12-18
Location : USA

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri Aug 24, 2012 5:40 pm

Compound system - Page 2 Processes

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.
Back to top Go down
Seregon
Regular



Posts : 263
Reputation : 37
Join date : 2011-08-10
Location : UK

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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.
Back to top Go down
NickTheNick
Overall Team Co-Lead
NickTheNick


Posts : 2312
Reputation : 175
Join date : 2012-07-22
Age : 28
Location : Canada

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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.
Back to top Go down
jaws2blood
Newcomer
jaws2blood


Posts : 62
Reputation : 3
Join date : 2011-12-18
Location : USA

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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.
Back to top Go down
Carnifex
Newcomer



Posts : 37
Reputation : 8
Join date : 2012-08-13

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptySat 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.
Back to top Go down
ido66667
Regular
ido66667


Posts : 366
Reputation : 5
Join date : 2011-05-14
Age : 110
Location : Space - Time

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptySat Aug 25, 2012 9:07 am

I myself don't know how to work with XML, Sorry.
Back to top Go down
gdt1320
Newcomer



Posts : 24
Reputation : 3
Join date : 2012-09-23

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyWed 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:

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:

Cell death rate , kd
Spoiler:

But what about oxygen?
Spoiler:

How this equation can be used for auto evo at the cellular level
Spoiler:

How to keep calculations simple but realistic
Spoiler:

Other issues to look into
Spoiler:

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.
Back to top Go down
~sciocont
Overall Team Lead
~sciocont


Posts : 3406
Reputation : 138
Join date : 2010-07-06

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyWed 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.
Back to top Go down
Seregon
Regular



Posts : 263
Reputation : 37
Join date : 2011-08-10
Location : UK

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyThu 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.
Back to top Go down
gdt1320
Newcomer



Posts : 24
Reputation : 3
Join date : 2012-09-23

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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:







Back to top Go down
Koeng
Newcomer



Posts : 8
Reputation : 0
Join date : 2013-02-24

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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
Back to top Go down
gdt1320
Newcomer



Posts : 24
Reputation : 3
Join date : 2012-09-23

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptyFri 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.
Back to top Go down
~sciocont
Overall Team Lead
~sciocont


Posts : 3406
Reputation : 138
Join date : 2010-07-06

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptySat 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=C12H26
Oxygen=O2
Carbon Dioxide=CO2
Sugar=C6H12O6
Water=H2O
Protein=Amino Acid chain of length n (n=tbd)
Fat Respiration:
Fat Synthesis:
Agent Synthesis:
RpAse Synthesis:

[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
Back to top Go down
NickTheNick
Overall Team Co-Lead
NickTheNick


Posts : 2312
Reputation : 175
Join date : 2012-07-22
Age : 28
Location : Canada

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptySun 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?
Back to top Go down
Koeng
Newcomer



Posts : 8
Reputation : 0
Join date : 2013-02-24

Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 EmptySun 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)
Back to top Go down
Sponsored content





Compound system - Page 2 Empty
PostSubject: Re: Compound system   Compound system - Page 2 Empty

Back to top Go down
 
Compound system
Back to top 
Page 1 of 2Go to page : 1, 2  Next
 Similar topics
-
» Compound system implementation
» Building Microbe Stage
» Compound Tags and Properties
» [Microbe] Implementing compound and agent clouds
» My Evolution System Concept

Permissions in this forum:You cannot reply to topics in this forum
Thrive Game Development :: Development :: Programming :: Technical Discussion-
Jump to: