Author |
Message |
PhantomAGN
Joined: Mon Jun 29, 2009 2:40 am Posts: 610 Location: Deep below The Map of Mars
|
Re: Garbage Collection
This sounds terrific, and I look forward to seeing it implemented in a way that makes CC run better, but my inner skeptic is demanding to know what the downside might be to this. I cannot think of anything off the top of my head, but I'm not a very good coder, nor am I familiar with CC's Lua engine inner workings.
|
Tue Apr 20, 2010 4:34 am |
|
|
Kalidor
Joined: Mon Apr 19, 2010 11:17 pm Posts: 8
|
Re: Garbage Collection
Okay, if chocolate isn't enough, then what would be? The brain script is a fancy idea. Im pretty sure you'll have to call the script in the Brain code at some point, though. Is there any way you could implement this automatically in future versions of CC? Also, for certain lua scripts that you want to repeat themselves rapidly (within the ten seconds), it might be best add the garbagecollect to the function by hand, such as with the FBMs grow cursor. I had to tag on one other line on that so i could have multiple items grow at the same time. Otherwise, after a mere three, cc barfs on my keyboard. (i do enjoy chocolate though )
|
Tue Apr 20, 2010 4:39 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Garbage Collection
Huh. That explains a lot. Be nice if this was handled by the lua wrapper or whatever in the next release.
|
Tue Apr 20, 2010 4:56 am |
|
|
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Garbage Collection
Kalidor, you are a ♥♥♥♥ genious. Great to see that a way to plug the memory leak has been found
|
Tue Apr 20, 2010 9:51 am |
|
|
salt_1219
Joined: Tue Jan 12, 2010 8:25 pm Posts: 400 Location: mukilteo, wa
|
Re: Garbage Collection
I just tested it and WOW it really works... I played a insane death match that would have been super laggy or even crashed but it ran perfect. There's not enough chocolate in the world for this.
|
Tue Apr 20, 2010 10:10 am |
|
|
whitty
Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
|
Re: Garbage Collection
OK idea here... BTW I'm loopy from meds so it may seem incoherent so ye be warned.
Water is impossible in CC b/c of the physics and lag and it would need Lua b/c it will need different physics. What if you made one, and had this garbage dump thing run every 100 or 200 ms? That would kill the Lua lag, and the only lag left would be from the amount of water the whatever is.
|
Tue Apr 20, 2010 9:51 pm |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Garbage Collection
Put it into that water demo I made and see how much it reduces the lag. That doesn't have complex physics at all, but it still lags like anything.
|
Tue Apr 20, 2010 10:04 pm |
|
|
whitty
Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
|
Re: Garbage Collection
Can you link me?
|
Tue Apr 20, 2010 10:05 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Garbage Collection
Whitty, this wouldn't really help with something like that.
Garbage collection is not magic; the reason a water mod won't work is because of the CPU demand, which garbage collection does nothing to reduce.
Garbage collection reduces memory bloat by removing isolated variables and old definitions of them. This means that for mods with lots of tables and sequential variables (TLB's computer) there's serious performance benefits because there's less memory strain.
It's not going to make the game run any faster. In fact, the more frequently garbage collection is done, the more load is placed on the processor.
|
Wed Apr 21, 2010 12:08 am |
|
|
TorrentHKU
Loose Canon
Joined: Sun Mar 29, 2009 11:07 pm Posts: 2992 Location: --------------->
|
Re: Garbage Collection
It works best on GIANT Lua mods, things that act in ways CC never dreamed of. If it's laggy because it checks every pixel and and particle, then deflects the close ones, it isn't going to become Un-laggy.
|
Wed Apr 21, 2010 12:56 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Garbage Collection
It doesn't even check every particle, just other water particles (in a global water table), and does deflection based on that. It's still pretty intensive for all intents and purposes though, but it shouldn't be. It's really not that many iterations, in programming terms, but I suppose that on top of the engine is what's killing it. Regardless, garbage collection shouldn't help it much. You can try though. viewtopic.php?f=61&t=18024Could be a good idea to unlock that topic for a day or so.
|
Wed Apr 21, 2010 6:34 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Garbage Collection
Geti wrote: Could be a good idea to unlock that topic for a day or so. A Moderator to the rescue *dun dun daaaa*
|
Wed Apr 21, 2010 7:05 am |
|
|
Benpasko
Joined: Sun Aug 09, 2009 9:26 am Posts: 1633
|
Re: Garbage Collection
A lagless computer mod? Could it really be? I are amazed!
|
Thu Apr 22, 2010 9:03 pm |
|
|
Daman
Joined: Fri Jan 26, 2007 3:22 am Posts: 1451
|
Re: Garbage Collection
seems like a pretty obvious thing to do, any time you handle tons of declarations and tables you should be doing this
you should not be collecting garbage 24/7 with your brain just for the sake of it
it won't improve your performance unless you're running scripts made by someone who doesn't know lua(anyone making anything that actually needs this would probably have it included already)
|
Thu Apr 22, 2010 10:13 pm |
|
|
hax
Joined: Tue Aug 11, 2009 2:42 am Posts: 321 Location: On an iceberg typing away...
|
Re: Garbage Collection
|
Fri Apr 23, 2010 2:39 am |
|
|
|