x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

ATTENUATION_LogReverse implementation is reversed

The implementation is backwards, as you get farther from the source the source gets louder and as you get closer it goes to 0.

This is the original implementation:

 case ATTENUATION_LogReverse:
 return FMath::Max( 0.5f * FMath::Loge( 1.0f / ( 1.0f - ( Distance / Falloff ) ) ), 0.0f );

Assume Distance = 1000 and Falloff = 20000 then this will evaluate to 0.5 log(1 / (1 - 0.05)) = 0.5 log(1.05) = 0.01 Assume Distance = 10000 and Falloff = 20000 then this will evaluate to 0.5 log(1 / (1 - 0.5)) = 0.5 log(2.00) = 0.15 Assume Distance = 19000 and Falloff = 20000 then this will evaluate to 0.5 log(1 / (1 - 0.95)) = 0.5 log(20) = 0.65

As you can see here, this is not the same as it is here: Wolfram Alpha plot of the above function: Wolfram Alpha UE4 Documentation: Epic/UE4 Documentation

I think this was the intended implementation: 0.5*log(1-x) + 1

 case ATTENUATION_LogReverse:
 return FMath::Min( 0.5f * FMath::Loge( 1.0f - ( Distance / Falloff ) ) + 1.0f, 1.0f );

Assume Distance = 1000 and Falloff = 20000 then this will evaluate to 0.5 log(1 - 0.05) + 1 = 0.5 log(0.95) + 1 = 0.99 Assume Distance = 10000 and Falloff = 20000 then this will evaluate to 0.5 log(1 - 0.5) + 1 = 0.5 log(0.5) + 1 = 0.85 Assume Distance = 19000 and Falloff = 20000 then this will evaluate to 0.5 log(1 - 0.95) + 1 = 0.5 log(0.05) + 1 = 0.35

This is much better: Corrected version on Wolfram Alpha

Product Version: Not Selected
Tags:
more ▼

asked Jan 07 '15 at 03:20 AM in Bug Reports

avatar image

Kory
383 8 133 45

avatar image Kory Jan 07 '15 at 03:21 AM

I had to retype that twice and submit it 3 times... That sucked that it never saved its state in Chrome. It is best from now on to write these outside of the browser and then copy them over.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Kory,

Thank you for bringing this to our attention. I was able to verify that it does look like we mixed this one up. I can submit a ticket to report this, but I wanted to check first to see if you preferred to submit a pull request on GitHub.

Tim

more ▼

answered Jan 13 '15 at 09:03 PM

avatar image Kory Jan 13 '15 at 09:50 PM

It seems that I cannot add another pull request as I currently have one pending. I tried to create another branch with only this change in it but I'm still seeing all of the previous commits. Do I need to fork another repo or do I wait or what? I would prefer to just submit a patch file if possible. Thanks Tim, Kory

avatar image Tim C ♦♦ STAFF Jan 13 '15 at 10:20 PM

You should be able to create multiple pull requests by creating a separate branch for each one. You would create a branch from the Master branch and make the changes for your pull request, then repeat that process for your next pull request. Once a pull request is closed, you can delete the branch for that pull request.

avatar image Kory Jan 14 '15 at 04:08 PM

Thanks Tim, I messed up earlier by committing to my master on my fork. So it seems that I may have to fork once again. It is a learning process that I guess everyone has to go through once. I just wish it was a higher priority for me to take the time to learn it properly, but I have more important tasks to perform. Thanks for your help!

avatar image Kory Jan 15 '15 at 06:23 AM

Submitted as new pull request #748

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question