Author Topic: Helping  (Read 10536 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping
« Reply #15 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

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #16 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.

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Helping
« Reply #17 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.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #18 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.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping
« Reply #19 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# ...


Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Helping
« Reply #20 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.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping
« Reply #21 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...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #22 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.  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.  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).

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: May 11, 2012, 05:21:31 PM »
I thought we are going with only 4 sided polygons  :blink:

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #24 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.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Helping
« Reply #25 on: May 11, 2012, 08:19:35 PM »
interesting...

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Helping
« Reply #26 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?
« Last Edit: May 10, 2015, 08:01:19 PM by havingphun »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Helping
« Reply #27 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:

  • Digging in to shapes to form nests
  • Swimming (using fluid dynamics),
  • A stable physics system that can handle building structures from bots without toppling over.
  • Infinite distance vision

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.
« Last Edit: May 25, 2012, 11:38:16 PM by Numsgil »