Alright so I've got a vague idea on how to do this.. well actually I've got a working idea, and had used this for quite some time but lately I've come to realize and understand that this is not efficient whatsoever.
Basically the goal is when a client is around either 1. clients of the same race as them or 2. "blood" objects on the floor (vampiric race), their stats get a boost the longer they are around them until they reach a 'max' point. IE: Double their base stat.
So, what I did was create this Regeneration proc which handles all background processes like slowly regenerating stamina, vitality, magic, etc. Lots of little things that make it a very large proc, but aside from these two checks I mentioned in the above paragraph, its all binary checks, and then adding some numbers or subtracting numbers if it comes out either true or false depending on the circumstance. Nothing too daunting or difficult to handle.
But, what I did for these checks I'm concerned about is use the for proc which loops through all the blood objects or mobs in their view(depending on their race, so that only the mobs who need this check go through it).
The problem is that.. this Regeneration proc repeats every 10 ticks. So.. I can't think of another way to do it but it adds a lot of stress on this whole proc (according to the World Profile when I've got 25 players combined for both races at any given time). Is this just something that has to be dealt with? Or.. is there something I might be able to do that could recreate the effect I'm going for?
One more thing, as far as On-Screen HUD objects go, is there an efficient way to do those rather than looping through it every second? I mean I just recently changed it where I now have a tmp var that holds the previous number of the health or stamina vars, and I loop through and check to see if those numbers match up. If they don't THEN I loop through the objects and update the icon states so they only have to go through that when its necessary.
It helped quite a bit, as I expected, but is there a better way? No I don't want to go to skin based huds because On Screen HUD is so much prettier and more dynamic. I like having my beautiful and well designed HUD made in photoshop. Bars made on BYOND just don't give off a good vibe.
All honest and thorough answers are appreciated.
Thanks in advance,
Jake
ID:155647
![]() Apr 25 2011, 1:14 pm
|
|