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?



You're tasked with implementing a computer player for a real-time strategy (RTS) game. Assuming..

Answer / Himanshu Srivastava

To implement the scout exploration system, we could use a priority queue with each grid cell representing an item in the queue. The priority of each cell would be based on factors like its distance from the base, the number of times it has been visited, and its proximity to enemy units or bases. When a scout is sent out, it would pop the highest priority cell from the queue and move towards it. If the cell has already been visited, the scout could either select another cell at random or re-prioritize the remaining cells based on their new information (e.g., if a base was discovered in an area, that area might become less interesting for exploration). To ensure thorough exploration, we could implement a heuristic that prioritizes cells that are likely to contain undiscovered areas, such as those surrounded by known areas or far from the player's base. The performance characteristics of this approach would depend on the size of the map and the number of scouts, but it should scale reasonably well if implemented efficiently.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Software Interview Questions

2+2*4-8/2

1 Answers   Infosys,


How to manage Payment terms in Credit Management?

1 Answers  


HOW to click on elements under moving banner, in selenium webdriver

1 Answers  


Explain Transactions?

1 Answers  


A boat running upstream takes 8 hours 48 minutes to cover a certain distance, while it takes 4 hours to cover the same distance running downstream. What is the ratio between the speed of the boat and speed of the water current respectively

1 Answers   Zoho,


UI Development questions

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  


How to iterate map in collection framework?

1 Answers   Mind Infotech,


To fill a tank, 25 buckets of water is required. How many buckets of water will be required to fill the same tank if the capacity of the bucket is reduced to two-fifth of its present ?

1 Answers   Zoho,


A student multiplied a number by 3 instead of 5 . 5 3 What is the percentage error in the calculation?

1 Answers   Zoho,


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,


Come up with an algorithm to shuffle a deck of cards. Discuss how uniform a distribution your solution would achieve, and how you could potentially improve upon it.

1 Answers  


Categories