1) AI plug-in recommend 2) VideoPlayer play video on the Android screen. 3) the Renderer GetPropertyBlock 4) RectMask2D problems
This is the 257th post of UWA Technical Knowledge Sharing. Today, we continue to select a number of issues related to development and optimization for you. It is recommended that you read for 10 minutes.
UWA Q&A Community: Answer.uwa4d.com UWA QQ Group 2:793972859 (The group is full)
AI
Q: We have some AI in our new project and we want to use some plugins to implement it. Do you have any AI plugins to recommend? As far as I know, there are Behavior Designer, Playmaker, Bolt and so on. I would like to ask for some popular science ones with good functions and performance. Thank you.
A1: Nodecanvas recommended. ● Three fully switchable graphics modules for you to choose from. ● Fashionable and intuitive visual node editor with all expected professional features. (All Undo/Redo, Zoom in/Zoom out, Minimap, Multi-Select, Copy, Copy/Paste, JSON Import/Export, Groups, Comments, etc.) ● Graphics, GameObject, and global blackboard variables to create reusable and agen-centric parameter behavior. ● Data binding variables with instance or static properties and fields. ● Use UNET’s Network Sync Variable. (Since UNET is now deprecated, it will be replaced with a new network solution.) ● Variables that the prefab can overwrite. ● Automatic conversion of different variable data types. ● Support all variable types out of the box. ● Reusable behavior diagrams across all numbers of agents. ● Nonsuture graphics nesting between all three graphics modules. ● Complete parameterization and mapping of subgraph variables. ● Modular action and conditional task design. ● Conditional response behavior tree assessment. ● Conditional and stack based FSM transition. ● Colorful and informative runtime visual debugging. ● Node/task browser for searching, bookmarking and reading built-in documents. ● Preferred type configurator to customize type-specific menus according to project requirements. ● Graphical mini-map for easy browsing of graphics. ● Graphic console, click the mouse can automatically locate the fault node. ● A graphical browser for searching and finding nodes, tasks, and parameters in the graph. ● Graphical refactorer to bulk refactor missing nodes, tasks, and reflection references. ● Real-time runtime editing to achieve design goals more quickly. ● Optimized reflection tasks to automatically integrate existing code APIs. ● Built-in event system to communicate and transmit data in graphics. ● A clean and well-documented API to extend the Nodecanvas framework and create your own actions, conditions, nodes, and even brand new graphics modules. ● Object and property plotter to customize the inspector in all possible ways. ● Integration with a large number of third party resources. ● Seamless integration with FlowCanvas Flowscripts. ● User friendly, lightweight, no setup required. Stable performance, zero allocation after initialization, asynchronous graph loading. ● Supports all platforms out of the box. ● Contains all C# source code.
Detailed link below: https://assetstore.unity.com/…
Behaviac is good also, it’s a pity that the TX is not how to maintain: https://github.com/Tencent/be…
Thanks to Zheng Xiao @uwa Q&A community for providing answers
A2: Carrying a big man: Baracuda.
https://github.com/Unity-Tech…
Thanks to the @uwa Answers community for providing answers
What A.I technique is most well suited to my game, FSM, BT, GOAP
Attach a AI related Blog: share station http://www.aisharing.com/sitemap AI
Thanks to the @uwa Q&A community for providing the answer
A4: tencent open source projects: behaviac https://www.behaviac.com/lang…
The Behaviac is a framework component for game AI development and a quick design tool for game prototypes. Support the whole platform, applicable to the client and server, facilitate the rapid iterative development of the game.
The editor can be run on PC, easy to operate, intuitive and reliable, support real-time and offline debugging; Editor can export XML, BSON and other formats, but also can export C++, C# source code, to provide the highest efficiency.
Runtime support for all platforms, C++ and C# versions, native support for Unity.
Thanks to Xiao Xiaojun @uwa Answers Community for providing the answer
Video
Q: This problem only occurs in project A. Copy the same video and code to A new project, and then put the video file into the Addressables Group and set it uncompressed, so it can play normally on the mobile phone. In project A, if you put the video in the Addressables Group and set it uncompressed, it will still not play.
AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-abafc77eff58910e7bc5f69ce62a4ed7/CAB-abafc77eff58910e7bc5f69ce62a4ed7.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.
Have you encountered similar problems?
A: Even though the Addressables Group is set to uncompress, you still can’t play video on your phone. Add ‘.bundle ‘to gradle’s noCompress as follows:
AaptOptions {noCompress '. Unity3d ', '. Reiss ', '. The resource ', '. Obb ', '. Meta ', '. Wem ', '. BNK ', '. TXT ', XML '. ', '. Bundle / / ADD_NoCompress_TAG} '
Thanks to the wenzhao@UWA Q&A community for providing the answer
Rendering
Q: From the code print log, what does getPropertyBlock initially get? Doesn’t seem to help:
public MeshRenderer mr; [Button] void DOTest() { MaterialPropertyBlock block = new MaterialPropertyBlock(); mr.GetPropertyBlock(block); Debug.Log(block.isEmpty); // Print true Color baseColor = block.getColor ("_Color"); Debug.Log(baseColor.ToString()); // The original print is white (0,0,0,0). // Set the color Mr. SetPropertyBlock(block); mr.GetPropertyBlock(block); // Get debug.log (block.isEmpty) again; // Print false baseColor = block.getColor ("_Color"); Debug.Log(baseColor.ToString()); // Print (1,0,0,1)}
Originally I thought by the Renderer. GetPropertyBlock (block). I will save the material properties of the Renderer into this Block, and then I will change the value inside, but this is not the case. For example, I just want to change the Alpha, but I can’t get the original color:
MaterialPropertyBlock block = new MaterialPropertyBlock();
meshRenderer.GetPropertyBlock(block);
Color baseColor = block.GetColor("_Color");
block.SetColor("_Color", new Color(baseColor.r, baseColor.g, baseColor.b, alpha));
meshRenderer.SetPropertyBlock(block);
A1: First, you didn’t add a Property to the Property, so it must be Empty, meaning your Property list is Empty. And then I’m going to set Color, which is essentially adding a property field to the property sheet, so that the list isn’t empty. As for the reason why white is printed, the default value is given to you to avoid returning null when you access a property that does not exist.
To get the original color, just grab it from the material:
var mat = renderer.material; //renderer.sharedMaterial; Color c = mat.GetColor("_Color"); Debug.Log(c.ToString());
Thanks to the @uwa question-and-answer community for this answer
A2: the Renderer. HasPropertyBlock () can be used to judge whether a Renderer has PropertyBlock, there is usually no call before SetPropertyBlock GetPropertyBlock receive organs that are the result of “empty”. In a special case, after controlling the material ball in the animation (e.g. controlling the color of the material ball), use getPropertyBlock to get the MaterialPropertyBlock so that the result is not “empty”. Theoretically, the animation control material ball uses setPropertyBlock to change the color.
Thanks to the Xuan@UWA Q&A community for the answers
UGUI
Q: I created some ICONS dynamically under the ScrollView node with RectMask2D. I found that the ICONS did not display properly when the page was opened, so I swipe to show them. I checked that the icon object was created when it was not visible, and the corresponding Inspector window lacked the Default UI Shader component. Does the big guy know what reason is excuse me?
Debug found that the icon object was added properly to RectMask2D’s cropped HashSet. Check Frame Debug for Batch missing when the icon is not displayed and when it is displayed.
A: you can try call dynamically created after the completion of the Canvas. ForceUpdateCanvases, this interface is to let all of the UI elements refresh in time.
https://docs.unity3d.com/Scri…
Thanks to the Xuan@UWA Q&A community for the answers
Cover image from the network
That’s all for today’s sharing. Life, of course, is long and knowledge is long. The questions you may see are just the tip of the iceberg in the long development cycle, and we have already prepared more technical topics for you to explore and share on the UWA Q&A website. Welcome you who love progress to join us. Maybe your method can solve others’ urgent need. And the “stone” of another mountain can attack your “jade”.
Website: www.uwa4d.com Official Technology Blog: blog.uwa4d.com Official Q&A Community: Answer.uwa4d.com Official Technology QQ Group: 793972859 (The original group is full)