Author Topic: Networking and bot memory  (Read 2882 times)

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Networking and bot memory
« on: October 23, 2008, 04:03:24 PM »
Now this is just an idea and possibly an ill thought out one at that, but what is the current thinking on bot memory values? I read somewhere you wanted them to be 9999 to -9999? The largest complete signed decimal number to fit into a 16 bit integer. Why not a 32 bit number? I.e. allowing 999999999 to -999999999 and then use 64 bit integers for the stack so you can still do multiplications?
This would let you use fixed point numbers. Say a million with 3 points of precision?
This would mean that a single bots memory would be 3.9K (4K on the wire), bit packing would take that down to 3.78K (3.88K) and compression of the whole stream would probably get it down to an average closer to 3K per bot since there tend to be a lot of empty locations and repeats, especially in simple bots.

This would also make it possible to effectively simulate huge fields that are spread over multiple machines (distributed computing) using simple box packing when new machines come online.
Then a bot could remember a location on one sim, wonder off 3 or 4 sims over and be able to come back to the same point again.
I am working on the assumption that we could reasonably expect to achieve an average migration rate of 1 bot per second per peer/sim even over the internet, using the edges of each sims field to transport them within a linked structure of simulations.
« Last Edit: October 23, 2008, 04:04:56 PM by Cyberduke »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Networking and bot memory
« Reply #1 on: October 23, 2008, 04:56:00 PM »
I wanted to limit the range of possible values for sysvars (to hopefully make it easier for evolution), and I wanted it to make sense to humans.  Which is where the -9999 to 9999 comes from.  The stack can handle very large values.  Either 64 bit or 128 bit, (I don't remember which).  The numbers just get truncated when stored to memory.  It isn't a memory issue, we can have bot memory be as big as we think we want it.

I've thought about fixed point numbers, never came to a decision one way or another.

For locations, I'm planning on not giving bots any absolute information.  As far as the bot is concerned it's the center of the universe.  If a bot wants to navigate around and then come back to its starting position it'll have to do something clever, like maybe leave a trail of chemicals behind to follow (haven't worked through exactly how this would work) or remember landmarks.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Networking and bot memory
« Reply #2 on: October 24, 2008, 03:15:19 AM »
must be 64, you don't natively get 128 bit numbers in .net (Unless you just stored an array of bytes and sort the boundaries out yourself?)

I like the idea of bots only using relative information. But it would still need a large memory space to store large relative distances (magnitudes) to these (landmarks?)

But I guess the limit isn’t so bad once you start thinking about it from a relative point of view.
Especially if you can leave a breadcrumb trail of (landmarks?) to follow, that’s quite cool actually. You could do ants properly then.

Note: By the way I wasn’t talking about nor worried about system RAM, we would be doing well to push a few megabytes for the combined memory of all the bots in the whole sim on one machine. I was referring to the increase in data transmission
« Last Edit: October 24, 2008, 03:22:23 AM by Cyberduke »