edited May 2023 in ORK Support
Hello Gil!

I hope you are well.

I realized that my Combatants are influencing the FPS of my game a lot. So 08 simultaneous combatants are decreasing the FPS to 20 FPS. Is there anything I can do to make my Combatants less influential?

Another thing, I would like to know if it is possible to Spawn Enemy Combatants on the battle grid based on the distance of the player and the player's group members.

Grateful
Post edited by Vykthorius on
  • That depends on what your combatants do, or generally, your status system.
    If there are a lot of things happening each frame for each combatant, that can reduce performance. E.g. if you're using a real time battle system, make sure to use sime timeoff between actions, either via AI Decision Time (in the battle system's settings) or the Timeout setting in your combatant's AI Settings > Real Time Settings (also for all combatants in the general settings).
    E.g. if your combatants spam a not animated none/do nothing action each frame, that can get heavy.

    Otherwise, it could be your combatant prefabs, i.e. just graphical/physics stuff that impacts performance, independent on what's going on in ORK.


    As for spawning combatants on the grid based on distance to the player/group - yeah, that can be done, but not automatically. That's something you have to do in your battle start event.
    E.g. after placing the player combatants, you can use Select Grid Cells nodes to get cells around the player/group via range templates (like use/affect ranges for abilities and items) and use those cells for placing your enemies.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Hello Gil!

    Thanks for the usual feedback and help.

    The system I'm using is turn-based.
    Prefabs are Lowpoly and not very demanding on performance.




    gamingislove said: As for spawning combatants on the grid based on distance to the player/group - yeah, that can be done, but not automatically. That's something you have to do in your battle start event.
    E.g. after placing the player combatants, you can use Select Grid Cells nodes to get cells around the player/group via range templates (like use/affect ranges for abilities and items) and use those cells for placing your enemies.

    2) As for the mentioned node, I didn't find it in Ork 2. Could you use the "Check Grid Distance" node as an option?

    It wasn't clear to me how to use these cells to position my enemies, can you help me more with this please?

    3) I also realized that when trying to create a battle grid in the same scene, following the Ork 2 tutorial, I am not able to Spawn the Player's combatant. Enemies are positioned and appear on the grid, but I can't position the Player in the "Deploy Player" cell, showing the error below in the console.

    NullReferenceException: Object reference not set to an instance of an object
    ORKFramework.GridDeploymentCell.CanDeploy (ORKFramework.Combatant combatant) (at :0)
    ORKFramework.Behaviours.BattleGridCellComponent.CanDeploy (ORKFramework.Combatant combatant) (at :0)
    ORKFramework.GridCombatantPlacementSettings.CanDeploy (ORKFramework.Behaviours.BattleGridCellComponent cell) (at :0)
    ORKFramework.Behaviours.BattleGridComponent.GetCells (System.Collections.Generic.List`1[ORKFramework.Behaviours.BattleGridCellComponent]& cells, ORKFramework.GridCellCheck check) (at :0)
    ORKFramework.GridCombatantPlacementSettings.StartCellSelection () (at :0)
    ORKFramework.GridCombatantPlacementSettings.CombatantSelected (ORKFramework.Combatant combatant) (at :0)
    ORKFramework.Menu.CombatantSelection.DoCloseSelection (System.Boolean closed) (at :0)
    ORKFramework.Menu.CombatantSelection.Closed (ORKFramework.GUIBox origin) (at :0)
    ORKFramework.GUIBoxContent.Closed() (at :0)
    ORKFramework.DialogueContent.Closed() (at :0)
    ORKFramework.GUIBox.Tick (System.Single t) (at :0)
    ORKFramework.GUIHandler.Tick (System.Single t) (at :0)
    ORKFramework.GUIHandler.Tick() (at :0)
    ORKFramework.ORKCore.FireTick() (at :0)
    ORKFramework.ORKHandler.Update() (at :0)

    Can you help me with this?

    Grateful,
  • Vykthorius said: Prefabs are Lowpoly and not very demanding on performance.
    Well, that can still depend on the used shaders, optimization, etc. :)
    Otherwise, HUD and constant HUD updates can be hard on performance - I'd need to know what generally is going on in the scene to give tips on what can be done.
    Also, if more combatants are in the scene than just those that are in battle, you can use the different ranges in Battle System > Battle Settings to limit their capabilities, e.g. blocking their move AI.

    2) Ah, sorry, that's in ORK 3 - in ORK 2 the node was called Store Grid Cells, but works the same, i.e. you can get cells around a combatant (or another cell) based on battle range (templates) and use those cells for spawning and placing combatants.

    3) Hm, what's your cell type's deployment setup like?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • 3) I will send a screenshot of it to your email.
Sign In or Register to comment.