Friday, March 31, 2017

TOE week 31: Accidentally Infinity



Not having a lot of time is not fun. Again this week was mostly taken up with my real job, being a dad. I did still manage to do some work. I drew some things scanned them and colored them. I needed to make a star gate looking thing that teleports the player. Then I made a streetlamp.

One thing that is often overlooked in game development is that making the art is only half of the work. You have to make it function in the game. Again ‘under the hood’ all of this is just different invisible box colliders with pretty pictures painted on top of them. So I made a star gate, now I have to make it actually work. Fortunately I had already made a box that when the player ‘talks’ to it, it will teleport them I just had to connect them and bam working game asset! The same thing was true of my streetlamp. I had already made the hit box that when struck by the player’s primary weapon will give the player more ammo then all I had to do was put that on the streetlamp artwork. I need to add a particle effect on death that is like shattered glass but right now the light goes out when struck. 

Then I started adding in more art to the star gate. I put a texture that was where you were going to teleport to. That was when I created infinity in Unity. I wasn’t trying to but when it happened I wasn’t surprised. Then when I was admiring this occurrence of infinity, it broke. The shader doesn’t work anymore it is now a flat black. Fortunately I took this screenshot of it in game. 



Now I have to fix it.

Next week I should make another street lamp and a broken star gate also a room that the star gate is in would be pretty good too. Need more time!

Sunday, March 26, 2017

TOE week 30: 85% is not enough for my wife



I didn’t have the most productive week. I did find a super cool bug when two teleporters overlap it sends the player’s position into oblivion and then fall until forever. No time to fix that however as I’m working on other things. Time was eaten up by breaking cars and other things. It wasn’t a terrible week though. I managed to put in artwork for all of the secondary weapons. The boomerang looks particularly cool IMHO. 

You know how an angry bird points toward the angle of its arc? Well I spent about a day trying to figure out just how to do that. The trouble with internet tutorials is that there is A LOT out there but not all of it applies directly to your specific situation. Like I could find out how to do this if you are trying to turn the Player facing based off of left analog input. I was almost to the point of asking a Unity Facebook group I am a member of. But then my wife called. We talked and I told her what I was trying to do and why it didn’t seem to work. She said ‘I know how to do that’.

She came home and wrote down part of an equation. She then bemoaned that she hadn’t used calculus in a while and didn’t hand me the equation. Then she had to work on her job stuff and the next morning she finished the equation showed me when I got up and then went to work. When my dad job was done I opened up the laptop plugged the equation as I understood it and it didn’t work. The Axe weapon just spun wildly and I was already doing that with the boomerang. Texted my wife she called and told me what I was doing wrong. I was using Tan instead of Atan. Hahahaha math! Switched it out and it worked…. Well mostly. 

The facing of the object I am rotating based on the angle doesn’t seemed to completely match the trajectory. But it is mostly right. Like 85% right. 85% was not enough for my wife. She considered this a failure. Personally from my POV this was 200% better than what I had two days before. It had game art and it appeared to face the direction of travel for the most part. Is this the behavior I would like to ship the game with? Hell no but it passes for now. 

For the truly curious and more math is fun friends of mine my wife’s equation looks like this in code:
toTangent = ((-4 * elapse_time) + (strengthY * speed));         angleOfMotionInRad = Mathf.Atan(toTangent) * playerFaceing * -1;           axeSprite.transform.Rotate(new Vector3(0, 0, angleOfMotionInRad));    
 
Also these 3 lines of code are far simpler than anything I could find online as to how you’re actually supposed to do this. So next time I’ll just ask my wife when I can’t get the boss AI right. Shouldn’t be a problem. 

Next week I hope to put in more artwork. Maybe I can put in some targets that are actually artwork. I also meant to add in a gateway artwork this week but didn’t have the time.

Monday, March 20, 2017

TOE week 29: Logical Gates.



I was once again late with my update but I had a busy weekend. However I did work on this giant project. Powers management.  Remember how I spent weeks working on creating various different powers like air dash and portal? Well last week I spend days figuring out how to turn them off. In my game loop it works something like this. Play level => Fight Boss => Get new Power. However powers are equipable. So I needed two bools for each power. IsEquiped and isUnlocked. If both are true then you can air dash.  There is also a health effect when I power is equipped and I had to put in the math for that. This week was like creating an electrical switch. 

