Re: [hlcoders] entities in sphere
Oliver wrote: -- [ Picked text/plain from multipart/alternative ] Thanks for the good suggestions. We are only interested in two types of entities. Is there a way to create a mask that filters out everything except for entities that are class X or class Y? You could have these entities add themselves to a global linked list when they are created and remove themselves when they are destroyed. Then just loop through your linked list and do the distance calculation yourself instead of having the engine iterate through all entities. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] entities in sphere
-- [ Picked text/plain from multipart/alternative ] Ah great idea, I'll give that a shot. Thanks. On 7/25/07, Jeffrey botman Broome [EMAIL PROTECTED] wrote: Oliver wrote: -- [ Picked text/plain from multipart/alternative ] Thanks for the good suggestions. We are only interested in two types of entities. Is there a way to create a mask that filters out everything except for entities that are class X or class Y? You could have these entities add themselves to a global linked list when they are created and remove themselves when they are destroyed. Then just loop through your linked list and do the distance calculation yourself instead of having the engine iterate through all entities. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] entities in sphere
-- [ Picked text/plain from multipart/alternative ] Thanks for the good suggestions. We are only interested in two types of entities. Is there a way to create a mask that filters out everything except for entities that are class X or class Y? On 7/23/07, Richard Hough [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] Personally I prefer using CEntitySphereQuery instead of UTIL_EntitiesInSphere. It's essentially just a wrapper for the UTIL call, but it makes iterating through the list a little cleaner. I don't know if there's a faster way than either of these two methods, but remember that you can put in a flagmask when issuing the calls. With the correct mask you can limit what is touched by the call and reduce its resource utilization. Botman is right though, moving to a timer interval would probably be the best option. -Richard Brackhar Hough On 7/23/07, Jeffrey botman Broome [EMAIL PROTECTED] wrote: Oliver wrote: -- [ Picked text/plain from multipart/alternative ] CONTEXT: In our mod, users create event-driven worlds. Events exist such as InRadius15 (i.e. for object O, when any object is in 15 units, the InRadius15 event is triggered). PROBLEM: The code to hook these events is not as optimized as we would prefer. On maps where a large number of objects have code for their InRadiusXX events, there is a noticeable 'chug' effect with each think tick. QUESTION: Is UTIL_EntitiesInSphere(...) the quickest way to get a list of entities within a particular radius of a vector? Rather than doing the UTIL_EntitiesInSphere() check every Think tick, you could create a timer interval so that you only do this check every so often (every 0.1 seconds or every 0.5 seconds, etc.). Doing the UTIL_EntitiesInSphere() check every tick would cause the engine to have to interate through all entities every tick. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] entities in sphere
-- [ Picked text/plain from multipart/alternative ] yeah, you can create a filter for sphere query. On 7/24/07, Oliver [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] Thanks for the good suggestions. We are only interested in two types of entities. Is there a way to create a mask that filters out everything except for entities that are class X or class Y? On 7/23/07, Richard Hough [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] Personally I prefer using CEntitySphereQuery instead of UTIL_EntitiesInSphere. It's essentially just a wrapper for the UTIL call, but it makes iterating through the list a little cleaner. I don't know if there's a faster way than either of these two methods, but remember that you can put in a flagmask when issuing the calls. With the correct mask you can limit what is touched by the call and reduce its resource utilization. Botman is right though, moving to a timer interval would probably be the best option. -Richard Brackhar Hough On 7/23/07, Jeffrey botman Broome [EMAIL PROTECTED] wrote: Oliver wrote: -- [ Picked text/plain from multipart/alternative ] CONTEXT: In our mod, users create event-driven worlds. Events exist such as InRadius15 (i.e. for object O, when any object is in 15 units, the InRadius15 event is triggered). PROBLEM: The code to hook these events is not as optimized as we would prefer. On maps where a large number of objects have code for their InRadiusXX events, there is a noticeable 'chug' effect with each think tick. QUESTION: Is UTIL_EntitiesInSphere(...) the quickest way to get a list of entities within a particular radius of a vector? Rather than doing the UTIL_EntitiesInSphere() check every Think tick, you could create a timer interval so that you only do this check every so often (every 0.1 seconds or every 0.5 seconds, etc.). Doing the UTIL_EntitiesInSphere() check every tick would cause the engine to have to interate through all entities every tick. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- -omega -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] entities in sphere
-- [ Picked text/plain from multipart/alternative ] OK, any tips on how to do that Tony? Thanks! On 7/24/07, Tony omega Sergi [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] yeah, you can create a filter for sphere query. On 7/24/07, Oliver [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] Thanks for the good suggestions. We are only interested in two types of entities. Is there a way to create a mask that filters out everything except for entities that are class X or class Y? On 7/23/07, Richard Hough [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] Personally I prefer using CEntitySphereQuery instead of UTIL_EntitiesInSphere. It's essentially just a wrapper for the UTIL call, but it makes iterating through the list a little cleaner. I don't know if there's a faster way than either of these two methods, but remember that you can put in a flagmask when issuing the calls. With the correct mask you can limit what is touched by the call and reduce its resource utilization. Botman is right though, moving to a timer interval would probably be the best option. -Richard Brackhar Hough On 7/23/07, Jeffrey botman Broome [EMAIL PROTECTED] wrote: Oliver wrote: -- [ Picked text/plain from multipart/alternative ] CONTEXT: In our mod, users create event-driven worlds. Events exist such as InRadius15 (i.e. for object O, when any object is in 15 units, the InRadius15 event is triggered). PROBLEM: The code to hook these events is not as optimized as we would prefer. On maps where a large number of objects have code for their InRadiusXX events, there is a noticeable 'chug' effect with each think tick. QUESTION: Is UTIL_EntitiesInSphere(...) the quickest way to get a list of entities within a particular radius of a vector? Rather than doing the UTIL_EntitiesInSphere() check every Think tick, you could create a timer interval so that you only do this check every so often (every 0.1 seconds or every 0.5 seconds, etc.). Doing the UTIL_EntitiesInSphere() check every tick would cause the engine to have to interate through all entities every tick. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- -omega -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] entities in sphere
-- [ Picked text/plain from multipart/alternative ] CONTEXT: In our mod, users create event-driven worlds. Events exist such as InRadius15 (i.e. for object O, when any object is in 15 units, the InRadius15 event is triggered). PROBLEM: The code to hook these events is not as optimized as we would prefer. On maps where a large number of objects have code for their InRadiusXX events, there is a noticeable 'chug' effect with each think tick. QUESTION: Is UTIL_EntitiesInSphere(...) the quickest way to get a list of entities within a particular radius of a vector? -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] entities in sphere
Oliver wrote: -- [ Picked text/plain from multipart/alternative ] CONTEXT: In our mod, users create event-driven worlds. Events exist such as InRadius15 (i.e. for object O, when any object is in 15 units, the InRadius15 event is triggered). PROBLEM: The code to hook these events is not as optimized as we would prefer. On maps where a large number of objects have code for their InRadiusXX events, there is a noticeable 'chug' effect with each think tick. QUESTION: Is UTIL_EntitiesInSphere(...) the quickest way to get a list of entities within a particular radius of a vector? Rather than doing the UTIL_EntitiesInSphere() check every Think tick, you could create a timer interval so that you only do this check every so often (every 0.1 seconds or every 0.5 seconds, etc.). Doing the UTIL_EntitiesInSphere() check every tick would cause the engine to have to interate through all entities every tick. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] entities in sphere
-- [ Picked text/plain from multipart/alternative ] Personally I prefer using CEntitySphereQuery instead of UTIL_EntitiesInSphere. It's essentially just a wrapper for the UTIL call, but it makes iterating through the list a little cleaner. I don't know if there's a faster way than either of these two methods, but remember that you can put in a flagmask when issuing the calls. With the correct mask you can limit what is touched by the call and reduce its resource utilization. Botman is right though, moving to a timer interval would probably be the best option. -Richard Brackhar Hough On 7/23/07, Jeffrey botman Broome [EMAIL PROTECTED] wrote: Oliver wrote: -- [ Picked text/plain from multipart/alternative ] CONTEXT: In our mod, users create event-driven worlds. Events exist such as InRadius15 (i.e. for object O, when any object is in 15 units, the InRadius15 event is triggered). PROBLEM: The code to hook these events is not as optimized as we would prefer. On maps where a large number of objects have code for their InRadiusXX events, there is a noticeable 'chug' effect with each think tick. QUESTION: Is UTIL_EntitiesInSphere(...) the quickest way to get a list of entities within a particular radius of a vector? Rather than doing the UTIL_EntitiesInSphere() check every Think tick, you could create a timer interval so that you only do this check every so often (every 0.1 seconds or every 0.5 seconds, etc.). Doing the UTIL_EntitiesInSphere() check every tick would cause the engine to have to interate through all entities every tick. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders