News Forums RAIN General Discussion and Troubleshooting Idea of Expression Evaluator for .NET

This topic contains 8 replies, has 4 voices, and was last updated by  prime 4 months, 2 weeks ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #33060

    Yuewah Chan
    Participant

    One of the powerful features of RAIN is the “Expressions” that allow directly enter condition e.g. a > 100 || b == 1 , but it is also the main problem of performance hit.

    There is some other .net expression evaluator project on the web, they might solve the performance problem and even provide more features that RAIN built-in expression.

    1. Flee, It uses a custom compiler, strongly-typed expression language, and lightweight codegen to compile expressions directly to IL, https://flee.codeplex.com/

    2. NCalc, can parse any expression and evaluate the result, including static or dynamic parameters and custom functions http://ncalc.codeplex.com/

    3. Interpreter, https://github.com/hisystems/Interpreter

    #33086

    prime
    Keymaster

    Thanks for the ideas. We’ll look into the links.

    Just to be clear though, we don’t see a “performance problem” with our expression evaluator. We’ve optimized the code and the use of memory allocations. Unity 4 uses a really old GC that has unavoidable issues. This was mentioned at Unite during one of the talks about Unity 5 and IL2CPP. Suffice it to say that Unity recognizes the issue and has a lot of related performance upgrades in Unity 5.

    #34097

    antoineguidi
    Participant

    Hello, I noticed there is an expression built in function called position()
    However I can not find it anywhere in the WIKI.
    Is there any updated list of available expressions?
    Thank you

    #34100

    prime
    Keymaster

    Here’s a list:
    debug(“some message”)
    random(min,max)
    deltaTime()
    currentTime()
    clamp(val,min,max)
    min(val1, val2)
    max(val1, val2)
    navigationtarget(“target name”)
    waypoints(“waypoint route/network name”)
    gameobject(“game object name”)
    position(object)

    Note that we are considering a change to expressions that would support arbitrary functions in your code plus access to most Unity built-ins.

    #34122

    antoineguidi
    Participant

    That would be a great tool.

    Thank you for your quick response.

    • This reply was modified 8 months, 1 week ago by  antoineguidi.
    #36038

    jakovd
    Participant

    I finally found this list after looking all over wiki and api.
    I think you should consider adding the last four functions here:
    http://rivaltheory.com/wiki/behaviortrees/expressions#built_in_functions

    • This reply was modified 5 months ago by  jakovd.
    • This reply was modified 5 months ago by  jakovd.
    #36060

    prime
    Keymaster

    Good idea. Done.

    #36511

    Yuewah Chan
    Participant

    any plan to add custom function in expressions ?

    #36517

    prime
    Keymaster

    At some point, yes. We plan to support direct access to static methods in code.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.