I ran into a problem. I put the power manager script onto the player and I understand how to get two different scripts to talk to each other but I didn’t know how to get two scripts on the same object to talk to each other. Seemed pretty basic actually. Usually this would be something that would hang me up for a little while but knowing what I now know I solved it in about ten minutes. The cool thing about this week has been that all of the problems I seemed to encounter I seemed to be able to solve with knowledge I already had. And that is a great feeling. It is like I’m actually good at this now or something! Don’t worry I also know I shouldn’t let it go to my head. I mean there is so much more to know about C# and Unity. 

I guess the down side is that I really don’t have anything to show off this week because it was all in code really. This week I need to start making more artwork and I think I’m going to start making my vertical slice level. I should probably make a list of all of the things that needs.

Friday, March 10, 2017

TOE week 28: Diagonal Legos++



I know that some of you might have looked at the rainbow bridge that I made last week and thought something like ‘what? Why is that even useful?’ Well it is test art. There is really no point in making full blown artwork if you don’t know what it is going to be put on. In fact if you just make the art and try to find a way to squeeze it in you’re just going to wind up with a lot of wasted art. The reason I want the UVs on this to be so precise is that I’m trying to make them attach with every other piece and still look correct. 

This  week I spent most of my time painting two different textures for my ground collision system. They look something like this:




Hopefully a picture is still worth a thousand words. But I can hear you ask 'why can I see through the ground? Even after you’ve put in the ground?' Well I have not yet made the artwork for that yet. Also I’m not completely sure if I’m going to solve this problem in code or model it in later. One thing at a time.

So that was this week mainly painting. Not a whole lot to say. Next week I think I’m going to try to put in a player powers manager. Also whenever I drive by a Chase bank I notice the architecture and I find myself trying to incorporate it into the design of my future tower… More on that later.  

Friday, March 3, 2017

TOE week 27: Serendipitous Deletion



Last week I said that I was going to have to do the whole UVs thing over again. Well I was wrong. I had to do it over again four times. Fortunately I now have this particular process down to a science. The first time I did it I learned that you need to use the straighten tool in blender. The straighten tool in blender sucks and makes me miss XSI. I don’t remember it being terrible in Maya either. You right click on the UVs you want to straighten and say straighten x or straighten y. They have this in blender but it actually does nothing. Looking it up on the various forums you have to do something entirely different to straighten UVs. Maybe it isn’t UVs I hate maybe it is Blender’s UVs. 

I finished attempt 1 and import it into Unity and it doesn’t really work. Like the test texture I made doesn’t line up. I worked on it for a bit but it seemed remarkable uncooperative. I gave up on attempt 1 and moved onto attempt 2 and had very similar problems. While I’m busy failing at this I am also learning what is going wrong. I quickly discover that attempt 2 will also not work. Ok attempt 3! I made everything over again and it kind of mostly works! It isn’t perfect. I put on the test texture and there are some problems but they don’t have to be fixed in the model. Okay bring it into Unity. Then back to Blender to break it into different pieces. 

For my collision I have a master file of all of the different collision pieces. This makes UVing much easier as in Blender you can’t see UVs on two different objects at the same time. Then I save them as different pieces and delete the remaining bits. Well if you guessed that at around 10pm I was too tired to properly handle this task then you would be one hundred percent correct. So if anyone had: ‘deleted the bulk of the collision in the master file and saved it’ in your office pool then you get a cookie. I was shell shocked and kind of pissed but it was done there was no ctrl Z for this one. I thought about how I could fix this… Source control software, I should put this on git hub and things like this can’t happen! It wouldn’t fix the current issue but it could prevent future problems. I considered just using the model I made last week it worked even if it had its own problems. Then I did the smart thing. I closed the computer and played Gears of War for an hour and went to bed.

I woke up the next morning in a fog. But it was fog of UVs, like I was in the zone! I stumbled around the house as one does when getting up early and I kind of stopped when it basically hit me. I could see the most perfect layout. My wife asked me what I was doing because I was just standing in the room probably picturing squares in my mind. I told her that I was thinking about UVs.

It was 7:40 and at 8:00 I had to get my son up for baby class. So I had 20 minutes. I worked on the 3D model and my son woke up 10 minutes early. We then went to baby class. When I got back I finished the model and UVs. Then I saved two copies of this file… Didn’t want to lose it. Broke it into pieces got it into Unity and then I had a Rainbow Bridge that connected with all pieces without any graphical errors. Also in my old UV layout you couldn’t tell where the edge of the foreground and background actually met. In this new version it is completely obvious. 

So what did I do this week? I built a rainbow bridge through failure.