Cellular Movement


#21

Alright so I didn’t implement grid-snapping and my mitochondria don’t rotate well (start vertical, hold right click to turn 60 degrees) but I figure I’ll share what I’ve got. It’s worth mentioning that to ensure nothing strange happens make sure that force_flagella is no greater than flagella_mass (otherwise the sigmoid function might take an argument outside the domain [0,1]).
Click a button to change a value or add an organelle, enter places the organelle where the mouse puts it, escape goes from organelle placement -> editor menu -> test-drive -> close
“E” opens the edit menu.

My stuff
https://pastebin.com/Z6V2kgtU

And a little tool that I borrowed and edited (little bit of laziness on my part since it’s only like 50 lines)
https://pastebin.com/crMvhrWK


#22

That is really cool! I am super impressed by how fast you have come up with that :slight_smile:

Hopefully it will be a great tool for balancing things.

In general it’s good to have prototypes in the git repo so I added rotation in and put it in the prototypes repo (if you need any help with git feel free to ask, I’m a bit of a noob with it myself but it is great, when you are working with the prototypes repo feel free to push to master without pull requests or anything). I put that other rotation thing in paste bin just because it seemed quite inconsequential but your think is def worth holding on to.

Hope that is helpful!


#23

Literally first time using pygame too so I’m sure there’s tons of stuff that could be done better. I just wanted to play around with it. I’ll add the snap to hex grid deal tomorrow if nobody gets to it before then. It should just be a matter of rounding the mouse position.

And yeah, I wasn’t sure if I’d be allowed to push to github at this stage or if I should for such a thing so I just went to pastebin.


#24

Alright, if anybody wants to play around with balancing some constants to see what feels good here’s my Movement/Editor Prototype (If there are more organelles or I got any wrong let me know and I’ll add them / fix their properties). There is no ATP system so the only properties that matter are the masses of each organelle, the strength of each flagella, and the global top speed. The code calculates the center of mass of whatever cell you’ve created and the relative positions of each flagella to that point to influence your speed in each direction. I have no artistic skill so things are a bit ugly but it’s just a testing tool so cut me some slack.
Hopefully the controls are simple enough (they’re written on screen most of the time) If anybody has any suggestions or feedback let me know.


#25

How do you calculate the center of mass? If it is different than what the physics engine does the prototype might not perfectly translate to how the parameters work ingame.


#26

@andross I added rotation to your prototype and had a quick go at balancing the numbers. To everyone what do you think (if you can run it)?

Just a nucleus on it’s own is pretty grindingly slow but you can move. The Fastest you can possibly go (speed = 8) is pretty zippy but not ridiculous. I made all cells rotate at the same speed which is pretty fast, that can be changed.

The most important factor for balance I think is how long do you spend just swimming around because it feels nice?


#27

@hhyyrylainen

I calculate center of mass by giving each organelle a mass value, assuming that that mass is evenly distributed through the organelle, adding then the mass of each hex * the distance from the center of the screen (where the cell will always be drawn) then divide by total mass. I don’t know how the physics engine does it but it can’t be that terribly different can it?


#28

I’m not exactly sure how it calculates it. But in it each organelle is represented by a sphere (size of HEX_SIZE) and with the mass of the organelle. And I just let the physics engine figure out the center of mass and the inertia matrix from that.


#29

It should be the same then. The center of mass of each sphere is the center of the sphere and in my simulation the center of mass of each hex is the center of the hex.


#30

Alright prototype is available on github If some people want to playtest to see if the constants feel good and if they prefer the fixed turn rate or the one that depends on the cell properties. Please and thank you. (If you don’t use python you’ll need to get it and “pip install” numpy and pygame to run things)


#31

Awesome work guys! I got the prototype running and I thought it felt pretty good. The only thing I’d suggest is that the cell be able to get a bit larger before getting very slow, but these things will be easier to balance once we’ve got it in the game and are able to playtest.