On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits)

Day 3:

Okay, so today I definitely learned a LOT about the Unity Physics engine (and what NOT to do during it, haha). This is regarding me trying to deal with collisions of the player with wall tiles, so here's a summary of what went down:

As I said yesterday, I was trying for the longest time to get my player rigidbodies to work. In the end, turns out kinematic rigidbodies don't actually respond to collisions (as note, I'm pretty sure dynamic rigidbodies CAN detect a collision with kinematic ones). I had been wanting to use a kinematic rigidbody for the player because I didn't really want to use the Physics engine - I didn't want the player to be pushed via force, but rather be clamped to move a certain distance in set intervals. I tinkered around with the Unity CharacterController but it seems built for 3D. Finally, I eventually settled to try to expand on my previous movement script: setting transform.position directly, BUT checking beforehand if the tile space that I want to move to is already occupied by one of the wall tiles (or other tile that doesn't allow player movement). Here I end up going on a wild goose chase to find the right function to detect a collision of a point with the tile collider - I try Physics.OverlapSphere, Collider.Bounds.Contains, etc. before finally finding Collider2D.OverlapPoint, which was right under my nose the whole time. Whew, it works now, but quite a ride now!

With that roadblock out of the way, it was time to populate my room! This was the fun part - I created multiple layers of tiles and added furniture and other decorations for the tavern. The room will be quite homely - there will hopefully be a few NPCs that stay for a prolonged time in some of the stools/chair that the player can interact with, but all of the combat encounters will take place in a separate combat scene. You can take a look at the current tavern below:




There are many other components that need to be worked on, but with the workweek coming up I have to decide what is feasible in small chunks. Some of the things I could work on relatively soon are getting the character sprite/animation, adding dialogue boxes when the player interacts with an object, and eventually try to get the turn-based combat system set up!