Posts

Showing posts from January, 2017

Using DirectXTK Input for Keyboard, Mouse & Gamepad

Image
For our game we have decided to make use of DirectXTK Toolkit that contains helper classes to work around with Direct3D 11with the help of DirectX SDK. We can utilize it for stuff like making audio using their Audio API, Sprite Batch & Font for rendering UI and text, finally game input through mouse, keyboard and gamepad class. This blog is going to be about using input singleton. You guys are ready, I'm about to blow your mind! Keyboard, Mouse & Gamepad // Resource Manager - Initializing at resource manager class std::unique_ptr<Keyboard>m_Keyboard; std::unique_ptr<Mouse>m_Mouse; std::unique_ptr<Gamepad>m_GamePad; // Call reset m_Keyboard.reset(new Keyboard()); m_Mouse.reset(new Mouse()); m_GamePad.reset(new GamePad()); ResourceManager* GetResource() { return m_refManager;} // Using it inside the player class - Object of the singleton Keyboard::State kb = GetResource()->m_Keyboard->GetState(); Mouse::State ms = GetResource()-...

General AI Behavior

TOKENS Behind the game, we have a Director that keeps track of how well the player is doing and which enemy has token to attack, stay idle or pick up an item around the room. As you will observe during gameplay that if the player is near by the vicinity of enemy, he will be send attack token to dodge himself and injure the player. There is a pattern of beat them up kind of hovering around by the NPC's to make it life-like and they also face towards the player when he is inside the zone. Director::Director(LevelManager & m_lvlManage, XMFLOAT4X4 _player) {     // Cooldown to switch tokens to other NPC's         PassoutGrabTokenTime = PASSOUTTIME;     m_lvlManager = m_lvlManage;     m_PlayerPosition = _player;     // Randomizing tokens between different NPC's        int thisone = rand() % m_lvlManager.GetNPCs().size();    m_lvlManager.GetNPCs()[thisone...

Milestone II - Well defined Combat & Collision System

Image
Brief Overview This progress is all about getting in gameplay involving basic combat between the player and the AI, interacting with the world by picking in items and using them as weapon to attack the target, and yes now the user can transit between different levels. The kind of task we focused on this month was designing and implementing visual feedback in form health bar for both player and enemies, the one for the enemies moves along the camera; combo meter that increases based on the player's successive strikes and counters against his foes; then moving on to radical game menu system that allows the user to adjust to their needs, pause menu allowing the player to exit, retry as well as access the options menu in between of the gameplay; stepping out from the realm of UI we have a smoother looking camera that follows the player now, we have strong Animation/Rendering system allowing the characters of the game to interpolate between multiple animations depending on their sit...

Collision: SlapEngine at Work

Image
Collision for the SlapEngine is actually not that bad. We have either wrapped our objects in a capsule, sphere, or AABB. We test each geometry against the other in order to determine collision between two objects. The only thing that we have different from that is how we determine if the Entities are in bounds of the game world. Entity Collision Entities are the Player and Enemies. For each entity, they have a body capsule around their body and spheres located on their feet and hands. The body capsule is just two spheres connected by a line segment. The first sphere is 5 units up on the Y-axis with a radius of 5 unit from the entities model location. The second sphere is 5 units down the Y- axis with a radius of 5 units as well. Then simply, we create a line from the first spheres center point to the second spheres center point. This gives the entity a non-rendering capsule around the entities body. Here is an example: Once we set up the body capsule we run Capsule To Capsu...

Pathfinding & Navigation

Image
Path Planning is core component in today's game. A magical profound system that makes computer-controlled characters move towards goals efficiently while avoiding obstacles and hazards. Visit: http://jessicajosejohn.blogspot.com/  for more on the demo of path finding. Getting started with proper path finding behavior can be daunting in making it smooth. The internet is filled with descriptions of standard A* algorithms for grid-based navigation. But modern 3d games often involve complex environment, right? So how do the programmers go about making the characters move around in those? Why don't we see zig-zag movement of characters towards you with good AI? In this blog, we'll take a short look at how we can navigate the character using Navigation Mesh , which was particularly found in Left Dead 4 by Valve. Navigation meshes are an efficient way of representing walkable regions in the game world. A collection of connected convex polygons. Each polygon is a n...

Milestone I - Basic Setup of Office Retribution

Image
Brief Overview This progress is all about loading in different 3D models and items with the help of FBX, performing advance collision checks like Nav Mesh Collision, Line to Triangle Intersection, Sphere to Sphere Intersection, Sphere to Capsule Intersection, and Capsule to Capsule Intersection to help the player aim properly at the target, and to receive impact of the hit; and secondly to let the player be inside the level by applying Nav Mesh check across the platform. Then we proceeded with smooth transition between few animations and interpolation of the bind pose. No doubt getting smooth animation has always been pain in the back, but we were really happy once we had got it working. Gradually, we polished the game, by managing the user interface and making it more appealing by receiving right feedback in terms of key press and change in animation of UI Combo bar as the player punches. Stay in tuned for more updates! For now lets take seat back & enjoy the basic gamepl...

Office Retribution - Getting Even!

Image
Office Retribution is three-dimensional, top-down type of action-adventure game based on upcoming and well-known genre, popularly known as Brawler. It features hand-to-hand, free-flow combat between the protagonist and large pool of opponents. Arkham Knight Free-Flow Combat System Gameplay consists of walking through a level, one section at a time, defeating a group of enemies before advancing to next section; a boss fight normally occurs at the end of each level. The Story  starts with the player being highly frustrated due to the constant nagging of his boss, colleagues making fun of him and him doing same cubicle job everyday sitting in front of slow windows desktop. His anger level reaches to the peek that he can't handle it any more, and decides to take revenge. Hence the player ends up fighting with cubicle co-workers, managers, security guards, H.R. and his boss. Why should one play this g...