Author Topic: P2P Internet Mode  (Read 18379 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
P2P Internet Mode
« Reply #15 on: June 01, 2008, 07:47:22 PM »
Ooh, neat, I think this will work.  Why does the data need to be coded in base 64, though?

Offline goffrie

  • Bot Builder
  • **
  • Posts: 65
    • View Profile
P2P Internet Mode
« Reply #16 on: June 01, 2008, 08:47:27 PM »
Quote from: Numsgil
Ooh, neat, I think this will work.  Why does the data need to be coded in base 64, though?

  Gah, you're supposed to use urlencode (with the %hexnumber goodness). The code I "post"ed (haha) doesn't handle this automatically, though, so you'll have to do it manually. I found this VB function at http://www.csie.nctu.edu.tw/~cdsheen/codin...b-urlencode.php :
Code: [Select]
<pre><font><font face="Georgia">Function UrlEncode(ByVal urlText As String) As String
     Dim I As Long
     Dim ansi() As Byte
     Dim ascii As Integer
     Dim encText As String
 
     ansi = StrConv(urlText, vbFromUnicode)
 
     encText = ""
         For I = 0 To UBound(ansi)
         ascii = ansi(I)
 
         Select Case ascii
         Case 48 To 57, 65 To 90, 97 To 122
             encText = encText & chr(ascii)
 
         Case 32
             encText = encText & "+"
 
         Case Else
             If ascii < 16 Then
                 encText = encText & "%0" & Hex(ascii)
             Else
                 encText = encText & "%" & Hex(ascii)
             End If
 
         End Select
     Next  I
    
     UrlEncode = encText
End Function

Using this function, you don't need base64 anymore (d'oh), so remove the "base64_decode" line.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
P2P Internet Mode
« Reply #17 on: June 02, 2008, 10:52:18 AM »
Quote from: goffrie
Security issues perhaps are a problem, but they are only moderately severe as long as code is kept well-managed.
As a guy who has spent a bunch of years working in software security, I respectfully disagree with you.  The moment you have applicaiton level code listening on a port on client machines, particularly code whose source is freely available as with DB, attacking you becomes relatively easy for someone with the right skills.  I am not going to spend my time code-reviewing and penetration testing a local DB server for every possible stack or buffer overflow and I would suggest other developer's time might be equally better spent elsewhere.  

Quote from: goffrie
Issues with NATs can be overcome by relaying through the central server.
If you're communicating through a server, by definition it's not P2P.


Quote from: goffrie
"moving the server communication code out of proc" - I'm not too sure what you meant by this.
It means pulling the client-side of the client-server communicaiton "out-of-process" and putting it in it's own process so that when it waits for the server to respond, it does so on a separate thread of execution (a separate process in this case) and thus does not block the simulator.

Quote from: goffrie
Which is a real server.
Forgive my shorthand.  By "real" server, I meant an applicaiton level server, specifically one which impliments our specific semantics.  Yes, FTP is a real server in the sense that it is code which listens on ports but the semanitcs it impliments are limited and not specific to our needs. It is not an applicaiton server.

Quote from: goffrie
... Why the lecture? I don't see what point you're trying to make.
That it is a hell of a lot easier, expediant and secure to build a real (excuse me.  I mean applciation level) server than to do P2P.  

Many beers....

Offline Vodalian

  • Bot Neophyte
  • *
  • Posts: 1
    • View Profile
P2P Internet Mode
« Reply #18 on: June 19, 2008, 01:51:38 PM »
I think the current concept of Internet mode is pretty flawed right now for one reason. Bots are being teleported back and forth into constantly changing sims with different costs and physics, this really plays havoc on evolution. I think it would be nice if we could have a way of sharing settings, like individual 'ponds' that you can create or join.  Having shared settings would probably yield much more interesting results than the chaos they currently go through.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
P2P Internet Mode
« Reply #19 on: June 19, 2008, 02:02:18 PM »
Welcome!

Settings don't necessarily need to be exactly the same.  A little variation might help to create nooks and crannies.  And a bot that can successfully sweep through the sim is all the more impressive.  That said, yes, it would be a good idea to help users share settings for IM.  If they're all totally different, the sims might as well not even be connected.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
P2P Internet Mode
« Reply #20 on: September 27, 2008, 10:31:48 AM »
Hi everyone, I just came across darwinbots.
I was originally just looking to see what was already about in the area of robot programming games (ala C-robots) with a view to creating my own in C#.
But having found Darwinbots have decided not to bother.

Anyway...

I have been reading allot about version 3 design decisions, in regards to networking what is the objective? Is this just for sharing bots in otherwise isolated simulations or are we talking multi-user simulation?

A multi-user simulation might be possible over a classic client-server sockets architecture, which would be the simplest way for networking this kind of game (relatively speaking).
The simulation would be run in a service to which one or more clients could connect and view the current simulation state.

It would better support:-

1)   Evolution Sims, You would be able to run your sim for months in the background as service and just load-up a client viewer every so-often to see what was going on. The service implementation could just save the sim when the service stopped and load it again when the service started.

2)   Different client views on the same data, you could have a basic win forms statistics overview client, a primitive 2D client and a swanky 3D client. These could be developed interpedently from the server and even independently from the server’s platform

