Havok Forum Transcript

From Second Life Wiki
Jump to navigation Jump to search

SLDev Forum Tuesday, 16Oct, 2007

Topic: Havok

Presenter: Andrew Linden


Introduction

Andrew Linden: Today's topic is Havok4 since that is all I've been doing for the last year. I probably won't say anything that hasn't already been said in another channel, but I can answer questions. I've got office hours now that Havok4 is in public preview. The next hours are tonight 16:30 - 17:30 at the Brampton Stage, in case anyone doesn't get their questions answered.

Glenn Linden: Great - thank you for joining us today, Andrew, and thanks all of you for coming. Andrew, what will we find different in Havok4?

Andrew Linden: The main difference is that Havok4 should crash less. There is a mode where the Havok1 physics engine can block for anywhere from a second to 20 minutes. We call it a "deep think"... it doesn't actually crash, but the simulator can't do anything else until it is done. When that happens we eventually kill the simulator with a watchdog signal and it appears to be a crash to everybody inside or near the region. So, the primary thing changing in Havok4 is that "deep thinks" will hopefully be a thing of the past.

The smaller changes... Some features may change subtlely, there are some bugs that have been fixed...and some that required fundamental improvements to the physics engine before we could fix them. The main one that comes to mind is that stacks of dynamic objects should "activate" whenever a supporting member is moved or deleted from the bottom of the stack.

Lessee... what else.... Not many new features; small ones are implicit spheres. Perfect spheres should roll like true spheres instead of faceted geometry, but no new shapes, no new LSL calls or big features like that.

Questions

Glenn Linden: Will Havok 4 require changes to any scripts?

Andrew Linden: Yes probably, but I'm not sure exactly which scripts or how the changes will have to be made. The problem is that some things will be changing in subtle ways and it is possible for scripters to "tune" their scripts to the current quirks of the physics engine. A good example is when using LLSetForce() or whatever that call is. The force required for a particular bit of content may depend strongly on the friction model of the physics engine so the main breakage that will happen in scripts is in those scripts that will have "magic" numbers hard-coded into the script that are not flexible. I hope that the set of scripts that start to misbehave in havok4 is small.

Question about Havok4 and Megaprims... Currently the Havok4 preview still has some anti-megaprim code inside.

Andrew Linden: I still need to pull that out. The plan for megaprims is to make them still partially supported (as broken as they are under Havok1) except... prims with dimensions larger than 256 will be clamped to 256.

Glenn Linden: And as you have seen, there's a blog post asking for input on Megaprims.

Question from Rhianna Arkin: there will be a limit of huge prims per SIM?

Andrew Linden: No, there won't be a prim count limit of megaprims. That is, they'll be treated as regular prims, just like in Havok1.

Question to Andrew: Gene Replacement has suggested making mega prims greater than a certain size forced to phantom, is this worth considering?

Andrew Linden: Same semi-broken support for megaprims with the one caveat I mentioned. I'm not really interested in forcing the phantom bit for large prims. There have been some anecdotal useful uses of large prims for their collision properties. One example that was given to me by someone here at LL was about how someone added a single large prim to turn a large body of water into ice for a winter themed ice skate party. As to handling the theoretical performance problems of megaprims, I've got some ideas. We may need to force objects above a certain size to be "static" and not allow them to go dynamic. If we do that, then there are some optimizations I can make to recover any performance problems they might pose.


Question from Jet Control: How are the collision maps of sculpties to be in Havok 4?

Andrew Linden: That is a biggish project and we won't be working on it until after Havok4 is done. The most important reason to get proper collision shapes for sculpties that I know of is to help solve the "my neighbors objects overlap my parcel" problem. I've got some ideas on how to use the physics engine to do object-parcel collision queries but in order for it to work for sculpties I'll need to have better collision representations for them in the physics engine.


Another mega prim question: Rhianna Arkin: What will happen with the current huge prims more than 256?

Andrew Linden: Megaprims larger than 256 on a side will have their scales clamped to 256 on those sides.


Question: Kim Anubis: These days, if you have a bucket of physical prims, they won't ever settle down and completely stop moving. Will they behave this way with Havok 4?

Andrew Linden: The problem of pile of objects not settling down may still be a problem in Havok4. I haven't investigated that much yet. All the piles I've played with eventually settled down... unless I was using implicit spheres. There is a known bug right now where large implicit spheres roll for a very loooooooong time... maybe forever. If piles don't settle down I may be able to make progress on that problem by tweaking some numbers in the physics engine. I suspect the problem is solvable in Havok4.


