Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 938 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Adjust 'Max_Entities' in your script! #63057
01/31/06 11:25
01/31/06 11:25
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline OP
Serious User
BlueBeast  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
Not exactly a tangible contribution, but I just learned this, and it really made me excited since I lowered my nexus size by a huge amount, and want to share with those who don't know about it...

It's about your level script and the line for max_entities. You want to make sure you have the best setting for this variable in your script!
First a partial description from SED:

max_entities

The maximum amount of entities in a level; must be set before loading of the level. The default value is NEXUS times 10.
Range:
0 .. unlimited (default: Nexus * 10)
Type:
var
Remarks:
Is to be set before level_load.
for every entity, around 1.5..2.5 KB memory is reserved from the nexus, dependent on its bones size.
Example:
max_entities = 1000; // alows up to 1000 Entities.

basically, if your max_entities is set waaaayy more than the number of entities in your level, you'r nexus will be higher than it needs to be.

This example is backwards tho... it says to set the number to 10 times the nexus... but the nexus is partly decided by the number of entities in max_entites.
-------------------

So instead,
1) Run your level, hit F11 to find out how many entities you're using.
2)In SED, set your max entities to maybe 30 more than what you have (so you can add more later if you need to).
3) Run your level again, hit F11, and see how big your nexus is.
4) In WED, under 'Map Properties' set the nexus to match the new nexus number you saw while running your level (you should round up the number)


What's the point to all this? Potentially saving memory on your custtomer's computer, enhancing performance.

I had my max_entities set at 3000 for all my levels over the past 2 years, because to me it just seemd a default number. After following the above procedure for one of my levels, my nexus size went down from 27MB to 22MB!

Now, maybe not everyone has max_entities set in their script, and maybe it's not as far off as mine was. But even so, this will help you perhaps get a bit less memory reserved to play your level. I saved 5 Megabytes!

If you do add more entities, your nexus may have to be set higher, but at least your starting as low as necessary first!

So hopefully this helps some people!

Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: Adjust 'Max_Entities' in your script! [Re: BlueBeast] #63058
01/31/06 12:08
01/31/06 12:08
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Simple but easily overlooked, your genius is helpful. Thanks.

Re: Adjust 'Max_Entities' in your script! [Re: DavidLancaster] #63059
01/31/06 12:46
01/31/06 12:46
Joined: Sep 2003
Posts: 1,037
Budapest, Hungary
DEX Offline
Serious User
DEX  Offline
Serious User

Joined: Sep 2003
Posts: 1,037
Budapest, Hungary
Very, very useful, many thanks


DEXSOFT-GAMES.COM
Re: Adjust 'Max_Entities' in your script! [Re: BlueBeast] #63060
02/14/06 05:54
02/14/06 05:54
Joined: May 2005
Posts: 138
jamrud khatulistiwa
Kotakide Offline
Member
Kotakide  Offline
Member

Joined: May 2005
Posts: 138
jamrud khatulistiwa
I'm a little..... con....fused..
can you explain in "english"
please......

Re: Adjust 'Max_Entities' in your script! [Re: Kotakide] #63061
02/14/06 07:23
02/14/06 07:23
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
@bb: thx, But I was thinking, that can this be automatically adjust during game, like:

Max_entities = Current_entities; ?? I'm like tired here..


"Yesterday was once today's tomorrow."
Re: Adjust 'Max_Entities' in your script! [Re: Inestical] #63062
02/14/06 16:48
02/14/06 16:48
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline OP
Serious User
BlueBeast  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
well, um, maybe you could the thing is, I don't know hardly anything about scripting, but i can adjust a variiable with the best of them

Like i said though, i don't know if 'max_entities' is a required line of script, but if you do have it in your script, this should help.

Can anyone explain what the purpose is for max_entities? Is it a necessary line of script for a level?

@Kotakide: This is all for if the scripts for your levels has the line 'max_entities' in it.

Basically, if your max_entities is set way more than the number of entities in your level, you'r nexus will be higher than it needs to be.

Like if your script says max_entities = 1000 but you are only using 50 objects in your level, then there's memory being reserved for objects you don't have. Which is a waste, of course.

Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: Adjust 'Max_Entities' in your script! [Re: BlueBeast] #63063
02/14/06 21:38
02/14/06 21:38
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
from 27 MB to 22?

Well then lets see what i can do... i have 220 MB nexus

Edit: But anyways its all right set. with 210 i have too less, and i have the correct amount of max_entities.

Last edited by Michael_Schwarz; 02/14/06 21:39.

"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Adjust 'Max_Entities' in your script! [Re: Michael_Schwarz] #63064
02/15/06 08:21
02/15/06 08:21
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
In the forecast, there' coming a ingame script editin' this could be good. You coud count the current entities and set it to the nexus immediatly.

Tho this would be very slow and would've huge effect in fps..


"Yesterday was once today's tomorrow."

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1