Thread: testnpc
View Single Post
  #12  
Old 01-18-2006, 04:45 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Yen
Sorry, I'm being retarded. I totally forgot that return stops the block. x-x
I did it anyway tho.
So... yea, having trouble even with adding conditionals. although they're definitely not as reliable.

UGH... Just one giant optimization problem that seems to have no ends. Classic's most popular level, standing, loads 160 NPCs. I haven't counted how many have a setshape (probably a majority of them). Changing the conditions is the only thing that makes it lag less, yet, you the only truly reliable conditions I can come up with are: npcs.size > 0, npcs[i].width>0 && npcs[i].height>0.

It is a LOT easier to optimize the players check, since they have a constant width and height.

Okay, list of problems with not having a built-in onNPC() function so far.
1. To limit the range of checking for NPCs (the most obvious means of optimizing) means to limit the size of setshapes. (Which I'm trying anyway)
2. Can't check to see if an NPC uses dontblock(). Would have to add to every NPC that has dontblock() a variable this.dontblock=1; or blockagain(); this.dontblock=0;

Last edited by jake13jake; 01-18-2006 at 05:53 AM..
Reply With Quote