adspace


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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is latest xcode version?

913


Which types of logs are using in your organization

1046


What are the cases why parameterization is necessary when load testing the Web server and the database server?

2150


list some of the data science libraries in python

941


How to call two different views from same action?

360


How to use primeng in angular 4?

948


How to get and log an error in angular 4?

877


What measures can ensure the robustness of AI systems?

60


What is your husband doing?

1322


how to connect your project in database?

2160


How to Retrieve the line number that a memo's cursor is on?

2010


Explain “row_number()” in sql server with an example?

1081


Tell us about your hobbies.

1186


Is primary key clustered index?

1021


Differentiate between null and void pointers.

1260