You have an AI player in an RTS game that occasionally needs to send scouts out onto the map to perform reconaissance. Designers want each scout to move around semi-randomly, exploring various parts of the map, particularly those that have been seen the least recently. Assume that the game is grid-based and has a fog-of-war feature. Also assume that the scouts are very cheap and dispensable, and it's OK for them to walk into the enemy base or other dangerous areas. How would you implement the system to decide where the scouts should go? What sort of data structure do you need to support this? How can you ensure that the scouts do a good job of exploring the map thoroughly? What are the performance characteristics of your approach? Is there any risk of scouts getting stuck trying to go somewhere that isn't even accessible?



You have an AI player in an RTS game that occasionally needs to send scouts out onto the map to perf..

Answer / Navneet Kumar Singh

A flocking-based steering system works by simulating the behavior of a group of animals (like birds or fish) that move together while maintaining cohesion and avoiding collisions. The standard flocking model as described by Craig Reynolds consists of three main components: separation (maintaining distance from neighbors), alignment (moving in the same direction as neighbors), and cohesion (staying close to neighbors). These behaviors are combined by calculating the resulting force for each component and normalizing it before applying it to the individual agents. Flocking-based steering can break down or produce undesirable results when the agents are too close together, causing them to collide, or when they are too far apart, causing them to lose cohesion. Performance implications of the standard flocking model include increased computational cost as the number of agents increases, but this can be addressed through optimization techniques such as hierarchical flocking, where larger groups are broken down into smaller subgroups.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Software Interview Questions

2+2*4-8/2

1 Answers   Infosys,


You're tasked with implementing a computer player for a real-time strategy (RTS) game. Assuming that there is no fog-of-war, how do you implement a system to allow the computer player to determine what parts of the map are controlled by enemy players, and which parts are open to easy exploitation? How do you identify the choke points on the map? How do you find the boundary between the parts of the map under your control and the parts of the map controlled by enemy players? How do you detect an impending enemy attack or a change in an enemy's offensive posture?

1 Answers  


What are some of the limitations of state machines? When is the use of state machines appropriate, and when are they insufficient to generate the kinds of behaviors you need in a game?

1 Answers  


Raja was studying for his examinations and the lights went off. It was around 1:00 AM. He lighted two uniform candles of equal length but one thicker than the other. The thick candle is supposed to last six hours and the thin one two hours less. When he finally went to sleep, the thick candle was twice as long as the thin one. For how long did Raja study in candle light?

4 Answers   Zoho,


Compare two strings character by character in qtp

1 Answers   Cap Gemini,


You're in charge of implementing a stealth game similar to Thief: The Dark Project, and you need guards in your game that have imperfect vision and hearing and inhabit dimly-lit castles, and they can search the area for the player if they think there's an intruder around. How do you model the sensory systems of these guards, and how do you aggregate auditory, visual, and other kinds of stimuli in this system? How do you implement the various alert states for the guards, and why?

1 Answers  


Where will find the Variants?

1 Answers  


What would be the possible test cases for following criteria You have a username filed which don't accept same name twice

1 Answers  


You're developing a boss encounter in a 3D platformer game, and the boss has 15 different attacks. The game designers have asked you to make sure that the player sees as many of those 15 attacks as possible during the encounter, and that he seldom or never sees the same attack twice in a row. What are some ways you can do this? What does the attack selection algorithm look like in this case? Keep in mind that not all attacks are possible all the time -- for example, the boss has a melee attack that he can only do when the player is very close, and a bombardment attack he can only do when the player is far away.

1 Answers  


A fires 5 shots to B's 3 but A kills only once in 3 shots while B kills once in 2 shots. When B has missed 27 times, A has killed:

1 Answers   Zoho,


How to iterate map in collection framework?

1 Answers   Mind Infotech,


Explain Transactions?

1 Answers  


Categories