Author Topic: .hit ? (2.42.1  (Read 6076 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
.hit ? (2.42.1
« on: April 16, 2006, 05:48:45 AM »
I read in the wiki that .hit does not save its value so I wanted to test if that is true.
However neither hit (tested with printmem) nor printtouch returned any value different from 0 regardless of situation.
(afternote: I also tested it for 2.42.2)

hm tielen does also return no value
« Last Edit: April 16, 2006, 07:49:55 AM by Welwordion »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
.hit ? (2.42.1
« Reply #1 on: April 16, 2006, 10:38:16 AM »
They're probably broken.  They're not really core featurs so sometimes they get overlooked.  Thanks for catching them.

Offline atrop

  • Bot Neophyte
  • *
  • Posts: 7
    • View Profile
Re: .hit ? (2.42.1
« Reply #2 on: January 27, 2012, 06:38:13 PM »
Hi Numsgil, it seems that at some point during those last five years .hit got broken again. I don't think .shflav and .shang are working either - in fact I don't see anything happening in that 210 range at all.

Do you still fix bugs in the 2.x version? I hope you do...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: .hit ? (2.42.1
« Reply #3 on: January 27, 2012, 08:01:46 PM »
I sometimes (and reluctantly) will go back in and fix bugs.

Which version are you using right now that they look broken in?

Offline atrop

  • Bot Neophyte
  • *
  • Posts: 7
    • View Profile
Re: .hit ? (2.42.1
« Reply #4 on: January 29, 2012, 07:01:09 PM »
I did some more testing and it turns out that only shang, shflav and the directional shot detection seem to be broken (I didn't realize that .hit is for "body" contact only). I put the following genes in veggie DNA:

cond
  *.shflav 0 !=
start
  100 .up store
stop

I would excpect that the veggie would move whenever it is hit by a shot, but nothing happens and I dont see anything going on in memory location 202. Nothing happening in the 209+ range (the directional shot values like .shup) either for that matter.

The version I use is DarwinBots 2.45.01, allthough it says 2.44 somewhere in the version pop up as well, not sure what that is about.

I'd really appreciate if you could take a look at this. Let me know if you'd like a postcard from Austria in return or something (no sexual favours).

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: .hit ? (2.42.1
« Reply #5 on: January 29, 2012, 09:27:06 PM »
I reformatted my computer and switched up to Windows 7 since I last worked on Darwinbots 2.  I'll see if I can install the IDE and stuff I need in order to work on DB2, but it's giving me a bit of grief atm.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: .hit ? (2.42.1
« Reply #6 on: January 29, 2012, 10:04:39 PM »
Nevermind, I'm just being whiny (for the record the VB6 install takes like 10 minutes to look for previously installed components).

I found and fixed the bug.  I checked the fix in to the trunk, and also built this version with the fix (but I didn't check it in against the tag, since that sort of defeats the purpose of tags).

Here's the fixed version.  Basically, robots with DNA disabled had this working, and all other robots had this broken (reverse of what I think was intended).

EDIT: Don't download this version, scroll down some more.
« Last Edit: May 30, 2012, 06:46:57 PM by Numsgil »

Offline atrop

  • Bot Neophyte
  • *
  • Posts: 7
    • View Profile
Re: .hit ? (2.42.1
« Reply #7 on: January 30, 2012, 04:17:18 PM »
wow, that's great thanks! To be honest I fully expected to be ignored.

However (and I feel kind of bad about bringing this up) I noticed that .shflav isnt set back to zero each click as mentioned in the sysvar documentation. I built in a quick workaround but then I noticed that my bots showed more odd behaviour, unrelated to .shflav - I did some testing and found out that one of the .in sysvars isn't being set back either (I'm using .in3 812 for silbling recognition - the poor fellows see brothers and sisters everywhere now)

so my guess is that some routine that you are using for setting back certain sysvars each click is broken in this version.

kind regards
atrop

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: .hit ? (2.42.1
« Reply #8 on: January 30, 2012, 04:55:23 PM »
Indeed, looks like I broke something with my fix.  It's difficult to see what consequences minor changes can have...

Let me play with it and get back to you.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: .hit ? (2.42.1
« Reply #9 on: January 30, 2012, 05:20:47 PM »
Okay, try this version.  I fixed my fix from last time. :)

Also, I fixed in6-10/out6-10.  Looks like they were half implemented.
« Last Edit: January 30, 2012, 05:36:44 PM by Numsgil »

Offline atrop

  • Bot Neophyte
  • *
  • Posts: 7
    • View Profile
Re: .hit ? (2.42.1
« Reply #10 on: January 30, 2012, 05:46:53 PM »
yep, everything seems to work fine again. thanks!

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: .hit ? (2.42.1
« Reply #11 on: February 01, 2012, 04:35:21 PM »
Might wana merge this to repository so I have a fresh 2.45 to work with when I get to it...

Related: I though in out 6 trough 10 did not reset there values on purpose...
« Last Edit: February 01, 2012, 04:38:02 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: .hit ? (2.42.1
« Reply #12 on: February 01, 2012, 04:40:20 PM »
It's merged in to both the Trunk and a branch off the 2.45.01 release (/branches/DB2.45.01_ShflavFixed).