[UnrealEngine][開發日誌] 關於GAS中FAttributeSetInitterDiscreteLevels的神坑

posted in: UnrealEngine, 開發日誌 | 40

最近發現GAS的Attribute初始化時那張CurveTable,在打包版本時會把多餘的資料移除,造成FAttributeSetInitterDiscreteLevels在進行初始化時會失敗,猜測這個行為是在4.23以後(2020年3月的commit)的修改。

由於CurveTable本身設計是被用來當成連續型資料使用,因此進行重覆點的移除是可以理解的,因為可以減少個存的資料量進而增進效能,只要我們可以在2點之間利用內插法取得數值就行。

但是用在GAS的Attribute初始化上就出問題了,因為在GAS中他並不被當成連續型資料使用;而是轉成離散型資料,並以CurveTable上面的點進行屬性的分群。

移除重覆點,代表我們會遺失某個等級的資訊,例如當我們某個GAS Attribute在不同的等級上的數值都沒有變化,例如1~3級的移動速度都是200,他就只會保留等級1跟等級3,中間的等級2被當成重覆資料移除掉了。

當我們對等級2的角色進行屬性初始化時,就會因為找不到該等級資料而失敗。 這個議題比較噁心的點在於,它只會在打包版本發生,因為在editor中並沒有進行移除重覆資料的動作。 這個問題解決方法有幾種:        

1. 使用ConsoleVariable把CurveTable.RemoveRedundantKeys這個預設行為關閉,但會影響所有的CurveTable,造成這項優化失效。    

int32 CVar_CurveTable_RemoveRedundantKeys = 1;
static FAutoConsoleVariableRef CVarCurveTableRemoveRedundantKeys(TEXT("CurveTable.RemoveRedundantKeys"), CVar_CurveTable_RemoveRedundantKeys, TEXT(""), ECVF_Default);

2. 重新設計AttributeSetInitter,不要離散化,而是直接用CurveTable

40 Responses

  1. free information

    I’m not sure where you are getting your info, but
    good topic. I needs to spend some time learning more or understanding more.
    Thanks for great info I was looking for this info for my mission.

  2. cm8-login

    Your style is unique in comparison to other people
    I have read stuff from. Thank you for posting when you’ve got the
    opportunity, Guess I’ll just book mark this page.

  3. cm8 slot

    I am really impressed with your writing skills and also
    with the layout on your weblog. Is this a paid theme or did
    you customize it yourself? Anyway keep up the excellent quality writing,
    it’s rare to see a great blog like this one nowadays.

  4. login cm8 slot

    I think that is among the such a lot significant information for me.

    And i am glad reading your article. But wanna statement on some normal issues, The web site style
    is wonderful, the articles is actually great :
    D. Excellent process, cheers

  5. cm8 slot

    Hello, i feel that i noticed you visited my web site
    thus i came to go back the want?.I am attempting to find issues to improve my
    web site!I suppose its good enough to make use of a few of your ideas!!

  6. cm8: login-akun-pro-server-luar

    You actually make it seem so easy with your presentation but I find this topic to be actually something that I think I would never
    understand. It seems too complicated and very broad for me.
    I’m looking forward for your next post, I’ll try to get the hang of it!

  7. Cara Main Slot Bagi Pemula

    I was very pleased to find this site. I wanted to thank you for your time just for this wonderful read!!
    I definitely enjoyed every little bit of it and
    i also have you saved to fav to look at new stuff in your website.

  8. wd808

    Your style is really unique in comparison to other
    folks I have read stuff from. Many thanks for posting when you’ve got the opportunity, Guess I’ll just
    bookmark this blog.

  9. wd808 JP

    It’s in point of fact a great and useful piece of info.
    I am glad that you simply shared this helpful information with us.
    Please keep us informed like this. Thank you for sharing.

  10. wd808 jp

    I got this site from my pal who shared with me regarding this web page and
    at the moment this time I am browsing this site and reading very informative posts at this place.

  11. wd808 JP

    Having read this I believed it was extremely informative.

    I appreciate you finding the time and effort to put this content together.

    I once again find myself spending way too much time both reading and leaving comments.

    But so what, it was still worth it!

  12. wd808

    I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get got an nervousness over that you wish be delivering the following.
    unwell unquestionably come further formerly again as exactly the same nearly a lot often inside case you shield this hike.

  13. wd808 JP

    It’s in point of fact a great and helpful piece of
    information. I am satisfied that you just shared this helpful information with us.
    Please stay us up to date like this. Thanks for sharing.

  14. masterslot69

    This design is wicked! You most certainly know how to keep a reader amused.

    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really loved what you had to say, and more than that,
    how you presented it. Too cool!

  15. wd808 slot

    Thanks for your marvelous posting! I genuinely enjoyed reading it,
    you can be a great author.I will make certain to bookmark your blog and will eventually come back someday.

    I want to encourage continue your great posts, have a nice morning!

  16. labuan bajo

    Today, while I was at work, my cousin stole my iphone and tested to see if it can survive
    a 25 foot drop, just so she can be a youtube sensation. My apple ipad
    is now destroyed and she has 83 views. I know this is completely off topic
    but I had to share it with someone!

  17. Biowin69 Gacor

    I do not even know how I ended up here, but I thought this post
    was great. I do not know who you are but certainly you
    are going to a famous blogger if you are not already ;) Cheers!

  18. Biowin69 Gacor

    Hello, i read your blog occasionally and i own a similar one and i was
    just wondering if you get a lot of spam
    comments? If so how do you reduce it, any plugin or anything you can recommend?
    I get so much lately it’s driving me insane so any support is very much appreciated.

  19. bokep lick pussy

    I like the valuable information you provide in your articles.

    I will bookmark your blog and check again here regularly. I
    am quite sure I will learn many new stuff right here!

    Best of luck for the next!

  20. WD808

    I like the valuable info you provide in your articles.
    I’ll bookmark your weblog and check again here frequently.

    I’m quite sure I will learn plenty of new stuff right here!
    Best of luck for the next!

Leave a Reply

Your email address will not be published. Required fields are marked *