Friday, July 28, 2017

TOE week 47: Slacking Off While Showing Off



The week before this I was on vacation. It was really busy, seeing family as we usually do over the summer. I didn’t get to work at all. So much of my time was spent around the hotter part of the state where our families are located. I did however get to show off the game to my father in law, brother in law, father and a friend of mine. I didn’t let the first three play the game because I brought my Xbox dongle but like a genius I forgot to bring along a controller. My friend though she had a PS4 controller and I figured that would work. 

This was a dumb thing to think apparently. Did you know that the PS4 and Xbox controllers use different numbers for the buttons? Cause I found that out when we plugged in. My friend she could open a portal but couldn’t teleport through it. I did look up that button 8 on PS4 is the share button where as button 8 is clicking the left analog but I did this after the fact. Also jump is the square button and is A on Xbox. Basically I think every button on the face of the controller rotated clockwise. This is good to know whenever I get around to porting this thing to PS4 or PS5. I could have had my brother in law look at the game in this way but there was a time consideration and honestly I didn’t even think about it. 

Another thing that happened was my friend she managed to detach the player’s head. You know the thing I thought I fixed weeks ago. I blame the PS4 controller.
Then there was this week and was honestly about as productive as last week. I had no time this week. Everything this week was either car or baby class or just decompression from vacation. Showing off my game to family was pretty great. Now I just have to get back to work on making this thing so I have more work to show off later.

‘This week’ and by this week I mean today. I made a Fire push collider. It is basically the same thing as my push colliders but this push collider only pushes you if the portal is open. The idea being that the portal blocks the fire and pushes the player in the given direction. If the portal is not open the player will take damage. So yeah any amount of work next week will be better than this week.

Friday, July 14, 2017

TOE week 46: Fixing a hack that I made.



Have you ever made a UI before? Cause I have… Maybe? Three days I ago, I found that something was tanking my frame rate. Like my computer was plugged in and everything, and still my push colliders in the vertical direction refused to work. Two days ago I found out what was tanking my frames. It turns out that hacking in a functioning UI has consequences on calculations. Creating and deleting all of the health graphics every frame is not a good idea. I tried to fix it and failed. 

Yesterday I was able to fix it. I spent all day (some of it face down on the floor) reworking the health display. Now in all appearances it functions identically to the hack without the drop in frame rate. All of that work basically brought me back to where I was two days ago but if you look at it then and now you probably couldn’t tell the difference. It is clearly a win but it doesn’t seem like one I suppose.

I need to update Unity to its latest version but I think some things will break. I have some code I got for free from the unity store to export  3D objects from Unity to Blender so I can create backgrounds and I am pretty sure that it will die when I update. My code may also break in places, I am just less sure about where that is going to happen. 



In AI related news I have created two more enemies. One is the Spotlight Cannon that I talked about last week shown above. If a raycast from it hits the player it starts shooting at the player. The other enemy is a flying enemy that is difficult to hit but dies in one hit. 

I had a revelation on Monday that my collision objects are too large. This means that I have to possibly remake them or more likely resize them. As they are now it is somewhat difficult to see them through my teleport window. This is relevant for gameplay reasons.  Yay more work to redo!

Friday, July 7, 2017

TOE week 45: Building a better Nemesis.

I was really lacking motivation this week. I wasn’t as distracted as last week but it was really difficult to get anything done. On Wednesday I made a basic enemy this week. This enemy doesn’t move probably one of the things that makes it basic. It is a stationary ranged attack enemy that fires at the player. I took a Udemy course on Unity like a year ago. One of the things that I did not understand about this course was why they made the enemy object determine the projectile’s path. 

In my opinion it is far easier to give the projectile ‘directions’ than have the enemy object pass said information to the projectile. I don’t think my way of doing things is wrong but there may in fact be something that I have yet to understand. 

 My enemy’s tiny AI brain works something like this.
AI: Is the player within firing range? Yes or No.
If No do nothing.
If Yes count down until it is time to fire by spawning projectile object. Then reset time to fire.
Then the Projectile asks: What side is the player on relative to the Projectile’s position? Then head in the direction toward the player. 

The thing that was strange was how easy all of this was. All of it was really easy to make. A lot of the starting properties of the enemy were created using existing pieces of code. Slap my target code and deal damage code onto this new thing and bang instant enemy. Then same thing for the projectile and instant projectile by creating a modified version of my knife sub weapon.  It was practically a cake walk. No problems…

I was/am really excited about my basic AI enemy. I made a cool mechanic out of the player’s teleport window blocks enemy projectiles.



The white rectangle is actually two enemy’s stacked on top of each other. The pink lines are attack projectiles.

Then Thursday happened. Because everything went so well on Wednesday I thought we can make another enemy in a day. This time I wanted a spot light enemy that visually ‘patrolled ‘ a piece of ground by looking back and forth between two points then if the player was occupying the space the spotlight was looking at stop and fire at the player. I couldn’t get the projectile to head toward the player. It would instead spawn in with the desired rotation and head screen left. I then spent too much time fighting trying to get the thing to work and none of it working. I would have been better off playing more Rimworld that is how much Thrusday’s work accomplished. 

Because my new AI wasn’t working out I then decided to make my Player into a prefab something that I had been putting off but it was about time to do. That BROKE my teleport artwork. I then spent the next hour fixing all of the things that this broke. I was expecting some breakage but I wasn't expecting HOW broken this would get. Basically Thursday’s progress was all in the opposite direction. I could never get the hang of Thursdays.