Jump to content


Ideal trace time


  • You cannot reply to this topic
2 replies to this topic

#1 917

    New Member

  • Members
  • Pip
  • 3 posts

Posted 10 April 2006 - 11:46 AM

Tracing 1000 lines with the length of 16384 with the quake3 map q3dm7sample through my bsp tree takes anywhere from just 170milliseconds to 2500 milliseconds. Meaning anywhere from 0.17milliseconds to 2.5milliseconds per line trace. Average trace time is somewhere around 0.3 milliseconds. Fast enough?

#2 Wernaeh

    Senior Member

  • Members
  • PipPipPipPip
  • 368 posts

Posted 10 April 2006 - 12:16 PM

Depends on several factors.

a) How does the size you gave relate to the size of the map, and how large is the map (polys, etc)? Tracing a line through an entire map with thousands of polys slightly differs from tracing a line which entirely is on one side of a cube.

b) How balanced is your bsp tree ? More balanced trees tend to give less deviation in trace times.

c) How often do you trace, and how much time do you want to invest on optimizing? Doing realtime radiosity with simple line tracing obviously has higher requirements here than just checking for line-of-fire once now and then.

Apart from that, another model would be: 60 (logic) fps on your computer => 1 / 60 seconds per frame = around 17 ms. Assuming you need to do just 10 traces each frame (such as from a shotgun blast), you spend 3ms (a little more than 15%) of your entire frame time for doing hit tests.

Cheers,
- Wernaeh

#3 917

    New Member

  • Members
  • Pip
  • 3 posts

Posted 10 April 2006 - 03:04 PM

a: A whole level, like I said q3dm7
b: I have tried to balance the tree, but it did not make much of a difference
c: Traces will be used for things like line of sight for enemies, and of course for firing guns.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users