Code Monkey home page Code Monkey logo

ecs-iaus-sytstem's People

Contributors

dreamersincstudios avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ecs-iaus-sytstem's Issues

IDestroyable Interface needed

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

Patrol Wait states dependency need to be removed.

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.

  • Update Patrol State to have a score of 0 during cooldown;
  • Update to next patrol point when Tag is removed and tag is successfully completed.

Patrol Consideration Rebalancing

  • Remove Distance Consideration from Patrol Consideration
  • Add an OnSuccess loop that guess through each state and and trigger reaction actions based on a successful state completion.

Example. When Patrol State is successfully Completed, if WaitAtPoint State exist in AI System, at time to timer.

Remove Hearing System

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 Save Path need to be updated

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

Tower AI

Need to create AI states for Towers in Destory the Tower Game Mode.

  • gather resources
  • defend self
  • repair self
  • spawn defenders

Running Spawn Scene

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.

thanks for your hard work.
Screen Shot 2020-08-04 at 1 47 10 PM

Mike

Clarification on scripts folder

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/?

Consider removing Wait State

Consider getting rid of the wait state and instead using the patrol cooldown
Pros

  • gets rid of an additional state to calculate
  • improve runtime speed
    Cons
  • Get rid of intentionally pausing
    Will reevaluate late

Rewrite Fall Off Equations for Influences System.

Need to come up with equations that take distance ratio and scale the influence.

  • Linear
  • Quad
  • Inverse,
  • Ring,
  • Barrier,
  • Logistic
    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; }

AssertionException: The scene catalog has not been loaded yet

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)

Unity Entities Package preview 0.8.0 Changes

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

Create new movement AI State

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

  • Patrol
  • Traverse

Expose Authoring Classes generated By GenerateAuthoringComponent Tag

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));

Rewrite state consideration blob system and text file.

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.

Rewrite Raise The Alarm

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.

Filter Detection 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

Consideration Component Not Visible In Entity

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

Global Function RandomPointOnNavMesh Code Need to run in IjobChunk

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;
        }

Remove all use of JobComponentSystems and ComponentSystems

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

Redo Detection RayCastCommand

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;

Project does not compile

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 Authoring System

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.

Abstraction of Travel AI States.

Need to created interface iTravelState. All ai states where entity movement is the primary function shall inherit from iTravelState.

Rewrite Awareness System Based on Influence System

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.