Light. Also, F4D progress.

Posted by Astryl on Dec. 8, 2011, 1:30 a.m.

Note: Most of this blog was typed up at the early hours of the morning before yesterday morning, with a few additions this morning. Feel free to skip most of it.

Love my new banner, OR ELSE…. it'll eat you.

I've been studying Raycast rendering for a few months (And by 'study' I mean lightly glossing over the materials I have),

and thanks to it I have gained a firm understanding of the way a Raycaster computes lighting for objects in a scene, as well as the way it constructs the final image.

I then got the thought: If the final result is just an image, can't I approximate those lighting calculations in my 2D art? The answer is, after much trial and error, that the human brain can perform a close approximation of various lighting and shading methods to a reasonable degree of accuracy.

The net result is that I turned this:

Into my new banner. How did I do it? In three phases:

First, I created a pure black layer over the main image and set it's opacity to about 85%.

Then I painted some basic ambient lighting onto that layer (Diffuse, no specular).

Then I created a "Screen" layer, and painted the specular highlights and light reflections.

Oh, and I removed the wings and modified the horns. And painted christmassy Tron lights onto him in the Specular layer.

Here's another old image of mine, polished up and re-lit:

Which has a lot more ambient light than the dragon (Ambient light coming from the right hand side of the screen, main Diffuse spot coming from the left. Of course, all these lights are imaginary, but keeping them in mind I can create much better images out of what basically looks like crap in comparison).

The primary difference between the two images is the amount of light reflected. The dragon absorbs more light, and the robot reflects more (Especially on the silvered parts).

I also experimented with some fine detailing (Mostly on the horns).

Winter comp entry - Redundant. See end of blog.

Well, I have lots of ideas for this one, but I'm making a rule for myself: Stick to platformers. It's the genre I know best.

Now, my design document this morning stood at "Linear platformer on skates". I'm still considering this… =P

And I'm staying away from Metroidvania. Metroidvania style platformers and comps don't mix.

Looking back

I've been browsing around my projects folder again… And I am ashamed of the number of games I started, posted

screenshots of, then dropped. Specifically, that 3D First Person Roguelike with the awesome sword I had made. D:

What I'm doing now is rushing to finish my current WIP's; I intend to release them before New Years. Then I'm resolving to start 2012 with a clean slate.

Who knows? I might actually re-boot that roguelike project again! (I know a lot more about 3D game development now. Spent most of the year reading Andre Lamothe's books, and articles off Gamedev.net).

Amusement in C++

I discovered to my great joy that the C++ pre-processor isn't very picky about what you #define. Here's a set of perfectly legal statements:

// Defines

#define Begin int main(int argc, char** argv){
#define End }
#define Print(str) printf(str);
#define Println(str) printf("%s\n",str);
#define If if(
#define Then ) {
#define Else } else {
#include <stdio.h>

// Code

Begin
    If 1 == 1 Then
        Println("This is weird");
    Else
        Println("And highly amusing.");
    End
End

Of course, this is all just the Macro and string-replacement functions of the pre-processor, but honestly: that's awesome.

Theoretically, I can take a Pascal program (Or Java, Python, etc) and #define it's keywords into C++ friendly ones. Of course, that could become an unbearably painful project, and why bother if the code compiles fine in it's native language anyway?

One use for it is the typical 'syntactic sugar'. Like this little thing that annoys me terribly in C++:

// Normal function with exception
int foo(int n) throw (MyException)
{
	return n;
}

Why does this annoy me? Because Java's syntax is much cleaner.

Luckily, I can redefine it into something that isn't perfect, but more readable (in my opinion):

int foo(int n) throws_int
{
    return 0;
}

Which will make the single restriction for the text-substitution apparent: The labels must be compliant with the C conventions.

The end bit

Well, back to work for me. I have a game to 'finish'. Actually a game demo. Heh. And once I release that… it's time to clear my 'current projects' folder and start looking to make something new, from scratch. A year-long project for 2012.

Feel free to let insults, comments, ideas and wisecracks fly.

Something tacked on at 00:26

I was recalling some of the things I'd learned about CPU design, which I dabbled in about three years ago, so I set

forth to do something I've been meaning to do for ages: Build a functional 8-bit memory cell in Minecraft based

on the old designs I have (I have some old books on CPU and computer design, most from the 60's and 70's).

And I came up with this:

The big messed up tower thing on the left contains my R-Latches. the weird tower right next to it in the middle of the

picture is the Reset line (Clears all latches to state '0').

The other weird towers on the far right are stairways for the display circuit, which is a simple 'LED' display on

the bottom right (8 inverted redstone torches coupled to the OUT lines from the latches).

And that's probably about as far as I'll be able to get with this thing. I can emulate a CPU with no problems; creating a real one, or even a facsimile of a real one makes my head hurt. :(

The First Amendment - Made at a sane hour the next day.

Well, I figured out a much more efficient way to transport redstone current vertically:

Vertical Inverters. Now I'm stuck with this CPU because I forgot how to make a Full Adder. Argh. Time to

dig up my old books and find those articles again.

Rest of Blog, F4D progress

I started working on a platformer; specifically, a platformer based around a christmas theme, and a boy who walks very much like Megaman and can throw snowballs. I already have the character and snowballs; screenshots tomorrow.

Comments

Astryl 12 years, 11 months ago

Response to comment by death in previous blog, 'cause I don't want to bump it

Hey. I DO have a PayPal account… I made it early this year with the intention of buying stuff…

Also, my avatar can stay as-is for now… until I come up with a new one.

BP Scraps 12 years, 11 months ago

I just noticed the grass blocks in your avatar. Neat.

Toast 12 years, 11 months ago

We did exceptions the other day in programming class

I did not understand any of it

sirxemic 12 years, 11 months ago

Toast, you just catch them.

Cesque 12 years, 11 months ago

Quote:
The answer is, after much trial and error, that the human brain can perform a close approximation of various lighting and shading methods to a reasonable degree of accuracy.

I think painters have been doing that for centuries.

They probably gain that amazing skill from sniffing paint.

Astryl 12 years, 11 months ago

Quote:
I just noticed the grass blocks in your avatar. Neat.
I was wondering when somebody would.

Quote:
We did exceptions the other day in programming class

I did not understand any of it
I can't say anything about this, because of sirXemic.

And sirXemic… epic. Just epic. Using that for the lesson I'm giving on exception handling.

Quote:
They probably gain that amazing skill from sniffing paint.
Which is why I had trouble: I don't usually apply paint. I use pixels. :P

LAR Games 12 years, 11 months ago

Man, this makes me wish I was able to understand other languages besides GML. And I've barely scratched the surface of what I can do with gml. (I recently understood how surfaces work. lol)