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.
Answer / Vijay Saxena
The attack selection algorithm could be implemented using a priority queue or a weighted random selection. Here's an example of how it might look:
1. Initialize a list with all 15 attacks, each marked as 'unused'.
2. When the boss is about to perform an attack, select the next one from the list. If the list is empty, start again from step 1.
3. Mark the selected attack as 'used'.
4. If the player's position meets the conditions for the selected attack (e.g., close for melee, far for bombardment), perform the attack. Otherwise, choose a new attack from the list.
5. After a certain number of attacks have been used (let's say 10), shuffle the list to increase the chances of previously 'unused' attacks being selected.
6. If the boss has a cooldown period for each attack, wait until the cooldown is over before marking the attack as 'unused' again.
| Is This Answer Correct ? | 0 Yes | 0 No |
What's the difference between a finite state machine (FSM) and a hierarchical finite state machine (HFSM)? Give an example of a hierarchical state machine with functionality that you could not easily replicate in a non-hierarchical FSM.
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?
My question has how do you face an interview
In Material Master, in which tab you will find the Loading Group?
Imagine you have to write a Tic-Tac-Toe game in which a human player plays against the computer. Discuss the different ways in which you could implement the computer’s artificial intelligence for the game. Which method would you ultimately choose? And why?
Whay $ dropdb databasename is used?
A student multiplied a number by 3 instead of 5 . 5 3 What is the percentage error in the calculation?
Do you know SAP VMS(Vehicle Management System)
What are the Issues faced while creating Delivery & Shipment Execution?
What is a decision tree? When would you want to use one? What are its performance characteristics? How can you generate a decision tree automatically from a pre-existing data set? Is it feasible to do this at runtime, and has it been done in a commercial game before? When and why would you want to do this, and how would the data need to be organized to make this possible?
Do you know the S/4 HANA?
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 ?
Software (196885)
Sciences (12521)
Engineering (38019)
Business Management (7371)
Accounting (11552)
Advertising Media (662)
Architecture Design (207)
Call Centre (2483)
Fashion Modelling (332)
Government (17384)
Law (806)
Tourism Hotel (377)
Everything Else (2323)
Military Police (160)
Skills Abilities (0)
Aptitude Questions (4307)
Placement Papers (705)
Certifications (3752)
Visa Interview Questions (2230)
Code Snippets (1098)
Entrance Exams (862)
ERRORS (16636)