Bots and Simulations > DNA - General
Swapping the top two stack values?
Trafalgar:
--- Quote from: Numsgil ---I thought about implementing a swap command. I think it's a reasonable thing to try. Maybe in a future version.
While we're on the subject, is there anything else that you'd like to see a feature for that's difficult to do with the language at the moment?
--- End quote ---
I can think of two other things off the top of my head:
1. A function that returns x,y coordinates for a given angle and distance (or sine and cosine, but since their return values are fractions, they would be useless on their own, unless what they returned was scaled) - This would be a counterpart to angle() and pyth(). (Or a function that gets the x coordinate, and another function that gets the y)
2. A function that returns an arbitrary root of a number, e.g. a cube root, or whatever. This is just x^(1/y), where y is 2 for a square root, 3 for a cube root, etc, and x is the number to get the yth root of. (This is, of course, only impossible currently because the stack is integer-only.)
Both of those are things that I had a use for before.
Two potential uses for the first one are: Flying around an enemy (there are other ways to do this, though), and arranging bots in a circle.
A while ago, I tried to calculate the radius of a bot in a DB bot script, but couldn't due to the formula for it using cube roots. (FindRadius = (bodypoints * CubicTwipPerBody * 3 / 4 / PI) ^ (1 / 3)) Of course, it would make more sense to put more bot information in sysvars than to encourage re-calculating them in bot scripts.
In the end that turned out to be unnecessary, since the values stored in the eye variables seemed to be relative to bot size. (At the time, I was trying to detect when an annoying tiny bot had managed to get *inside* my bot's radius, preventing my shots from hitting it - and yes, I actually saw this happen).
abyaly:
I want sysvars that give me the position of the bot I'm viewing relative to my position and orientation.
Eg: That bot is 300 (unit) ahead and -200 (unit) to my right
This is sort of possible with what we have now, but it's a mess and breaks on large field size.
I want *.robsize to actually update when the robot changes size instead of always giving 120
There were more that I can't remember at the moment.
--- Quote ---* I'm probably the only person writing ridiculously complicated bots with numerous conditions attached to almost every store, but I'm guessing that's probably because of the sheer infeasibility of doing such a thing directly in DB's bot language (as opposed to in an easier to understand language, which is translated to DB bot language).
--- End quote ---
I think part of your size issue comes from generating the DNA instead of writing it
I'm looking forward to seeing what kind of monster you are making, although I hope it doesn't slow down the sim too much.
Trafalgar:
--- Quote from: abyaly ---I want sysvars that give me the position of the bot I'm viewing relative to my position and orientation.
Eg: That bot is 300 (unit) ahead and -200 (unit) to my right
This is sort of possible with what we have now, but it's a mess and breaks on large field size.
I want *.robsize to actually update when the robot changes size instead of always giving 120
There were more that I can't remember at the moment.
I think part of your size issue comes from generating the DNA instead of writing it
I'm looking forward to seeing what kind of monster you are making, although I hope it doesn't slow down the sim too much.
--- End quote ---
It's in the starting gate now, although it's nowhere near readable (At the moment, I've mostly only posted the generated version of it - what it looks like before being converted/compiled/whatever is much more readable, at least to me ). What I posted would be more readable if I hadn't had it strip out the comments to make the file smaller (The .txt without comments is about 70 KB in size - the original file is only about 30 KB including comments), or if I had left on the option to insert the original source in comments (that would help if you're just reading the .txt, but would increase its filesize rather a lot too).
Having it generated helps quite a lot with reliability, though. I can't make a mistake writing chains of - ++ & blah blah blah when that's all done for me (except that I could make a mistake in coding them to be generated, but that's what planning before coding, and what testing to make sure it's doing what it should be, are for, of course).
I was thinking about when I should release PyBot so anyone could use it, but I'd need to write a good amount of documentation, and perhaps clean up some quirks first - For example, it doesn't follow (or understand) order of operations, so you have to use a lot of parens. If you tried to write "foo>=bar-3", it would think you meant "(foo>=bar)-3". It also throws a compiling error if you write "!=-3", as it doesn't recognize "!=-" as an operator (You just need a space between the != and -). And the "foo when (conditions) = bar" isn't like any other language I've used, so it might take seem a little unusual (compared to more traditional if/else structures).
Anyways, I'll stop rambling about it now.
googlyeyesultra:
Trust me, guardian WILL slow your sim to destruction. One of 'em will bring it down to around 2 cycles per second, and more will put it down to less than one.
I think you've developed a new strategy: Make the game lag enough that no one in their right mind would watch your bot to figure out how it works, and make the code complicated enough that no one cares to decipher it.
For now, I think your PyBot idea is great. However, once we get elseifs, nested conditionals, gotos, and a few other commands, I think it'll be far less useful. After all, you can then code in the defines manually once we get 'em.
Commendations on your amazingly powerful bot. Methinks I'll be bumped to third.
Numsgil:
I'm presently imagining up a new DNA system to allow for more complexity. Something like a neural net hybrid with the current system. I'd be interested if you would describe the sort of organization for your bot (reading bot code isn't something I enjoy). It's definitely a stress test, it think.
I'll start a new thread where we can discuss DNA.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version