Skip to content

Out of view eggs are now displayed in an icon - #5742

Open
TuxFan53 wants to merge 1 commit into
supertuxkart:BalanceSTK2from
TuxFan53:BalanceSTK2
Open

Out of view eggs are now displayed in an icon#5742
TuxFan53 wants to merge 1 commit into
supertuxkart:BalanceSTK2from
TuxFan53:BalanceSTK2

Conversation

@TuxFan53

Copy link
Copy Markdown

Whenever an egg is outside of the map, it uses a frame to point towards the location of the egg (the same one from soccer game mode). The egg inside of the frame also gets smaller the farther away it is.

(This should hopefully work? I used the main branch for testing and it works well. I wasn't able to test it in the actual BalanceSTK2 branch due to assets being missing, but it was able to compile. So unless a change occurred to how players are rendered on the map it should work the same)

Agreement

By creating a pull request in stk-code, you hereby agree to dual-license your contribution as
GNU General Public License version 3 or any later version and
Mozilla Public License version 2 or any later version.

This includes your previous contribution(s) under the same name of contributor.

You also confirm that this contribution is your own original work
and that it does not contain code generated by AI tools.

Keep the above statement in the pull request comment for agreement.

@TuxFan53

Copy link
Copy Markdown
Author

Just checked the forums and saw that the Evolution assets were released the same day the pull request was made, oops!

Anyways I just tested it and it works as expected. Eggs off the minimap display in an icon frame and the farther the egg the smaller it is.

float map_half_width = m_map_width*0.5f;
float map_half_height = m_map_height*0.5f;
//uses posy to get posx if the slope of the points is higher than the map's
if (abs((draw_at.getY() - m_map_height*0.5f)/((draw_at.getX() - m_map_width*0.5f))) >

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose and working (why are the formulas like that?) of this if/else isn't clear at first glance and the comment doesn't do a very good job at clarifying it.

I suppose this is related to the fact that even if say the X value is within bounds, if the Y value is out of bounds, the X value is actually getting changed too when projecting the out-of-map position to a map-border position?

lower_y -(int)(positionY-((scaler)*m_minimap_player_size/2.5f)));
draw2DImage(m_egg, position, source, NULL, NULL, true);
}
else

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case the egg is not out of the map, you essentially do the same final drawing operation, it's just that the scaling value is 1.0 and positionX / positionY are different than the draw_at getX/getY. I would take these final operation fully entirely out of the if/else, have the scaling variable and positionX/positionY defined/set before the if, and modified within the if in case the egg is out of the map.

@Alayan-stk-2

Copy link
Copy Markdown
Member

I tested the PR, and it appears to generally work well.

I don't think it supersedes the concept of having enhanced minimaps for egg hunt that can show more than just the racing mode's drivequads, but it's an overall good change.

There is some noticeable pixellation with the icons but that's STK's fault and not something wrong in this PR.

I think there are a few things that could be improved though. I pointed out two things in the code review. I think there could be some tweaks functionality-wise too, but it's not really worth thinking about those without the enhanced minimap present for context.

Minimap_egg

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

Successfully merging this pull request may close these issues.

2 participants