Arvutiteaduse instituut
  1. Kursused
  2. 2017/18 sügis
  3. Arvutigraafika projekt (MTAT.03.316)
EN
Logi sisse

Arvutigraafika projekt 2017/18 sügis

  • Main
  • Projects
  • Topics
  • Results and Schedule
  • Links

Crazy Doom Dungeon

Marko Täht, Diana Algma

LATEST BUILD: Android ; PC

Plan

We are continuing the project we started last semester: PROJECT PAGE // REPO

The original idea was to make an isometric dungeon crawler with procedurally generated dungeons and randomly placed treasures and enemies. The plan now is to have a story mode and a grinding mode (name WIP). Grinding mode will be procedurally generated so it will not feel like the same dungeon every time. The story mode will have predetermined levels so it can support the story better.

This time we would like to fully implement an inventory system where the player keeps the stuff found in the dungeon. We want to create a story. We have some basic ideas for what the story will be, but now it needs to be put together to create a connected sequence of actions and logical backstory. We will also create a control schema for smartphone or tablet. The game right now is lacking a menu, this will change!

We hope to get the game far enough to have a few playable levels in the story mode.

We will continue using Unity for the project and Blender for simple models. We will not be focusing on the art aspect yet.

Foreseen difficulties:

  • Creating a story - it might be easy to think up ideas, but hard to make it into a comprehensible story and quest line.
  • Because our aim is to get this game to work on a smartphone, we need to make a good UI that will have all the necessary things but not too much info, because the smartphone screen is rather small.

Milestone 1 (29.09)

Marko

  • Continue working on inventory system
  • Add item drops

Diana

  • Try to get CDD working on Android
  • Start rewriting the input handler
  • Create a basic menu

First time working on android, cannot reset or swap weapon though:

Basic main menu and death screen menu (on Windows):

Tweaked menus now on android + a button to swap weapons with:

The texts about pressing a key to do something will be removed later when all the required buttons are ready.

Before we had the problem, that clicks on the UI elements (including the swap weapon button) went through to the scene and triggered movement or attacking commands. The buttons still worked. This problem was solved on Windows but the same solution doesn't work on Android. After some thinking and discussing we concluded that there will not be any interaction directly from the screen to the scene and all user input will be via the UI. Because of that this problem won't need to be resolved after all.

Right now there are 2 actions that are done by clicking/tapping on the scene objects: attacking and moving.

  • For attacking there will be another button next to the "swap weapon" button.
  • For moving there will be a joystick on the left.

Working demo joystick (thanks to THIS TUTORIAL):

Milestone 2 (13.10)

Marko

  • Health Potions
  • Continue working on inventory system
  • UI button for inventory
  • Decide how to do equipment / inventory whatever

Diana

  • Get player moving with joystick
  • Continue rewriting the input handler
  • Add blocks (functional walls) to enough dungeon parts (for testing) so the player can move safely and logically without navgrid

