Unity Raycasting Reflections

Okay, so, Unity is kind of a pain, but I did manage (with lots of help and the use of a pretty good tutorial here http://www.41post.com/4162/programming/unity-raycast-reflection) manage to put together something that I want.

http://www.johnalatouf.com/testing/LightPuzzleTest.html

There are still some bugs. For one thing, the way to select the mirrors is stupid right now, but that’s fixable. You have to click and remain hovering over them with the mouse, then spin them using the left and right keys. More concerning is the fact that when I have two beams hitting one mirror, the first reflection beam is replaced with the new reflection. It shouldn’t do this. I guess it should display both? I don’t know, that might just be annoying. I’ll think about it.

Still Here

I have spent the last few days doing Unity tutorials. I’m trying to do some annoying things with Unity’s RayCast that may or may not be possible. I’m trying to make a simple laser reflection game. A RayCast is emitted from a light source area and then when it hits another object it draws a line using LineRenderer to reflect from that object. Ideally, it should continue reflecting along objects that you can turn until it touches an end point.

I found a tutorial online that makes the RayCasts reflect on a set number of objects and then draws one long lineRenderer. This isn’t quite what I want, as I need to be able to adjust the number of reflections differently and I will need to use separate LineRenderers probably, but it’s a start. I am working towards getting the separate LineRenderers working, and then I’ll try and fit them into a loop of some sort. We’ll see.

Twine and Spreadsheets

I’m working at prototyping The Ceresian in Twine. I’m a huge fan of Twine for this purpose because it lets me design the various points systems while I write the game. I need to implement the morale points system into what I have finished so far, but the rest are in.

Points systems:

  • Personality Friendly
  • Personality Hostile
  • Personality Professional
  • morale
  • experience
  • Friendship Points for each character

Twine doesn’t let me design the puzzles that will be included, but I can work on those later. I have ideas in mind for several of them. I have written up a list of the assets I’ll need for the scenes I have written. I’m going to go through Andrew’s Unity assets later to see if there’s anything I can use.

If I have time, I’d like to write some jQuery scripts for Twine that I could share out. I’d like to make some scripts that allow developers to make non-linear web comics. I’d need:

  • speech bubbles
  • layout
  • character creator

Anyways, things to think about.

My Art Site

So I have created a new theme for my art website. I built it off of http://underscores.me/ which is a great starting theme. I studied a few tutorials to figure out how to make the layout scroll horizontally. The links in the navigation menu point to the id of each div. When a link is clicked, the html,body scrolls to that target minus the width of the margin to centre it. At the same time, the background and foreground divs also animate the same distance with different timing.

Getting the whole thing to line up at all screen sizes was a delightful experience. Javascript makes it fairly easy to detect the size of a window and when it resizes, so I was able to dynamically resize the images easily in a browser. The real challenge was making the whole thing work for mobile. It doesn’t help that mobile devices insist on holding onto javascript no matter how many times you try to clear their caches. In the end, I had to rename js files over and over just to test my tweaks.

The sky is a simple CSS gradient that changes based on the hour. The hour also adjusts brightness and contrast effects on the foreground and background images.

Outstanding Issues:

  • The pages are hard coded into the index.php file. I’m not happy about this. It works fine for my website, but WordPress themes should be more dynamic than this. I would like to find a way to load pages dynamically and resize the website to account for new pages.
  • There’s no support for sub menu links.
  • I have disabled the links to entry permalinks. I wasn’t sure how I wanted to display those yet. Right now, they’re just a mess.

What is This?

It turns out I’m a developer now, so I should make a habit of keeping a developer diary. I won’t publish this blog until I have had a chance to customize the appearance and populate the journal. I have a main blog already on my site for my art, and even that is in need of updates. Mostly, I find I have a bad habit of forgetting what I was doing with something, so I’m keeping this diary to keep better records of my work.