Friday, June 1, 2018

Temp Hiatus

So it is kind of a good news bad new kind of thing. The good news is that I got a new job. I just finished my first week. The bad news is that I don't have the time to work on this project because I'm working on bringing home the bacon. My job seems to want me to learn some Java Script and I've been looking into it. It seems a lot like C# except Java Script requires more equal signs. So will still get some programming in. It is a temp job so I will eventually be back working on this it just might be in July.

Friday, May 18, 2018

TOE week 60: The Actions of Associated Objects


Basically immediately after I wrote last week’s blog I un threw away all of the work that I did for my crappy version of bouncing a ray off of a reflector. This was the first attempt that worked but also didn’t. Fixed what wasn’t working except for the multiple hits problem and got line renderer to actually work. It was like I just had to write down all of the things that were making me frustrated and then I could move on. Here is a video of it working!


 The rest of the week was also pretty good. I drew up some temp artwork for my Lazer Projector and the Power Source Panel. I created a particle effect for my the flame jets that push the player around if the portal is open. I found a better way of dealing with rotation. Using transform.rotate instead of transform.rotation is good alternative according to me. What you don’t know the difference? Neither did I. #Learning. 

On Wednesday I was kind of stumped. I didn’t know how to implement something. I have two objects that are the Power Source Goal or the Laser Beam Goal. Each of these flip a flag when they are getting power or getting hit by a Laser. But I needed them to activate their associated object, like open a door or activate a particle effect. The trouble was that what the associated object IS, is variable. So in script you specify hey I’m looking for a MovingPlatform’s script and then tell it to do a thing but if you put a Particle Effect in there the script doesn’t know what to do.

So I cheated. I created a generic mediator script that basically is plopped on top of any object, MovingPlatform, particle effect, door. The Power Source is looking for that script and that script talks to the associated object. I don’t know if this is the RIGHT answer and further experimenting may be needed. Here is a video of that working!

 
With all of these cool new elements I might be able to start building a level again…. That means I may have to start working on AI again… FUN… Next week will be interesting!

.

Friday, May 11, 2018

TOE week 59: Arrow Heavy and Failing the City


This week was a banner week for failure. I just kept hearing Oliver Queen saying “You have failed this city.” I took an arrow to the knee and took a knee. Honestly the weight of this project is heavy and I am just one person. In industry if you have a bad week chances are that your co workers did not and the project moves forward. Working by yourself when you have a bad week the project just stands still. 

Last week I worked on getting a reflection system working in the game. This was unsuccessful until it was successful. OR so I thought. I may have mentioned that the way I had it working only showed up in the editor window and it did not show up in the game window. This is important because the player would be unable to see my lazer in game. Last week I thought it would be a simple task of figuring out how to use Linerender to draw my lazer using the existing system that I set up last week. Turns out I was very wrong about this.

If I learned anything this week it was that I kind of hate Linerender. It is a head ache to set up if you want anything more complicated than drawing a line between two points. Over the weekend I fought to get Linerender to work with my system. No avail. On Monday I fought with Lineredner. No avail. On Tuesday I tried to just get a Raycast to draw instead of a Gizmo. Because the raycast system drew every frame it slowed the game down to a crawl. No avail. On Wednesday I gave up on it because I was just spinning my wheels. And on Thursday I just wallowed in my own failure. The old system that I had last week with all of its faults might have been the better way to go even though it didn’t even do the reflection part correctly.

In less depressing news I did set up Pro Builder in my game. Pro Builder is pretty awesome and probably more powerful than what I need but it works great for quickly making geometry and is faster than saving in blender and waiting the 20 seconds that Unity needs to update the 3D file. This was the height of my accomplishments this week. That and I changed my desktop background to say CODE, DRAW, UDEMY, UNITY. Basically the things I should be working on. 

Oh and the results are in a pretty picture will add 10 hits to your blog.
.

Friday, May 4, 2018

TOE week 58: A couple of hitches.


What did I do this week? The better question is, what didn’t I do?



I colored this picture. Why, who is that lady? You might ask. I don’t know who she is I didn’t draw her, she is just the line art provided by the tutorial. I am trying to get better at making art as it seems to be one of the things that catch peoples’ attention. So I colored her for better future advertising purposes when I have my own line art.
.
I fought with programming. Like I created my own admittedly crappy bounce a ray off of collision system but for the life of me I could not figure out how to correctly use vector3.reflect. All of the documentation and tutorials I found basically say this vector3.reflect(angleOfIncoming , normalOfHit). I did that and boy did I get some weird results. So I keep looking for a better documentation or tutorial. I eventually found one after having fought with reflection for a day and a half. I throw away all of my old work and implemented a system that is arguably better than the one that existed prior. Mainly because my old system could only handle one incoming ray meaning that if a mirror was hit by two rays only one of them would draw the reflection. 