For the player to move with joystick, I first used the navgrid that the player was using before. It worked but the input for the movement had to be a point not a direction which demanded a good distance to be used that wasn't too short (the player wouldn't move enough) or too long (the player would sometimes start moving to another room or wouldn't move closer to the edge if near it). To simplify navigation and other stuff I removed "leveled corridor" that acted as stairs.

Next I removed the player from the navgrid since we want the player's character to only move in the direction we give instead of to a point. No pathfinding needed. This introduced a new problem, the player has to rotate towards moving direction. After doing many different calculations the solution that worked uses LookRotation and RotateTowards.

But that wasn't the only problem that came from removing the navgrid. Now the player could move through the bears. That's a bit bad since the player could juke the bears a lot by just going through them and behind them. While trying to get the collision stuff working 2 different things happened, either the player still went through the bears or the bears would push the player into flying or rolling on the ground. Working solution was to scrap the capsule collider and rigidbody from the player and add a CharacterController. One bug that the CharacterController has is that colliding sometimes places the "character" above the colliding objects so after some "close combat" the player would jump on the bears and float there. Fixed it by resetting the y position every time it changed from the original.

After all this the player would walk nicely among the bears but could also walk off the platforms and just float where the floor would be if there was any. Since the CharacterController does the necessary collision prevention, just adding some walls to the dungeon parts was enough. I left the exit points open right now but later it would be pretty easy to add a wall as the door and deactivate it when that exit is used to connect another in the generator. Here are some pictures:

About the input handler... I removed (or rather commented out) all the crazy logic behind the attacking/moving of the player. Instead there is a few lines that give the movement commands from the joystick to the character controller and rotate the player. This can be easily moved to a script on the player. Also since there is no new logic for attacking, the character can't attack. The bears still can though.

Milestone 3 (27.10)

Marko

  • Implement weapon equipping from inventory
  • Start implementing shop

Implemented Drag and Drop system for inventory using the new EventSystem. It opened up a really easy way to get equipment slots to work as intended. Dragging items into equipment slot equips the weapon and dragging out unequips it.

Shop is a empty grid currently that has no logic behind it.

Lot of time went into Merging my branch with Dianas branch to get UI-fixes she had made. After merge, many fixes needed to be done to make inventory work again.

Diana

  • Add attack button
  • Implement auto-targeting
  • Make at least 1 weapon able to attack again

Milestone 4 (10.11)

Marko

  • Create menu buttons to go into generated wordls, static world(story mode) and tutorial
  • Start creating/designing tutorial level
  • Can sell items at store + money counter in inventory

Diana

  • Make the weapons attack with collision-based logic (and possibly using particles)

Weapons use collision-based logic now. Wand's projectile goes straight and can hit multiple enemies. Changed sword attack animation, now a slash that can hit twice if the enemy gets hit by both the upwards swing and downwards. Also changed wand attack animation a little so it is more like "I raise this wand to attack" and less like "I poke you with my wand and a projectile appears".

Added also particles to the wand's projectile but there is a minor problem. When the projectile is destroyed at the end of its range the particles instantly disappear also. Since the projectile system has changed so much between different Unity versions there are many out-dated solutions to this problem but even the latest doesn't seem to work. Many answers say you should detach the particle system from the projectile so it can "live on" with the particles still visible. After that other stuff needs to be done like stopping the particle system from emitting and then destroying it after. This is irrelevant for me at this time though since the old particles get destroyed already with the detaching action.

Bonus: added a cooldown indicator on the attack button. Will add the same to the swap button some day in the future, that needs a lot more code.

Milestone 5 (24.11)

Marko

  • Continue working on tutorial level

Added more stuff to tutorial scene. Added in some steps for tutorial.

Tried to create lighting for the scene. Cant use real-time lighting with shadows because phones can't handle it well and start to lag. Baking the light only includes single light.

This is what the scene look with baked lighting and shadows.

This is what the scene look with real-time lighting and shadows.

As it can be seen there is something very wrong with the baked lighting.

Diana

  • Clean up project structure (long due) & ui
  • Research how to fix inventory gui (scaling)
  • Change menu flow (menu->game->menu etc instead of menu->game->game->...)

Issue with the inventory GUI was that the inventory slots weren't scaling with the screen. I was supposed to first check the asset Inventory Master to see how they did it. Imagine my surprise when I found that the asset didn't actually scale the slots either but our inventory did a little bit. Changing the sizes of the inventory slots made it nicer for standard mobile screens so we concluded that adjusting the sizes more after we have decided on the exact cell amounts will work and the cells scale enough.

Menu flow:

Milestone 6 (08.12)

Marko

  • Try to fix the lighting in tutorial scene
  • Add door to tutorial exit

Diana

  • Add cooldown indicator and functionality to weapon swapping
  • Add more appropriate sprites to weapons and sprites and models to potions

Cooldown indicator, after attacking and after swapping:

Buttons are now non-interactable when on cooldown. When attacking, swap will be on cooldown as long as attacking is. After swapping, swap will be on cooldown (for less time than attacking) but when attacked when swap is on cooldown, swap will get the attack cooldown. Attack cooldown is now equal to the previous attackWindup+attackWinddown which are removed. Where an attack was previously triggered after attackWindup, it is now triggered in the animation.

New weapon sprites:

Potion model and sprite:

I made the model in Blender and vertex painted it. Used the shader created in Computer game development and design course practice session to show the colors in Unity.

  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Tartu Ülikooli arvutiteaduse instituudi kursuste läbiviimist toetavad järgmised programmid:
iktp regionaalarengu fondi logo euroopa sotsiaalfondi logo tiigri�likooli logo it akadeemia logo