Welcome To Darwinbots > Newbie
Darwinbots replacement/clone
Pascal666:
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
Houshalter:
I have no idea whats going on when I run it , but it looks awesome.
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
Pascal666:
--- 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
--- End quote ---
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: ---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
--- End code ---
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?
Navigation
[0] Message Index
[#] Next page
Go to full version