Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Shasta

Pages: 1 [2]
16
Suggestions / Customisable best bot function
« on: April 30, 2008, 09:21:40 AM »
By this I mean something like the program parsing a text file that we create using some key words (mostKills, mostOffspring, mostNrg... ect), operators, numbers, and if you want it run through veggies or not. Then defining if we want the lowest or highest result when run for the bots.

Because of the fact that the best bot in the sim is a pretty subjective thing, most offspring doesn't always work. With this people can define what they think of as the best bot for their current sim.

17
The Gene depository / Antivirus
« on: December 18, 2007, 12:10:36 AM »
I'm not sure if anyone has done this yet, I didn't see anything (although I didn't look very hard.)

Here is an antivirus that works with the random virus gene placement. I made it work in animal minimals as it was short and practically everyone has seen it, so you can notice the changes. This will work in any bot, it will just take quite a bit of writing for longer ones. I heavily commented the antivirus gene, an un-commented version is attached below.

Code: [Select]
'Animal_Minimalis
'By: Nums
'Good for mutation sims and for
'newbies to see how a basic bot works.
'Contains everything necessary for it
'to survive and reproduce.
def g1num 71
def g2num 72
def g3num 73
def g4num 74
def g5num 75

' Gene 1 Food Finder
cond
start
 *.eye5 0 >
 *.refeye *.myeye != and
 *.refveldx .dx store
 *.refvelup 30 add .up store
 true
 *.thisgene .g1num store 'Always Store the gene # for later
stop

' Gene 2 Eat Food
cond
start
 *.eye5 50 >
 *.refeye *.myeye != and
 -1 .shoot store
 *.refvelup .up store
 true
 *.thisgene .g2num store 'Always Store the gene # for later
stop

' Gene 3 Avoiding Family
cond
start
 *.eye5 0 =
 *.refeye *.myeye = or
 314 rnd .aimdx store
 true
 *.thisgene .g3num store 'Always Store the gene # for later
stop

' Gene 4 Reproduce
cond
start
 *.nrg 20000 >
 10 .repro store
 true
 *.thisgene .g4num store 'Always Store the gene # for later
stop

' Gene 5 AntiVirus
cond
start
'Always Store the gene # for later
*.thisgene .g5num store
'Make Sure My Gene #s get A chance to record (if not here good genes get delted
 *.robage 1 !=
'Check If first gene is still first
   *.g1num 1 !=
'If Not, get rid of genes above it
    *.g1num 1 sub .delgene store clearbool
'Check the distance between gene 1 and 2
   *.g2num *.g1num sub 1 !=
'Delete the Genes below 2 if distance is > than 1  
    *.g2num 1 sub .delgene store clearbool
'Check the distance between gene 2 and 3
   *.g3num *.g2num sub 1 !=
'Delete the Genes below 3 if distance is > than 1  
    *.g3num 1 sub .delgene store clearbool
'Check the distance between gene 3 and 4     
   *.g4num *.g3num sub 1 !=
'Delete the Genes below 4 if distance is > than 1  
    *.g4num 1 sub .delgene store clearbool
'Check the distance between gene 4 and 5
   *.g5num *.g4num sub 1 !=
'Delete the Genes below 5 if distance is > than 1    
    *.g5num 1 sub .delgene store clearbool
'Check if gene 5 is last
   *.genes *.g5num !=
'Delete the Genes above 5 if not
    *.g5num 1 add .delgene store clearbool
stop
end

[attachment=763:attachment]

On another note, once I finished this tonight during testing I noticed something strange. When virus gets deleted, if it already submitted a .mkvirus call, it WILL shoot, no matter what. So even though there is nothing to copy into a virus in the bot, it still does with the full original virus. I wasn't sure if this is a bug or not.

Not really sure if I worded that very well, but if you run a sim with self-replicating viruses and this bot you will see what I am talking about.

Well, there you go!  

18
DNA - General / Divide by Zero
« on: November 23, 2007, 06:04:32 PM »
I was trying to write a new bot and came across a few questions that I couldn't find an answer for.

What value does a divide by zero return? I saw in DB 3 it will yield a 0 is this true for 2.4x also?

True and False can be used to control whether parts of genes execute, can conditional operators be used to control them?
For example I have a gene (Which I doubt works, as this computer cant really run DB I cant test it) that asses if the bot is being hurt to much and should run away:
Code: [Select]
'See If I Am Being Hurt Too Badly
cond
 *.wellness 0 <=
start
 628 rnd 314 add .aimsx store
 *.maxvel .up store
 *.welltime 4 mod 0 =
 0 .wellness store
stop

Finally,
Code: [Select]
*.refnrg *.refkills div *.nrg *.kills div div 1 >=   'Less than one is bad/dangerousWould there be a better option for checking if the bot in eye5 is worth attacking? This one would have problems depending on what a divide by zero returns (veggies) and for low energy bots and a couple of other problems, such as never finishing off bots.

Edit: Also how many cycles does poison last for, is it the same as venom?

Sorry for all of the questions

19
Off Topic / Custom Language and Auto-Fill
« on: November 20, 2007, 12:35:22 AM »
I spent some time and defined a custom language and a Auto-Fill sheet for DB DNA tonight. I find that it makes code easier to proofread and follow, but I'm sure some of you have done something similar already. I [you]think[/you] I have everything spell correctly and have all of the sysvars operators and flow statements in there, but if I missed any let me know.

Example of this here.

To Install:

  Paste this [attachment=692:attachment] into your application data\notepad++
       (Alternatively this can be reached by typing %APPDATA%\Notepad++ in the Run box)


For the Auto-Fill:

  Paste this [attachment=693:attachment] into your install location\notepad++\plugins\APIs and rename the file type to .api (the forums wouldn't let me upload a .api)


Notepad++ can be found here.

20
Newbie / Hello!
« on: October 29, 2007, 01:29:24 AM »
Hi there everyone, I have been lurking around for a while and decided to say hello, and to ask for some help.

I got around to writing my first bot based off of Animal Minimalis tonight it was working fairly well then, I messed it up somehow, I think though a find/replace. So now it no longer ties to anything, I am sure it is something small but I cant find it.  Any help would be great.

[attachment=677:attachment]

Pages: 1 [2]