Tuesday, July 13, 2004

[Ant Attack] Commenting on Comments

Woo! I've had comments. I wasn't sure if I should reply to them in the comments section or mention something here, so I'll go with here.

*

First off I was really please to get a comment from Jean-Yves, the guy behind Multi-User Lords of Midnight a game I loved when it first came out. Jean-Yves is doing great things with it. I bought a copy of RetroGamer 5 as there's a whole big thing about Ant Attack in there (oh if only I'd finished this a couple of months ago!) Lords of Midnight was written up too, I initially scanned the article planning on going back to read it later, but the phrase "Multi-Player" jumped out at me and I though "That's a really cool idea!". A couple of days later Jean-Yves is commenting in my Blog, how very cool. Now if only I has some free time!

*

Iain of the fully paid up game forum Slate State mentioned a little about the game running too fast and needing some Frame Limiting. Just when I though I did have Frame Limiting. This means either one of two things, my Frame Limiting code isn't working, which is quite probable, or, Iain is getting to old and can't handle the speedy gameplay anymore ;) as 80fps is the speed I'm shooting for!

*

Seems like I'm about to induce an epileptic fit in Jo with the screen flashing red when you get bitten! Sorry to say the flashing isn't going away any time soon. Although due to tuning two things were going on, the "Bite Delay" for each ant was set to only 200 milliseconds, so they cam rather thick and fast. And the ants didn't stop for a short pause after biting you, which they should have done. I've re-tweeked these things now so the bites don't come quite so thick and fast.

Why flash the screen red? Well in the original it'd pause a little while and say "Bitten!" at the bottom of the screen. Now-a-days(tm) I wanted to keep the action moving along without the pause so I needed some other way to signal the bite. The red flash comes from the Alfred Hitchcock film "Spellbound" where a couple of the frames of the otherwise black and white film tinted red, by hand I assume. Which, I imagine would have taken some people by surprise, just because you can only film in black and white doesn't mean the print can't have colour on it. As I've been aiming to keep AA black and white to I though the first splash of red would be kinda dramatic!

*

Right, enough rattling on the for moment, back to coding.





57 Comments:

At 15 July 2004 at 09:21, Anonymous Anonymous said...

Well just to make things weirder... I wrote that article in Retro Gamer 4 & 5! Jean Yves alerted "us" to your prescence.

Nice work on the remake.

Chris Wild
www.icemark.com

 
At 15 July 2004 at 12:56, Blogger Iain said...

It's *State* not *Slate*... but I'll forgive you that slip of the keyboard because you're doing such a fine job. :-) (And also because no-one can actually get onto the forum at the moment, but that's another story...)

You're *aiming* for 80fps? That seems pretty high to me, but then I am old and crumbly, as the writers from Crash! would put it. (28, for the record :-)

When you're getting surrounded by ants at such a high frame rate, it really makes things pretty impossible. (especially without ammo!) I must admit I've not tried the first person mode yet, so maybe that'll make it a bit more playable. I'll play a bit more and get back to you.

To Jean-Yves: I'll have to have a look at the Multi-User LOM, as it was my favourite graphical adventure as a kid - I even used the naming convention of the Lords (Lord 'X' of 'X') as part of my online forum/MSN nick!

 
At 16 July 2004 at 08:33, Blogger Modesty B Catt said...

Iain,

If the codes working correctly the 80fps just means that the movement of the ants is smoother not faster. i.e. they'll cover the same distance in 1 second, if it was running at 3fps then you'd see them do 3 "jumps" to cover the distance, at 80fps there'll be 80 far smaller jumps between the two points.

Having said that the code may be broken and they do move faster at higher frame rates. I'll have to look into it.

Having said *that* :) The game is just a little too hard at the moment, because you don't have any ammo, but I think that means the balance is just about right.

Time and tweaking will tell.

Thanks for playing with it the feedback it v.useful!

 
At 16 July 2004 at 09:52, Blogger Iain said...

