Darwinbots Forum

Bots and Simulations => Bot Tavern => Topic started by: Ulciscor on June 07, 2005, 12:37:13 PM

Title: Bots with Feelings
Post by: Ulciscor on June 07, 2005, 12:37:13 PM
Hey everyone!

I was wondering if it would be possible to make a bot that had a reeeally basic set of 'emotions' for events. Not the kind of emotions we think of, rather crude weightings that are associated with events.

Like being shot at or having low energy would give a negative weight. Reproducing or feeding would give a positive weight. Then the bot could act in such a way as to make its 'emotional state' as high as possible by carrying out the appropriate events.

I know this would be no mean feat and would probably make the bot clunky and slow in a competition but this is just food for thought lol.

B) Ulciscor B)
Title: Bots with Feelings
Post by: Numsgil on June 07, 2005, 12:41:35 PM
You'd have to either set up a neural network (as you suggested in the other post) or a Finite State Machine or something along those lines.  It would mean quite a bit of programming, but I'm sure it's possible.  The trick is just deciding on an appropriate structure for your DNA.

And quite a few variables, but that's not a bad thing since 800 aren't used.   :lol:

1.  You'd need to have weights for each state, both permanent (remembered) and
temporary (I'm getting hungry!)

2.  A variable for the current state

3.  Something to stop other states from interupting a current state where needed

4.  Something to pick a new state based on weights for each state (both permanent and temporary) after a current state is at a good stopping place.

Would be some work, but it's possible.
Title: Bots with Feelings
Post by: Zelos on August 20, 2005, 03:34:21 PM
yeah, a mb or Mb is able to do that, by making all the bots a part of the brain.
Title: Bots with Feelings
Post by: PurpleYouko on August 21, 2005, 12:32:40 PM
Inter-bot communication will need to be improved first.
Title: Bots with Feelings
Post by: Ulciscor on August 21, 2005, 07:51:59 PM
I really need to find a way to get a bot to test whether a tie is actually tied or not, if you know what I mean.
Title: Bots with Feelings
Post by: Numsgil on August 21, 2005, 07:58:23 PM
You mean if a tie attempt was successful?  Easiest way is if the number of ties increases.  It's not foolproof, but it's just about.  I can't remember what sysvar handles that.  numties I think it's called.
Title: Bots with Feelings
Post by: Ulciscor on August 21, 2005, 09:42:33 PM
More than that; if I have 4 ties a,b,c & d, I want to be able to tell which ties are intact and which aren't
Title: Bots with Feelings
Post by: PurpleYouko on August 22, 2005, 08:47:38 AM
Sounds like we may need to introduce a "ping" command.

We could use a,b,c to address the internal tie array and numbers to address the tie phases.

"ping a" would return 1 if there is currently a tie in the first tie array position.
"ping 12" would return a 1 if there is currently a tie with a phase of 12. 2 if there are two ties with a phase of 12.

If this would be helpful then it could very easily be added.
Title: Bots with Feelings
Post by: Endy on August 22, 2005, 09:36:17 PM
I like the idea of a ping function(states of 1 or 0 would be useful), with all of these new ties and tielenX/tieangX it'd be useful to know which ties are actualy being used. So far I've just randomly stored the same value into all of them in hopes of hitting the right tie.

I've looked into finite state machines, made some progress into figuring out how to use math to make true/false/other statements (and, or, xor, not). Using in/out memloc and tmemloc set at 1, 0, -1. It's possible to communicate up to a max of 81 different states between bots.(for more info just ask) I still haven't worked out a practical use, but maybe you could use it for a neural net somehow.
Title: Bots with Feelings
Post by: Numsgil on August 23, 2005, 08:56:11 AM
Just a note at some point I thought I'd like to add 3 more in/out pairs (for use in communicating coordinates especially.)  I don't think I did it in 2.4, but I'd have to check.  Just throwing that out here.  Ulc's post reminded me of it.
Title: Bots with Feelings
Post by: Light on September 02, 2005, 09:02:48 AM
A few more in/outs would be good  :)
Title: Bots with Feelings
Post by: PurpleYouko on September 02, 2005, 09:07:59 AM
Don't forget the little (if ever) used memloc/memval pair.
Title: Bots with Feelings
Post by: Numsgil on September 02, 2005, 09:26:28 AM
But the memloc/memval pair is most useful for conspec recognition.  I wonder how many conspec recognition systems exist in DB...
Title: Bots with Feelings
Post by: PurpleYouko on September 02, 2005, 09:29:07 AM
The more the better IMO.

