Author Topic: Helping  (Read 14916 times)

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Helping
« Reply #15 on: April 16, 2013, 03:43:43 PM »
It is complicated :)
It all seems complicated to me.. :mellow:
Oh my god, who the hell cares.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping
« Reply #16 on: April 16, 2013, 04:40:18 PM »
It is not that bad if you grind calculus all your life.

Offline rwill128

  • Bot Builder
  • **
  • Posts: 67
    • View Profile
Re: Helping
« Reply #17 on: April 17, 2013, 10:26:40 AM »
Haha, I've been in the planes of the Liberal Arts majors for the last few years, grinding rhetoric and critical theory.

Working on getting my stats up in calculus this whole week, but even the trash mobs sometimes force a tactical retreat.

EDIT: Looks like I was just jumping in too deep. The dense linear algebra code is making a lot of sense. Should be able to make some actual contributions within a week or two. Thanks for your patience and willingness to shove all this information my way.
« Last Edit: April 17, 2013, 12:08:34 PM by rwill128 »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping
« Reply #18 on: April 17, 2013, 02:24:43 PM »
(I was not trying to be sarcastic)

I have been grinding basic binomials since I was 7 years old, learned the quadratic equation was I was 8.

Funny how the mind works, never really figured out calculus.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Helping
« Reply #19 on: April 17, 2013, 03:27:36 PM »
I have been grinding basic binomials since I was 7 years old, learned the quadratic equation was I was 8.
I think I was just learning multiplication tables at that age...
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #20 on: April 17, 2013, 11:31:54 PM »
Haha, I've been in the planes of the Liberal Arts majors for the last few years, grinding rhetoric and critical theory.

Working on getting my stats up in calculus this whole week, but even the trash mobs sometimes force a tactical retreat.

EDIT: Looks like I was just jumping in too deep. The dense linear algebra code is making a lot of sense. Should be able to make some actual contributions within a week or two. Thanks for your patience and willingness to shove all this information my way.

It's pretty daunting math.  What you see is several years of work learning the underlying math and writing code to do that math well.

If that math ends up winning, I do have other tasks you can work on.  But they might be less fun :)  (for some definition of fun)

Offline rwill128

  • Bot Builder
  • **
  • Posts: 67
    • View Profile
Re: Helping
« Reply #21 on: April 18, 2013, 08:41:37 PM »
Well, you're welcome to hit me with these other tasks.

The main thing slowing down my progress is that I can only work effectively learning one thing at once, and there's simply a lot more than one thing for me to learn -- C#, .NET libraries, math, your coding practices (which seem like good examples to follow), and the overall organization of your modules for Azimuth (and for the larger project that is DB3).

I've recently gotten a better mental map of which modules feature the lowest-level code and how they interact, so now I'm just learning how the basic Vector classes, etc. behave and what features they have before I get into the denser stuff.

The thing is, I start looking at the math, which usually makes sense, until I hit a concept I don't remember clearly, which means I get on Wikipedia or various other sites and read up on it. Then I go back to the code briefly and run into a line of C# code that I'm not familiar with. Next thing I know I've been on msdn.microsoft.com reading about the SerializableAttribute class for 45 minutes.

---

With all this math to learn, I'm starting to think the most effective way to review it is to practice coding implementations of it in my own basic programs.

But I'd like to also keep in mind how Azimuth handles these problems because it does it in such a clean, flexible fashion, processor-efficient fashion. As far as I can tell from my amateur perspective, physics engine libraries and object-oriented programming principles were made for each other, so it's nice to see a structured combination of the two.

---

Anyway, I'll keep on chipping away at the big pieces, but if there's some practical way of helping that I can take part in, I'll do that, even if it's not as fun.
« Last Edit: April 18, 2013, 08:43:23 PM by rwill128 »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #22 on: April 18, 2013, 11:32:14 PM »
Implementing them is a good way to learn it, yeah.  Also, you can set breakpoints in some of the functions and run the unit tests, and step through the code to figure out what it's doing.  I've always found the debugger to be the best tool for understanding unfamiliar codebases.  The code is built very much bottom up, which makes trying to understand it from a top down perspective, which is usually how people like to understand things, difficult.  Doesn't help that it's not even really done.

Have you seen this picture?  It's woefully out of date, but but that's roughly how I imagined things fitting together when I first started coding things.

...

Anyway, day-to-day right now I'm working on Azimuth.DenseLinearAlgebra.DenseVector.  C# and I have been battling over making the code both readable and as fast as possible.  I've been losing that battle, but I'm bringing out the big guns: a C preprocessor.  Gonna throw some macros at the problem.  Take that C#!  I'm working on modifying an existing open source preprocessor so it'll work for the task, and I've basically got it working.

