1 (edited by anjumshehzad316 2024-06-06 05:17:44)

Topic: Fix Fuzzy AI on WebGL builds in UFE 2.4

Hi, I have a working android game and I'm converting it to webgl for a client but my ufe version is 2.4
In ufe 2.5.1, there is a mention of "Fixed Fuzzy AI on WebGL builds" in change log
How do I do this in my current ufe v2.4?
I can't upgrade as my code is too complicated and undocumented
If anyone can share code that I can use, it will be really helpful.
Or tell me the scripts name that has this improvement
Thanks

Share

Thumbs up Thumbs down

Re: Fix Fuzzy AI on WebGL builds in UFE 2.4

Its hard to say if these were the only fixes done to improve the WebGL build between 2.4 and 2.6, but if I know most issues were caused by some incompatibilities with the Fuzzy AI algorithm.

Under AIInfo.cs, look for this code segment (line 419):

public static readonly string Rule_NOT = " NOT ";
public static readonly string Debug_NOT = " NOT ";

And change it to this:

#if UNITY_WEBGL && !UNITY_EDITOR
    public static readonly string Rule_NOT = "";
    public static readonly string Debug_NOT = "";
#else
    public static readonly string Rule_NOT = " NOT ";
    public static readonly string Debug_NOT = " NOT ";
#endif

Then, under RuleBaseAI.cs, look for this code segment (line 1713):

this.inferenceEngine.SyncCalculateOutputs(requestedOutputs);
this.aiOutput = this.inferenceEngine.Output;

And change it to this:

if (UFE.config.aiOptions.multiCoreSupport && Application.platform != RuntimePlatform.WebGLPlayer){
    this.inferenceEngine.AsyncCalculateOutputs(requestedOutputs);
}else{
    this.inferenceEngine.SyncCalculateOutputs(requestedOutputs);
    this.aiOutput = this.inferenceEngine.Output;
}

If for some reason you can't find these segments, try replacing both files from your current project with the ones available on version 2.6. Its highly unlikely these files got changed in your project.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.

Re: Fix Fuzzy AI on WebGL builds in UFE 2.4

Thanks alot

Share

Thumbs up Thumbs down