Development Blog

Where we pretend to know how to code.


We keep hitting brick walls!

Published: 2011-05-09

Author: Teddi

Garrysmod is a wonderful tool. Source is a wonderful engine.

Sort of.

It can be debated that the RP mod we’re making is one of the most advanced and elaborate out there, which means we’re pushing source further and further to work for us. And we’ve discovered that with our ideas, we’re going to be hitting some pretty solid ones soon. The main one is-

Edicts

Edicts in Source are what make the world go around, so to speak. You can sort Edicts into two categories - Networked and Unnetworked and with both you have 2048 which total 4096 total edicts available for use. That may sound like quite a few but in reality there are specific entities which fit into one or the other and never both. So, where does this all mean?

In a map many of the entities used will use at least one networked edict. Lights, doors, breakable glass, the list goes on. Now a hundred doors for example may not seem like many, but then add on lighting. Then add on buttons. Then add players (Which I think use around 15 edicts in total per player). Then add in the fact we’re having persistent items in the world. It’s causing quite a headache in terms of optimization and playability how we can handle such a thing. We actually got to a point questioning ourselves why is this limit even in place?

In Half Life 1 (goldSRC engine) there was actually a launch parameter you could use to set the maximum amount of edicts and for a long time this actually existed in Source as well. However someone over at Valve decided that the command wasn’t worth keeping in for whatever reason (most likely optimization, yknow, 56k modems and all back in 04). So we figured hey, lets ask Garry if he can raise it! Turns out Garry would have to ship his own version of the engine to raise the edict limit which is problematic, because he doesn’t. All he ever does is edit the server / client dlls mostly for maximum compatability (ie if there’s a main source engine update, it hopefully doesn’t break Gmod at the same time). So we actually went ahead and contacted Valve about how to go about this and any information they could spare.

Killermon emailed Valve and we got a reply back pretty quickly (as in, an hour quick!) Brian (whom Killermon got in contact with) emailed Robin (Walker) and asked him what the maximum edict limit in TF2 was and if Garry could do something about that. Robin said they had raised it (we guessed they effectively doubled it at the time, seemed reasonable) in TF2 and that Garry actually could raise it also if he exposed it. I forwarded this all to Garry and for a few days we heard nothing back.

Garry got back to us on the 8/5/2011 (or 5/8/2011 if you’re a yank) and basically said that there appears to be no change in what the Edict limit was. Killermon and Myself pretty much went “uhh, oh shit”. We were (and still are to some extent) pinning our hopes on this edict amount getting raised. So Killermon emailed (after we hunted down the right email adddress for ) Robin and he sent an email off to both Robin and Brian again. Brian was the one who replied to us.

Brian effectively stated that he wasn’t sure if Garry has access to rebuild the engine (as far as I know he does, but refuses to for compatability) and that Garry would have to ship it. Brian also added that the limit hadn’t been raised in TF2 either. We emailed Garry the response and so far we’ve not heard anything back from him.

This puts us in a major rut. Until we can clarify that the limit won’t be raised (4096 networked ents would be godly, honestly) we’re sort of throwing ideas around how we can keep the edict limit as free as possible whilst still having a fun and rich gamemode.

 

Entity limit in vbsp

This one isn’t so bad because it primarily applies to thet SDK and hammer specifically. Obviously an entity is an entity and in this case there’s no “networking” and whatsnot. This means that if Killermon somehow hits 8000 ents we have to devise a way to put the rest of the map together via lua (ie certain objects in certain areas).

However it’s not as bad as the edict limit because this only applies to vbsp alone. Yay lua for saving the day!

Instancing

Is a tricky one. It’s something that would be so very handy with the edict limit but we’re having issues with it regarding sounds and certain collisions. It works somewhat but we believe we may have to just leave instancing out of the gamemode in general. It’s a pity because it would have effectively allowed limitless apartments and whatsnot, but oh well.

It’s now 2:56am, so I’m going to bed before the birds get up.

Oh- and to keep Killermon happy


Historical Posts