3)   Independent simulation speed, it would enforce the total separation of rendering frame rate to simulation frame rate. The client can render as fast as it can, the simulation can simulate as fast as it can and the network can send and receive data as fast as it can, all Independently of each other.

4)   League and shared games, all participants could connect and view the simulation in real-time to check on the progress their entry was making. Users could just set up their own server (simulated environment) and other users can join and introduce their bots and see them interact with other user’s bots.

5)   Performance, it’s going to be the fastest and simplest way of any kind of multi-user simulation. Since this isn’t Counter strike there is no twitch user input or correlating feedback, you only really need to worry about raw bandwidth for sending updates. And in that regard you can just cap and rotate the number of bot updates you send in one tick, you would only need to send a reference ID and accumulated velocity delta’s as regular updates say about 32 bits per bot update, you should be able to manage an update rate of about 32 per tick (in a single UDP packet) with a tick rate of 5 per second, which would give you about 6.7kb/s (160 updates per second) per connection. Obviously for local connections you can achieve a display which approximates the status of the simulation much more tightly by using tick rates closer to that of the simulation frame rates or by updating a larger proportion of the bots in each tick.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
P2P Internet Mode
« Reply #21 on: September 27, 2008, 10:55:04 AM »
Quote
Is this just for sharing bots in otherwise isolated simulations or are we talking multi-user simulation?
Isolated that are shared trough a central server. Altrough that is what Eric is talking about and has been inplementated in DB2.
The title states a P2P-network as you see.

Quote
it would enforce the total separation of rendering frame rate to simulation frame rate
uhuh, seperation rendering/simulation, uhuh. If you mean about shutting the graphical interface down it is also in DB2. I am pretty sure there comes something like it in DB3.

Current way of IM. Simply, central server receivs bots, sends bots and updute IM-graphs. Does nothing else as far I know.
Oh my god, who the hell cares.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
P2P Internet Mode
« Reply #22 on: September 27, 2008, 11:28:31 AM »
Ah ok I have misunderstood, after skimming though aload of posts about P2P networking I assumed the talk was of a system closer to the like of Terrarium.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
P2P Internet Mode
« Reply #23 on: September 27, 2008, 12:58:07 PM »
And in fact after more reading (so far I have spent most of the day reading this forum) with ideas like complex dynamic cell shapes and joins that could well take a cell update into the realms of 128 bits or more which considering the number of cells and frequency of change would make viewing over the internet far too slow, it would still be fine locally, but then what’s the point!
« Last Edit: September 27, 2008, 01:02:16 PM by Cyberduke »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
P2P Internet Mode
« Reply #24 on: September 27, 2008, 04:24:18 PM »
It's not like terrarium, where you have a server running things and you connect to view it (that's how it worked, right?)  Rather, each user is running their own local copy, and bots are periodically teleported to a central depository, where they sit in raw binary form until another user downloads them in to their own sim.  We don't have the money for a fancy central server, so the idea here is to leverage everyone's computing power to create a large universe for bots to roam around in.

BTW, if you're interested I could use a hand with DB3 (in C#), or Eric could use a hand with the current DB2 (in VB6).

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
P2P Internet Mode
« Reply #25 on: September 27, 2008, 05:08:31 PM »
Ok I would love to help, It looks like a really interesting project, It’s been like 7 years since I used any VB6 but my C# is current, I am experienced with sockets and GDI+ and a little bit of XNA, but I am sure TAO can't be that hard to learn.
« Last Edit: September 27, 2008, 05:08:54 PM by Cyberduke »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
P2P Internet Mode
« Reply #26 on: September 27, 2008, 05:13:11 PM »
Actually I'm leaning towards XNA at the moment instead of TAO and OpenGL, since then I can get Darwinbots running on my XBox360.  Give me a few days (it's milestone week at work) and I'll update the pages on the wiki with instructions for the new source code I've been working on.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
P2P Internet Mode
« Reply #27 on: September 27, 2008, 05:42:36 PM »
I have been wanting to do something for the Xbox for a while (I have one too) It would be great for running and displaying the simulation and even sharing bots about.
does the new v3 have any existing graphical concepts? I.e. to look like you’re looking under a microscope

http://www.youtube.com/watch?v=w8O4OolGcPg...feature=related

Is the DNA going to be executed in a single thread (each bots in turn) or in parallel via a thread pool?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
P2P Internet Mode
« Reply #28 on: September 27, 2008, 05:46:20 PM »
DNA execution is embarrassingly parallel, so I'm probably going to set up some threading in that regard.

Graphics wise I haven't given it as much thought as possible.  Right now my plans are to make a cleaner version of the current DB2 graphics.  Basically a vector graphic look, with lots of curves that tessellate to a proper level as you zoom in and out.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
P2P Internet Mode
« Reply #29 on: September 28, 2008, 05:43:48 PM »
At the minute I am still suffering from 'so much to read so little time',
especially on all the biological side of things as I have no previous knowledge there.

The P2P networking... has there been any discussion on distributed computing?
As in when your client comes online your added to an existing web as an environment to the left, right, above or below someone else’s?  So Individual bots can wonder off the left of your screen, get taken out of your game and sent to the person on your left whereby it re-appears coming out from right side of their screen?

Would that even be desirable?
« Last Edit: September 28, 2008, 05:45:06 PM by Cyberduke »