Darwinbots Forum

Code center => Darwinbots3 => Topic started by: havingphun on October 17, 2011, 04:56:18 PM

Title: Helping
Post by: havingphun on October 17, 2011, 04:56:18 PM
I should be able to start helping on friday.
Title: Re: Helping
Post by: Numsgil on October 18, 2011, 12:16:32 AM
Cool.  How much background do you have in math and physics?  I want to make sure I can give you a task that's not going to be too hard or too easy.
Title: Re: Helping
Post by: havingphun on October 18, 2011, 04:10:02 PM
Well i know c++ pretty well. I only have a middle school education in math but i am very good at it and would learn more if i needed to. I know some physics but i cant find any good tutorials on it or how to implement it into proggramming. Also is c# much different than c++? I mean in the proggramming part is it similar in the way it c++ looks and acts?
Title: Re: Helping
Post by: havingphun on October 18, 2011, 04:28:38 PM
I am also learning how to make gui's for windows, the ones that programs like notepad have. I am gonna learn opengl but that will also have to start on friday.
Title: Re: Helping
Post by: Numsgil on October 18, 2011, 06:29:54 PM
C# is similar to C++.  The syntax will feel familiar at least.  It's closer to java, but it's not super weird like Caml or Lisp.

Here's two fairly small tasks.  Either (or both) would be a good way to get your feet wet.

First, there's a bug I noticed in my unit testing framework after I fixed some performance issues.  It has to do with callstacks.  Clicky (http://bugs.darwinbots.com/view.php?id=46). 

Second, I need someone to write Parse and TryParse methods for my Vector class.  I've already done it for my Scalar class, and Vector is literally just a pair of scalars, so it should be pretty easy.

First step would be to grab the code from the repository and make sure you can get things compiling.  Check the wiki for that, and let me know if you have any issues.  The first issue is inside UnitTestSharp.sln.  The second issue is inside Azimuth.sln (each module gets its own solution file).  So make sure you can get either/both of those compiling and running.
Title: Re: Helping
Post by: havingphun on October 18, 2011, 07:05:23 PM
Ok. What does it mean to build a dll locally? Also do you want me to program Parse and Tryparse, If so what do you want them to do? I have learned c++ but i havent had much experience proggramming with it so i don't understand some things.
Title: Re: Helping
Post by: Numsgil on October 19, 2011, 03:10:40 AM
Each module spits out compiled binaries to the "bin" directory, and these get checked in.  So in theory you don't have to build any binaries except the ones you're currently modifying.

For the unit testing bug, it's a bug I see only when using the binary that's checked in to the repository.  If I build the UnitTestSharp.dll locally, it works like it should.  So first step for that one would be to verify that you can reproduce it.  I was building Azimuth (the math library) when I first saw it, so just "rebuild" the Azimuth solution and check the output and see if it matches up with what's in that bug report.

