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

Tech Tree - Find "true" center of parents #72

Open
valkyrienyanko opened this issue Mar 24, 2022 · 0 comments
Open

Tech Tree - Find "true" center of parents #72

valkyrienyanko opened this issue Mar 24, 2022 · 0 comments
Assignees
Labels
Enhancement New feature or request Good First Issue Good for newcomers Help Wanted Extra attention is needed Low Priority

Comments

@valkyrienyanko
Copy link
Contributor

image

Notice how nodes X, D, and E are centered perfectly but node B is not quite "centered". Rather B is leaning more towards nodes E, F, C instead of nodes W, D. This is because of how the parent node center is calculated. The sum of the y positions are added together and divided by the number of nodes giving the "averaged weighted center".

This could be the way to represent the tech tree nodes however I would like to see how it looks if every parents center was calculated based on the top child node the bottom child node y position divided by 2 to get the "true" center.

Perhaps a boolean could be added to switch between the 2 styles to see which ever looks better.

// Find weighted middle y pos based off children
for (int i = 0; i < data.Unlocks.Length; i )
{
yPos = ResearchData[data.Unlocks[i]].Position.y;
}
yPos /= data.Unlocks.Length;

@valkyrienyanko valkyrienyanko added Enhancement New feature or request Good First Issue Good for newcomers Help Wanted Extra attention is needed Low Priority labels Mar 24, 2022
@valkyrienyanko valkyrienyanko self-assigned this Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Good First Issue Good for newcomers Help Wanted Extra attention is needed Low Priority
Projects
None yet
Development

No branches or pull requests

1 participant