ED_Alloc: no free edicts

Today when I was working on a map im creating I compiled after finishing a room with a gunrange in it and it compiled fine with no errors but as it got onto the initial loading page the game crashed with the error thats in the title.

So I googled it and it said it had something to do with to many entities.

So first I tried compiling again with the parameter -num_edicts 4096 but it didnt work.

I then tried using a custom VBSP compiler which increases among other things entity limits and when I compiled and it loaded up it crashed just like it orginally did but with no message stating why.

I then tried compiling with no props showing and it worked. So after that I tried compiling with props besides the ones I had placed during building the gunrange room and it worked, so at that point I assumed it had to be one of the props in the room. So I then quickhid half of the props in the room and compiled, it didnt work. So I then unquickhid em and then quickhid the other half and compiled it didnt work. So im left at the conclusion that I have hit some actual limit in the source engine. But since that would mean this map would be pointless continuing im here to ask if theres some way to fix this whole issue if I am wrong with the cause of it or a way to increase whatever limit im hitting (if I am hitting one that is).

Thankyou in advance for any help.

EDIT: I tried quickhiding all the props in the room again and then heading to another spot on the map and spawned 19 random props to see if it would crash with the same issue. It loaded up fine but when I checked the group of random props the compiler had like deleted some of them with only 14 being there instead of 19. Dunno if this is helpful but I felt it needed to be here.

Do not make threads for every question. Use the question megathread and read the sticky.

There is a in-game limit of how many dynamic entities you can have at once, including props. This limit is huge, however and it is very unlikely that you hit it. Post your compile log and the amount of props you have in your map


(User was banned for this post ("Backseat moderation" - Kiwi))

Im assuming when you ask for props you mean this?

oh also ignore the “Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring…” in the compile log.


Starting a 'Normal' compile.
Starting compilation of C:\Users\New User\Documents\rp_city20.vmf
Valve Software - vbsp.exe (May 15 2014)
8 threads
materialPath: C:\Program Files (x86)\Steam\SteamApps\common\Half-Life 2\ep2\materials
Loading C:\Users\New User\Documents\rp_city20.vmf
ConVarRef mat_reduceparticles doesn't point to an existing ConVar
Could not locate 'GameData' key in c:\program files (x86)\steam\steamapps\common\half-life 2\ep2\gameinfo.txt
Patching WVT material: maps/rp_city20/concrete/blendbunk_conc01_wvt_patch
fixing up env_cubemap materials on brush sides...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
Material glass/glasswindowbreak070b is depending on itself through materialvar $crackmaterial! Ignoring...
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
Processing areas...done (0)
Building Faces...done (0)
Chop Details...done (0)
Find Visible Detail Sides...
Merged 1810 detail faces...done (0)
Merging details...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (1)
writing C:\Users\New User\Documents\rp_city20.prt...Building visibility clusters...
done (0)
Creating default LDR cubemaps for env_cubemap using skybox materials:
   skybox/sky_borealis01*.vmt
 ! Run buildcubemaps in the engine to get the correct cube maps.
Creating default HDR cubemaps for env_cubemap using skybox materials:
   skybox/sky_borealis01*.vmt
 ! Run buildcubemaps in the engine to get the correct cube maps.