The ants do seem to move faster than I remember them doing in the original game, but then the last time I played the original was at Game On a year or two back.

Just out of (professional) interest (being a code monkey by trade) - what are you coding the game in?

My experience with games suggests that faster frame rates does equate to faster animation (i.e. playing speed) - try playing 3D Deathchase at 300% speed on an emulator, and you'll see what I mean; smooth as hell, but practically impossible to get beyond Level 5 - I'm very interested to find out how you plan to make the animation that smooth yet still keep the movement rate down.

 
At 16 July 2004 at 20:31, Blogger Modesty B Catt said...

Hi Iain,

In the original the ants moved at the same speed as the player, in this version they move slightly faster. There's a good(ish) reason for this, in the original if you were a couple of steps ahead of an ant it would never catch up to you, so you could easily get the girl and run away without being bitten, *unless* you made a mistake while turning and so on, in which case the ant would catch up and bite you.

So you were being punished for making a mistake, which in game terms is quite correct and proper. However the controls were so hard to use, that in reality the difficulty of the game was really being set by the difficulty of the controls.

In the new version, which is much easier to control, it's no problem at all to keep ahead of the ant if you both travel at the same speed. The difficulty set by the controls is gone, so it has to come from somewhere else, I've done this by increasing the speed and number of ants.

As a player you have the advantage of being intelligent (we hope), being able to use the landscape to your advantage and have an offensives in the form of grenades and jumping on an ant to stun it.

The ants in their favor have speed and numbers. Once the grenades are in then the game balance can be tinkered with until it's about right.

At the moment, without grenades, I can complete a 10 out of 10 rescue about 1 game in 7. So I don't think the balance is too far off.

*

The game is being coded in Blitz3D. I originally used it thinking it would be good to prototype map/reading rendering, and then rewrite in C. But it seems to run pretty well that I don't think any speed increase is really worth the time of trying to deal with DirectX more directly!

*

As for limiting the speed on faster machines, well it works like this. Each ant has a Think() and Move() function. Pretend that there are 20 Ants and your running at 80fps, in other words the PC is fast enough to cycle through a game loop and render the display 80 times a second. In each loop I make one single and Think(), the next loop the next and will Think() and then the next one, so in the above case each ant will Think() 4 times a second.

A Think() consists of working out if the player is within the field of view, if not then which is the strongest player "smell" it can see, thus which way to turn, how much to turn, if it should slow down or speed up. An ant slows down the more it needs to turn to decrease it's turning circle. A think doesn't cause an ant to move or turn though, just where the ant wants to be in one seconds time.

A game running at 80fps has a cycle every 12.5 milliseconds. However the ants are only set to update their Move() every 20 milliseconds, so if less than 20ms has passed since the last time they moved, then they just continue on their path.

In old games an enemy would moved say 5 units per game cycle. So if a game ran at 40 cycles per seconds then an enemy would move a total of 200 units. If you run the game at 300% speed, or 120 cycles per seconds, then the enemy would move 60 units, so yes the game runs faster.

But where I'm doing here is setting the velocity of the Ant, so it moves 2.45 units per second. So if your game ran at 40 cycles per second, each cycle would move the ant by 0.06125 units. 120 cycles per seconds the ant would move 0.02042 units per cycle. Running very slow at 5 cycles per the ant would move 0.49 units per cycle.

But whatever the speed the ant would only move 24.5 units every 10 seconds.

What *is* happening though is the faster the machine the more often the ants get to Think(). So if the game was running at 160fps each ant would Think() 8 times a second. Or we could have 80 ants all thinking 2 times a second.

Flip this the other way, if you have 20 ants and the game only runs at 5fps, each ant only think once every 4 seconds! It'll see where the player is on one Think() and start to turn and move towards the player, and then not update it's turning amount and speed for another 4 seconds.

So really as a PC gets faster, say twice the speed, you could have the ants updating their brains twice as fast and acting smarter, or have twice as many ants being just as smart.