This is my reflection in the editor. The yellow lines are the path of the lazer the green boxes are the source of the lazer and the green rectangles are the mirror objects. It doesn’t show up in game as gizmos do not render in the game window. You have to use LineRender to get it in game and that is the hitch.

I can’t get LineRender for the life of me to draw a line where it is supposed to. The line just shows up a position 0 for reasons it decided, not me. Something for next week’s work list I suppose!

Then I took the show on the road and showed the game to two former co workers at lunch. One of them game me homework. Basically if you want your large design to be cohesive you have to always look at any new idea and ask does this support the mission statement of the game. The hitch here is that your mission statement is one sentence. 

Sounds easy but IT IS NOT. So far my sentence is: Electric exploration using time travel to fight the one percent. Something more to work on next week. 

This week was productive and eventful.

Friday, April 27, 2018

TOE week 57: The Department of Super Weapons


For me coding doesn’t seem to be like riding a bike. I have to code everyday in order for it to stick around. Some parts of coding stick around like I still know what a bool is and when to use it. The part of coding that doesn’t stick around seems to be the part where you are staring a blank page and the amount of time it takes for you to know what to do is basically near zero. I haven’t yet got that part back yet.

This week I decided to work on something easier. I made super weapons. These super weapons function similar to sub weapons that I made earlier but you can only fire off a super weapon if you have a large amount of ammo, they fire off of a different button and you can only fire one of them at a time. Turns out super weapons are very much like sub weapons except in some places they are very different. 

After two days of work I had four new super weapons that work well enough for a version 1.0 of functionality. After having finished I thought ‘man that took a while’! I basically chided myself for doing the work but not fast enough. I mean am probably just being impatient with myself. I want everything NOW. When I should just be happy that it got done.

I spent the other few days of the week being sick and that resulted in getting mostly nothing done aside from binge watching the new Lost in Space. I don't know what I'm working on next week but I think it involves raycasts and reflective objects. Keep in mind that I have to make said objects reflective. Wish me luck!

Friday, April 20, 2018

TOE week 56: Like a Dragoon I have returned!


I did a THING!

Not having touched this mammoth of a project in about 4 months and not have really worked on it 4 months before that, this week I decided to open it back up and try to do the most difficult coding task I have ever attempted. What is that you ask? It is an AI enemy that make different random decisions based on player actions. How did it go? Not good. Not because of the reason that you’re thinking.
AI was really grinding my gears before I stopped working on this but opening Unity and Visual Studio after VS had been dormant for months basically meant that it was broken upon opening. Like My project solution was no longer connected to my Unity project. Why did this happen you ask? TFIIK. Let us just say ‘because computers’ and be done with it. Long and short is that I had to NUKE VS 2015 and install VS 2017 and then coding could continue. But hey VS 2017 had a checkbox for Unity specifically so that is cool. 

On Tuesday I tried to make an enemy ray cast two different rays, high and low. If both hit do a thing if only low hit do a different thing and that was a swing and a miss. Basically wasted time. Monday and Wednesday both were spent drawing with some success. Thursday was the day I gave up on fighting with AI and I decided to make collision objects that simulate power conduction. I did this because I thought it would be easier than fighting AI the results are fifty fifty. 

I created a square that was the power source it is simply a box with the tag PowerSource. Then I have a different square tagged with Conductor. If a Conductor is OnTriggerStay (touching) an object that is PowerSource then the Flag on the Conductor flips to true for IsPowered. Sounds simple right? Wrong. One of my struggles in Unity is with objects that don’t know about each other talking to each other.

Simply in Unity you can send a message to two objects that are colliding but you can’t directly access the object. (Or if you can I don’t know about it.) Meaning that the Power Source knows nothing about the Conductor and vice versa. Let’s talk about a Conductor. If a Conductor is touching a Power Source on its left and it is ALSO touching a Conductor on its right. The Conductor in the middle sends a message to the Conductor on its right to flip IsPowered to true. Where it breaks down is when the power source is removed the Conductor loses power BUT the Conductor next to it then sends a message ‘hey buddy you are powered’ even though both are no longer connected. 

It should be noted that if there is only one Conductor object this all works correctly but a Conductor next to another Conductor has a bug. I will try fighting with it more after this update. So why have I done all of this? Because I wanted to create some power puzzles where the Player uses the portal to bridge a gap between Conductors. That works pictured below. Yellow blocks are Conductors, light Blue is Power Source, and Dark Blue is a Power Destination. 

 

Like pretty much now I guess. Oh and this is the picture of my main Character.