Author Topic: Global Variables?  (Read 3017 times)

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Global Variables?
« on: October 17, 2011, 04:19:41 PM »
Is there a way to make global variables that can be accessed by any bot in that species?

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Global Variables?
« Reply #1 on: October 17, 2011, 04:21:50 PM »
Nope, there isn't. You'd have to create some sort of communication system for that, or pass it down from generation to generation. But I don't know what you're wanting to do, so I can't really give you any advice for it. :p

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Global Variables?
« Reply #2 on: October 17, 2011, 04:33:54 PM »
Well i was thinking what if i had a clump of bots tied together (Same Species) and then they communicated through the ties to decide what to do. Thats what i want to do but i need a way for the bots to know whos who so they each have an individual identity.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Global Variables?
« Reply #3 on: October 17, 2011, 04:37:23 PM »
Set an identity at birth:

Code: [Select]
def id 50
cond
*.robage 0 =
start
32000 rand .id store
stop

Then the one with the highest(or lowest) number is the "leader"? Or something like that. It's complicated to get it to work as it requires a lot of difficult communication. But it's possible.

Offline Shasta

  • Administrator
  • Bot Destroyer
  • *****
  • Posts: 231
    • View Profile
Re: Global Variables?
« Reply #4 on: October 17, 2011, 04:42:18 PM »
Another problem with large multibots is the propagation delay between them. As you increase the number of bots, the amount of time (cycles) a "message" takes to propagate is equal to the length of the path between the first bot and the last.

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Global Variables?
« Reply #5 on: October 18, 2011, 04:05:44 PM »
I was thinking about limiting the amount of bots in the clump. But if i got a communication system working what would i use it for?

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Global Variables?
« Reply #6 on: October 18, 2011, 05:14:33 PM »
Keeping energy and body throughout. If a bot is being attacked, give it more energy, body and poison, maybe? Or get the multi-bot to retreat. There's a load of things that you could do with it. That was just an example.

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Global Variables?
« Reply #7 on: October 18, 2011, 06:12:08 PM »
Hmm.... what happened to all the projects planning on building an advanced multibot with a brain and different parts of the thing?

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Global Variables?
« Reply #8 on: October 19, 2011, 01:47:55 PM »
I don't know. They just don't finish, really. They are incredibly complex things to build!

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Global Variables?
« Reply #9 on: October 19, 2011, 03:04:17 PM »
Ya that makes sense. It also would take a powerful cpu! :O

Offline ashton1993

  • Bot Neophyte
  • *
  • Posts: 14
    • View Profile
Re: Global Variables?
« Reply #10 on: April 16, 2012, 05:15:10 PM »
Ya that makes sense. It also would take a powerful cpu! :O
I've not been on DarwinBots for a few months now but if I remember correctly your limited by 32,000 commands per bot which might be another limiting factor