Legofarmen / tunics

A roguelike-like Zelda game for the Solarus engine.
http://tunics.legofarmen.se
Other
36 stars 11 forks source link

Rethink primary and secondary tiles #41

Open sandstrand opened 9 years ago

sandstrand commented 9 years ago

Should we have two sets of wall_statue per tileset? Should one always be selected for one tier for tileset diversity or should one be selected per room for room diversity?

Floor allocation needs a this more than anything else in regards to #40 : Layered rooms.

mattias-p commented 8 years ago

Today, I'd say room diversity is much greater than tileset diversity. Therefore I think there's higher value in improving tileset diversity.

sandstrand commented 7 years ago

Conclusion after workshop:

We do not need more than 1 primary tile for any elements apart form floors which is covered by #95. The issue should instead (once #95 is completed) deal with updating mappings.lua and dependent scripts to handle weighing of probability assets for floors, enemies and music and defining primary assets per tileset family:

local families = {
    cave = {
        tier = 1,
        floor = {
            high = {
                'floor.sand' = 10,
                'floor.5.a.light' = 1,
                'floor.3.a.light' = 1,
            },
            low = {
                'floor.5.a.dark' = 1,
            },          
        },
        statue = {
            'statue.1' = 1,
        }
        wall_statue = {
            'wall_statue.1' = 1,
            'wall_statue.5' = 0.5,
        }
        pillar = {
            'pillar.5' = 1,
        }
        barrier = 'barrier.2'
        barrier_big = 'barrier_big.2',
        entrance_pillar = 'entrance_pillar.3',
        drapes = 'drapes.3',
        music = {
            'dungeon_castle' = 1,
            'dungeon_dark' = 1,
            'dungeon_light' = 1.4,
        },
        destructibles = {
            'pot' = 'entities/vase',
            'stone1' = 'entities/stone_white',
            'stone2' = 'entities/stone_black',
        },
    },
},

Some values should be allowed to be empty. One tileset family might not want to have any drapes what so ever, for example.

Mappings.lua should also handle the rules for which enemies can spawn on which floor type and in which tileset.

local enemies = {
    burrower = {
        tier = 1,
        families = {
            'smoothbrick' = 1,
            'brick' = 1,
        },
        exclusive_floor = 'sand',

    },
    fireworm = {
        tier = 1,
        families = {
            'smoothbrick' = 1,
            'brick' = 1,
        },
        deny_floor = 'shallow_water',

    },
sandstrand commented 7 years ago

I am also considering producing a tileset which have the graphics for all timeset families and let the mapping decide which wall, wall_border, high_wall etc to be used.

sandstrand commented 7 years ago

I'm considering the original question in the issue:

"Should [a random tile] always be selected for one tier for tileset diversity or should one be selected per room for room diversity?"

Maybe we should define the probabily in groups where a single selection is made for a group and any group group is selected for a room?

asset_type = {
    group.1 = {
        probability = 1,
        tiles = {
            tile.1,
            tile.2,
        },
    },
},

In the example above tile.1 OR tile.2 is randomly selected for the group and since it's the only group that single tile will be used for all occasions.

asset_type = {
    group.1 = {
        probability = 2,
        tiles = {
            tile.1,
            tile.2,
        },
    },
    group.2 = {
        probability = 1,
        tiles = {
            tile.4,
        },
    },
},

In the example above, with more groups the tile for a room is selected by random based on group probability, but each group still only has one selected tile, so some rooms will have different tiles than other, but always the same tile within a room.

The number of groups sets the number of possible different tiles, and one tile in a group is randomly selected to represent that group.

There is precedence for different tiles, in regards to wall_statues among others, in alttp.

Thought?

mattias-p commented 7 years ago

Let me take a walkthrough of the involved technical terms to see if I'm following.

All tilesets share identical dat-files. Families are sets of tilesets with similar look and function. Categories are sets of tiles with identical size and function. Families specify their own set of tiles for each category. Each category has a placeholder tile with the same size as the tiles in the category. For each room a set of primary tiles is selected to replace the category placeholders.

Here's a rough suggestion for how primary tiles differ from room to room in the same tier: I think the probability for two rooms to have identical or similar sets of primary tiles should be high for rooms close to each other and should be low for rooms far away from each other.

If I understand the "groups" correctly, I think they could be useful if there are tilesets with tiles in one category that don't mix with tiles in another category.

sandstrand commented 7 years ago

Moving discussion to gist, comment there: https://gist.github.com/sandstrand/5491b134a44789296bf0382d64afec24