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

Inconsistent friendships when ponies added #22

Closed
latonv opened this issue May 15, 2015 · 3 comments
Closed

Inconsistent friendships when ponies added #22

latonv opened this issue May 15, 2015 · 3 comments

Comments

@latonv
Copy link

latonv commented May 15, 2015

Adding a new pony tends to scramble the friendship graph due to the inconsistent order in which friendships are added for increasing pony counts. I think this (untested) modification to the friendship loop in OrganizePonies() prevents all those tragic broken friendships:

// ponyclicker.html line 997 ...
var f = Game.store[1];
var p1 = 0;
var p2 = 1;
for(var i = 0; i < f; ++i) {
    var x1 = Math.cos(a*p1 + th)*r + r;
    // etc. (x,y calcs and line drawing all identical)
    p1 += 1;
    if(p1 >= p2) { p1=0; p2+=1; }
}
// ...
@ErikMcClure
Copy link
Owner

This was originally how friendships were drawn, but if they are done like this, one pony becomes friends with everypony else, then the next pony does, then the next one, etc. I chose an alternative method to try and randomize the friendship lines in a predictable way, at the cost of breaking friendships when new ponies were added. It can be proven that the method above is the only way to preserve friendships without maintaining an entire adjacency matrix, so it's a matter of choice.

@latonv
Copy link
Author

latonv commented May 15, 2015

Fair enough, I admit it is rather sad having everypony shun pony m until ponies 0 through m-1 finish building a complete graph amongst themselves. I guess the earlier variety in your method does make it slightly more bearable to watch the heart-rending tragedy of all those friendships disappearing. :<

@ErikMcClure
Copy link
Owner

This is being rejected in favor of a long-term friendship remembering scheme: #37

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

No branches or pull requests

2 participants