Finding displacement neighbors...
Finding lightmap sample positions...
Displacement Alpha : 0...1...2...3...4...5...6...7...8...9...10
Building Physics collision data...
done (1) (1850176 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Compacting texture/material tables...
Reduced 10927 texinfos to 5717
Reduced 1485 texdatas to 1133 (66712 bytes to 51164)
Writing C:\Users\New User\Documents\rp_city20.bsp
8 seconds elapsed
Valve Software - vvis.exe (May 15 2014)
8 threads
reading c:\users
ew user\documents\rp_city20.bsp
reading c:\users
ew user\documents\rp_city20.prt
1917 portalclusters
4483 numportals
BasePortalVis:       0...1...2...3...4...5...6...7...8...9...10 (0)
PortalFlow:          0...1...2...3...4...5...6...7...8...9...10 (51)
Optimized: 4257 visible clusters (0.95%)
Total clusters visible: 449444
Average clusters visible: 234
Building PAS...
Average clusters audible: 867
visdatasize:478896  compressed from 920160
writing c:\users
ew user\documents\rp_city20.bsp
51 seconds elapsed
Valve Software - vrad.exe SSE (May 15 2014)

      Valve Radiosity Simulator     
8 threads
[Reading texlights from 'lights.rad']
[48 texlights parsed from 'lights.rad']

Loading c:\users
ew user\documents\rp_city20.bsp
Setting up ray-trace acceleration structure... Done (6.46 seconds)
16242 faces
2 degenerate faces
1726455 square feet [248609568.00 square inches]
32 Displacements
1088 Square Feet [156760.58 Square Inches]
16240 patches before subdivision
190046 patches after subdivision
1115 direct lights
BuildFacelights:     0...1...2...3...4...5...6...7...8...9...10 (42)
BuildVisLeafs:       0...1...2...3...4...5...6...7...8...9...10 (17)
transfers 22747001, max 1429
transfer lists: 173.5 megs
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #1 added RGB(226548, 206560, 135598)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #2 added RGB(38691, 30634, 15432)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #3 added RGB(8132, 5529, 2174)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #4 added RGB(2038, 1174, 364)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #5 added RGB(573, 278, 69)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (1)
	Bounce #6 added RGB(173, 71, 14)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #7 added RGB(55, 19, 3)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #8 added RGB(18, 5, 1)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #9 added RGB(6, 1, 0)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #10 added RGB(2, 0, 0)
GatherLight:         0...1...2...3...4...5...6...7...8...9...10 (0)
	Bounce #11 added RGB(1, 0, 0)
Build Patch/Sample Hash Table(s).....Done<0.0636 sec>
FinalLightFace:      0...1...2...3...4...5...6...7...8...9...10 (11)
FinalLightFace Done
323 of 323 (100% of) surface lights went in leaf ambient cubes.
ThreadComputeLeafAmbient: 0...1...2...3...4...5...6...7...8...9...10 (10)
Writing leaf ambient...done
Ready to Finish

Object names       Objects/Maxobjs  Memory / Maxmem  Fullness 
------------       ---------------  ---------------  -------- 
models                 136/1024         6528/49152    (13.3%) 
brushes               5113/8192        61356/98304    (62.4%) 
brushsides           36042/65536      288336/524288   (55.0%) 
planes               14834/65536      296680/1310720  (22.6%) 
vertexes             28724/65536      344688/786432   (43.8%) 
nodes                 5738/65536      183616/2097152  ( 8.8%) 
texinfos              5717/12288      411624/884736   (46.5%) 
texdata               1133/2048        36256/65536    (55.3%) 
dispinfos               32/0            5632/0        ( 0.0%) 
disp_verts             800/0           16000/0        ( 0.0%) 
disp_tris             1024/0            2048/0        ( 0.0%) 
disp_lmsamples        5776/0            5776/0        ( 0.0%) 
faces                16242/65536      909552/3670016  (24.8%) 
hdr faces                0/65536           0/3670016  ( 0.0%) 
origfaces            12071/65536      675976/3670016  (18.4%) 
leaves                5875/65536      188000/2097152  ( 9.0%) 
leaffaces            19647/65536       39294/131072   (30.0%) 
leafbrushes           9871/65536       19742/131072   (15.1%) 
areas                   18/256           144/2048     ( 7.0%) 
surfedges           128904/512000     515616/2048000  (25.2%) 
edges                82026/256000     328104/1024000  (32.0%) 
LDR worldlights       1115/8192        98120/720896   (13.6%) 
HDR worldlights          0/8192            0/720896   ( 0.0%) 
leafwaterdata            0/32768           0/393216   ( 0.0%) 
waterstrips           2063/32768       20630/327680   ( 6.3%) 
waterverts               0/65536           0/786432   ( 0.0%) 
waterindices         38295/65536       76590/131072   (58.4%) 
cubemapsamples         206/1024         3296/16384    (20.1%) 
overlays                 0/512             0/180224   ( 0.0%) 
LDR lightdata         [variable]    13481720/0        ( 0.0%) 
HDR lightdata         [variable]           0/0        ( 0.0%) 
visdata               [variable]      478896/16777216 ( 2.9%) 
entdata               [variable]      660602/393216   (168.0%) VERY FULL!
LDR ambient table     5875/65536       23500/262144   ( 9.0%) 
HDR ambient table     5875/65536       23500/262144   ( 9.0%) 
LDR leaf ambient     16513/65536      462364/1835008  (25.2%) 
HDR leaf ambient      5875/65536      164500/1835008  ( 9.0%) 
occluders                0/0               0/0        ( 0.0%) 
occluder polygons        0/0               0/0        ( 0.0%) 
occluder vert ind        0/0               0/0        ( 0.0%) 
detail props          [variable]           1/12       ( 8.3%) 
static props          [variable]           1/126408   ( 0.0%) 
pakfile               [variable]    18325731/0        ( 0.0%) 
physics               [variable]     1850176/4194304  (44.1%) 
physics terrain       [variable]        6472/1048576  ( 0.6%) 

Level flags = 0

Total triangle count: 47793
Writing c:\users
ew user\documents\rp_city20.bsp
1 minute, 28 seconds elapsed
C:\Users\New User\Documents\rp_city20.bsp -> C:\Program Files (x86)\Steam\SteamApps\common\Half-Life 2\ep2\maps\rp_city20.bsp
1 File(s) copied
'Normal' compile finished in 00:02:28

This dudes only made one thread and it actually sounds a lot more complex and not a quick question as stated in the sticky.

Read it yourself.

̶3̶̶8̶̶3̶̶9̶̶ ̶+̶ ̶̶1̶̶6̶̶9̶̶9̶̶ ̶=̶ ̶̶5̶̶5̶̶3̶̶8̶̶.̶̶ ̶

̶y̶̶o̶̶u̶̶ ̶̶a̶̶r̶̶e̶̶ ̶̶1̶̶4̶̶4̶̶2̶̶ ̶̶e̶̶n̶̶t̶̶i̶̶t̶̶e̶̶s̶̶ ̶̶a̶̶b̶̶o̶̶v̶̶e̶̶ ̶̶t̶̶h̶̶e̶̶ ̶̶l̶̶i̶̶m̶̶i̶̶t̶̶.̶̶ ̶̶t̶̶h̶̶e̶̶r̶̶e̶̶ ̶̶i̶̶s̶̶n̶̶t̶̶ ̶̶r̶̶e̶̶a̶̶l̶̶l̶̶y̶̶ ̶̶a̶̶n̶̶y̶̶t̶̶h̶̶i̶̶n̶̶g̶̶ ̶̶y̶̶o̶̶u̶̶ ̶̶c̶̶a̶̶n̶̶ ̶̶d̶̶o̶̶ ̶̶a̶̶b̶̶o̶̶u̶̶t̶̶ ̶̶t̶̶h̶̶a̶̶t̶̶.̶̶ ̶̶m̶̶a̶̶y̶̶b̶̶e̶̶ ̶̶y̶̶o̶̶u̶̶ ̶̶a̶̶r̶̶e̶̶ ̶̶c̶̶r̶̶e̶̶a̶̶t̶̶i̶̶n̶̶g̶̶ ̶̶u̶̶n̶̶n̶̶e̶̶c̶̶e̶̶s̶̶s̶̶a̶̶r̶̶y̶̶ ̶̶e̶̶n̶̶t̶̶i̶̶t̶̶e̶̶s̶̶.̶̶ Post some screenshots.

[editline]a[/editline]

I was wrong about that thing above :smiley: The actual limit is 8192. Still post some screenshots

8192 is the edict limit for gmod – most source games have a limit of 2048 edicts

This is the only problem I see but it’s a big one. Basically, this might happen if you are defining entities in your map without using their FGD file. an FGD file tells hammer the varibles and their default values for entities. If this isn’t included, hammer doesn’t know what information to omit from the file (as it doesn’t know what the default value for something is) and so it includes it all, making for a lot of entity data.

Actually the entdata is irrevelant: you can even get away with 220% if you use addoutputs and templates.

The thing you have to consider is that aside of all the content of your map, you have to count with the players, their weapons, and their stuff as it counts to the limit ( and since it is dynamic, you will have to forsee how many players will play your map ).

Do your best to use only prop_static except when really needed ( if you are desperate, recompile the model so you can use it, if only Valve added a prop_static_override ), and use a combination of templates, entity makers and the magical addoutput output:

This trick saved my ass and allowed me to add a lot of stuff that without it would go over the limits.

These links should be useful as well:

http://forum.facepunch.com/showthread.php?t=1284014&p=41267368&viewfull=1#post41267368

Holy crap that first link helped alot and I am not sure why but after I went through my map deleting dynamic props and dynamic_override props it fixed the issue that I was getting.