Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upBetter, Faster Scent #4591
Conversation
This comment has been minimized.
This comment has been minimized.
|
Jenkins likes it and so do I :) |
atomicdryad
merged commit 1e2b17b
into
CleverRaven:master
Nov 24, 2013
1 check passed
default
Merged build finished.
Details
phaethonfire
deleted the
phaethonfire:new_scent
branch
Nov 25, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
phaethonfire commentedNov 23, 2013
I have big ideas for how scent could be reworked, but this PR is just a simple, clean improvement on the current system. It does the following:
Scent trails aren't as wide as before, and they disappear more slowly (which both address requests from the forums). Scent trails are still limited by the scent radius, which is only 40 squares.
I tested performance of this algorithm (in a different git branch, not in this PR) by editing game.cpp to time how long it took update_scent() to run. The edits for testing performance looked like this:
include
...
clock_t start_time = clock();
update_scent();
clock_t finis_time = clock();
running_total += ((double) (finis_time - start_time)) / CLOCKS_PER_SEC;
if (int(turn) % 100 == 0) {
debugmsg ("updating scent consumed %f seconds thus far", running_total);
}
From testing an early game character, it seems to be ~25% faster.
Note: experimental build doesn't work on Mac right now because of some warning in the JsonSerializer class. I wasn't able to double check these changes by building locally. I did copy this exact code into a slightly older experimental build and it worked. It should be ready to go. We'll see if Jenkins likes it...