Skip to main content

Posts

Showing posts from April, 2017

Item's Icons

"What is that ugly mess?"
Well, it's a test for a dynamically colored set of items.
The original icons were taken from here, a great source of black and white game icons. Very useful if you're planning your project and need some stand it art.

The red channel is the grayscale image, the green channel holds a mask for non metallic, non-colored sections, like rope or bare leather. The blue channel holds a mask for dynamic colors.

The masked areas can have their input adjusted by a three channel input (RGB) from a material, to control hue, saturation and value. This gives a wide array of different colors meaning that no two items generated by the item generation script should look identical.

Here's what they look like when passed through the shader:


Ok, still a bit of an ugly mess... I think I need to start with better material than a faked hightmap from a 2 bit image. :)

Honestly, I think 2d art is my worst area. I'm probably just going to move on and come back…

The pits!

I added the possibility of pits or water to the dungeon yesterday:



I also added some debugging tools to reveal the map on command. I noticed a room sometimes isn't connected. I think it has to do with adding rooms manually. I'll sort that out as soon as possible.

I also have been working on item generation.

Sample output from the equipment generator:
Perlmurite armor
Iron man-trap
Broken, cooked eggs
Brass handbow
Feathered clothes
Hollow, corroded, copper hatchet
Occult, rare, gyium-leather sandals
Rudde-leather cape
Oil stained, white-copper ring
Enchanted, brewed meat
Brewed medicine
Perfect, gyium-leather armor
Awesome, composite, brass handbow
Ivory mace
Magical, akkadi-iron greaves
Fur choker
Old, haldiris greaves
Extended, gyium-leather leggings
Magical, iron hatchet
Magical, perlmurite treasure
Light, bronze, narrow hammer
Animal-hide shield
Occult, gyium-leather belt
Blood stained, grubby, iron throwing-axe
Magical, gold coins
Ruined, spoiled, jellied eggs
Oil stained, lead anklet
Enchanted, ha…

TOTDD 2017 Video Diary number 3

Another video diary can be viewed here:


This shows at least part of the screen layout. I'll be working on the inventory and UI next. You'll be able to drag and drop things right from the UI to the viewport.

Level generation types.

I've now narrowed my level generation methods down to two. Previously I was also using randomly placed rooms and BSP trees, but with one the corridors were too long, and the other suffered from terrible predictability.

The two I'm using are (1) cellular automata and (2) collision based room insertion.

In the maps above the D and E maps are type 1, a kind of cavern like level. There are several inputs like coverage and smoothness. They basically generate these two extremes, very open, joined caves, or sparse tunnels. I may add double thickness corridors to the (E) map as otherwise they are annoying to play (no room for maneuver).   

Type 2 maps start by piling up a bunch of random rooms in the center of the map. Then they run collision detection to push them apart. (A) is a map with quite high padding value, which places the rooms far apart. (C) is the same method by a padding value of 1. The rooms are quite close together. Corridors are short, which is a good thing.

(B) and (…

Map screen designs

I've been working some more on the map window. Right now you can only see the base, it doesn't show items, enemies or even doors on the map yet. These would be decals.


In the top window you can see the modified result of last night's tile based map. It looks good but there are some visual artifacts related to the problems I encountered yesterday, and as well it takes much more code and time to calculate.

The second window uses a cheap trick to fake an beveled look from a smoothed version of the 32x32 map. It uses black to mask unexplored areas.

Finally the third version is meant to look like a had drawn map. I'm using a cross hatching texture to distort it and unexplored areas are shown as blank map paper.

There's going to be a mechanic in game where you need to use some paper every level in order to activate the map for that level. From there it will fill it in automatically. Paper will be pretty rare so it might be worth keeping it safe for the more complex level…

Problems with map display...

I spent a total of about 4 hours trying to find out why my map wasn't displaying properly.
Turns out there was nothing wrong with my code, or my shader, the problem was in the imprecision of the floating point numbers used to scale the UVs and the default use of sRGB color space by blender.


(top left) This is similar to what I was getting, obviously not right, but I couldn't figure out why.  
(top right) Using data from the map each square is given a red color from 0-255.
(bottom left) There are 16 possible arrangements of tile and the red color offsets the UVs of that tile by a set amount.
(bottom right) The rather unimpressive final base result.

When scaling UVs Blender avoids imprecision in floating point number by just rounding up to a more suitable number, so 0.0625 becomes 0.063. This is fine usually, as you don't really care about pixel perfect placement in most applications. But when your total image is only 32 pixels across it can cause issues as 1 divided by 16 i…