Author Topic: Command-ize everything  (Read 3307 times)

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Command-ize everything
« on: October 24, 2006, 06:30:32 AM »
I'm sure this had been discussed briefly before

How about steadily transfering the 'do something' sysvars into commands. This gives them greater flexibility and more compactness

For example:

10 .up store -> 10 up

-1 .shoot store -> -1 shoot

This way, you can also pack more functions into one command too, for example:

-1 .shoot store
314 .aimshoot store

becomes

314 -1 aimshoot

And

300 *.eye5 mkvenom

Makes 300 units of venom that affects an enemy bot's eye5

And maybe we could also have some readback commands, like some eye and ref ones. For example:

7 eye

Returns the value of *.eye7
And

6 refeye

Returns the *.refeye of the bot in eye6
« Last Edit: October 24, 2006, 06:35:30 AM by Elite »

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Command-ize everything
« Reply #1 on: October 24, 2006, 08:42:51 AM »
The trouble with this idea is that to implement it would involve a radical change in the way the stack works.

Presently all values from the DNA go onto the top of the stack then one of the commands such as store or add, manipulates them in some way.
If you remove the need for the "Store" command then you have to find some new way to process the information from the stack.

Additionally, it would make it a whole bunch more complex for the program to evolve these commands as they are no longer numeric equivalents.

It would be possible certainly but I can see more disadvantages than advantages.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Command-ize everything
« Reply #2 on: October 24, 2006, 03:29:44 PM »
I disagree that the disadvanatges outweight the advantages.

As I see it, the stack is a great success as far as evolution is concerned.  Bots seems to have an easier time when the question isn't where to find data but how to manipulate it.

Of course, I'm probably a little biased, I think I was the one who mentioned this before

Also, commands allow for greater flexibility in what is inputed, what is outputted, and other similar issues.

Would mean a radical change if we did this for basic sysvars though.  And you'd still want a memory array (though probably much smaller) for custom variables and values stored between cycles.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Command-ize everything
« Reply #3 on: November 03, 2006, 08:48:59 AM »
I'm not saying it wouldn't work.

I just think we would be adding complexity rather than taking it away.

We would be treating some sysvars differently than others.

Making .up a command rather than its numeric equivalent of 1 means that a bot evolving this number 1 in the right place, would no longer have it treated the same as if it evolves .up in that same place.
In other words, sysvars and numeric memory locations would no longer be direct equivalents. Right now there is one way to deal with all memory locations. A change such as this would require two most likely.

It could be done but not easily and IMO it would not be desirable either. Others, I'm sure, will disagree.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Command-ize everything
« Reply #4 on: November 23, 2006, 03:30:39 AM »
Been thinking about this some more, and I think this shrould be part of a sort of "next generation" bot programming language.

Basically, I'd have sysvars all be commands.  Evolution works best on the stack from my experience.  We'd just need to be sure the bots can mutate the different commands.

Each codule could then be given a small private "static memory space", which is entirely protected from other codules, which can be used for long term memory.  The root codule's memory space could be entirely copied into children, like racial memory.  This private memory space wouldn't need to be very large, maybe on the order of 30 memory locations.

This would entirely change the current ability to "make" another bot do something with ties or shots, though, which I don't think is necessarily a good thing.  On the other hand, evolved DNA would be moderately more readable, since it would always be obvious what's being read/written to/from.

I'd vote to keep the old language around, and have bot DNA files specify that they're using the new paradigm.  If things don't work out, we're not really out anything.  You could even run two species using different paradigms in the same simulation.
« Last Edit: November 23, 2006, 03:34:29 AM by Numsgil »

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Command-ize everything
« Reply #5 on: November 23, 2006, 07:16:42 AM »
I'm not sure I've understood this right but; if you make everything a command without needing store instructions would that remove most of the junk dna and add costs to having all the extra bits because they are then repeated and therefore charged instructions?
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Command-ize everything
« Reply #6 on: November 23, 2006, 11:52:40 PM »
I'm not sure I understand what you're asking.