dreamersincstudios / ecs-iaus-sytstem Goto Github PK
View Code? Open in Web Editor NEWInfinite Axis Utility System for Unity
Home Page: https://dreamerincblog.wordpress.com/2021/01/24/devlog-15-the-one-about-the-dots-iaus-repo/
Infinite Axis Utility System for Unity
Home Page: https://dreamerincblog.wordpress.com/2021/01/24/devlog-15-the-one-about-the-dots-iaus-repo/
IDestroyable interface need for all entities and GO that can be destroy.
Need to sync to Stat Component and destroy GO and entity when Health is zero.
Include enum/bool for object vs living thing
Currently Patrol lets wait state tag removal update patrol to the next way point. This screws up the attack system.
Wait state need to be used as a do nothing state.
Example. When Patrol State is successfully Completed, if WaitAtPoint State exist in AI System, at time to timer.
Hearing System cause major lag and performance spike. Performance test with 500 entities with hit all 15 worker threads at full load for 20ms every 60 frames. Making the game unplayable. Removing entire system. Will recreate effect using influence systems and a presence modifier. Each Entity will be scored on a scale of 0 to 100 based on the abilities for other be aware of it.
NPC Editor creates SO based on using a generic path extension, NewIAUS.SO.EnemyNPCSO. This has issues save and when the address is changed.
tring assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New" + typeof(T).ToString() + ".asset");
Replace typeof(T).ToString() with input parameter and create a new void with this option
File ScriptableObjectUtility.cs
Need to create AI states for Towers in Destory the Tower Game Mode.
Hello,
thanks for sharing your work on ecs ai. its very informative.
I just need a bit of help, when running the spawn scene, im getting errors. I have uploaded a screenshot.
Also, could you maybe write quick, couple sentence instructions on how to start using your system? I know its work in progress, a lot will change, but just maybe a short paragraph, this will provide a good entry point into using it, or a 2min youtube video of you just showing a quick setup of an npc, whats needed to get started.
Mike
Sorry for using issues for questions.
This repo is an excellent source of learning. Many kudos!
I have a question which I can't find an answer. Consider this is a request to update readme (answer to issue would work perfectly as well).
Repo itself has somehow custom folders structure. What is the difference between /Assets/Systems
and /Assets/Scripts/IAUS/Scripts/
?
Combine this system with Influence
Consider getting rid of the wait state and instead using the patrol cooldown
Pros
Need to come up with equations that take distance ratio and scale the influence.
public float Output(float input) { float temp = new float(); switch (fallOff) { case FallOff.LinearQuadInverse: temp = M * Mathf.Pow((input - C), K) + B; break; case FallOff.Logistic: temp = K * (1.0f / (1.0f + Mathf.Pow((1000.0f * M * Mathf.Exp(1)), -input + C))) + B; break; } return temp; }
Transform sync job inherited from ijobparallel<> which is depreciated. Need to rewrite as ijobchunk.
Unknown Error in build of Alpha 0.7.1 2020.2f1 build. Unsure of cause. project runs without issue. Will fix later ???
AssertionException: The scene catalog has not been loaded yet
Assertion failure. Value was False
Expected: True
at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in C:\buildslave\unity\build\Runtime\Export\Assertions\Assert\AssertBase.cs:29
at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00009] in C:\buildslave\unity\build\Runtime\Export\Assertions\Assert\AssertBool.cs:20
at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in D:\Main Game Folder\ECS IAUS sytstem\Library\PackageCache\[email protected]\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
at Unity.Scenes.SceneSystem.GetSceneGUID (System.String scenePath) [0x00001] in D:\Main Game Folder\ECS IAUS sytstem\Library\PackageCache\[email protected]\Unity.Scenes\SceneSystem.cs:97
at Unity.Scenes.GameObjectSceneUtility.AddGameObjectSceneReferences () [0x0003c] in D:\Main Game Folder\ECS IAUS sytstem\Library\PackageCache\[email protected]\Unity.Scenes\GameObjectSceneUtility.cs:93
at Unity.Entities.AutomaticWorldBootstrap.Initialize () [0x0000d] in D:\Main Game Folder\ECS IAUS sytstem\Library\PackageCache\[email protected]\Unity.Entities.Hybrid\Injection\AutomaticWorldBootstrap.cs:17
(Filename: C:/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs Line: 29)
Gave Up on this based on inability to easily a Dynamic buffer. Review at later date as it is not required
Deprecated
Types that implement IJobForEach interfaces have been deprecated. Use IJobChunk and Entities.ForEach for these jobs.
Allow usage of Entities.WithReadOnly, Entities.WithDeallocateOnJobCompletion, Entities.WithNativeDisableContainerSafetyRestriction, and Entities.WithNativeDisableParallelForRestriction on types that contain valid NativeContainers.
Project needs to be refactored to account for these updates. Must refactor before other updates
Movement states need to be separated based on required functionality for entity.
IE Citizen/normal NPC do not patrol area and do not response to takes in area.
States needed
Unknown error with dots. Setup IAUS system crashes. Waiting for feedback to determine how to fix
Linked issue from DOTS Spawner
Need to get the following code working for easier SO spawning
internal static Type GetAuthoringComponentTypeFromIComponentData(Type IComponentDataType)
{
string[] AssemblyQualifiedNameAttributes = IComponentDataType.AssemblyQualifiedName.Split(',');
string AuthoringComponentAssemblyQualifiedName = $"{IComponentDataType.Name}Authoring";
for (int i =1;i< AssemblyQualifiedNameAttributes.Length;i++)
{
AuthoringComponentAssemblyQualifiedName = $"{AuthoringComponentAssemblyQualifiedName}, {AssemblyQualifiedNameAttributes[i]}";
}
Type AuthoringComponentType = Type.GetType(AuthoringComponentAssemblyQualifiedName);
AddComponentIfMissing(AuthoringComponentType);
return AuthoringComponentType;
}
GameObject gameObject = new GameObject();
gameObject.AddComponent(GetAuthoringComponentTypeFromIComponentData(typeof(IComponentData));
Currently state consideration raw data is kept in a single file and parsed into the game at run time.
Desired refactor
Each state consideration gets it own text file for input data. This will be easier for designers to each and read thru.
Currently, Raise the Alarm job is based on NPC hearing the player or target in order to trigger investigation.
Hearing system is being remove for a Perception system.
Instead of running Detection system for each entity archetype, test adding check to see if specific components exist in entity. This could be used sorting logic
Because I am using getters, setters, variable methods and interfaces for the construction of the consideration struct, considerations can not be viewed in the entity debugger windows.
A custom editor window will have to be written to view AI related information
Need to add an attackable tag system. This will allow for enemies to attack and surround other rival enemy factions. IE Beast npcs will attack hostile Bandit NPCS Police chase Theft
UnityEngine.Random.insideUnitSphere can only be call on the main thread. Are there any alternatives ?
public static bool RandomPoint(Vector3 center, float range, out float3 result)
{
for (int i = 0; i < 30; i++)
{
Vector3 randomPoint = center + UnityEngine.Random.insideUnitSphere * range;
NavMeshHit hit;
if (NavMesh.SamplePosition(randomPoint, out hit, 1.0f, NavMesh.AllAreas))
{
result = (float3)hit.position;
return true;
}
}
result = float3.zero;
return false;
}
Check CheckThreatAtWaypoint() code over loading system
Unity DOTS is shifting away from use of JobComponentSystems and ComponentSystems and moving to SystemBase.
Will update accordingly.
This project will probably remain on the 2019.4 for the foreseeable future due to the slow roll out of 2020.1
Currently, detection system cast a single ray towards center of target. If a small game object is in the way, AI cant "see" gameobject. Vice Versa is a gameobject is barely hanging out, AI can see a hidden gameobject. Need a way to tie raycast detection back to Character Awareness stat;
Hello,
I checkout branch Stable-0.7.2-2020LTS
and it does not compile. I openned it with unity version pointed in ProjectVersion.txt
.
Assets\Systems\InfluenceSystem\Faction Database\Relationship.cs(24,23): error CS0246: The type or namespace name 'Pool<>' could not be found (are you missing a using directive or an assembly reference?)
If there are extra steps to make the project compile, can we add them to the readme?
-Evgeni
State have to be manually state up. Need to add a way to dynamically setup up StateBuffer based on that attached states when entity is created.
Consider Adding create IAUS tag and have a job component system that going down each state sees if the StateBuffer Exist for that state. Add it if it doesnt not exist.
Need to created interface iTravelState. All ai states where entity movement is the primary function shall inherit from iTravelState.
The Amount of Threat an entity projects to the Influence Grid will vary by its ability to be detected.
Crouching, Moving slowly, staying out of line of slight will reduce other entities ability to detect
Running, Making excessive noise, fighting will make it easier for other entities to detect.
Create a detection component.
When detected by other entities increase detection
Weapon in arm vs holstered state
Create hiding conditions, IE working thru High Grass.
Relate detection score to Influence amount sent to grid. possible reduce the range of influences as well
Convert and Inject system is broken causing multiple issues.
Rewriting spawn system to work with entity gameobject representation while bugs are fixed hopefully
Please upvote the issue on unity site
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.