2 mins
The sixth post in making items for mario kart in DirectX12
Data driving items and bullet bills.
Since now all of the items variable’s values have been stored in their respective class. However, this made the item system very rigid and the values of the variable needed to be read in from json files to be more data driven. There was already an item config json file which stored the probabilities of getting each item from an item box depending on your rank. This was then added to with the variables and their values of the items. To help contain this data in the item classes structs where set up that stored types of data used by multiple items, such as boost data for mushrooms and star and growth data for giant mushroom and lightning cloud. It was also made possible for any item that can collide with the player to use all 3 forms of animation (jump, flip, and spin) with the animations not being used value’s being set to 0. The new additions to the item config files is currently being added to the code base’s asset manager so the values can be changed there.
With the Ai made by another group member being now available the bullet bill item can be implemented. This item causes the player to turn into a large bullet which auto steers the player, makes them invincible, and gives them a speed boost. It’s duration lasts longer the further back the player is in the player rankings.
When the bullet bill is used it switches the player’s model to the bullet bill (this was implemented by another group member). The duration of the item is then set to equal the player’s ranking so if they’re in 12th then bullet bill lasts for 12 seconds. Then it checks the player’s id to see if it is -1. If it is then the player is an ai player, if not then it is a regular player and the ai controller is added to the using player class. The players current move and turn speeds are then stored in the bullet bill class. The player’s move and turn speed are then increased to give the player the speed boost. The during the update function when the bullet is used the player’s movement class is updated which allows the ai to control it and the duration of the bullet counts down. Once the duration is competed the players move and turn speed and reset back to the stored values and if the player is not an ai then the ai in the player class is removed.
The bullet bills variables were also added to the item config json file and read in when the bullet is constructed.
Subscribe to this blog via RSS.
C++ 30
Directx12 11
Mario kart 11
Commercial games development 15
Unity 15
Low-level programming (19) C++ (30) Text based adventure (5) Ex-machina (9) Game engine programming (11) Directx12 (11) Mario kart (11) Land of gold (5) Audio visual production (1) Commercial games development (15) Unity (15) Don't walk by (15)