Question from Seph Swain: Can you tell us more about the timetable? Can I apply for testing it on my Main Grid Sim?

Andrew Linden: I'm terrible at making time estimates. I'm always too optimistic. But we're getting close now so... a month maybe. As long as we don't have any really bad content bugs, and people can cross from H1 to H4 regions and back again then I'd be inclined to start deploying H4 to some regions early... maybe a sandbox or two in Second Life and eventually start allowing estate owners to opt into Havok4 simulators at their request. Currently there are two known crash bugs that I don't know how to fix. I've opened some support tickets with Havok. Hopefully we'll be able to fix those this week. There are some vehicle bugs that need to be fixed and the runtime collision control system (RCCS) which does object collision level of detail (LOD) needs work at the moment the RCCS might not be smart enough... it causes some objectionable artifacts. However, the RCCS is the primary thing that prevents a Havok4 simulator from suffering too much lag. Havok4 is faster than Havok1, but you can always throw more objects at it until it lags to death. Once you throw enough at Havok4 the RCCS is the only thing that keeps it "usable". Re the "static" vs. "dynamic" megaprim question...


Question from Itazura Radio: What are the implications/limitations of "static" vs. "dynamic" megaprims in how they can/can't be used?

Dynamic objects are managed by Havok4's "simulation island" system. Simulation islands are distinct piles of colliding objects and Havok4 uses the list of simulation islands to rapidly cull collision information each simulation step. So.... A very large prim will tend to bridge all simulation islands into one. As a result, the physics engine will not be able to cull the collisions as efficiently --> lag. Perhaps lag. How much is not known at this stage. I haven't experimented yet. If the megaprims are forced to be "static" then I can shift them into a different category of objects in the Havok4 physics engine. There is support in Havok4 for large objects that never move. The simulation islands don't have to manage them, but things still collide correctly. But... if they are treated this way we don't allow them to suddenly go dynamic at the whim of an LSL script.


Question from SaintSaens Writer: What steps are being taken to ease the problems related to physical movement with linked sculpted prims and Havok 4?

Andrew Linden: What are the problems with physical movement of linked sculpted prims? I need more context for that question.

SaintSaens Writer: One of my developers has a test with a set number of prims, roughly 20, where he changes the position at the click of a button, if the prim is a sculpty, he can crash the sim with lag.

Andrew Linden: Oh? In a Havok4 simulator?

SaintSaens Writer: yes

Andrew Linden: If so, then that is a bug and we'll try to fix it. Er... does the simulator actually crash? Or does it just lag?

SaintSaens Writer: great, there's a bug post on Jira and Dan Linden has the actual test object, I was just curious if you had more information about the issue.

Andrew Linden: If it is a crash bug we're certainly going to try to fix it. If it is lag, we'll also try to fix that.

SaintSaens Writer: in one case it just lagged, another case I believe it crashed, it depended on the nature of the test.

Andrew Linden: Not all bugs will block a release of the Havok4 project onto Second Life proper but the really bad ones will block the release.

SaintSaens Writer: but by lag I mean, time dilation dropped to 0.2. It's currently in the Issue Tracker, I was just curious if this was something that had come up internally.


Question: Andrew, what's the best way to report problems with Havok4 - via Issue Tracker?

Andrew Linden: The best way to report Havok4 problems is to file bugs or comment in existing bugs at jira.secondlife.com. I've been browsing the list and fixing the bugs that people have found. One problem with jira.secondlife.com is that there is a little bit of a learning curve. There are multiples of categories under which you can file a bug and if you file a Havok4 bug as a "viewer bug" or a "web bug" it may get overlooked for a little while. Also, the list of bugs can get big, and anyone who doesn't take the time to examine the current list of bugs may enter duplicates. However, the system is working pretty well, and that is the recommended way to file a Havok4 bug, and many other sorts of bugs. I expect the LL developer interaction with jira.secondlife.com to increase. It may eventually become the primary list of known problems. At the moment we have an internal jira.lindenlab.com system but if we were to move things to jira.secondlife.com then many things would be more transparent and we definitely want to move in that direction. There are internal discussions going on about it right now.


Question from Kim Anubis: I was also wondering if you have noticed any remarkable changes to the behavior of vehicles?

Andrew Linden: Kim could you elaborate on that? I wouldn't be surprised to find some vehicles significantly changed.

Kim Anubis: Well, I have a book coming out in about a week, and one chapter focuses on an airplane script -- based on your basic airplane script, in fact

Andrew Linden: Supporting vehicles as they were has been very difficult, and I don't think I've completely succeeded. I might not be able to succeed 100%

