Author Topic: Darwinbots replacement/clone  (Read 18377 times)

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« on: February 26, 2010, 09:05:53 AM »
Since darwinbots is pretty old I thought maybe its time for a complete renewal of the client... I have been developing a clone for a while, which I want to show here.
I also want to ask if it would be a nice idea to host it here, and it will be completely opensource of course...
The reasons why a replacement or offering a second client would be nice are: new neater code, faster simulations, and a neat client.

The current version only contains the dna functions equalivent to the functions animal_minimalis uses here.
And it runs about 3 times the speed of darwinbots.
This is the downloadlink: http://www.megaupload.com/?d=KSUYI98A

« Last Edit: February 26, 2010, 09:18:49 AM by Pascal666 »

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Darwinbots replacement/clone
« Reply #1 on: February 26, 2010, 11:42:20 AM »
I have no idea whats going on when I run it  , but it looks awesome.  

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Darwinbots replacement/clone
« Reply #2 on: February 26, 2010, 01:11:31 PM »
When you say a new "client", do you mean a complete rewrite or are you borrowing some of the existing code?  I'm mostly curious how you're handling collisions, physics, and vision (if you are).  Because they're non trivial problems to solve.

Yeah, we can set up a hosting if you like.  I'm a bit busy atm but give me a few days and I can at least set you up with a repository tree if you like and a login to post versions to our FTP.

Also, you are aware of DB3, right?  You're preaching to the choir about the need for a new version
« Last Edit: February 26, 2010, 01:12:32 PM by Numsgil »

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #3 on: February 26, 2010, 02:09:37 PM »
Quote from: Numsgil
When you say a new "client", do you mean a complete rewrite or are you borrowing some of the existing code?  I'm mostly curious how you're handling collisions, physics, and vision (if you are).  Because they're non trivial problems to solve.

Yeah, we can set up a hosting if you like.  I'm a bit busy atm but give me a few days and I can at least set you up with a repository tree if you like and a login to post versions to our FTP.

Also, you are aware of DB3, right?  You're preaching to the choir about the need for a new version
With a new client I do mean write a completely new client, with new benefitional settings for entity features like mass and ties, and limiting them more naturally.

I am aware of the development of DB3, I do not know the stage of it, but I think there will be great difference between the 3D and 2D experience, maybe also some performance differences... And since the development of darwinbots 2 is mainly ceased/finished it might be nice to get a higher performance/neater version of darwinbots, and depending on the results of this new client it might be published as "Darwinbots Classic".

My physics function is pretty simple and probably very similar to how darwinbots handles it:
Code: [Select]
Private Sub executePhysics(ByVal Entity As Integer)
Dim i As Long
Dim a, b, c, d As Double

    With Entities(Entity)
        ' UPDATE POSITION
        If .Velocity > 0 Then
            .X = .X + (.Velocity * Cos(.Angle * PI / 180))
            .Y = .Y + (.Velocity * Sin(.Angle * PI / 180))
            .Velocity = .Velocity * 0.99 ' FRICTION
        End If

        ' COLISSION DETECTION AND EYE FUNCTION
        For i = Entity + 1 To GLO_TOTALENTITIES
            a = .X - Entities(i).X
            If a < 0 Then a = a * -1
            a = a * a
            b = .Y - Entities(i).Y
            If b < 0 Then b = b * -1
            b = b * b
            c = Sqr(a + b) - (.Mass + Entities(i).Mass) ' DISTANCE
            If c <= 0 Then ' COLISSION
                d = Atan2(.Y - Entities(i).Y, .X - Entities(i).X) * 180 / PI
                .Angle = d
                Entities(i).Angle = (d + 180) Mod 360
                ' FRICTION
                a = (.Velocity + Entities(i).Velocity) * 0.75 / 2 + c / 10 * -1
                .Velocity = a
                Entities(i).Velocity = a
            End If
            If Not .isPlantae Then ' SIGHT ENTITY 1
                If c < (50 + Sqr(.Mass) * 10) Then
                    d = Atan2(.Y - Entities(i).Y, .X - Entities(i).X) * 180 / PI
                    d = (d + 180) Mod 360
                    If .Aim > 338 And d < 22 Then d = d + 360
                    If .Aim < 22 And d > 338 Then d = d - 360
                    If d < .Aim + 22 And d > .Aim - 22 Then
                        If c < .Sight Then
                            .Sight = c
                            .sightReference = i
                        End If
                    End If
                End If
            End If
            If Not Entities(i).isPlantae Then  ' SIGHT ENTITY 2
                If c < (50 + Sqr(Entities(i).Mass) * 10) Then
                    d = Atan2(.Y - Entities(i).Y, .X - Entities(i).X) * 180 / PI
                    d = (d + 360) Mod 360
                    If Entities(i).Aim > 338 And d < 22 Then d = d + 360
                    If Entities(i).Aim < 22 And d > 338 Then d = d - 360
                    If d < Entities(i).Aim + 22 And d > Entities(i).Aim - 22 Then
                        If c < Entities(i).Sight Then
                            Entities(i).Sight = c
                            Entities(i).sightReference = Entity
                        End If
                    End If
                End If
            End If
        Next
        
        ' CHECK IF THE ENTITY LEFT THE PLANE
        If .X > OPT_PLANEWIDTH Then .X = .X - OPT_PLANEWIDTH
        If .X < 0 Then .X = OPT_PLANEWIDTH + .X
        If .Y > OPT_PLANEHEIGHT Then .Y = .Y - OPT_PLANEHEIGHT
        If .Y < 0 Then .Y = OPT_PLANEHEIGHT + .Y
    End With
