About entity_max error E1513 or E1005

Posted By: 20BN

About entity_max error E1513 or E1005 - 02/27/18 04:20

Hi all.
About entity_max error E1513 or E1005.
how to set entity_max(unlimited, ent_create(...) ) use sys_malloc?
THANKS.
Posted By: Kartoffel

Re: About entity_max error E1513 or E1005 - 02/27/18 07:28

there's a variable called max_entities that you can set at the start of the main function:

Code:
void main()
{
   max_entities = 5000;

Posted By: 20BN

Re: About entity_max error E1513 or E1005 - 02/27/18 09:08

@Kartoffel
THANKS your time.

I need more than 100K entities in level.( my dynamic system render less than 500 entities in area, not all render in screen).
The engine crash when i set entity_max > 100000. But i need more entities support.
Posted By: HenWoll

Re: About entity_max error E1513 or E1005 - 02/27/18 11:27

I mark myself here quickly - had a similar question for some time.
Posted By: Kartoffel

Re: About entity_max error E1513 or E1005 - 02/27/18 22:58

I don't think that's possible.

I think the best way is to create entities only when they are needed.
Posted By: Dooley

Re: About entity_max error E1513 or E1005 - 03/19/18 20:51

Originally Posted By: 20BN
@Kartoffel
THANKS your time.

I need more than 100K entities in level.( my dynamic system render less than 500 entities in area, not all render in screen).
The engine crash when i set entity_max > 100000. But i need more entities support.


I think you need to think about optimizing your game. If you are only rendering 500 at a time, you can use some clever programming to change/reposition entities when you enter a new area. Having 100000 or more entities will make any game run very slow if at all.

Can I ask what kind of things you need so much of in your game?
Posted By: 20BN

Re: About entity_max error E1513 or E1005 - 03/20/18 05:45

Originally Posted By: Dooley
Originally Posted By: 20BN
@Kartoffel
THANKS your time.

I need more than 100K entities in level.( my dynamic system render less than 500 entities in area, not all render in screen).
The engine crash when i set entity_max > 100000. But i need more entities support.


I think you need to think about optimizing your game. If you are only rendering 500 at a time, you can use some clever programming to change/reposition entities when you enter a new area. Having 100000 or more entities will make any game run very slow if at all.

Can I ask what kind of things you need so much of in your game?


less than 5000.
Posted By: Dooley

Re: About entity_max error E1513 or E1005 - 03/22/18 23:06

So you could use "ent_create()" to create new entities when they are needed, and "ent_remove()" to remove the ones that you don't need any more. This way it is possible to have many more entities in a level.

You will still have to be careful with memory usage, and may need to use "ent_purge()" to remove resources from memory.
© 2024 lite-C Forums