Right now I have to run the preprocessor as a pre-build step.  It generates a C# code file, and I'll use that to build the project with.  However, it's not immediately obvious which code is the real code and which is autogenerated, other than a comment at the top.  Visual Studio has a way to help with this, though, which is to use the concept of "code behind" getting generated by a custom tool.  It's not sexy coding work, but I need someone to code up a DLL that will allow Visual Studio to treat the preprocessor as a Custom Tool.  See Custom Tools Explained.  It comes with source, so it should be pretty easy to modify it.

The task is to build the DLL and have it query the input file's first line for the tool to run, and then run that tool.  eg: the first line might be //..\..\3rdParty\mcpp\bin\release\mcpp.exe  The custom tool takes that, appends the current file's path and a reasonable output file (maybe currentFile.Generated.cs), and then runs that final command.   Also, you need to build scripts to register and unregister this custom tool with Visual Studio, which involves registry keys and fun things like that.

I'd normally start working on it sometime on the weekend or early next week, but if you want to tackle it for me it would save me some time and be immediately useful.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping
« Reply #23 on: April 19, 2013, 12:54:20 PM »
Quote
SerializableAttribute class

I remember that one.  :)

Offline rwill128

  • Bot Builder
  • **
  • Posts: 67
    • View Profile
Re: Helping
« Reply #24 on: April 19, 2013, 02:09:10 PM »
Heck yeah! Something immediately useful that I can do. And I can accomplish it in the short term, which makes it easier to get motivated.

I'll read the Custom Tools tutorial and get cracking.

And yeah, I've seen the ModuleDiagram. It was helpful for some basic insight, which is good.

The main thing I need to work out (and perhaps diagram for myself, just to keep it straight) is how Azimuth works within itself, in addition to how it's going to connect to the larger project. That idea of using the tests and the debugger to watch the code work is perfect, though. I will be doing that later this weekend.
« Last Edit: April 19, 2013, 02:47:08 PM by rwill128 »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #25 on: April 20, 2013, 01:28:32 AM »
Another useful tool: websvn.  If you find a file you're interested in, you can view the log for it and see all the commits I made to it.  I usually had interesting comments for any given commit, so it can be useful to see what I was thinking when I originally checked something in, for instance.  Some of the stuff in there is just there because I wanted to experiment, and then I never really got very far with it, or it proved to be unteneable for whatever reason.
« Last Edit: April 22, 2013, 03:30:30 AM by Shasta »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Helping
« Reply #26 on: April 20, 2013, 07:23:43 AM »
Correct me if wrong, but it seems physics are being build from scratch. Why not use a phycics engine?

What's the software license of darwinbots 3?
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #27 on: April 20, 2013, 03:31:05 PM »
Correct me if wrong, but it seems physics are being build from scratch. Why not use a phycics engine?

All the off-the-shelf physics engines are too wobbly for what I want to do with DB3.  Like, have you played Tower of Goo?  The gooey-ness of the tower is a result of how the physics engine works.  For DB3, I specifically want to be able to have large sturdy towers of bots for things like trees, and if they're constantly falling over because the physics engine can't withstand the forces that's no good.

Quote
What's the software license of darwinbots 3?

MIT License.  Note that that's much different from the DB2 license, which is a more restrictive holdover from when Carlo first wrote it.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #28 on: April 20, 2013, 04:00:49 PM »
Okay rwill, I've checked in changes to Azimuth.  DenseVectorPre.cs has a bunch of macros in it that get expanded to produce DenseVector.cs.  Right now it's running as a prebuild step (for some reason you have to run the build process twice for it to take properly), but if you can get it to work as a custom tool that would be huge.  The prebuild step has two commands: one does the preprocessor, and the other does an autoformatting on the code to make it actually readable.  You'd probably want both to be put in to a batch script and have that get run by the custom tool.

Let me know if you have any issues/questions.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Helping
« Reply #29 on: April 20, 2013, 04:38:07 PM »
An interesting task you could do to get your feet wet is build something for the graphics engine to save out screenshots as SVG. I have some code already in Annulus for visualizing unit tests that produces SVG. It would just be a matter of taking that code and expanding it to handle more shape types and that sort of thing. It might also be possible to include animation data in JavaScript or something like that, but I don know how to do that. But it would let us save out basically movies from a sim and post them online in the forums.
Most likely a silly question. How can I run the code for the visualization?

Unrelated other stupid question, how can the code for DB2 be set up. I can't find a project file for Darwinbots2. :(
Oh my god, who the hell cares.