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

When respawning pedestrians, only animate nearby pedestrians #244

Merged
merged 4 commits into from
Nov 17, 2022

Conversation

madebr
Copy link
Collaborator

@madebr madebr commented Nov 15, 2022

Only animate the respawn when we are in viewing distance.
This is done such that the "Peds visible on map" powerup draws far away items.
Far away animated pedestrians would otherwise remain invisible on the map until we get close to them.

Fixes #206

@madebr madebr changed the title Animate only nearby pedestrians When respawning pedestrians, only animate nearby pedestrians Nov 15, 2022
#if defined(DETHRACE_FIX_BUGS)
// Only animate the respawn when we are in viewing distance.
// This is done such that the "Peds visible on map" powerup draws far away items.
// (far away animated pedestrians would otherwise remain invisible on the map)
Copy link
Owner

Choose a reason for hiding this comment

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

Why would far away animated pedestrians be invisible on the map?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The current action is used to decide whether a ped needs to be drawn on the map here:

// Item is a human
if (pedestrian->hit_points == -100
|| pedestrian->current_action == pedestrian->fatal_car_impact_action
|| pedestrian->current_action == pedestrian->fatal_ground_impact_action
|| pedestrian->current_action == pedestrian->giblets_action) {
return 0;
} else {
BrVector3Copy(pPos, &pedestrian->pos);
return 1;
}

Using hit_points alone to decide whether a ped is alive does not work either.
I think what we're seeing here is layers upon layers of technical debt :)

@madebr madebr merged commit 2c6f699 into dethrace-labs:main Nov 17, 2022
@madebr madebr deleted the animate-only-nearby-pedestrians branch November 17, 2022 22:16
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.

"Peds on map" powerup doesn't show respawned peds
2 participants