Item and Lighting Cleanup

Hey Folks! I've made some nice visual progress today cleaning up the item placement and lighting. Have a look!

IMAGE(http://bluebottlegames.com/img/screenshots/screenshot-2016-01-07.jpg) On second thought, you go ahead and take the bigger room...

Most of these pieces are familiar to those who've been following my devlog. The difference here is that I reworked the normal maps on all the items, and cleaned-up some light/shadow parameters for them.

One of the big highlights is the bed. The bed is my first attempt at hand-painting a more complex normal (i.e. bump) map. Normal maps are just images where red is used to control left/right surface direction, and green controls up/down.

Usually, they're created automatically by using a 3D mesh tool like 3DStudio, Zbrush, etc. The artist makes a mesh or bump surface in their tool of choice, and it generates appropriate normal maps. There are also plugins for Photoshop, and even pixel-art-based normal map tools out there.

In my case, I basically just painted the bed as if it was grayscale and lit from the right. Then used that as the red channel. Repeat as if it was lit from below, and use that for the green channel. Finally, draw a grayscale blue channel as if lit from the camera's view, so parts facing you are RGB=128,128,255 (gray blue) and parts facing sideways are RGB=128,128,128 (gray).

The result is that lights will highlight and shadow the surface as if it is bumpy. Notice the top bed in the image above has blue on one side of the pillow, and orange on the other. And the surface of the bed looks rumpled. I didn't have to work too hard to paint that. A lot of it was just rough penciling with a thick brush to create texture, with some blobs of light and dark in appropriate channels.

Is that sustainable? Maybe. Might not be too much harder than drawing the light/shadow into the sprite manually. Especially once you get the hang of it.

You can also use a reference image like this to pick colors for different faces/directions, and just paint with that:

IMAGE(http://bluebottlegames.com/img/screenshots/screenshot-2016-01-07.png)

Note: This image was cobbled together from here among other places. I've adjusted the color channels to work in Unity, though, so it may not be compatible with other apps without some tweaking.

Will modders be able to do this? Yes, but they might find easier ways to do so. The aforementioned tools are only some of the literally dozens out there, ranging from free to expensive, that will do normal maps regardless of your skill level. And picking and painting using the reference image above isn't too bad. So I think modders will manage. And worst-case scenario: just make the normal map all RGB=128,128,255, and it behaves like a flat sprite without bumps.

Apart from the above, I also added a "Clear Scene" button for convenience. And I started working on more complex rules for placing items. I was starting to run into situations where items would overlap despite the "forbidden" socket info each had. Items may need to set multiple socket types per grid to get the right kind of placement. But I'll need to think about that some more.

Believe it or not, today was a less productive day than yesterday. I had a lot of stumbling and work/rework today. It just looks prettier :)

Anyway, still chugging along!

Comments

Rovlad's picture
Rovlad

Is that blurriness just a case of resized low resolution sprite image, or is this some kind of screenspace effect unity is doing on these beds? Pretty sure they're not supposed to be this blurry.
When you compare them to pixel perfect floor and walls (which I know are actually 3D objects) it just looks a bit off-putting, that's all I'm saying. For what I know they might be just placeholder art.
Anyway, can't wait to see more.

matsy's picture
matsy

I think that is just the style, I am quite impressed because when I saw the bed icon in previous pictures in the placement tool bar I did think to myself will you be able to tell it is a bed?

Malacodor's picture
Malacodor

I think it would look better if walls were on the tile borders like in The Sims. Walls should also be thinner, on a space ship space is valuable, and a few mm of steel should be enough for inner walls.

Ran around with a clown mask before it was cool

matsy's picture
matsy

I have a bit of ocd in that the bed can't be flush with the corner of the walls but I don't think stick thin walls would be the answer, as the game is in a top down perspective it would be hard to tell where walls were as it isn't played in an isometric view! Plus I imagine it would be nice to see the damage to the wall etcs.

Anyway one option would be to have more variable wall tile pieces? Well actually for the most part it is just rotating and placing the wall pieces as hall way tiles of instead inside the room. I would it would then need some more code to be able to put a light in the middle of two floor pieces rather than in the centre of a pre-set tile like you have done but suppose it would coming if you were going to implement wall lights and such.

IMAGE(http://i.imgur.com/PKIQDsV.png)
Ignore my quick paint job.

dcfedor's picture
dcfedor

Some excellent points! Let me try to address each.

Re: beds being blurry, this is likely an art issue, not Unity. Both the bed and the floor are exactly the same object types in the engine, with different textures. It probably looks weird because I drew the floors with 100% opacity and grid-aligned pixels, while the bed was "feathered" and used pressure-sensitive shading with a pencil too. The bed art is done like the dirty/organic items (e.g. clothes) in NEO Scavenger, while the floor is more like clean/technical items (e.g. Nanorobotic Medkit), for reference.

So far, everything is placeholder, though I was planning on going with something like this in production. I may have to bump up the surface clarity/detail a bit to see if that helps.

Re: walls, they're still evolving, but they represent the current plan. Right now, walls can look like anything we want. I did this quick mockup to show some possibilities and considerations:
IMAGE(http://i.imgur.com/fnTPaxY.png)

a. wall fills a 1x1 grid
b. wall spans a 3x3 grid
c. wall is paper-thin within 1x1 grid
d. wall as shown in devlog, above

In all of the examples above, red squares are impassable by crew, oxygen, water, etc. Option b. might be able to make the upper right corner green without issues, but none of the 1x1 grids can be reduced any further. Otherwise, they wouldn't be walls, according to the game. Crew would walk through them, air would flow through them. Only light would be blocked.

As such, placement of items against walls means either the item is hugged tightly by a grid, as in option a. Or the item has to straddle multiple grid squares to rest against the wall, as in c. and d.

There's also a problem involving smaller items. Originally, I wanted players to be able to build not only ships, but items within those ships, by arranging parts on a grid. I was thinking it'd be cool if players had the ability to tweak item designs for optimal performance.

For example, this was a reactor design I mocked-up:
IMAGE(http://bluebottlegames.com/img/screenshots/screenshot-2015-09-21.jpg)

I was hoping that dedicated players could rearrange this design's parts to do things like add extra radiation shielding, increase the reaction chamber size, or route coolant differently to avoid cascading failures. Then, they could place that new reactor design in their ship for better (or worse!) performance.

This would still work in the grid system above, because reactors are big enough for each part to be on a grid. But if we were doing, say, a pistol or a coffee maker, then all the parts would have to fit within a single grid, making their properties hard to track from the game's perspective (since each grid needs to have properties like temperature, air pressure, etc.).

I might have to give up on smaller item designs. Or I might have to rethink the way grids work. But at least for walls, the design of the system means we can make them look like anything we want. It's just the game's grid size that limits things.

Dan Fedor - Founder, Blue Bottle Games

Malacodor's picture
Malacodor

I'd prefer option a. with tripled or quadrupled resolution. Walls only partly filling but fully blocking a tile look bad in my eyes, and so does the straddling bed. Regarding performance, you don't need tile based pressure/temperature, make it room based.

The blurriness seems to be rather jpg artifacts than anything else.

Btw, did you notice my last post from 12/18/2015?

Ran around with a clown mask before it was cool

matsy's picture
matsy

For smaller object likes a coffee machine or pistol, could you not have a pop up window of a larger grid?

dcfedor's picture
dcfedor

Option a. is indeed the cleanest, and probably the easiest to do. The downside, however, is really blocky ships. And unless the grid is super small (which has performance considerations), interior walls have to be really thick.

I think we'll need more testing to know for sure. At least for now, all options are still possible. Only the data needs to change for option a/b/c/d. The engine is the same for all.

As for tile-based vs. room-based simulations, rooms have some gotchas of their own. First of all, detecting a room in an arbitrary map isn't as easy as it sounds. Is a corridor a room? What about an intersection? Does a room require doors, or can the doors be openings/bulkheads? What about local effects that don't fill a room, like a liquid spill or alpha radiation? Do they have to fill an entire room? Do they travel out of rooms with doorways that are open?

Not to say room-systems are inherently bad. But again, pros and cons.

As for your December post, I hadn't seen it until you mentioned it now. I know what you mean about inconsistent art styles with lighting on pixel art. Do you think the mockups I've shown so far fall into that trap? Either partially or wholly? (I.e. are some parts of them better than others?)

I'm not sure if I like the Darkwood style, though. At least for this setting. Darkwood feels a bit too painterly, like board game pieces. High detail, but soft on realism. That's probably just me, though, since I grew up on fat pixel games :)

Dan Fedor - Founder, Blue Bottle Games

Malacodor's picture
Malacodor

Room detection should work like the bucket tool in Paint with walls and doors being the boundaries. Everything providing an airtight seal is a door, anything else is just a variation of empty space. Whenever a door opens a pressure equalization between the rooms on both sides happens.

Anything that doesn't quickly fill a room, like liquid spills, is so slow that it shouldn't be a performance problem. Alpha radiation is blocked by a few inches of air, nice try ;-). In case of dangerous radiation, however, I'd do distance and line of sight checks instead of tile based stuff.

About the December post, yes the mockups do fall into that trap. I'm sorry, but it's difficult to go into detail further over the internet. One thing I really don't like is the lights in the floor lighting the surrounding floor. There must be a pretty heavy gravity if light flies in curves.

I grew up on fat pixel games as well. I also grew up on children's TV and pop music, which I don't like anymore, too. :-b

Ran around with a clown mask before it was cool