Page MenuHomeFeedback Tracker

Add a threaded version of 'CGame::GetObjectsAtPosition'
Assigned, UrgentPublic

Description

When passing in a high radius, the game can slow down to a halt for a while. Allowing the functions 'GetObjectsAtPosition' and 'GetObjectsAtPosition3D' to run a separate thread will add a much-needed improvement for many modders and server owners.

Easier to show what I think is needed than just writing it all down in words

typedef array<IEntity> TIEntityArray;
typedef array<CargoBase> TCargoBaseArray;

enum ObjectSearchType
{
  S_BBOX,
  S_CIRCLE, // same as CGame::GetObjectsAtPosition
  S_SPHERE, // same as CGame::GetObjectsAtPosition3D
};

class ObjectParams
{
  vector position; // position
  float radius; // specified radius
  typename inheritance = IEntity; // finds all objects that inherit from this script typename
  ObjectSearchType type;
};

class ObjectResult
{
  TIEntityArray objects; // so we can get more than just objects
  TCargoBaseArray proxyCargos;
};

class ObjectCallback
{
  void OnFinishSearch(ObjectResult result);
};

class CGame
{
  proto native void GetObjects(ObjectParams params, ObjectCallback callback);
};

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General

Event Timeline

Geez changed the task status from New to Assigned.Dec 7 2020, 1:02 PM
komer added a subscriber: komer.Dec 8 2020, 9:09 AM