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.



You're developing a boss encounter in a 3D platformer game, and the boss has 15 different attac..

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

Post New Answer

More Software Interview Questions

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.

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  


My question has how do you face an interview

0 Answers  


In Material Master, in which tab you will find the Loading Group?

1 Answers  


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?

1 Answers  


Whay $ dropdb databasename is used?

1 Answers  


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

1 Answers   Zoho,


Do you know SAP VMS(Vehicle Management System)

1 Answers  


What are the Issues faced while creating Delivery & Shipment Execution?

1 Answers  


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?

1 Answers  


Do you know the S/4 HANA?

1 Answers  


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,


Categories