Skip to content
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

[feature] Add inter-user repel physics to rendering #253

Open
0jrp0 opened this issue Nov 22, 2020 · 2 comments
Open

[feature] Add inter-user repel physics to rendering #253

0jrp0 opened this issue Nov 22, 2020 · 2 comments

Comments

@0jrp0
Copy link
Contributor

0jrp0 commented Nov 22, 2020

In large scale renderings, there is a tendency for users to clump together in the center. They are pulled away from the center due to the gravity of files they are working further out. It would be nice to have a parameter that would push users away from each other to reduce the amount of overlap.

One possible design is to modify Gource::addUser to inject a reference to the users map in the constructor of RUser:

RUser* user = new RUser(username, pos, tagid);

Then modify RUser::applyForceUser and/or RUser::applyForceAction:

void RUser::applyForceAction(RAction* action) {

Here we can loop through the users map and compute manhatten distances between them. To simplify, the repel force can look at k=3 nearest neighbors to push away from them. We can play around with k and perhaps reduce it to 2 to see if a flocking effect can be achieved.

Thoughts?

@acaudwell
Copy link
Owner

There's already a force applied to push users away from each other but its not very big at the moment.

Maybe you could do something like expose gGourcePersonalSpaceDist a setting, then you'd also need to change userTree->visitItemsInBounds(a->quadItemBounds, uff) in gource.cpp (UserForceFunctor calls applyForceUser between users) to use a bounds value based based on gGourcePersonalSpaceDist instead of the bounds of the normal quadItemBounds so it'd find all the users in the larger bounds.

@0jrp0
Copy link
Contributor Author

0jrp0 commented Nov 23, 2020

Ah, interesting. I can try to play with this.

My hypothesis on why the users are clumping together so much in the center is based on the evolution of the rendering from the beginning into 10 years later.

One of the unique properties of this rendering is that it's custom log of something that's not source code. Unfortunately, the source database does not have hierarchical information for 9 years. So what happens is that you get 15,000 to 20,000 file objects built up in the root. Then suddenly, when hierarchy is available, all those files are deleted and moved to deep paths .. directories can be layered 10 to 12 to 15 layers deep from the root. What's happening is that there is this strong left over gravitation pull to the root directory where the 20,000 file objects used to be.

I think because of this dynamic, users are clumped in the center over time and unable to freely move around the rendering. The other aspect that manifests is that the bloom effect remains pretty visible around the root directory for the remaining of the rendering, even though all the files have been deleted. I've counteracted this by dampening the bloom effect through --bloom-intensity=0.125.

If this hypothesis is true, then it would be nice to add a parameter that allows me to increase the gravitation decay such that the root directory doesn't have such a powerful influence on the bloom effect and the user clumping issue. This could possibly solve 2 issues with 1 solution. If you have an idea on where this might be factored, I can take a look. In the meantime, I can try to poke around with gGourcePersonalSpaceDist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants