New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework cell movement #557

Closed
TjWhale opened this Issue Apr 12, 2018 · 16 comments

Comments

Projects
None yet
3 participants
@TjWhale
Copy link
Contributor

TjWhale commented Apr 12, 2018

Movement is too slow in 0.3.4 and turning is painfully slow.

Soln: Movement to be rebalanced in line with the prototype made by @Andross and myself, with all cells turning at a constant speed.

Prototype is here. The key lines are 416-508.

The goal is that movement should feel fluid and smooth. Cells without flagella should be able to move, but only slowly.

@Untrustedlife

This comment has been minimized.

Copy link
Contributor

Untrustedlife commented Jun 5, 2018

Should we just merge trevisolian's code?

@hhyyrylainen

This comment has been minimized.

Copy link
Contributor

hhyyrylainen commented Jun 5, 2018

It still needs changes. See my review on the pull request for why I'm not ready to merge it yet.

@TjWhale

This comment has been minimized.

Copy link
Contributor

TjWhale commented Jun 5, 2018

I think the main problem with movement is that it's too slow. I'd like to try both systems, moving with mouse and moving with a + d, at the same time if possible, to see which is better after the speed and turning rate have been nicely balanced. I'm open to a + d being better but I'm not sure it will feel right and I don't want to commit to it now.

@TjWhale

This comment has been minimized.

Copy link
Contributor

TjWhale commented Jun 5, 2018

If it's possible I think it would be helpful to have all the movement related constants defined in a single place, that would make balancing quite straightforward. Things like "force per flagella" "mass of cells" "friction" "turning rate" etc could all be at the top of a non-compiled file somewhere and then it would be easy to change them to get the game feeling good. Is this possible?

@hhyyrylainen

This comment has been minimized.

Copy link
Contributor

hhyyrylainen commented Jun 5, 2018

@TjWhale

This comment has been minimized.

Copy link
Contributor

TjWhale commented Jun 5, 2018

I think linear will be ok to start with. If a cell is twice the size and has twice as many flagella it's not that unreasonable it will go the same speed.

@Untrustedlife

This comment has been minimized.

Copy link
Contributor

Untrustedlife commented Jun 15, 2018

You said something about not wanting a constant turn rate on teh dev forum, should we remove that from this issue?

@TjWhale

This comment has been minimized.

Copy link
Contributor

TjWhale commented Jun 15, 2018

In this issue when I say "constant rate" I mean that it doesn't matter how large a cell is (as in how many organelles it has) it should always turn at the same rate. However the turning should be proportional to the distance left to turn. (For larger turns all cells turn faster)

The other option was to have larger cells turn more slowly however I am worried they will be painfully slow so I'd like to try them out being able to turn just like small cells. We can iterate on it later.

Apologies if this was confusing.

@hhyyrylainen

This comment has been minimized.

Copy link
Contributor

hhyyrylainen commented Sep 24, 2018

Once #618 is done this needs just a little bit of tweaking to make it feel good.

@Untrustedlife

This comment has been minimized.

Copy link
Contributor

Untrustedlife commented Oct 4, 2018

Status on this?

@hhyyrylainen

This comment has been minimized.

Copy link
Contributor

hhyyrylainen commented Oct 4, 2018

This is still blocked by #618
Once that is done this needs just some tweaking to the constants:

const auto FLAGELLA_BASE_FORCE = 4.0f;
const auto CELL_BASE_THRUST = 1.0f;
//! The drag force is calculated by taking the current velocity and multiplying it by this.
//! This must be negative!
const auto CELL_DRAG_MULTIPLIER = -0.4f;
//! If drag is below this it isn't applied to let the cells come to a halt properly
const auto CELL_REQUIRED_DRAG_BEFORE_APPLY = 0.001;

@hhyyrylainen hhyyrylainen added the impeded label Oct 4, 2018

@Untrustedlife

This comment has been minimized.

Copy link
Contributor

Untrustedlife commented Oct 29, 2018

Im pretty confident this can be closed

@TjWhale

This comment has been minimized.

Copy link
Contributor

TjWhale commented Oct 29, 2018

Does the drag work properly at the moment or does it still do that left drifting?

@Untrustedlife

This comment has been minimized.

Copy link
Contributor

Untrustedlife commented Oct 29, 2018

I fixed the drifting, the only "issue" and i dont think it is one, is that you stop more slowly now.

@Untrustedlife

This comment has been minimized.

Copy link
Contributor

Untrustedlife commented Oct 30, 2018

I think its properly fixed in this issue: Its properly fixed in this commit: 2b985cf

Maybe needs some minor tweaking to the constants now but now it makes sure there is no drift. ANd you stop faster.

@Untrustedlife Untrustedlife self-assigned this Nov 1, 2018

@Untrustedlife Untrustedlife removed the impeded label Nov 1, 2018

@Untrustedlife

This comment has been minimized.

Copy link
Contributor

Untrustedlife commented Nov 4, 2018

Once we confirm what everyone likes in terms of movement and change those constants this should be good to close @TjWhale , what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment