JonathanRyan.org

Raptor Attack Simulation

I read XKCD, a brilliant web comic, regularly. Recently I decided to write a simple simulation based on one of his older comics. Here is an excerpt showing exactly what I simulated:

substitute.png

I threw the simulation together in JavaScript rather quickly, so it isn’t at all elegant and nice looking. However, it is still a lot of fun to play with. Your character runs towards the mouse, and the simulation stops when you are caught. Refresh with F5 to start again.

Version 1 has momentum, and feels strange to control. It is possible to get the raptors to constantly circle around you, since they can’t turn fast enough to get you once they are up to speed.

Version 2 has much more agile raptors. They can turn and stop instantly, but still need to accelerate to get to speed in a new direction. This one proves for certain that RAPTORS ARE SCARY! My best time so far is 2.8 seconds.

Eventually, I would love to implement a version with floorplans using the rules from the last problem in the linked comic, but I doubt I’ll get around to playing with that for a long time.

Search for Raptor Attack on Amazom

2008-02-08 12:59 by Jon, Filed under:Games   18 Comments »

Comments

  1. Sammie Says :

    haha. Yes! Thank you for the quick entertainment.

    sammie

    2008-02-22 13:44 Permalink
  2. Danny Says :

    15.5 seconds on the second one… Whew… Raptors are scary…

    Nice man! Good work!

    2008-07-23 15:44 Permalink
  3. S7evyn Says :

    Second one:

    Survived so far: 85.29999999999943 seconds Ran: 448.6871266136949 meters

    I could’ve kept going, but I got bored. Go straight down and slightly to the right, then make a hard right and you can move in circles indefinitely.

    2008-09-26 10:08 Permalink
  4. fringefr Says :

    Raptors? You mean those 0.5m tall non-flying birds that you could kick out of your way?

    2008-09-26 10:13 Permalink
  5. Shawn Sanders Says :

    45 seconds in the first one! w00t!

    2008-09-26 11:09 Permalink
  6. Alistair Says :

    Go up-right for 2.1 seconds, then 90 degrees right, facing dwn-right:

    Survived so far: 3.900000000000002 seconds
    Ran: 18.569800522903538 meters

    2008-09-26 14:08 Permalink
  7. Naiden Says :

    6.89 on version 2

    2008-09-26 15:49 Permalink
  8. asdf Says :

    seems i can evade the first version forever.

    version 2: 23.3secs

    nice simulation.
    reminds me of dogfight sims, and evading homing missiles.

    2008-09-26 16:41 Permalink
  9. chad hamby Says :

    18.9 on ver.2 head down and then circle only works if raptors trip over each other

    2008-09-29 14:59 Permalink
  10. Raptor Advocate Says :

    The raptor on top does not appear to have its speed limited as mentioned in the strip

    2008-09-29 15:38 Permalink
  11. Jon Says :

    Raptor Advocate,

    The speed is definitely limited, you just don’t see it much. The strip doesn’t mention a slower acceleration, and most of the time the top raptor hasn’t had a chance to reach top speed by the time you’re caught.

    2008-09-29 15:41 Permalink
  12. Dustin Says :

    42.6 sec.
    202.485 m
    Straight down then doing 90 degree turns

    2008-09-29 16:53 Permalink
  13. Dustin Says :

    Version 2 ^^^

    2008-09-29 16:54 Permalink
  14. War_Hero Says :

    I got infinite time on the first one. go up right until you are out of the triangle of death, then make a sudden turn down. Just keep circling after that and they will never get you.

    2008-09-30 00:11 Permalink
  15. eric Says :

    64 seconds on the second one!
    Run down, then turn as soon as the one on the bottom right passes to dodge the top. after that its essentially running in a square or circle since they have to stop to turn. straight lines = death.

    2008-09-30 16:33 Permalink
  16. Nick Says :

    Second one I got 63.90000000000064 seconds, Ran for 189.20081264441484 meters. Once you break away from their initial charge it is easy to just keep them moving in a circle behind you and keep evading them indefinitly.

    2008-10-03 07:51 Permalink
  17. Nathan Says :

    How long you can survive the simulation isn’t really important..realistically, you would eventually get tired and even if you didn’t it doesn’t matter how long you run in circles, you’re just stuck in that area and will never make to cover. Not that many places that would save you from a raptor right on you’re tail…plus you should take into account the fact that they can jump and catch you before you got to that crucial turning point. Also, they’re a pack. A smart one at that. While you’re running in circles one of them would just pull back a wait to cut you off from another angle….point being, you can’t survive. Raptors are the greatest predators in this planet’s history. Great simulation though.

    2009-02-12 20:09 Permalink
  18. Matt Corey Says :

    Yeah he’s right, you can go infinitely if you hit one of the windows JUST right. The bottom followed by a right jink worked best. The 2 o clock is more interesting but only got me 4 seconds once. I think it’s cuz it’s easier for our brains to recognize straight down than slightly to the right

    2009-03-01 21:01 Permalink

Leave a comment

(required)

(required)

RSS feed for comments on this post.

Powered by WordPress , Theme Ported to Wordpress by Liu Xun. Original Design by Cathayan

liuxun at gmail dot com