Bots and Simulations > DNA - General

shootval and distance for -1 shots

<< < (3/5) > >>

peterb:
got to keep integers under <32000
so

25.0438 / (0.217382 -e5)

3200 /25.0438 = ~1277

so it equals >  (25.0438 *1277) / ((0.217382 *1277)-e5 *1277)

= 31980 / ( 278 -( e5 * 1277)  

----------------------------------------------
In DB language that is   (using clacula as a temp)

278 - *.eye5 .calcula store
31980 *.calcula div .shootval store


 i will attach a bot with this forumula contained   (but remove the last gene of that bot dont let it repro, thats still crap inside this bot).

peterb:

--- Quote from: peterb ---got to keep integers under <32000
so

25.0438 / (0.217382 -e5)

3200 /25.0438 = ~1277

so it equals >  (25.0438 *1277) / ((0.217382 *1277)-e5 *1277)

= 31980 / ( 278 -( e5 * 1277)  

----------------------------------------------
In DB language that is   (using clacula as a temp)

278 - *.eye5 .calcula store
31980 *.calcula div .shootval store


 i will attach a bot with this forumula contained   (but remove the last gene of that bot dont let it repro, thats still crap inside this bot).
--- End quote ---


...hmmm for some reason its not ok, did i make an error here above ?, i do believe the math retrieved from eureqa was ok 25.0438 / (0.217382 -e5)

ashton15:
Ah... I've not checked here recently though I did go ahead with the programming in the direction I was taking and have had a good result, the following code is super-efficient using only 0.04 nrg with F1 default settings when the position of the bot if in sight changes as only a single store is activated at any one time and conditionless logic is used. It computes for every eye rather than just eye5 and also takes into account the width of every eye as as they become narowrer the sight becames longer-ranged, storing a positive value into .power will allow you to make a powerful shot for when close to the enemy though I recomend for effeciency you find every instance of *.power and replace wi with a number, unfortunetly it's fairly large so if DNA upkeep is charged (which is hardly ever the case though you never know) it will all of a sudden become fairly ineffcient, anyways tell me what you think.  Not bad for 34 hours development time...

25044 217 *.eye1 600 mult sub div *.eye1width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye1width sgn - mult        *.focuseye -4 sub sgn abs -- - mult *.eye1 sgn mult store
25044 217 *.eye1 600 mult sub div *.eye1width 80  div ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye1width sgn   mult        *.focuseye -4 sub sgn abs -- - mult *.eye1 sgn mult store
25044 217 *.eye1 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye1width sgn abs -- - mult *.focuseye -4 sub sgn abs -- - mult *.eye1 sgn mult store
25044 217 *.eye2 600 mult sub div *.eye2width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye2width sgn - mult        *.focuseye -3 sub sgn abs -- - mult *.eye2 sgn mult store
25044 217 *.eye2 600 mult sub div *.eye2width 80  div ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye2width sgn   mult        *.focuseye -3 sub sgn abs -- - mult *.eye2 sgn mult store
25044 217 *.eye2 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye2width sgn abs -- - mult *.focuseye -3 sub sgn abs -- - mult *.eye2 sgn mult store
25044 217 *.eye3 600 mult sub div *.eye3width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye3width sgn - mult        *.focuseye -2 sub sgn abs -- - mult *.eye3 sgn mult store
25044 217 *.eye3 600 mult sub div *.eye3width 80 div  ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye3width sgn   mult        *.focuseye -2 sub sgn abs -- - mult *.eye3 sgn mult store
25044 217 *.eye3 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye3width sgn abs -- - mult *.focuseye -2 sub sgn abs -- - mult *.eye3 sgn mult store
25044 217 *.eye4 600 mult sub div *.eye4width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye4width sgn - mult        *.focuseye ++     sgn abs -- - mult *.eye4 sgn mult store
25044 217 *.eye4 600 mult sub div *.eye4width 80 div  ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye4width sgn   mult        *.focuseye ++     sgn abs -- - mult *.eye4 sgn mult store
25044 217 *.eye4 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye4width sgn abs -- - mult *.focuseye ++     sgn abs -- - mult *.eye4 sgn mult store
25044 217 *.eye5 600 mult sub div *.eye5width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye5width sgn - mult        *.focuseye        sgn abs -- - mult *.eye5 sgn mult store
25044 217 *.eye5 600 mult sub div *.eye5width 80 div  ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye5width sgn   mult        *.focuseye        sgn abs -- - mult *.eye5 sgn mult store
25044 217 *.eye5 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye5width sgn abs -- - mult *.focuseye        sgn abs -- - mult *.eye5 sgn mult store
25044 217 *.eye6 600 mult sub div *.eye6width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye6width sgn - mult        *.focuseye --     sgn abs -- - mult *.eye6 sgn mult store
25044 217 *.eye6 600 mult sub div *.eye6width 80 div  ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye6width sgn   mult        *.focuseye --     sgn abs -- - mult *.eye6 sgn mult store
25044 217 *.eye6 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye6width sgn abs -- - mult *.focuseye --     sgn abs -- - mult *.eye6 sgn mult store
25044 217 *.eye7 600 mult sub div *.eye7width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye7width sgn - mult        *.focuseye 2  sub sgn abs -- - mult *.eye7 sgn mult store
25044 217 *.eye7 600 mult sub div *.eye7width 80 div  ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye7width sgn   mult        *.focuseye 2  sub sgn abs -- - mult *.eye7 sgn mult store
25044 217 *.eye7 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye7width sgn abs -- - mult *.focuseye 2  sub sgn abs -- - mult *.eye7 sgn mult store
25044 217 *.eye8 600 mult sub div *.eye8width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye8width sgn - mult        *.focuseye 3  sub sgn abs -- - mult *.eye8 sgn mult store
25044 217 *.eye8 600 mult sub div *.eye8width 80 div  ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye8width sgn   mult        *.focuseye 3  sub sgn abs -- - mult *.eye8 sgn mult store
25044 217 *.eye8 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye8width sgn abs -- - mult *.focuseye 3  sub sgn abs -- - mult *.eye8 sgn mult store
25044 217 *.eye9 600 mult sub div *.eye9width -17 div ++ mult 5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye9width sgn - mult        *.focuseye 4  sub sgn abs -- - mult *.eye9 sgn mult store
25044 217 *.eye9 600 mult sub div *.eye9width 80 div  ++ div  5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye9width sgn   mult        *.focuseye 4  sub sgn abs -- - mult *.eye9 sgn mult store
25044 217 *.eye9 600 mult sub div                             5 mult 3 div dup sgn abs *.power mult add dup *.shootval sub sgn abs .shootval mult *.eye9width sgn abs -- - mult *.focuseye 4  sub sgn abs -- - mult *.eye9 sgn mult store

Houshalter:
 Wow. Does it work? (cant test it because I'm not on the right computer.) You might have invented the most accurate shooting gene ever.

ashton15:

--- Quote from: Houshalter --- Wow. Does it work? (cant test it because I'm not on the right computer.) You might have invented the most accurate shooting gene ever.
--- End quote ---

I belive it does... not 100% accurate however as eyes only read back a value from 0 to 100 thus if something is 66.698 in an eye shootval will only be assigned to something like 67, the effect is more noticable at eye values 1-10  on eyewidth -34 where there is a small possiblity of error though quite small and it should overjudge rather than underjudge so it hits... in theory anyways... also idealy I would use 25043.8 and 217.82 though because of problems with darwinbots I must use 25044 and 218 instead. By the way it only calculates how far a shot should travel... it doesn't bother with aim or anything like that before you decide I'm a genius.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version