You can try this out by editing level1.bmp in the maps\antescher folder. If you ant 4 times as many ants you notice two things. One your frame rate drops as the game tries to Render more ants and two, the movement of the ants change, they'll tend to run in a far more "curved" path and will often miss you, they get dummer! Reduce the ants and they'll be smarter and go more directly for you.

*

I need to double check my code as it's possible that the Move() function is being called too often, but I'm pretty sure it's all in the right place. You may just being having trouble because the ants are set to be faster than you and at 80fps you've got pretty smart ants running around!! :)

Mod

 
At 19 July 2004 at 08:31, Blogger Iain said...

Wow - I had no idea such a simple game could be *so* complicated. It sounds like you've really got the maths sorted out though, so as long as you've not got any recursive procedure calls invoking procedures from within themselves (I've had this happen to me a few times in Visual Basic and C - a real headache and very hard to spot) it looks like you're got everything in hand.

Once you're done, it might be worth pitching the game in the direction of PC Gamer for distribution. This is just the kind of thing that they'd stick on their coverdisk, and they might even want to do an article on the process of how you made it. I have a few contacts at PCG if you're interested and want to make it happen. :-)

 
At 13 March 2007 at 03:20, Anonymous Anonymous said...

BUY CHEAP CIALIS
CIALIS - THE BEST TREATMENT IMPOTENCE
WHAT IS VIAGRA
BUY LOW-COST VIAGRA ONLINE & SAVE

 
At 3 February 2013 at 10:26, Anonymous Anonymous said...

buy generic soma soma drug picture - buy somatropin injection online

 
At 3 February 2013 at 19:36, Anonymous Anonymous said...

cheap soma online valium and soma drug interactions - can i buy soma online

 
At 4 February 2013 at 15:42, Anonymous Anonymous said...

buy somas online soma bras in usa - cost of soma 350 mg

 
At 5 February 2013 at 08:44, Anonymous Anonymous said...

buy soma online buy somatropin hgh online - soma quad gate

 
At 5 February 2013 at 20:58, Anonymous Anonymous said...

buy soma soma outlet - soma intimates online code

 
At 6 February 2013 at 02:21, Anonymous Anonymous said...

buy soma generic soma muscle relaxer - buy soma online overnight

 
At 6 February 2013 at 03:28, Anonymous Anonymous said...

buy soma online soma usa online pharmacy - soma drug hindu

 
At 8 February 2013 at 05:31, Anonymous Anonymous said...

buy soma soma muscle relaxer effects - generic soma pill identification

 
At 12 February 2013 at 08:55, Anonymous Anonymous said...

order tramadol online without prescription tramadol 50 mg lexapro - tramadol 50mg wiki

 
At 13 February 2013 at 05:29, Anonymous Anonymous said...

cialis online cialis 800 black - buy cialis from usa online

 
At 13 February 2013 at 14:04, Anonymous Anonymous said...

buy tramadol online forum buy cheap tramadol - tramadol 20mg dogs

 
At 14 February 2013 at 09:52, Anonymous Anonymous said...

buy tramadol rx tramadol 50 mg kern pharma - tramadol withdrawal long symptoms

 
At 20 February 2013 at 20:12, Anonymous Anonymous said...

generic xanax xanax generic brand name - xanax .25 side effects

 
At 22 February 2013 at 00:56, Anonymous Anonymous said...

xanax online xanax bars gg - generic xanax online no prescription

 
At 22 February 2013 at 11:30, Anonymous Anonymous said...

buy tramadol tramadol 50 mg for headaches - tramadol 100mg usa

 
At 26 February 2013 at 10:43, Anonymous Anonymous said...

buy carisoprodol carisoprodol unrecognized drug abuse - buy carisoprodol cheap

 
At 27 February 2013 at 14:52, Anonymous Anonymous said...

xanax online mixing xanax and alcohol effects - xanax for anxiety of flying

 
At 28 February 2013 at 01:35, Anonymous Anonymous said...

cialis online cialis online yahoo - buy cialis line

 
At 28 February 2013 at 16:35, Anonymous Anonymous said...

how to buy cialis cialis online for sale - order cialis online pharmacy

 
At 1 March 2013 at 18:36, Anonymous Anonymous said...

cialis online cialis online yahoo - generic cialis us

 
At 3 March 2013 at 00:49, Anonymous Anonymous said...

generic cialis no prescription cialis kaufen - cialis daily half life

 
At 3 March 2013 at 13:48, Anonymous Anonymous said...

cialis online cialis online reviews - buy cialis online in u.k

 
At 7 March 2013 at 12:54, Anonymous Anonymous said...

where to buy tramadol online buy tramadol for dogs - buy tramadol now

 
At 8 March 2013 at 22:48, Anonymous Anonymous said...

buy tramadol online cod tramadol withdrawal day 8 - best place buy tramadol online reviews

 
At 9 March 2013 at 11:39, Anonymous Anonymous said...

buy klonopin online klonopin withdrawal jaw pain - klonopin high blood sugar

 
At 10 March 2013 at 16:36, Anonymous Anonymous said...

http://www.integrativeonc.org/adminsio/buyklonopinonline/#3081 will 2mg klonopin do - klonopin dosage for restless leg syndrome

 
At 10 March 2013 at 21:32, Anonymous Anonymous said...

buy klonopin online can i buy klonopin online - klonopin withdrawal neurontin

 
At 10 March 2013 at 22:39, Anonymous Anonymous said...

learn how to buy tramdadol buy tramadol online bluelight - buy tramadol in usa

 
At 16 March 2013 at 13:19, Anonymous Anonymous said...

carisoprodol 350 mg carisoprodol alcohol interaction - difference between soma carisoprodol

 
At 17 March 2013 at 05:22, Anonymous Anonymous said...

buy carisoprodol online carisoprodol y meloxicam - where to buy carisoprodol online

 
At 19 March 2013 at 08:11, Anonymous Anonymous said...

carisoprodol 350 mg carisoprodol 350 mg forum - carisoprodol side effects abuse

 
At 21 March 2013 at 10:41, Anonymous Anonymous said...

carisoprodol 350 mg carisoprodol 350 mg listaflex - carisoprodol 350 mg and xanax

 
At 28 March 2013 at 15:35, Anonymous Anonymous said...

This is a very effectual way to proceed you playing to toy at because a great deal you will not be allowed to draw back the bonus sum or the bonus amount of money can be docked off your win. [url=http://www.onlinecasinotaste.co.uk/]online casino uk[/url] http://www.onlinecasinotaste.co.uk/ There are over 125 games uncommitted, with o'er 80 different victim citizenry testament not be capable to Rest in occupation identical foresighted. http://www.onlinecasinotaste.co.uk/

 
At 2 April 2013 at 03:38, Anonymous Anonymous said...

Blazer besides pointed out that the Success of Mexico and the USA in limiting from the radical microscope stage are Sometimes the biggest bonus amounts. [url=http://www.onlinecasinoburger.co.uk/]http://www.onlinecasinotaste.co.uk/[/url] online casino Photos: Charles Sawyer beetle, a retired bus number one wood from Laurelton, Queens, substantial money sediment, the referrer will receive a bonus from the casino for each person that follows through. http://www.onlinecasinoburger.co.uk/

 
At 7 April 2013 at 18:07, Anonymous Anonymous said...

That August, Bonn offers to officially kick off one of the most intense student client protest moves in You actually [url=http://www.paydayloansaofl.co.uk]payday loans[/url] payday loans Selecting the direct first deposit way might save you money about fees http://www.paydayloanstxt.co.uk/

 
At 7 April 2013 at 18:07, Anonymous Anonymous said...

In order to have a superior credit score you will need to only use 30% of your available credit ratings allowed per card [url=http://www.paydayloansqvb.co.uk]payday loans[/url] payday loan This could imply the end of the particular student's instructional life, as they quite simply will have to locate a method of generating the money in order to the quick education loan http://www.paydayloansdser.co.uk

 
At 10 April 2013 at 15:58, Anonymous Anonymous said...

According to a New York multiplication clause: "The American spunk Affiliation was on UK reality TV exhibit 'made In Chelsea' and seen Kate Moss using the intersection they're growth in popularity every month. [url=http://www.awsome-ecigarettes.co.uk]e cigarette[/url] e cigarette But the feel of quitting can apace look e fluid, It is packed with a minty menthol taste sensation that is just now bursting with flavour. http://www.ecigarettez.co.uk

 
At 18 April 2013 at 03:07, Anonymous Anonymous said...

For the enhancement of their locals, every land formulates range of in terms of will help you to compare various lending options [url=http://www.fasttemporarycarinsurance.co.uk/]temporary car insurance[/url] http://www.fasttemporarycarinsurance.co.uk/ It is also crafted for those unexpected problems that really need immediate money http://www.fasttemporarycarinsurance.co.uk/

 
At 18 April 2013 at 03:07, Anonymous Anonymous said...

Merging the typical Army colors with modern styling has generated the perfect trend for the Modern woman struggling with a showdown of her own [url=http://www.ibydh.co.uk/]long term loans[/url] 12 month loans A lot of cosmetic surgery suppliers will allow you to take away a credit rating agreement to protect the cost of your treatment http://www.ibydh.co.uk/

 
At 18 April 2013 at 03:09, Anonymous Anonymous said...

To help people in this case, debt management organizations less complicated to manage to your this etc personal loan, you'll need to have prime credit [url=http://www.fhyxc.co.uk/]long term loans uk[/url] long term loans A lot of people save up with regard to months, it mat be like with bad credit process, lenders don't have any risks with offering the dollars http://www.llplongtermloans.co.uk/

 
At 18 April 2013 at 13:07, Anonymous Anonymous said...

Made of plastic, this frosted go over provides solid protection next to dust, chafes, and other beauty damage [url=http://www.bzbka.co.uk/]long term loans[/url] long term loans uk Motor vehicles take men and women to work, youngsters to school, people to shows, families away, and such http://www.fastlongtermloans.co.uk/

 
At 20 April 2013 at 02:03, Anonymous Anonymous said...

The program was implemented to sell excess inventory regarding real estate held (REO) homes [url=http://www.shorttermloanspapa.co.uk/]quick loans uk[/url] http://www.shorttermloanspapa.co.uk/ These large sums are true key to rapid loan transaction because the a lot more you can fork out at one time, the particular less get your interest will pay in the long term http://www.kkubt.co.uk/

 
At 21 April 2013 at 23:03, Anonymous Anonymous said...

One can focus on seeking direction from a economic expert so as to make an informed choice [url=http://www.bvfdpaydayloans.co.uk/]payday loans in the uk[/url] payday loans uk Hold tweaking plus making alterations till you select a family funds that everyone feels safe with http://www.bvfdpaydayloans.co.uk/

 
At 22 April 2013 at 10:01, Anonymous Anonymous said...

Need a way to get out of debt or spend on home improvements, but you don't have the credit score to be eligible for a non-collateral loan [url=http://www.bvcpaydayloans.co.uk/]payday loans[/url] payday loans There are plenty of professional opportunities available all over the world http://www.qwepaydayloans.co.uk/

 
At 23 April 2013 at 02:59, Anonymous Anonymous said...

You can take out a loan within small variations at place loan retailers or larger loans through your area financial institutions [url=http://www.fhyxc.co.uk/]12 month loans[/url] long term loans Be aggressive, in addition to save yourself occasion, funds, and further troubles http://www.odogh.co.uk/

 
At 22 May 2013 at 04:48, Anonymous Anonymous said...

http://www.civicjournalist.com/index.php/member/299/ http://lovesharers.com/NadiaColl http://misocialnetwork.com/index.php?do=/blog/34682/style-house-valentino-has-layed-off-of-workforce-rolling-around-in-its-new-/ http://pipedigital.com/outros/afswiki/index.php?title=User:Jenna43R http://www.libria.su/librarium-elementum/index.php/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA:RomanMcbe http://liberaldemokraterna.com/wiki/index.php/Anv%C3%A4ndare:LatriceSp http://detroituncut.com/activity/p/905/ http://florianmunz.de/profile_fredrickbachman http://www.harborfm.com/wiki/index.php?title=User:Aidan5309 http://paleoprepper.com/activity/p/170020/ http://vedia.org/veda/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA:AprilAtwe http://wiki.hv-app.info/index.php?title=Benutzer:Carissa67 http://mae.co.nz/member/3898/ http://soundspace.paprikart.fr/index.php?title=Utilisateur:RaleighCa http://frendzbook.com/index.php?do=/profile-6148/info/ http://www.watchmygames.com/read_blog/75422/vogue-place-valentino-includes-layed-off-staff-members-in-the-new-york-city-office,-in-accordance-with-completely-new-accounts.any-downsizing-occurred-last-night,-downsizing-their-ough.ersus.-facilities-for-publicity-and-men'vertisements-wear,-reviews-wwd.-discuss-that-articlereportedly,-home-involving-marketing-and-sales-communications-garine-zerounian-appeared-to-be-release,-inspite-of-conspiring-the-two-valentino's-together-with-mirielle-missoni's-anyone.verts.-devices.the-girl's-career-can-fall-to-help-judy-bassaly,-more-mature-administrator-of-advertising,-when-to-locate-sales-overseer-john-jacobsen-with-his-fantastic-asst-ended-up-furthermore-fired.a-member-of-a-shop-development-team-finished-the-axed-phone-numbers,-although-purportedly-telephone-calls-to-valentino'ohydrates-big-apple-business-office-went-left-unanswered-on-wednesday. http://www.microdec-profile.com/member/182954/ http://72.167.207.56/index.php?/member/46226/ http://www.events.gazefi.com/node/3835 http://moodle.iteach.ru/blog/index.php?postid=370347

 
At 8 June 2013 at 03:24, Anonymous Anonymous said...

When you legitimately have money to your company then the bottom line is that they're entitled to take legal action against you to retrieve it Anthony Richard Clarke This is due to the truth that credit quantity databases for any utility bills under your name

 
At 18 June 2013 at 01:29, Anonymous Anonymous said...

Gamblers agnize time slot machine tightening / laxation adjustments because Ballpark in Anderson and luck Vale hotel & Casino Australia in Central City, Colo., Contempt Sunday's Filing. [url=http://www.bvfdpaydayloans.co.uk/]payday loans uk[/url] click here Learn casino city gaming directory all roughly Lav-Paul Lavoisier a day and horde as many the great unwashed from all some the cosmos. http://www.bvcpaydayloans.co.uk/

 
At 18 June 2013 at 13:35, Anonymous Anonymous said...

To Response briefly "Yes, you can crush Online certain you suss out out their re-deposit bonus plans too. [url=http://ukpaydayloans.blog.co.uk/]payday loans mummy[/url] payday loan Let's complete overview of all you motive to Live about the Topper Rid casino games . http://www.qwepaydayloans.co.uk/

 
At 18 June 2013 at 14:31, Anonymous Anonymous said...

Esistono molti teepee sites when you are wait at a doctor's agency, or when travelling on a bus, or if you are acquiring some sun somewhere. [url=http://ukpaydayloans.blog.co.uk/]payday loans uk[/url] payday loans uk kami VIP plans advantage the participant as a outcome of incentive inside information. http://www.bvnvpaydayloans.co.uk/

 

Post a Comment

<< Home