Has anyone ever used memloc/memval?

I can't remember seeing any bots that use it.
Title: Bots with Feelings
Post by: Numsgil on September 02, 2005, 01:59:05 PM
My bots are usually memloc/memval whores.  The ones ment to compete anyway.  That's Ymir and SC I think.

I dunno about other people's bots.
Title: Bots with Feelings
Post by: PurpleYouko on September 02, 2005, 02:35:03 PM
Hadn't really noticed that.

I have only used it for a kind of memory reading gizmo in ant-bots.
Title: Bots with Feelings
Post by: Endy on September 07, 2005, 02:16:09 AM
A problem with memloc/memval is that it's possible to query the value of one to find the other. I'd personally like it if memloc couldn't be read by another bot, this way recognition would be safer.
Title: Bots with Feelings
Post by: Numsgil on September 07, 2005, 09:32:56 AM
I can see your point, but I hate the idea of another specifically designed excpetion...

I'll go with concensus.
Title: Bots with Feelings
Post by: PurpleYouko on September 07, 2005, 10:54:25 AM
I agree with Num. Exceptions are bad.

If a bot is programmed (or evolved) cleverly enough to mimic the enemy by copying its memloc value then using it to find out the memval value then it deserves to be allowed to do it.
Title: Bots with Feelings
Post by: Ulciscor on September 09, 2005, 07:58:19 PM
Quote
Sounds like we may need to introduce a "ping" command.

We could use a,b,c to address the internal tie array and numbers to address the tie phases.

"ping a" would return 1 if there is currently a tie in the first tie array position.
"ping 12" would return a 1 if there is currently a tie with a phase of 12. 2 if there are two ties with a phase of 12.

If this would be helpful then it could very easily be added.
Would it be possible to add this? I think it might be rather useful for MB structures which need to have a particular pattern of arrangement.
Title: Bots with Feelings
Post by: Numsgil on September 11, 2005, 02:50:29 PM
Sure thing.  Whenever PY or I get around to reworking the tie structure.
Title: Bots with Feelings
Post by: Botsareus on September 11, 2005, 08:25:05 PM
Num when are you going to post whats going on with the ties? (That physics/vb related problem you want me to help figure out)

sorry a bit of topic , but does not sound like a new thread eather
Title: Bots with Feelings
Post by: Numsgil on September 12, 2005, 01:01:08 PM
I have to go look at my old notes, and since my new place doesn't have internet yet, but it does have Baldur's Gate II, well, I'm sure you can see the problem.  Also, my sunburn is killing me!  I think I'm going to die!  Arg.
Title: Bots with Feelings
Post by: Numsgil on September 13, 2005, 01:35:29 PM
It's posted in suggestions.
Title: Bots with Feelings
Post by: peterb on April 12, 2010, 05:56:52 PM
basically my evolve series of bots use simple 'feelings', it is not neural programming.
Still it does result in intresting behaviour, in the first series evolve-2 the aiming was simple
So you cold spot this behaviour easily.

