Author Topic: Hi Guys  (Read 4037 times)

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Hi Guys
« on: August 10, 2009, 08:53:50 AM »
Whoa time flies,
I have been off gallivanting around with my new gf and sorting out my new house etc, I can’t believe I last stopped by like 10 months ago, only seems like a few weeks.

Anyway stuff around here has been returning to normal lately and I have been feeling an increasing urge to get back into some hobbyist programming projects and thought of you guys    

I wouldn’t mind getting back on the project if you guys will have me.  
I took a look at the source in the repository and it looks like you have been making some good progress.

I think I saw a todo list around somewhere, is it still just bite off a chunk and start chewing?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Hi Guys
« Reply #1 on: August 10, 2009, 12:46:36 PM »
Hey, great to have you back around.  I know what being busy is like   I'm currently sorting through a recent move as well, so I can relate.

I actually have a rather "easy" (in that it impacts existing code very little) task I've been trying to get to but keep putting off.  I've been doing a lot of research into physics and constraints the last few months.  Specifically solvers.  I'm in the process of working out on paper a constraint solver that might be able to globally solve constraints in linear time, which would actually be sort of a breakthrough (if any of this sounds interesting I'll point you (or anyone who's interested) to my sources and scribblings on the matter).  But I need some reference implementations of the usual methods to compare against.

Basically you can express the system with an nxn matrix (where n is the number of constraints).  There are at least two current implementations for solving that matrix.  The first is to iterate along the diagonals of the matrix and treat any non diagonal element as 0.  Given a large enough number of iterations, this method will converge to the right solution.  I believe this is called Gauss-Seidel (though I could be wrong about that).  So the first task might be to figure out what to call it   It's basically the method people use in most engines.  You basically take each constraint (collision) in isolation and solve it, then iterate like this for a while.  It generally converges pretty quick but there are some times where it won't and it can cause jitters.

The second method is called Cholesky Decomposition.  It's a cubic time solver which takes special advantage of the fact that the matrix is symmetric and positive definite.  You can find information about it here (scroll down to section 2.9).  There's a sample implementation of how to decompose it and then solve from that decomposition.

There's already an existing LU decomposer and solver in the Azimuth math library in the repository.  So what I basically need is for someone to take that as a reference and implement these other two methods for solving the system.  Not sure how appetizing the math is, so if it sounds like a huge pain in the ass there are plenty of other things needing doing too

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Hi Guys
« Reply #2 on: August 11, 2009, 08:36:17 AM »
Reading though that seems like quite heavy stuff, and I haven't done much with matrix calculus in a while. I normally work with business software; it might take a bit to get my head back around it.

I wouldn't mind coming back to these types of problems at some point, but I think I would be best off starting on something else for now. Some general C# stitching work, GDI/XNA drawing, network sockets etc.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Hi Guys
« Reply #3 on: August 11, 2009, 09:27:16 AM »
You might have to bear with me on this one, the last time I did collision detection it was using a quad tree of AABBs for broad phase and then a direct narrow phase iteration though the vertexes of the corresponding OOBB checking to see if the ray from the old position to the new one intersected the other OOBB. (Using an external math library to do the transformations). Then I just calculated the penetration depth, moved the object upto the impact point and added a calculated opposing force to each object's velocity and rotation, which yes can get objects horribly stuck and just jitter about until they get deactivated.

Globally solving all constraints in linear time certainly sounds an attractive proposition if not a bit outside my current understanding. But would be great consideing most of the objects would be in motion most of the time.
« Last Edit: August 11, 2009, 11:28:23 AM by Cyberduke »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Hi Guys
« Reply #4 on: August 11, 2009, 12:39:22 PM »
Ha, that's most people's response when I ask them to work on linear algebra stuff

Actually, though, the algorithms aren't too hard.  It's basically manipulating the nxn matrix as if it were a large 2D array.  But yeah, feel free to pick something else to work on.  If you want to play around with GUI stuff, there are some custom widgets I'd like built.  Basically I ended up building them at my last work.  The one I'm thinking of at the moment is basically a slider and a text box combined.  You can use the slider to move inside a "suggested" range of values.  If you enter in a number in the text box that's too large for the slider, the slider gets disabled and the value in the textbox stays.  If you right click on the slider, it reenables it (or maybe pops up a context window, depending on what makes more sense).  The textbox should be built from another custom widget which is basically a regular textbox but with a regex filter on it so it only accepts inputs of a valid type (ie: if it's a floating point slider, it only accepts key presses that create a valid floating point number.  So -556.235 would work, -556.23-5 would not.)

You'd probably add it to the UI.Controls project.  And you should also set up a unit testing sub project for it (I can help with that, it involves a bit of project file magic to get all the stuff going in the right places).  You want to make sure it's thoroughly tested because there are literally dozens of gotchas that can ruin user experience (things like the cursor in the text box jumping to the beginning of the text if you enter a wrong digit, etc.)  It's not a very glamorous job, though, so if that's not your cup of tea either I can poke around for some other tasks, too

I'm not quite ready to play with networking just yet, but the other thing you might be interested in is graphics.  I still need to flesh out how the XNA graphics module will work, which will drive the interface for the GDI module (the two'll be interchangable at run time), so I'd either need to get off my butt and finish that or if you have some graphics card knowledge of how things work under the hood you could take a stab at it (it's easier to bang on GDI to make it work like XNA than the other way around).  It's quite different from how GDI works, I must warn.  Plus there are some shaders involved, so it's not for the faint of heart.  Or Hell, you could take a look at what I have so far and take a stab at it on the interface side at least.  At first it was going to be a pretty flimsy wrapper, but it's sort of becoming a full featured graphics library just minus rendering stuff.  So basically it handles things like hierarchies of shapes (for things like organs) and scene graphs (so you only render what's visible).  I'm literally walking in the dark as far as interface, so another set of eyes would be useful.

If you go to chat.darwinbots.com, it's a HTML chat room I set up for developers.  It's pretty dead at the moment but I'll make a point of staying online.  That way I can give you timely help if you get any problems setting things up.
« Last Edit: August 11, 2009, 12:44:31 PM by Numsgil »

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Hi Guys
« Reply #5 on: August 11, 2009, 01:47:21 PM »
Ok, great the regex validity checking slider input thingy seems simple enough to start with.
I have written large scale GDI driven components before to the extent of making a sort of interactive visio floor planner.  And I have tried making GUIs from scratch before so that all that sounds right up my street.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Hi Guys
« Reply #6 on: August 11, 2009, 02:19:25 PM »
Ok good   You shouldn't have any trouble syncing with source, but if you do let me know.  I can probably write up a wiki page on how to create a new unit testing project.  It isn't too hard but it does involve a few steps.  The other widget we might need is a color picker.  Basically the one that comes in .NET has some problems that may or may not matter (for one thing it's a form instead of a control so you can't embed it).

Plus as long as you're poking in the source for the controls, take a look at the viewport and see if you can see a cleaner way of doing it.  There were a lot of subtle problems, and I didn't unit test it (a mistake on my part to be sure), so the whole thing works really well but the code isn't all that great.

And again, feel free to join the developer chat if you have any problems setting things up.  It's at chat.darwinbots.com, and should work with any browser.