Welcome to PlagueFest.com! Log in or Sign up to interact with the Plague Fest community.
  1. Welcome Guest! to interact with the community and gain access to all the site's features.


Discussion in News started by Kyle, Jun 2, 2012

  1. Apr 9, 2007
    So uh... as many of you know, we've been having crashing issues for years. Mostly from "The Edict Count is Too Damn High". We thought it was just shitty maps from Authors who didn't know what they were doing. The situation was pretty horrible, as you all have experienced. At least this is what we thought.

    How was this combated? We've had a Weapon cleaner for quite some time. Originally taken from Kigen's implementation in DM or something obscure. I made it our own, adding functionality and just 'Rockin' with it. People complained, it gets changed. Changed and Changed and Changed. I can't even count the revision count that it's currently on, but it's pretty high up there.

    The Weapon cleaner has caused some damage, making people lose on ZE (Feature), and well, hurting gameplay overall. But it's something we've all had to bear with for a while. I make an update to it, seems ok, or so I thought. So cool it isn't cleaning map items anymore, but everything's crashing even more now! SHIT!

    We all got pretty fed up with the Situation, @Josh made a thread, received some rather bad feedback. @Haplo made one after saying we're removing @Luffaren's Map (Predator) until the crashing issues are addressed. I've been testing almost daily, getting @Luffaren's hopes up, then both getting crushed when it just dies.

    It must be a plugin problem. Preposterous! It's a Feature! So I asked around, asking for someone to audit the plugin (again). Pointed out some issues, fixed the issues, it still didn't work. DAMN IT.

    So one day, I show my latest revision to someone, and they point out something rather obvious. I'm checking Edict indexes instead of using the function GetEntityCount()! What the hell, I'm an idiot! We swap to GetEntityCount, I add the same thing to rdisplay to monitor. Cool! We're doing things properly now, out of the woods. I call Luffaren in, it still crashes. Horrible.

    @GiGaBiTe's map crashed yesterday and suggested we're leaking entities because his map is awesome and totally superiour (I'm paraphrasing). At the time I thought to myself "Ha, yeah ok. Fix your shit. Thanks!", make a few changes to the Weapon Cleaner, then notice that GetEntityCount only increases and doesn't decrease on Predator. What the hell? Are we leaking?!

    I do some more investigation, ask around why "The Count" from the Engine Function GetEntityCount is static for the round. Got a bunch of shrugs (Including from the suggester, not that I can blame him at all). So I look at Ed_Alloc (CreateEdict's internal function), and it uses GetEntityCount as a basis for setting Edict indexes. Cool, now we have a big problem.

    Since Ed_Alloc does this, we can't really do jack shit about this. So at 2AM (Probably the best time) I file a bug on AM's Bug tracker and I post a message to both the HLDS_Linux and CSGO_Servers mailing lists as both engines have this issue . Get two answers in the morning.

    The definition for GetEntityCount is horribly incorrect. As Asher Baker pointed out, it isn't the number of used Entities, it's the highest used entity index. What the shit? That's the same thing as just checking indexes! But then I realized something... If Ed_Alloc is using this, if we have a high entity count at the end of one round it's going to hurt us going into the next rounds. This isn't good.

    So I wrote a SourceMod extension to detour CVEngineServer::CreateEdict(int). Instead of trying to do an action when we hit a certain number of entities (Valve tried this, and failed horrifically). I figured what the hell, I'll just write my own Allocator, NBD. And really? It was one of the easiest things to do. Did a bunch of testing, asked a friend to help out with an issue I was having (I forgot about classes in C++ >.>). Tried some more things, the allocator works on my dev server.

    Cool! So the allocator works, doesn't crash anymore. However, I did find one issue with it, all edicts are marked as used on mapchange, which is rather odd. But whatever, adding a check for that and allowing the engine to do what it normally does is just fine for now. Time for the test.

    I copy the binary from my test server to ZE. Make a vote to change to Predator for the third time today. Cross my fingers. I try to bring Luffaren in, but it's way too late (7 45~PM PST). As a matter of fact, no one is around. Good, GMAN FACE TIME. Map changes to Predator, we play a round of normal, entity count seems suspiciously low. I think there's an issue.

    So I noclip, kind of spooked, and change it to hard when they win on Normal. Cool, that was unnecessary, but eh. The Ent count is still low. I check with my test plugin, shit, it's pretty close to the same counts. We play a few rounds, lost horrifically each time. So I change it to Ultimate, the Server Death Stage. Server Ent count jumps up to 1555 ents, this is the norm for Ultimate. We're Screwed.

    Round ends, I cringe a bit. The Entity Count stays the same. What the hell? I run sm_wpt, it's still really low. Did I break something? We play, die at the elevator due to people not actively shooting. Round ends, Round 2 on Ultimate. Ent count remains at 1555 according to the engine? Seriously? Wtf is going on now? We should be up to 1800 entities by now.

    This remained constant for the 1H and 30M we played on Predator with 60~ players. Unless if things continue to get worse with entity usage, we're out of the woods interms of this crash. It's a shame Valve doesn't have their shit together, as this is broken on every engine. On GO, in the disassembly I see HPE is trying for this, but it still seems bugged.

    Proof [IMG]

    Lost: Ed_Alloc crashing. Gained: Stability, Performance improvement.

    Thanks to everyone for dealing with me testing shit on ZE (Broke the Round Ending for a day), and to @Tony Montana for reporting issues.
    • Winner x 18
    • Like x 4
    • Wizard! x 3
    • Informative x 2
    • Useful x 1
    • Aug 1, 2011
      Just wanted to point out that you failed to tag dem peoples >:.

      EDIT: Nevermind I see the tags. Must be high or something...
    • Oct 29, 2010
      Inb4 "Is Minas back" posts D:

      EDIT: I actually enjoyed the read @Kyle.
      • Like Like x 1
      • Dec 30, 2006
        I'm sure everyone appreciates your hard work and dedication kyla.

        Now everyone can play the removed maps without crying.
        • Like Like x 1
        • Agree Agree x 1
        • Apr 1, 2012
          thank you so much Mr. Kyle for your hard work, determination and brilliance.
          no, I'm damn serious here, but yes, I'm sure many of us are really amazed with your sorcery.

          once again, thank you, thank you and thank you.
          send my thanks and appreciation to those who helped you in "fixing" this!
        • Jul 28, 2011
          Woooo! Thanks for your hard work Kyle! Show that ent count who's boss!
          • Like Like x 1
          • Jul 14, 2008
            You are awesome Kyle! But your score sucked.
            • Funny Funny x 2
            • Feb 9, 2012
              good job, that must have been a whole shytload of work you had to put in for this server, and i appreciate it and im sure everyone else (mainly on ze) appreciates what you've done as well.
            • Feb 18, 2011
              I'm famous!
            • Apr 12, 2012
              Kyle - thanks for sticking with the issue until it was resolved! Troubleshooting can be such a pain in the ass, especially when you're not getting paid for it.
            • Feb 1, 2011
              Wow Kyle! I can't believe it. I figure it'd never be fixed, but if there was someone who ever could, it'd be you. Thanks! x 1,000,000
            • Nov 2, 2011
              Kyle is not human.
              • Like Like x 1
              • Agree Agree x 1
              • Nov 11, 2011
                He's definitely not human. We all thought he was using a voice changer to deepen his voice, turns out he's a robot trying to sound human. Good job Kyle...ur.
              • Aug 1, 2011
                Let's all face it. We love Kyle.

                Kyle we love you.
              • Jan 21, 2011
                I've been saying this for a while now, Valve has awesome game design and backs it with shit code. We have Kyle. We're set. :heart:
                • Agree Agree x 2
                • Oct 27, 2010
                  Amazing work Kyle.:thumbsup:
                • Sep 25, 2010
                  This was quite an enjoyable read. If there existed a thank you rating. Thank you very much!!
                • Mar 19, 2012
                • Apr 9, 2007
                • May 27, 2008
                  There will always be crying. No matter what.