Advertisement

Planning to Write an AI Article But-

Started by September 22, 2010 04:11 AM
7 comments, last by Windexglow 14 years, 2 months ago
Hello.


I am planning to write an article, which may be donated to GameDev, that covers advanced aiming AI for the bots in games. My hope is that the article, not long enough to be a book, would be considered the bible for AI bot aiming in games.

As an example, we have all played GoldenEye 007 for Nintendo 64. The rocket launcher has the following properties:
1: It starts slowly and accelerates to a max speed.
2: It takes a dive when first fired then pulls up and goes straight.
3: It consumes 100% of your velocity when fired.

And I want to pretend there is another property:
4: It bounces off walls (just pretend).


By reading my article, the AI engineer for any upcoming game would be able to make a bot that can account for all of this, bounce the rocket around corners, and still hit the target in the head, even if the target has changed direction due to bouncing off the walls or ground while the bullet is in flight. Even if the target is falling. Even if the bullet is falling (grenade-type bullets).
Wavy bullets? No problem!
My article will show you how to solve any type of bullet pattern while also accounting for how the target may move while the bullet is in flight, and adjusting for any velocity that the bot transfers to the bullet when firing.


Now the reason I post.
Basically it occurred to me that I may end up posting such an article just to have someone leaving a comment saying, “That’s all nice but [link to an article/book that covers the same thing].”
Wouldn’t be it be a nightmare to spend so much time explaining all of this with pretty pictures too, just to find out that someone else already covered everything and maybe even more, and maybe even better?

I have done some searching on my own and I could not find an article of this nature. I personally could not find anything that scratched the surface, in fact.
So I am posting here as a last resort to make sure I have not missed anything.
Does anyone know of any articles/books/etc. that cover this subject matter?


Regards,
Yogurt Emperor

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

The chirping crickets tell me such an article probably does not exist. They also tell me that perhaps there is no interest in such an article.
It’s a lot of effort so I wanted to be sure of 2 things:
#1: Never been done before.
#2: That there would be an interest for it to be done.

In asking whether or not I should write such an article, it seems I have my answer. It does makes sense that if it has never been done before then it was because there was no interest for it to be done.

[EDIT]
Time zones. It says I posted my question and this reply on the same day, but being in Japan, I have already gone to work, gone home, slept, and gone back to work. To me it has been a full day (which is about how long it would take for an interested party to reply), so sorry if it seems I was impatient on waiting for a reply. It has been a full day for me.
[/EDIT]


Regards,
Yogurt Emperor

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement
Quote: Original post by YogurtEmperor
In asking whether or not I should write such an article, it seems I have my answer. It does makes sense that if it has never been done before then it was because there was no interest for it to be done.


By that logic, no one would ever write anything.

I don't know of any such article, but I have helped a few people in these forums with similar questions. It always comes down to having a function to compute how long it would take the bullet to reach any point in space, having the expected trajectory of the target described as a curve parametrized by time, and then solving the equation

time_it_takes_bullet_to_reach(position_of_target_after_time(t)) = t

Unless you are thinking of showing some radically different approach to the problem, I don't think I would be particularly interested in reading your article. But enough people ask questions about this that perhaps you would have an audience.
I'd like to put my thumbs up. Look forward to reading it.
Quote: Original post by alvaro
By that logic, no one would ever write anything.

I don't know of any such article, but I have helped a few people in these forums with similar questions. It always comes down to having a function to compute how long it would take the bullet to reach any point in space, having the expected trajectory of the target described as a curve parametrized by time, and then solving the equation

time_it_takes_bullet_to_reach(position_of_target_after_time(t)) = t

Unless you are thinking of showing some radically different approach to the problem, I don't think I would be particularly interested in reading your article. But enough people ask questions about this that perhaps you would have an audience.


No, I think when people have an interest, things get written. Sometimes things get written even when people don’t have an interest, but that is a folly I hope to avoid.


I think my article may surprise you if you are expecting it to be as simple as that. Let me propose the following questions in order of difficulty:
#1:
Bot has a laser. Instant hit when fired. Target is falling. Where does the bot need to aim to hit the target if firing right now? Very very simple.
#2:
Bot has a rocket launcher. It travels at a constant speed and the target is falling. Where should the bot aim? Not so tough.
#3:
Same as #2, except the rocket launcher will consume 40% of the velocity of the bot when fired. Now where should the bot aim in order to account for this (knowing its own current velocity)?
#4:
Same as #3, except that it before the rocket hits the target, the target will collide with the ground, maybe even bounce. Maybe even bounce off multiple course objects. How can the bot account for all of this and where should it aim?
#5:
Same as #4, except now we have a grenade launcher instead of a rocket launcher. The bullet falls and is affected by the bot’s velocity when fired. And the target may or may not bounce off objects before the grenade reaches it. How can the bot account for all of this and determine the actual direction it should be facing when firing the bullet? Remember, since the grenade falls, the bot will have to aim higher. But how much higher?
#6:
All of #5, but the target is around a corner. Plus, when the grenade bounces off walls it loses a bit of its steam. Where does the bot aim (exactly which direction does it face) so that the grenade bounces off a wall, slows down a bit after doing so, and still gets a head shot on a target that may have bounced off/collided with any number of walls while the grenade was in flight?
#7:
The bullet has a strange pattern such as a wave, or is starts slowly and accelerates to a point then stays at that velocity. The target may still be colliding with walls before the bullet reaches it and the bot still has the option of bouncing the shot off the wall. Which direction should it face to get a head shot if firing right now?


My article provides the concepts and code snippets (which are actually quite simple) to solve all of these problems using methods that, as far as I know, have never been presented before. If they have then I sure wasted a lot of time reinventing wheels.


Solving for the time of collision is one problem. But where to aim is the actual solution.
Like the rock launcher in GoldenEye 007, if the collision time is less than 1.05 seconds, the rocket will still be in its “dipping down” state and the bot would have to aim higher during this time to account for it. Afterwards the rocket will be heading straight and the bot can aim mostly straight-forward.


If I were approached I could pad it out enough to make a small book, but I think there is really only enough content for a fairly long article.
But it’s enough work that I just won’t do it if either it has been done before or if not enough people would actually care to read it. I’m fairly convinced it has never been written before. Now I just want to know that there is some interest in this (thank you Zeophlite).


Regards,
Yogurt Emperor

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Don't be discouraged,

Its hard to garner support before you've written anything. My suggestion is to write a short article (part 1), and see how people respond to it. They can give you writing advice that can improve your further work.

What you've written so far sounds impressive, I'd like to see how it's implemented.
Advertisement
Have you checked all the articles in the 4 AI Game Programming Wisdom books and the 8 Game Programming Gems books?

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

If you've found ways to deterministically solve all those problems, I'll read it just for the mathematics. That's quite impressive.
Two things are infinite: the universe and human stupidity; and Im not sure about the universe. -- Albert Einstein
I'd read it as well, the more complex ones strain my brain in how they could be calculated (outside of actually calculating multiple frames worth of data into a single one for each bullet)

EDIT: Most importantly, right it for fun. You aren't required to write it.

This topic is closed to new replies.

Advertisement