DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: The little bug who grew up to become a feature  (Read 10,839 times)

Eóin

  • O'Callaghan
  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
The little bug who grew up to become a feature
« on: April 05, 2010, 07:23 PM »
This is a cool little story about a programming arithmetic bug which caused such a cool effect it became a feature. It's a post Bug or feature? from Shawn Hargreave's blog.

Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,772
    • Participated in NANY Challenge Three Times
    • Cody Award
    • Coding Snacks
    • Official Forum Clown
    • Volunteers/Staff
    • Writer
    • Hardware Hacker
    • DJ Badge - DJ
    • Linux User
Re: The little bug who grew up to become a feature
« Reply #1 on: April 05, 2010, 10:08 PM »
Wow, such a cool feature caused by such a small accident in the coding stages!  :Thmbsup:

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: The little bug who grew up to become a feature
« Reply #2 on: April 05, 2010, 10:56 PM »
Nice bug :)

Hadn't see the Shawn Hargreaves name for a long time, brings back memories of DJGPP+Allegro days.
- carpe noctem

JavaJones

  • Review 2.0 Designer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,739
    • Participated in NANY Challenge Once
Re: The little bug who grew up to become a feature
« Reply #3 on: April 06, 2010, 02:34 AM »
Hehe, cool story. :)

- Oshyan

Daleus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 147
Re: The little bug who grew up to become a feature
« Reply #4 on: April 07, 2010, 01:23 PM »
Interesting story.

Without trying to be too philosophical about it, I wonder if there is a lesson to be learned from the story when considering AI.

It would be prudent when working on Artificial Intelligence projects, that we not mistake coding errors for human behaviour.

And that's about as deep as I can go - the thought just popped into my head when reading the blog post.

Please, return to your normally scheduled aspirating.

Daleus, Curmudgeon-at-Large

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,321
    • Gathering Badge
Re: The little bug who grew up to become a feature
« Reply #5 on: April 10, 2010, 10:49 PM »
Quite a remarkable story of how subtle differences in rules can lead to completely unexpected behavior  :Thmbsup:

nharding

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 36
    • Participated in NANY Challenge Once
Re: The little bug who grew up to become a feature
« Reply #6 on: April 11, 2010, 10:41 PM »
Although it wasn't a bug, one of the first games I wrote was Hyperball for the Atari ST. You control a spaceship and fire at a puck to score goals by guiding it into the opponents score line. I had reasonably accurate physics (I think the conservation of angular momentum was just hack rather than correctly implemented from memory), which give the masses of the ships compared the projectiles you fired meant it was better to ram the puck than to fire shots at it. So I made it so that it wouldn't ram the puck (unless the player started to do so, and which case I would up the aggressiveness of the AI). It worked well, but since it would use prediction, so it would work out how far the puck was from the ship, what the movement vectors would be when the shot would get there etc, that it was almost impossible to beat the AI. I just added a difficulty level, on hardest difficulty it would run the AI code every other frame, (it originally ran every frame), and would just run it less often on the easier levels.

All the code was in 68000 assembly language, I miss programming in assembly language now (well I don't miss x86 assembly language that much :))

Neil Harding

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: The little bug who grew up to become a feature
« Reply #7 on: September 22, 2010, 02:01 AM »
It's a really cool story, but I wonder how that bug made it through testing. :-\

Josh

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,411
    • Gathering Badge
    • Official Forum Clown
    • Coding Snacks
    • Plugin Coding Medal
    • Volunteers/Staff
    • Military Service Badge - US Army
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: The little bug who grew up to become a feature
« Reply #8 on: September 22, 2010, 02:08 AM »
Is this how Find-And-Run-Robot came to be?
Strength in Knowledge

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: The little bug who grew up to become a feature
« Reply #9 on: September 22, 2010, 08:38 PM »
It's a really cool story, but I wonder how that bug made it through testing. :-\
Testing?
- carpe noctem

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: The little bug who grew up to become a feature
« Reply #10 on: September 23, 2010, 08:25 AM »
It's a really cool story, but I wonder how that bug made it through testing. :-\
Testing?
Er... Sorry, I don't know what came over me. I'm not sure what I was thinking. ;)

Original address: https://www.donationcoder.com/forum/index.php?topic=22335.0