Shadow Mesh, Go!

Looks like my hunch last night was right: it was the normal mesh and not collision mesh that casts shadows. It took some finagling, but I was able to sort out the appropriate position and scale info to make shadow meshes from a list of points specified in the data.

So far, it's looking pretty good. I'm getting wall shadows as expected, and I can even do complex shapes if I want. E.g. I made the shadow points match the full thickness of the wall sprite, instead of just a flat line from one side to the other. This should be handy for sprites with more thickness or other non-straight edges.

There's one problem: my shadow mesh and my sprite seem to be flipped horizontally relative to each other. From what I can tell, my prefab cube must have flipped UVs in the horizontal direction. I'm looking into blender now to see if there's something I did to flip them. Though, I suspect it may just be a coordinate system thing. Unity's camera points in the Z+ direction, so I'm actually looking at the underside of the object.

During all this, I also did some patching-up of my JSON handling code, and now I can write out any JSONs that I want based on current game data. This probably won't be used much in the final game, but for development, it can be handy for quickly adding bulk data to a large number of items. Just read in the base data, have my code procedurally write extra data to each object, and save out to JSON again.

I also fixed the scrollwheel sensitivity on the scrolling parts list, so now a single mouse wheel increment moves about one full button part. Should make scrolling easier.

However, I'm still having trouble detecting when the mouse is over that GUI panel or not. Unity handles mouse clicks and scroll events on that panel magically, but if I want to manually check if the mouse is over it, I seem to fail. I'm mainly interested in this so I can prevent mouse events from affecting the scene when manipulating the menu. Mouse wheel scrolling zooms the camera and scrolls the part list, but it should only do one or the other based on where the pointer is.

For the life of me, though, I can't figure out how to do this. Seems to be a glaring omission in the Unity UI system, based on my searches. (I.e. I may have to create custom OnEnter/OnExit handlers for the panel in question)

We're starting to get there. I think I'm quite close to being able to place correctly-lit sprite parts soon. The next step will be getting the grid-fitting rules active, so parts only go where they're supposed to.

That's all for tonight. Have a good one, all!


Malacodor's picture

Hi Dan, didn't know if you keep an eye on older news posts, so I just post here about the 2D-3D discussion (, and sorry for the late response.

My thought was if you have to make 3D objects to create bump maps anyway, making the game 3D wouldn't be extra work. On the other hand 3D would be better for animations, which NEO Scavenger is lacking. Let's say there are 4 different characters with 4 animations each, then with pixel art you had to do 16 animations. In a 3D game you just make 1 character with 4 different textures and 4 animations, that can be applied to all the characters. A 3D model might be more work than a 2D sprite at first, but 2D scales horribly regarding animations, which I would really like to see. Or think of a hand grenade rolling over the floor, for example, this could be done much easier with a rotating 3D object than with sprites. You could place decorative objects which fly around when there was an explosion nearby.

Another problem with pixel art is that it looks really bad when using non-integer zoom factors, which is another problem of NEO Scavenger. Some people like to zoom out a bit more for a better overview, while others might suffer from bad eyesight and prefer to zoom in.

Also, if the game is 3D you can use the 2.5D camera to imitate the classic 2D look, but you aren't forced to stick with it all the time. Conversations could show the dialog partner from a first person view, for example.

What I like most about the Unity screens is the realistic lighting and shadowing.

Ran around with a clown mask before it was cool

dcfedor's picture

Hey Malacodor,

No worries about the late reply. Just curious what some long-time players of NEO Scavenger thought about different art styles :)

You make a lot of good points about the pros and cons, so I'll try to hit some of the highlights.


I love 2.5D, and I'd totally do it if I could. However, 2.5D is a pretty big jump in complexity and development cost over top-down. Instead of only needing the top view of each object, each object now needs 2-5 more profile views, depending on rotations.

Top-down means I can get away with each object being either a cube or plane with a texture on the top, and that's it.


Like with 2.5D above, I love when a game has good animations. They're hard to do, though. And that's why NEO Scavenger has none :)

This game will probably need some for the wandering crew, among other things. But I'm dreading it. It'd be nice to have different outfits and character equipment show up like in NEO Scavenger, but it'll get cost prohibitive.

3D animations can indeed be more economical in the long run, but they're not trivial to make. Even a good rig and skinned meshes falls apart in certain situations. (Swappable character parts was a big part of my job at BioWare, and was more than enough work to keep a full character team busy for years.)

Animations are a can of worms, and I'm not looking forward to them. I may have to do some sort of sprite-with-bones setup to keep things simple while sidestepping hand-animating every combo of sprites.


Pixel art does indeed scale poorly. NEO Scavenger has taught me what a headache that can be.

And 3D art does scale pretty well. Keep in mind that the texture on the models still has a base resolution, and scaling it too much causes blurring/aliasing. And models have verts, which appear when you zoom in too much. The way most games avoid this is super-high detail meshes and textures (or geometry shaders), and then we're talking AAA (or at least triple-indie) art budgets.

I'm definitely keeping this in mind for this prototype. Pixel art is a style I like, and one I'm still interested in trying for this. I may have to limit zooming to integer values, choose an appropriate base resolution, and use fog of war to allow for field of view changes with resolution.

Lighting and Shadowing

I like these, too, and they're the reason I poured all this energy and time into Unity so far. Lighting can really transform a scene, and I'd like to see how I can use it to enhance a pixel art style.

I'm still a bit worried, though, that there may be consistency issues with high-fidelity lighting and pixel art. Like, will characters look okay casting simple shadows? Will lighting look as good on them as it does the environment? It's possible I'm just creating a spike in fidelity that makes everything else look bad by comparison.

We're still a long way away from answering the art style question!

Dan Fedor - Founder, Blue Bottle Games

Malacodor's picture

Yes, the art style question... I'm not sure if I can help you there.

Regarding Megasphere, Galactic Princess and Halfway it's similar to what Kaaven said, these games have 20th century graphics with 21st century light effects. This is like baby food with caviar. Riot is better in that regard. However, I find all of these games more or less ugly, only Halfway looks somewhat decent. FTL is too simplistic for me, too. I like the high resolution of the WTF graphics, but the interior has no dynamic lighting.

Perhaps not what you wanted to read, but I'd prefer a style similar to that of Darkwood:

Ran around with a clown mask before it was cool