End Sub

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Darwinbots replacement/clone
« Reply #4 on: February 26, 2010, 04:24:41 PM »
DB3 is strictly 2D, actually.  I was playing with the idea of 3D but I dropped it.

Are you programming it in VB.NET?

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Darwinbots replacement/clone
« Reply #5 on: February 26, 2010, 09:21:04 PM »
Random suggestion, instead of using AE use Æ. It looks cooler. If you don't know how, just hold alt and press 146 sequentially. æ also works.

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #6 on: February 27, 2010, 07:05:36 AM »
Quote from: Numsgil
DB3 is strictly 2D, actually.  I was playing with the idea of 3D but I dropped it.

Are you programming it in VB.NET?

I do know how to program in the .net series, but I prefer to stick to VB6, and if I would choose another language I would probably go for visual c++ due to performance differences.

I will continue the development of Ævolution, and maybe the development of 2 opensource applications may have some benefits for each other.  

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Darwinbots replacement/clone
« Reply #7 on: February 27, 2010, 08:10:05 PM »
Speaking about open source, where can I can find the source for 2.44.04?
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Darwinbots replacement/clone
« Reply #8 on: February 27, 2010, 09:06:29 PM »
Use the SVN: clicky.  This will be changing location once I move it to the new server (I'll post an announcement).

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #9 on: March 18, 2010, 09:01:07 AM »
Since I havent updated for a month I just want to let you guys know that I am working on AEvolution...
The dna functions have expanded a lot, and I just started working on the bond functions(ties).

After I finished the binding and viral functions, I will post AEvolution here with with a few sample bots included.
 

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #10 on: April 05, 2010, 08:58:05 AM »
Since progress is slow lately, because of the lack of time, I have decided to show what I currently have.

I am still working on solving bugs in bond physics.
And I am also still working on a improved evolution system which should make it easier to evolve different cell-states, useful in both single and multicellular bots, the key function to this is the dna function jump which allows to skip genes, the current problem with it is that it doesn't increment along with gene count mutations.

My goals are:
- Make it easy for animalia_nihilo(darwinbots 's nullbot) to evolve.
- To create a successful evolvable multicellular entity.

Download:
http://www.megaupload.com/?d=M2KB0OC6

Information log:
Quote
Features:
- Basic physics
- Both plantae and animalia repopulation
- Energy/body handling; max energy is 30000, when one exceeds 30000, the energy is automatically fed to the entity 's mass which is limited by 100
   Mass addition and removal is limited by the size of it 's mass

- Simple plantae and animalia cost handling; plantae receiving 1 energy per cycle, and animalalia paying 0.1 energy per cycle
        Animalia costs increase based on the populationsize: COST = 0.1 * (POPULATION / 20)
   Reproduction costs 10% of the entity 's energy
   Mass removal costs 10% of the asked for energy
   DNA costs 0.01 energy point per 10 units of DNA per cycle
   Age cost increase by 0.1 per 10000 cycles
   Waste costs 0.1 energy point per 100 units of waste per cycle

- Entity details
   Entities can be selected and moved
   Mass benefits sight range by the following formula: SIGHT = 50 + SQR(MASS) * 10(For example: an entity with a mass of 10 will have a sight range of 70, where an entity with a mass of 100 would have a sight range of 150...)
   Mass slows down speed using the following formula: maxVelocity = 11 - Int(Sqr(MASS))
   Eating other animalia gives double the amount of energy than eating plantae, but also gives waste...
   Mass benefits waste dumping by the following formula: DUMPEDWASTE = Sqr(MASS) / 40 (Meaning it can dump 0.25 waste per cycle)
   Mass is the basis for defense and attack in animalia: ENERGY = ENERGY * (SQR(MYMASS) / SQR(REFMASS))

- Plantae details
   Do not have sight
   Mass increases the energy uptake by the following formula: ENERY = ENERGY + 1 + (SQR(MASS) / 4)
   Not able to reproduce after exceeding option_plantaemaximum

- Mutation system
   Mutation per reproduction
   When the population is low the amount of random mutation will be higher

- Stack based DNA system.
   Genecaching so it can skip dna faster

- Dna functions
Functions with a x still have to be added...
   Movement:
      strength moveright
      strength moveleft
      strength moveforwards
      strength movebackwards
      maxvelocity

   Aim:
      amount aimright
      amount aimleft
      angle setaim

   Reproduction:
      reproduce
      fertilize      x
      isfertilized      x

   Vision:
      sight

   Mass management:
      amount addmass
      amount removemass

   Waste management:
      amount dumpwaste
      

   Personal functions:
      myvelocity
      myenergy
      mymass
      myangle
      mywaste
      pain
                myaim

   Reference functions:
      isplantae
      samespecies
      refvelocity
      refmass
      refenergy
      refangle
      refwaste
      refaim

   Reference communication:
      readmem1 to 10
      value writemem1 to 10
                readrefmem1 to 10
   
   Reference sharing:
      amount shareenergy
      sharemass
      sharewaste

   Bond functions:
      growbond
      nextbond
      setbond
      totalbonds
      bondenergy
      bondmass
      bondwaste
      bondvelocity
      bondangle
      breakbond      x
      bondaim

   Bond communication:
      readmybmem1 to 10
      value writebmem1 to 10
      readbmem1 to 10

   Bond sharing:
      amount sharebenergy
      sharebmass
      sharebwaste

   Viral functions:
      amount jump
      gene sharegene
      gene delgene
      thisgene
      totalgenes

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #11 on: April 09, 2010, 07:59:45 AM »

Offline Ammeh

  • Queen of the Internets
  • Bot Destroyer
  • ***
  • Posts: 169
    • View Profile
Darwinbots replacement/clone
« Reply #12 on: April 09, 2010, 11:56:02 AM »
What kind of FPS are you getting at say, a population of 1000 bots?
What kind of FPS would you get in DB2 with the same pop?

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Darwinbots replacement/clone
« Reply #13 on: April 09, 2010, 02:06:55 PM »
Quote from: Sammeh
What kind of FPS are you getting at say, a population of 1000 bots?
What kind of FPS would you get in DB2 with the same pop?
I am running 200 bots at about 240 cycles per second, while in darwinbots I am running only 50 bots to reach this speed.

Offline Ammeh

  • Queen of the Internets
  • Bot Destroyer
  • ***
  • Posts: 169
    • View Profile
Darwinbots replacement/clone
« Reply #14 on: April 09, 2010, 02:08:47 PM »
Quote from: Pascal666
Quote from: Sammeh
What kind of FPS are you getting at say, a population of 1000 bots?
What kind of FPS would you get in DB2 with the same pop?
I am running 200 bots at about 240 cycles per second, while in darwinbots I am running only 50 bots to reach this speed.

Awesome  then you have my vote to upload it