Kim Anubis: I was wondering if it'll still fly once your Havok 4 deployment is all debugged and ready to roll out in the main grid, especially for vehicles that move along the ground.

Andrew Linden: My hope is that airplanes will not be changed at all in the initial release of Havok4

Kim Anubis: whew

Andrew Linden: I've got some ideas on how to make better airplanes using some simple lift/drag/stall-speed models, but that is a new feature and is months away I'm sure. We certainly are not changing the LSL interface to vehicles in the short term. I'm just working to make the old vehicles work as good or better than they did before.


Question from Jet Control: How are the "friction" and/or "collision" properties of prim "materials" (glass, rubber, wood etc.) affected?

Andrew Linden: The friction effect in Havok4 is a bit different than Havok1. As it turns out... friction in Havok1 is probably "more correct" than Havok4. That is, a bit more like true friction. This has been the main problem with keeping ground vehicles moving along the terrain and roads in Havok4. But... I tried to make the friction and collision properties of the various materials equivalent to their behavior in Havok1. So my hope is that nothing has changed. If anything is drastically different then it should be filed as a bug. Currently I don't know of any such bugs. But I'm a little behind in browsing the list this week.


Question from Timeless Prototype: Will I be able to send a test vehicle for use in testing?

Andrew Linden: Yes, if you have any broken content you can send it to me, preferably in the Havok4 Preview so it shows up in my inventory there. It is better if you can post an example script in the public bug list, or provide some other simple recipe for reproducing the bug. That way, other developers beside myself can also work on it.


Question from Count Bayliss: Will Havok 4 help with sim crossings at all?

Andrew Linden: No, initially Havok4 will not change region crossings. That is... it isn't a problem with the physics engine, so much as a problem with serialization/deserialization of the objects as they cross the boundary. Region crossing is distinct from Havok4 and will be it own project when it comes to fixing it. Improving region crossings is an important project, and we may very well start it very soon after Havok4 is done. That is, I might be working on it. Not sure yet.


Question from crucial Armitage: I don't work for Sun but I was just at the last CEC Sun Microsystems convention last week in Vegas and they announced there latest Sun servers at the convention and from the looks of it and the specs of the servers, one of these Sun Microsystems servers can run many regions in SL at the same time--is this something that could help?

Andrew Linden: No, I don't imagine we would use Sun servers. At the moment we build on inexpensive off the shelf hardware. We call it "bronze plated hardware". Sun sells silver or gold plated hardware... very expensive. I doubt the cost/performance ratio is right for using Sun. That said, I'm sure Ian Linden and some of the other Ops people could supply a better opinion than me on that.

Crucial Armitage: http://www.sun.com/servers/coolthreads/t5220/specs.xml - that’s the new server if any one wants to see it


Glenn Linden: We're near the end of our time today - any last questions for Andrew?

Question from Rhianna Arkin: When Windows Vista will support second life? Is it more end of 2007 or summer 2008?

Crucial Armitage: just a thought I am in no way a tech expert *~~smiles~~* We don't yet have Vista support for SL?

Seph Swain: I'm using SL on Vista for half a year now.

Andrew Linden: We have a couple of developers who are currently using Vista on their dev machines. That question is somewhat related to Havok4 it turns out... one of the things we'll be able to do once Havok4 is merged into the main codebase is to migrate to Visual Studio 2005 or whatever the latest version is, which many of our developers and the open source community is looking forward to. At the moment we're stuck on Visual Studio 2003 because Havok1 libs development is not available for 2005. Upgrading Visusal Studio will help our own developers migrate to Vista, I suspect.

Andrew Linden: An interesting thing about sim crashes under Havok4... under Haovk1 we had reached a state of apathy about solving sim crashes since we couldn't solve the deep think problem but now under Havok4, as soon as we find a new distinct crash mode we're very motivated to fix it. So even if Havok4 goes out with some crash modes... I'm pretty sure we'll be able to fix them faster.

Seph Swain: I'll take your word :)

Andrew Linden: Yes, well when you've got 100 deep think crashes and you know you can't fix them... you're less motivated to search the pile for the 101st crash that wasn't a deep think. Just an interesting thing I noticed about "developer motivation" while working on this project. Well, I had fun answering all of your questions.

Seph Swain: Yes, thanks! We're really looking forward to less sim crashes.

Andrew Linden: As I mentioned, I also hold office hours Tuesdays 16:30 - 17:30 if you have any more questions.

Glenn Linden: Andrew, thank you very much for joining us today and for sharing your knowledge of Havok.

Andrew Linden: Ok, see you all later.