Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-09-2006, 04:16 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
findareaplayers(x,y,w,h)?

I feel this would be quite useful in optimization of many NPCs (damage, checking the visible field on the playing screen for displaying stats of players, etc). A little bit more useful than findnearestplayers(x,y) I think.
Reply With Quote
  #2  
Old 03-10-2006, 03:40 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
Hmm yea, still finding a lot of places this would help optimize a lot. Nick name system, movement system (especially), ratings system. If findareanpcs reduces lag to like 4% from 30%... I would think that findareaplayers would reduce lag from 4% to like <=1%
Reply With Quote
  #3  
Old 03-10-2006, 03:47 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
you can use findnearestplayers(x,y)
Reply With Quote
  #4  
Old 03-10-2006, 02:27 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
uhm cant u script this yourself?
__________________
Reply With Quote
  #5  
Old 03-10-2006, 08:45 PM
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 Warcaptain
you can use findnearestplayers(x,y)
Not clientside.

Quote:
Originally Posted by projectigi
uhm cant u script this yourself?
Yes, but it wouldn't be nearly as efficient. It would be more efficient to script this yourself if you had findnearestplayers(x,y) clientside. It would be even more efficient if there were a findareaplayers(x,y,w,h). The reason these types of functions exist would be to reduce the lag of cycling through all the players in the array. It's a lot more evident that this would be needed for NPCs, but if you're drawing a lot of info around a lot of objects which include players (esp. on a GMAP), it would be more efficient to use something like findareanpcs(x,y,w,h). Players have a much smaller impact (that's why this function doesn't exist yet), but still have an impact if there are a lot of scripts looking through all of them.
Reply With Quote
  #6  
Old 03-11-2006, 03:15 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
The actual programmed version of it probably wouldn't be any more efficient than a scripted version. Either way, it's only doing simple checks.

PHP Code:
function findAreaPlayers(txtytwth) {
  for(
temp.plplayers) {
    if(
temp.pl.x in |tx,tx+tw| && temp.pl.y in |ty,ty+th|) {
      
temp.plarray.add(temp.pl);
    }
  }

  return 
temp.plarray;

or something like that.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #7  
Old 03-11-2006, 03:34 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 ApothiX
The actual programmed version of it probably wouldn't be any more efficient than a scripted version. Either way, it's only doing simple checks.

PHP Code:
function findAreaPlayers(txtytwth) {
  for(
temp.plplayers) {
    if(
temp.pl.x in |tx,tx+tw| && temp.pl.y in |ty,ty+th|) {
      
temp.plarray.add(temp.pl);
    }
  }

  return 
temp.plarray;

or something like that.
Yes... I know.... You're making me repeat myself? The reason I'm suggesting this is the LAG factor.

Quote:
Originally Posted by jake13jake
Yes, but it wouldn't be nearly as efficient. It would be more efficient to script this yourself if you had findnearestplayers(x,y) clientside. It would be even more efficient if there were a findareaplayers(x,y,w,h). The reason these types of functions exist would be to reduce the lag of cycling through all the players in the array. It's a lot more evident that this would be needed for NPCs, but if you're drawing a lot of info around a lot of objects which include players (esp. on a GMAP), it would be more efficient to use something like findareanpcs(x,y,w,h). Players have a much smaller impact (that's why this function doesn't exist yet), but still have an impact if there are a lot of scripts looking through all of them.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.