Please optimize the game

24

Comments

  • nsguynsguy Join Date: 2010-01-03 Member: 69869Members
    <!--quoteo(post=2063495:date=Jan 20 2013, 02:10 AM:name=Vitdom)--><div class='quotetop'>QUOTE (Vitdom @ Jan 20 2013, 02:10 AM) <a href="index.php?act=findpost&pid=2063495"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Lua is compiled by NS2?<!--QuoteEnd--></div><!--QuoteEEnd-->

    I would assume a compiler.
  • beaglebeagle Join Date: 2010-12-04 Member: 75469Members, Reinforced - Shadow
    The entire gamestate is in Lua right? so each frame effectively needs to be 'compiled' yeah?
  • RockyMarcRockyMarc Join Date: 2009-11-24 Member: 69519Members, Reinforced - Shadow
    Hmm yeah I agree the optimisation needs work, client side for sure, but even more so the server side.
  • VitdomVitdom Join Date: 2012-04-30 Member: 151345Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, WC 2013 - Shadow
    <!--quoteo(post=2063497:date=Jan 20 2013, 03:22 AM:name=nsguy)--><div class='quotetop'>QUOTE (nsguy @ Jan 20 2013, 03:22 AM) <a href="index.php?act=findpost&pid=2063497"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I would assume a compiler.<!--QuoteEnd--></div><!--QuoteEEnd-->
    If it isn't compiled at run-time by NS2, it isn't compiled at all and is directly fed into the Lua VM which interprets the code.
  • beaglebeagle Join Date: 2010-12-04 Member: 75469Members, Reinforced - Shadow
    <!--quoteo(post=2063508:date=Jan 20 2013, 01:38 PM:name=Vitdom)--><div class='quotetop'>QUOTE (Vitdom @ Jan 20 2013, 01:38 PM) <a href="index.php?act=findpost&pid=2063508"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->If it isn't compiled at run-time by NS2, it isn't compiled at all and is directly fed into the Lua VM which interprets the code.<!--QuoteEnd--></div><!--QuoteEEnd-->

    So, just to be clear, the graphics engine is not written in Lua right? Only the game logic, yes? And since the graphics engine has to wait for the game logic to generate a frame we get low fps?

    If my thinking is correct, improvements could be made to the lua code to make it more efficient and the VM which interprets it could also be improved?
  • nsguynsguy Join Date: 2010-01-03 Member: 69869Members
    edited January 2013
    <!--quoteo(post=2063508:date=Jan 20 2013, 02:38 AM:name=Vitdom)--><div class='quotetop'>QUOTE (Vitdom @ Jan 20 2013, 02:38 AM) <a href="index.php?act=findpost&pid=2063508"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->If it isn't compiled at run-time by NS2, it isn't compiled at all and is directly fed into the Lua VM which interprets the code.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I know nothing about Lua nor am I a game developer. I've worked with OpenGL but I never needed to recompile code for each frame, hence I didn't think the code would be compiled at runtime (although compiling code for each frame sounds stupid to me). So it's an interpreted language like PHP, or does it compile to an intermediate language and is compiled JIT by the Lua VM like Java and C#?
  • VitdomVitdom Join Date: 2012-04-30 Member: 151345Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, WC 2013 - Shadow
    <!--quoteo(post=2063513:date=Jan 20 2013, 03:57 AM:name=beagle)--><div class='quotetop'>QUOTE (beagle @ Jan 20 2013, 03:57 AM) <a href="index.php?act=findpost&pid=2063513"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So, just to be clear, the graphics engine is not written in Lua right? Only the game logic, yes? And since the graphics engine has to wait for the game logic to generate a frame we get low fps?

    If my thinking is correct, improvements could be made to the lua code to make it more efficient and the VM which interprets it could also be improved?<!--QuoteEnd--></div><!--QuoteEEnd-->
    Exactly.

    <!--quoteo(post=2063517:date=Jan 20 2013, 04:15 AM:name=nsguy)--><div class='quotetop'>QUOTE (nsguy @ Jan 20 2013, 04:15 AM) <a href="index.php?act=findpost&pid=2063517"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I know nothing about Lua nor am I a game developer. I've worked with OpenGL but I never needed to recompile code for each frame, hence I didn't think the code would be compiled at runtime (although compiling code for each frame sounds stupid to me). So it's an interpreted language like PHP, or does it compile to an intermediate language and is compiled JIT by the Lua VM like Java and C#?<!--QuoteEnd--></div><!--QuoteEEnd-->
    I don't know. The developers have designed their own version of Lua. All I know is that it is not pre-compiled in any way.
  • nsguynsguy Join Date: 2010-01-03 Member: 69869Members
    <!--quoteo(post=2063530:date=Jan 20 2013, 03:51 AM:name=Vitdom)--><div class='quotetop'>QUOTE (Vitdom @ Jan 20 2013, 03:51 AM) <a href="index.php?act=findpost&pid=2063530"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I don't know. The developers have designed their own version of Lua. All I know is that it is not pre-compiled in any way.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Well there's the problem. Compiled code performs far better than interpreted code or code that is compiled from an intermediate language at runtime. I don't see why they don't have a Lua to C translator and compile the code using the same compiler they're using for the rendering engine. Of course I don't know the architecture so the devs may have a good reason for it.
  • ClonesaClonesa Join Date: 2012-02-05 Member: 143691Members
    edited January 2013
    LUA is a scripting language like JavaScript and is not pre-compiled (well not in this case at least). Much more than the game logic for NS2 is in LUA, but the actual engine state handling logic, which is one of the reasons its slower than cryengine. The other is that cryengine is made by a huge team of professionals. This is an indie project.

    A low poly pack/ low res texture pack will not help your perf. issues.
  • WombatLOLWombatLOL Join Date: 2011-11-30 Member: 136042Members, Reinforced - Shadow
    I have no issues with the game no more since I've upgraded to a new CPU.

    Used to have an e8400 core 2 duo with 4gb ddr2 ram, now I have an i5 3570k with 8gb ram, MASSIVE improvement and the game runs silky smooth.
  • SehzadeSehzade Join Date: 2010-12-29 Member: 76024Members
    ^ I'd do that, too.
    But my PC is old enough that, if I upgraded one part I would need to upgrade all of it.

    new cpu -> new motherboard -> new RAM (due to tickrate) -> new graphics card (because why even bother to upgrade when you still have an ancient gpu as massive bottleneck)

    and as it seems you upgraded more than the CPU, too.
  • SixtyWattManSixtyWattMan Join Date: 2004-09-05 Member: 31404Members
    <!--quoteo(post=2063203:date=Jan 19 2013, 01:05 PM:name=lame-o)--><div class='quotetop'>QUOTE (lame-o @ Jan 19 2013, 01:05 PM) <a href="index.php?act=findpost&pid=2063203"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->2.0ghz quadcore CPU,
    4650 HD Radeon 2gb vram,
    4gb ram

    It's a pretty old comp, but I don't see how my specs are relevant since I can play modern games, and I should ideally be able to play NS2 very smoothly.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Barely past minimum requirements.
  • xen32xen32 Join Date: 2012-10-18 Member: 162676Members, Reinforced - Supporter
    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->A low poly pack/ low res texture pack will not help your perf. issues.<!--QuoteEnd--></div><!--QuoteEEnd-->

    So it's not those polys added by crags and cysts, but rather logic every crag and cyst create, right?
  • Know painKnow pain Join Date: 2012-09-04 Member: 157674Members
    Please don’t optimize the game and just finish it. Add in whatever is already missing from the game i.e. upgrades and player add-ons, then optimize it.
  • senatesenate Join Date: 2010-11-19 Member: 75023Members
    even worse if you've taken the AMD path. I have an overclocked phenom 2 x4 965 @ 3.8, and I find the fps to be better than in beta but still low enough to affect gameplay and reduce fun. My only upgrade option is Intel which is only worthwhile for this game. Guess I have to wait for AMD to get it's shiz together (FX lol).
  • YMICrazyYMICrazy Join Date: 2012-11-02 Member: 165986Members
    Idk I've lost all hope for AMD cpus. At least for now. And Haswell is coming in June for Intel I think. So that should make things more difficult for AMD.
  • SixtyWattManSixtyWattMan Join Date: 2004-09-05 Member: 31404Members
    <!--quoteo(post=2063654:date=Jan 20 2013, 08:48 AM:name=senate)--><div class='quotetop'>QUOTE (senate @ Jan 20 2013, 08:48 AM) <a href="index.php?act=findpost&pid=2063654"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->even worse if you've taken the AMD path. I have an overclocked phenom 2 x4 965 @ 3.8, and I find the fps to be better than in beta but still low enough to affect gameplay and reduce fun. My only upgrade option is Intel which is only worthwhile for this game. Guess I have to wait for AMD to get it's shiz together (FX lol).<!--QuoteEnd--></div><!--QuoteEEnd-->

    Intel upgrade is worthwhile for everything. You really have no clue how much faster it is.
  • MaximumSquidMaximumSquid Join Date: 2010-07-20 Member: 72593Members
    One of the better commanders I know gets around 7 frames in game. . .

    Probably why he commands so much =/
  • JAMESEARLJONOSJAMESEARLJONOS Join Date: 2012-12-15 Member: 175155Members
    Most of the bad performance can be blamed on how much useless extra crap is in every map and how it's forced to be rendered. That and poorly coded infestation.


    If you've played on any of the NS2 Classic maps that people have made, maps which are very barebones with no set dressing (but still completely functional), you'll notice that the FPS you get is often more than double what you get on the stock maps.

    No clue if it'll get finished, but a pet project of me and a few other people right now is going through the stock maps and deleting as much as possible without changing the gameplay. Every room has <b>tons</b> of extra objects in it that have little to no effect on the actual gameplay. For reference on what I'm talking about when it comes to extra objects, stuff like this in Transit on Refinery:

    <img src="https://dl.dropbox.com/u/62698906/uselesspiece.jpg" border="0" class="linked-image" />

    versus it when removed:

    <img src="https://dl.dropbox.com/u/62698906/withoutuseless.jpg" border="0" class="linked-image" />

    Every map put out by UWE has tons of extra objects like that which every person is stuck rendering. It's just really poor design that sacrifices performance for bland visual appeal.
  • SquishpokePOOPFACESquishpokePOOPFACE -21,248 posts (ignore below) Join Date: 2012-10-31 Member: 165262Members, Reinforced - Shadow
  • CrushaKCrushaK Join Date: 2012-11-05 Member: 167195Members, NS2 Playtester
    <!--quoteo(post=2063947:date=Jan 21 2013, 12:19 AM:name=JAMESEARLJONOS)--><div class='quotetop'>QUOTE (JAMESEARLJONOS @ Jan 21 2013, 12:19 AM) <a href="index.php?act=findpost&pid=2063947"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Most of the bad performance can be blamed on how much useless extra crap is in every map and how it's forced to be rendered. That and poorly coded infestation.


    If you've played on any of the NS2 Classic maps that people have made, maps which are very barebones with no set dressing (but still completely functional), you'll notice that the FPS you get is often more than double what you get on the stock maps.

    No clue if it'll get finished, but a pet project of me and a few other people right now is going through the stock maps and deleting as much as possible without changing the gameplay. Every room has <b>tons</b> of extra objects in it that have little to no effect on the actual gameplay. For reference on what I'm talking about when it comes to extra objects, stuff like this in Transit on Refinery:

    <img src="https://dl.dropbox.com/u/62698906/uselesspiece.jpg" border="0" class="linked-image" />

    versus it when removed:

    <img src="https://dl.dropbox.com/u/62698906/withoutuseless.jpg" border="0" class="linked-image" />

    Every map put out by UWE has tons of extra objects like that which every person is stuck rendering. It's just really poor design that sacrifices performance for bland visual appeal.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Actually would the lack of it be really poor design that sacrifices standards of level design that have been around for more than the last decade for a minor desperate performance gain.

    If the removal of that stuff actually has any noticeable impact on the performance, you rather have to blame the engine than the existence of those assets. Other engines laugh about such things and don't really care a lot these days about how many polygons they have to render. The complexity of shaders and number of different materials on a mesh weigh much more into performance than the bare object and polygon count.
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    <!--quoteo(post=2063942:date=Jan 20 2013, 03:15 PM:name=MaximumSquid)--><div class='quotetop'>QUOTE (MaximumSquid @ Jan 20 2013, 03:15 PM) <a href="index.php?act=findpost&pid=2063942"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->One of the better commanders I know gets around 7 frames in game. . .

    Probably why he commands so much =/<!--QuoteEnd--></div><!--QuoteEEnd-->
    That's because high APM doesn't matter much in NS2, so you can be a good comm with terrible fps.
  • NeokenNeoken Bruges, Belgium Join Date: 2004-03-20 Member: 27447Members, NS2 Playtester, Reinforced - Shadow, WC 2013 - Silver, Subnautica Playtester
    edited January 2013
    <!--quoteo(post=2063947:date=Jan 20 2013, 06:19 PM:name=JAMESEARLJONOS)--><div class='quotetop'>QUOTE (JAMESEARLJONOS @ Jan 20 2013, 06:19 PM) <a href="index.php?act=findpost&pid=2063947"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Most of the bad performance can be blamed on how much useless extra crap is in every map and how it's forced to be rendered. That and poorly coded infestation.


    If you've played on any of the NS2 Classic maps that people have made, maps which are very barebones with no set dressing (but still completely functional), you'll notice that the FPS you get is often more than double what you get on the stock maps.

    No clue if it'll get finished, but a pet project of me and a few other people right now is going through the stock maps and deleting as much as possible without changing the gameplay. Every room has <b>tons</b> of extra objects in it that have little to no effect on the actual gameplay. For reference on what I'm talking about when it comes to extra objects, stuff like this in Transit on Refinery:

    Every map put out by UWE has tons of extra objects like that which every person is stuck rendering. It's just really poor design that sacrifices performance for bland visual appeal.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Why stop there? Get rid of textures, we don't need that useless stuff, and it's affecting performance. Particle effects? Shiny stuff nobody needs, dump it. Hell, just look at the models. So many polygons it's rediculous.
  • IronHorseIronHorse Developer, QA Manager, Technical Support & contributor Join Date: 2010-05-08 Member: 71669Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Subnautica Playtester, Subnautica PT Lead, Pistachionauts
    <!--quoteo(post=2063203:date=Jan 19 2013, 09:05 AM:name=lame-o)--><div class='quotetop'>QUOTE (lame-o @ Jan 19 2013, 09:05 AM) <a href="index.php?act=findpost&pid=2063203"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->It's a pretty old comp, but I don't see how my specs are relevant since I can play modern games,<!--QuoteEnd--></div><!--QuoteEEnd-->
    A) specs are always relevant
    B) "Modern games" are 90% of the time games that are developed for multiple platforms, i.e. hardware that was pre 2004, for the Xbox360.
    So Yea.. your system should be able to run games built for NINE YEAR OLD hardware...
  • AurOn2AurOn2 COOKIES&#33; FREEDOM, AND BISCUITS&#33; Australia Join Date: 2012-01-13 Member: 140224Members, Forum Moderators, NS2 Playtester, Forum staff
    hurr hurr hurr, so true. but even then, the 360 could barely run games built for it to begin with.
  • matsomatso Master of Patches Join Date: 2002-11-05 Member: 7000Members, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Shadow, NS2 Community Developer
    Mmm... the current iteration of the game does not contain any easy optimizations. Those have been done; fps doubled or trippled over the last 6 months before the release. Yea, it was really bad ...

    So while performance will increase a little bit now and then, any major performance increases will require complex and time-consuming re-architecting, and its doubtful that you can make a case for that compared to adding more content/features.

    Do note that because the rendering thread is run in a parallel thread, decreasing the amount of stuff rendered will not normally affect your fps (unless you have a really old graphics card) unless your fps is really high OR you are running around in areas full of models/particles. Usually, the bottleneck is in the game logic part.

    You can use either the "profile" console command to do online profiling, or "p_logall" and the perfanalyzer.py program to do offline profiling.
  • nSidianSidia Join Date: 2012-08-15 Member: 155651Members
    <!--quoteo(post=2063985:date=Jan 20 2013, 05:06 PM:name=matso)--><div class='quotetop'>QUOTE (matso @ Jan 20 2013, 05:06 PM) <a href="index.php?act=findpost&pid=2063985"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Mmm... the current iteration of the game does not contain any easy optimizations. Those have been done; fps doubled or trippled over the last 6 months before the release. Yea, it was really bad ...

    So while performance will increase a little bit now and then, any major performance increases will require complex and time-consuming re-architecting, and its doubtful that you can make a case for that compared to adding more content/features.

    Do note that because the rendering thread is run in a parallel thread, decreasing the amount of stuff rendered will not normally affect your fps (unless you have a really old graphics card) unless your fps is really high OR you are running around in areas full of models/particles. Usually, the bottleneck is in the game logic part.

    You can use either the "profile" console command to do online profiling, or "p_logall" and the perfanalyzer.py program to do offline profiling.<!--QuoteEnd--></div><!--QuoteEEnd-->

    then how come my fps is doubled when i play in a ns2c server?
  • YMICrazyYMICrazy Join Date: 2012-11-02 Member: 165986Members
    edited January 2013
  • OnosFactoryOnosFactory New Zealand Join Date: 2008-07-16 Member: 64637Members
    "then how come my fps is doubled when i play in a ns2c server? "

    Does it have as many dynamic game objects?
  • ResRes Join Date: 2003-08-27 Member: 20245Members
    <!--quoteo(post=2063992:date=Jan 20 2013, 08:18 PM:name=nSidia)--><div class='quotetop'>QUOTE (nSidia @ Jan 20 2013, 08:18 PM) <a href="index.php?act=findpost&pid=2063992"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->then how come my fps is doubled when i play in a ns2c server?<!--QuoteEnd--></div><!--QuoteEEnd-->

    No Cyst/infestation logic. No powernode Logic.
Sign In or Register to comment.