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.