For the parsing, see clicky (http://msdn.microsoft.com/en-us/library/system.single.parse%28v=vs.71%29.aspx) for an example for a float.  It basically converts a string representation to an actual instance of an object.  I just want something similar for Vectors.  There's some methods set up in the code right now, but they just throw exceptions saying they aren't implemented for Vector.  You need to write tests to verify that they work (check out the Scalar class's unit tests for an idea of what to test for and how to set up tests), and then actually make them work (ideally in that order, because it's considered good practice).  It'll make more sense if you look at the code in Azimuth, I think.

I can break this down in to more step-by-step instructions, if you need.  Part of the effort is just understanding Visual Studio and the basic layout of all the modules and how things fit together a bit.  Browse the source a bit and see if it makes any sense or not.
Title: Re: Helping
Post by: havingphun on October 19, 2011, 03:09:34 PM
Ok i cant start until friday due to my internet, but then i will look at it.
Title: Re: Helping
Post by: havingphun on October 19, 2011, 05:52:06 PM
When you say you built UnitTestSharp.dll locally do you mean on your pc and then if it isnt local you are just useing the version of it that is in the repository online? All im saying is what does it mean when you say you build it locally? Also i have slow internet most of the time (about 20kbps) so when i go to upload a modified version of DB3 would it take a long time?
Title: Re: Helping
Post by: Numsgil on October 19, 2011, 08:20:27 PM
You might want to read this (http://betterexplained.com/articles/a-visual-guide-to-version-control/) to get some background on how repositories work, that sort of thing.

I checked out the Azimuth.dll from the repository, and on my machine it produces the bug.  Recompiling it from source to create a working copy magically fixes the bug.  The source used to build the assembly in both cases is identical, so it's a mystery to me :)
Title: Re: Helping
Post by: havingphun on October 21, 2011, 08:35:01 AM
How do i get the project files?
Title: Re: Helping
Post by: Numsgil on October 21, 2011, 12:33:16 PM
Oh, sorry, I thought you had found the wiki page on it.

clicky (http://wiki.darwinbots.com/w/Darwinbots_3)
Title: Re: Helping
Post by: havingphun on October 23, 2011, 09:39:11 AM
Im sorry but i cant help my computer crapped out and i cant download the files and vc wont work
Title: Re: Helping
Post by: Botsareus on January 23, 2012, 05:46:33 PM
Everything is still c#2k08 right?
Title: Re: Helping
Post by: Numsgil on January 23, 2012, 06:27:53 PM
I recently upgraded everything to Visual Studio 2010.  Still C# tho
Title: Re: Helping
Post by: Botsareus on January 27, 2012, 03:21:23 PM
ah good, I have 2k10 on my desktop, maybe i'll help if I have more time
Title: Re: Helping
Post by: Numsgil on February 01, 2012, 02:27:00 PM
Actually I've thought of useful tasks coders can do, though it's not very glamorous.

I'm working on collision detection write now.  I need tests written that test all the edge cases.  So in this case it's just thinking through how to position segments, boxes, and points, give them an initial velocity and spin, and check that my functions are returning the correct time of first contact.

The other thought: I've written some basic technology to find the union of two polygons, and some technology to cut holes in polygons.  I just need an interface created that can do "difference" between two polygons, and "intersection".  So it's just a matter of wiring up the technology that's there to a new API that needs to be written (and mirrored off of the existing polygon union API) and tests written to test it (which is a huge pain; you basically need to get graph paper and draw various interesting tests and then translate that in to points).

The first one I'm going to end up doing myself sooner than later if no one else volunteers.  The second one will probably sit for a month or two till I get around to it.
Title: Re: Helping
Post by: havingphun on May 10, 2012, 07:13:15 PM
Since I won't be able to help anytime soon. I could try to get coders that know how to program C# from other forums to help and direct them here. Only if you want me too though. Also this forum is a 'little' dead but I think its great so I could post something about darwinbots in a off - topic section of some other forums if you like. But I won't go to any places like 4chan.
Title: Re: Helping
Post by: Numsgil on May 10, 2012, 08:34:25 PM
The problem is that knowing C# isn't enough.  I have specific goals and my approach so far has been to do literally whatever it takes to make those goals come true.  Which usually means reading academic papers and text books, implementing them, and then aggressively testing the result.  It's not exactly "fun" for most coders (I'm a bit of a masochist I must admit).

Or alternatively, people who are willing to do the work of coming up with test cases for the algorithms I'm working on could help quite a bit.  That's actually a fairly labour intensive part.  But even here, it requires a reasonable understanding of how the algorithms are supposed to work to figure out cases that could cause problems.  Not exactly all that fun.

...

I've been avoiding trying to advertise Darwinbots personally just because the current VB6 program isn't very good and all my development effort is going in to something that doesn't even have a proper executable yet.  (So it feels a bit like putting the cart before the horse).

But don't let that stop you from talking about it on other forums if you like.  Personal word of mouth is really the only way projects like Darwinbots get any sort of exposure.
Title: Re: Helping
Post by: Botsareus on May 11, 2012, 03:38:40 PM
I went trough the source trying to figure out what he was doing. The only thing that came out of that was that I can use

 Dim dinosaurs As New List(Of String)

or

List<string> dinosaurs = new List<string>();

if you prefer c# ...

Title: Re: Helping
Post by: havingphun on May 11, 2012, 03:45:23 PM
Ok Numsgil. What do you mean by test cases? Would they require programming to create? If not I could try to help with those.
Title: Re: Helping
Post by: Botsareus on May 11, 2012, 04:53:06 PM
It is not really creating, it's viewing an algorithm, understanding what it does, and sending the test idea to Numsgil.

example:

Code: [Select]
cond
*.nrg 1000 >
start
10 .up store
stop
end

A good test for that will be "Does the robot go up when energy is being set over 1000?"

Obviously c# is more complex then darwin bot code, but you should get an idea.



Quote
Also this forum is a 'little' dead

I am the only one (as I understand) who is actively working on changes to the program, but I am slow and impulsive so I guess the form is kinda dead...
Title: Re: Helping
Post by: Numsgil on May 11, 2012, 05:08:58 PM
Ok Numsgil. What do you mean by test cases? Would they require programming to create? If not I could try to help with those.

If you can figure out the coding, great.  If not, I can do the coding myself and it'd still save some time.  But you still probably need a basic idea of what I'm doing to help build the tests.

Right now I'm working on something called a Straight skeleton (http://en.wikipedia.org/wiki/Straight_skeleton).  I have a few test cases I'm failing right now, and I'm working on fixing those.  But there's probably quite a few cases I'm missing.

The input would be a simple polygon (possibly with holes), which would be a list of vertex positions in 2D.  The output is a list of edges (that is, connections between two of the vertices).  If you come up with test cases yourself that would be great, but it's actually pretty difficult.  If you could find a working implementation of a straight skeleton online and feed in the input, and get back the output, and parse it in a way I can use for my own tests, that could be quite helpful.  I think there's a Java implementation floating around the internet, for instance.

I have the easy ones right now (triangle, square, rectangle).  But I'm missing any complicated convex polygon test cases.  That would be a good place to start.  Imagine the silhouette a potato would make, for instance.  Also, regular polygons, (triangles, squares, octahedrons, etc.) are tricky problems because all the edges meet at a single interior point.  I only have a up to something that looks like a prism or pencil shape right now.  A full octahedron would be a good test case.  A hybrid between a potato and a regular polygon would also be a good test case.

Check out this file (http://svn.darwinbots.com/Darwinbots3/Trunk/Modules/Annulus/Annulus.UnitTests/CSG/StraightSkeletonBuilderTests.cs).  Look for the second "public void Triangle()"

It looks like this:
Code: [Select]
public void Triangle()
{
var vertices = new PerforatedPolygon(new SimplePolygon(new Vector[]
{
new Vector(0, 0),
new Vector(1, 0),
new Vector(0.5, Math.Sqrt(3)/2),
}));

var expectedStraightSkeleton_AdditionalVerts = new Vector[]
{
new Vector(0.5, Math.Sqrt(3)/6),
};

var expectedStraightSkeleton_AdditionalEdges = new int[]
{
0, 3,
3, 1,               
3, 2,
};

var straightSkeleton = StraightSkeleton.BuildStraightSkeleton(vertices);

CheckSimilarity(straightSkeleton,
vertices,
expectedStraightSkeleton_AdditionalVerts,
expectedStraightSkeleton_AdditionalEdges);
}

The "vertices" are the vertices in the initial polygon.  The "_AdditionalVertices" are vertices created by the straight skeleton.  The "_AdditionalEdges" are edges created by the straight skeleton.  The first integer is the index of the first vertex, and the second integer is the index of the second vertex, assuming counting starts at 0, and the additional vertices get added to the end of the original vertices.

...

If you can write me some new tests using the above as a template, that would be great!  If not, don't worry about it.  There are some other areas that need tests, too, that might be a bit easier to do (things like testing rays for collision, that sort of thing).
Title: Re: Helping
Post by: Botsareus on May 11, 2012, 05:21:31 PM
I thought we are going with only 4 sided polygons  :blink:
Title: Re: Helping
Post by: Numsgil on May 11, 2012, 05:35:31 PM
This is for the graphics engine, actually.

And I'll probably use it for shapes in the simulation, so that bots can tunnel in to them and form ant nests.
Title: Re: Helping
Post by: Botsareus on May 11, 2012, 08:19:35 PM
interesting...
Title: Re: Helping
Post by: havingphun on May 25, 2012, 04:19:29 PM
This is for the graphics engine, actually.

And I'll probably use it for shapes in the simulation, so that bots can tunnel in to them and form ant nests.

Thats AWESOME!!!!  :D . I love darwinbots and i want to help badly. I think it was this thread that I said my computer crapped out and I could not help. Turns out I have a virus(and my computer is old and prone to problems.). But the virus does not let me access the internet and breaks most programs I install. Visual studio was one of them. But right now i am working on getting rid of them and have already gotten rid of several. If they are gone by monday and my laptop can connect to the internet I should be able to re download visual studio and help. If not monday hopefully in the end of june. I don't know most of the things needed to create this but Ill try my best to help in some way.

What else do you have planned for darwinbots 3?
Title: Re: Helping
Post by: Numsgil on May 25, 2012, 11:36:27 PM
You might want to consider just wiping the computer and installing windows fresh.  It takes about 8-16 hours to get everything wiped and re-install windows and all your applications that you use regularly.  So it's a huge pain, but then everything is fresh and there's no more trace of the virus.  Often once a system gets virused there's no good way to recover it.  Even if you remove the virus it usually manages to trash the system one way or another.

...

The major improvements over DB2 I'm thinking about:


Right now I'm working on the graphics parts.  I'm building it to be hardware accelerated with proper vector graphics.    The end result won't be much different from DB2, but it should be much faster.  I'm going to post a sample of it in a few months so I can make sure it works on everyone's hardware, etc.

...

Let me know when you get Visual Studio (2010) up and running.  I'll show you how to get the computational geometry project building.  I've got the tests spitting out SVG pictures you can look at in Chrome, which is pretty cool.