Tile help

This is a discussion on Tile help within the Game Programming forums, part of the General Programming Boards category; I'm beginning to make a tile based game, but just as I'm starting I having some problems. How do I ...

  1. #1
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735

    Tile help

    I'm beginning to make a tile based game, but just as I'm starting I having some problems.

    How do I spread one tile of grass over a large area without making it obvious that a tile is being used?

    And also, how do I blend together two unlike tiles (for instance water and grass to make a coastline)?

    Thanks for any help,
    MadCow

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by MadCow257
    How do I spread one tile of grass over a large area without making it obvious that a tile is being used?
    Use good tiles?

    Quote Originally Posted by MadCow257
    And also, how do I blend together two unlike tiles (for instance water and grass to make a coastline)?
    That is accomplished using special border tiles.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    Use good tiles?
    This helps mask it, but even the best tiles I've seen look tiled.

    That is accomplished using special border tiles.
    I was thinking algorithm wise. I read about one called plasma, but I didn't save the link and now I can't find any other alogs

  4. #4
    Peace
    Join Date
    Aug 2001
    Posts
    1,510
    Quote Originally Posted by MadCow257
    How do I spread one tile of grass over a large area without making it obvious that a tile is being used?
    Theres lots of ways to accomplish both these tasks. Its kind of hard to pick just one. One option would be to create several different tiles for the same tile type. i.e. 5 different grass textures which all tile seamlessly with each other that you could spread around randomly.

    Otherwise you could generate parts of the texture at runtime. I once wrote each tile to the terrain texture from a precompiled tile texture. I used a precompiled noisemap to select at "random" a new part of the texture for each tile. The result is an apparently random noise texure that never repeats but has the colour values of the texture you desire. The results turned out surprisingly pleasing. It obviously fails to work on textures that require a certain appearance, i.e. stones on dirt, brick floor, carpet, or whatnot. This is solved with either a second layer pass or to determine the boolean noise/constant value of each tile in a single pass.

    A third option is to create a unique texture for your entire terrain. This is valid only on a terrain which does not encompass large areas. For games such as most RPGs, this is not an option.

    Quote Originally Posted by MadCow257
    And also, how do I blend together two unlike tiles (for instance water and grass to make a coastline)?
    This part can take several routes as well, depending on the route you take with the first question. If your tiles are a constant texture, you could either manually create border tiles for each possible border scenario. This is tedious as has the disadvantage that if you later add or changes a single tile, you must change it in all other border tiles which contain it. A better solution would be to write an application which has a border mask, takes each combination of tile and outputs a border tile for each combination. This could also be done at runtime if speed is less of an issue than video memory.

    Doing a runtime bordering is your only option if working with dynamic tilesets such as those modified/drawn with a noisemap. A mask for borders could be done with either pure boolean testing like so (on a 4x4 pixel tile):

    A-A-B-B
    A-A-B-B
    A-A-B-B
    A-A-B-B

    for a W-E border, or with a fade style mask wich would blend the textures together like so:

    A2B0-A1B1-A1B1-A0B2
    A2B0-A1B1-A1B1-A0B2
    A2B0-A1B1-A1B1-A0B2
    A2B0-A1B1-A1B1-A0B2

    Figuring out which is best is something only testing will reveal.
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need testers for editor
    By VirtualAce in forum Game Programming
    Replies: 43
    Last Post: 07-10-2006, 09:00 AM
  2. Tile map loading/saving
    By sand_man in forum Game Programming
    Replies: 16
    Last Post: 04-23-2005, 10:38 PM
  3. Tile Engine Scripting Idea. Suggestions?
    By napkin111 in forum Game Programming
    Replies: 8
    Last Post: 07-28-2003, 03:01 PM
  4. tile collision detection help needed...
    By werdy666 in forum Game Programming
    Replies: 0
    Last Post: 01-01-2003, 02:57 AM
  5. Tile Editor
    By Nick in forum Linux Programming
    Replies: 3
    Last Post: 08-11-2001, 12:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21