But i write it down in normal english, this bot shoots a bit longer shots (actually based on distance).
But every shot costs him something, the cost is reset when nothing is in eye5 (so the move gene runs)
If the eye5 gene is not running then the move gene is running
The move gene resets the missed shots (you could also write it to count them down).
Back to the eye5 gene,  if there are to many shots missed then it will perform a fixpos, and if even more shots are missed then it turns away from this difficult to get prey.
Also while in gene5 execution if it was under pain, then that counted for 3 shots (which is i think a bit low, but well that's easily changeable).

Later bots evolve series had better aiming techniques but still sometimes made use of the fixpos, or of the givingup option tricks.
As a result of that behaviour the bots didnt endlessly shoot at bots they cant get, they stop the hunt after a while.
the better aiming was gained by also moving like   *.refdx 2 div .dx store   besides the .up moves.

the code is an early version without the .dx adjustments
So its better to spot this behaviour, SIM sohuld be F1 no friction (so we get aiming problems for this bot).



[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Évolve  II
'
'Advanced shooting and aiming
'
'mainly 2 gene bot with new mechinisms
'
' Gain or pain >> eat or not, and always shoot target if insight
' simple repro gene more advaces will be added later
' first other parts need to be tuned. (gain pain mechanics)
'
def direction 52
def etarget 53
def eyetemp 54     'left or right or not (1|-1|0)
def shootnow 55
def shootdist 56
def temp 60
def pleased 61
def borring 62
def missed 63
def detect 64
def nogain 65
def sneaky

'GENE EAT ============================================
'
'Note this bot always tries to eat
'It checks (still to improve) if eating was succesfull
'Is it a Gain or Pain ?
'So it wont keep shooting runing & spinning, if its out of reach
'Or if it doesnt contain enough food.


cond
*.robage 30 >
 *.eye5 0 >
' *.in1 *.reproval !%=
' *.in2 *.bigsmall !%=
' *.refeye *.myeye !=

start

'
'*.refxpos *.refypos dist .edist store
'*.eye5 30 sub sgn 1 add sgn .shootnow store



-32 *.eye5 div .shootval store
-1 .shoot store
*.sx 2 div .dx store


*.refxpos *.refypos angle .setaim store
-1 .shoot store
 
0 .fixpos store

 'positive longer
 'negative smaller



'after shooting move
*.refvelup 20 add .up store


'____________________________________________________________________________
___
' pain is more then gain counts as 3 times missed. ???..

*.pain *.pleas sub sgn 1 add sgn 1 sub abs 3 mult *.missed add .missed store
'  0      0     0   0     1   1    0    0    0
'  7      0    -7  -1     0   0   -1    1    3
'  0      7     7   1     2   1    0    0    0

'no pain no gain missed + 1  
*.pain sgn 1 sub abs .nogain store
*.please sgn 1 sub abs *.nogain add sgn *.missed add .missed store

'out of reach tried long enough now (150..??) .....


*.missed 150 mod sgn 1 sub -628 mult .aimdx store
*.missed 150 mod sgn 1 sub -1 mult .fixpos store



'____________________________________________________________________________
___
stop




'GENE MOVE====================================================================

cond
*.eye5 0 =
*.robage 30 >
start
*.eye9 *.eye1 sub sgn .eyetemp store
*.eyetemp 130 mult .aimdx store
*.eyetemp abs -1 add abs 5 mult .up store
*.eyetemp abs -1 add *.mass mult .dn store

*.dx -2 div .dx store
10 .up store

'if eye eye4 or 6 see something fixpos turn
*.eye6 *.eye4 sub sgn .borring store
*.borring 35 mult .aimdx store
*.eye6 *.eye4 add sgn abs .fixpos store
*.pain 1 sub abs .pain store
*.eyetemp abs .detect store
*.borring abs *.detect add sgn .detect store
*.detect *.missed mult .missed store

0 .sneaky store
stop


cond
*.nrg 30000 >

start
10 .repro store
-700 .aimdx store
7 .strbody store
11 .mkshell store
stop

cond
*.robage 30 <
start
*.tiepres .deltie store

500 .dx store
*.robage 5 sub sgn 1 add sgn 500 mult .dn store
'    1                 -1     0    0           0
'    5                  0     1    1          500
'   10                 1     2    1          500

1 .aimdx store
1 .strbody store
stop

cond
*.body *.refbody <
*.refeye *.myeye !=
*.sneaky 0 =
start
.repro .shoot store
50 .shootval store

stop

I know its a real old topic, but since i just made them (just a week ago)
And it answers this post i thought lets post it, its a basic principle, and could be used in other more advanced bots too
So if someone else gets into this thread he would get an answer.
(i came here looking for neuron based bots)


Title: Bots with Feelings
Post by: Ta-183 on April 19, 2010, 12:48:54 PM
SF2.1 uses a system that could be described as one step away from 'feelings', pertaining to the bots situation rather than its experiences. Its behavior (what it is doing, what it will do, what it won't do, like it will run from an enemy if its health is low but not if the health is good and it will eat if it sees food an it isn't doing anything more important, like RUNNING AWAY) is determined by what it sees and what it knows about itself, such as it health and if there is any food nearby, or enemies. SF2.2, which was planned but dropped because it would have been a nightmare to program, would have used a rudimentary (in a very loose sense of the word) system that could actually be called it's 'mood', which would control which eye control system it would use, whereby it would normally use the complex eye-switching system envisioned for SF2.2, but if it got confused a lot or didn't work, it would get 'frustruated' and revert to 2.1 eye control.