Super Mario 2D. Questions.

Hello!

Sorry for English in advance. I am creating Mario Clone for learning. It won’t be for commercial usage. It’s only for learning how to create platformer games.

You will understand my problem if you will see the picture below (you will see vertical lines):

It looks like you are missing padding around your tile textures.

I use this tileset (16x16 for a tile):
2246949--150062--NES - Super Mario Bros - Tile Set.png

I don’t understand. Where must I find a problem?

2246998--150066--TileSetProblem.png

You need to have some room (“padding”) between the single tiles in your texture atlas. Textures tend to “bleed” over a little into adjacent textures.

How to make a handling of texture atlas to add the padding? What programs can I use? I have Tiled Map Editor, but I think it cannot.

I have “Pixel Per Unit” = 1. Maybe is it a problem?

I solved the problem. I will create little tilesets from the general tileset. For example by Paint and GIMP or by Tile Map Editor:

2247337--150087--Hill.png

2247337--150088--TileSetSolution.png

I found a solution here

How to solve this problem:

I solved the problem above. I apply this plugin and I wrote my own plugin for GIMP in Python.

add-pixels-to-tiles.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# add-pixels-to-tiles v1.0: Python-fu plugin for GIMP 2.8
# Copyright Ivan Enzhaev (8Observer8) [http://ivan.enzhaev.name], 2015
# Licence GPL-2
# Installation: put the file into /GIMP 2/lib/gimp/2.0/plug-ins

from gimpfu import *
import os

def python_fu_add_pixels_to_tiles(tile_size = 16):
       # Get image
       image = gimp.image_list()[0]
       # Get drawable
       drawable = pdb.gimp_image_get_active_drawable(image)
       # Get width and height
       width = pdb.gimp_image_width(image)
       height = pdb.gimp_image_height(image)

       # Right
       x = 17
       y = 2
       spacing = 5
       y_counter = 0
            
       while y < height:
        while x < width:
         # Get color
         color = pdb.gimp_color_picker(image, drawable, x, y, FALSE, FALSE, 0)
         # Set end point
         ctrlPoints = [x+1,y,x+2,y]
         if color.a == 1:
          # Set color
          pdb.gimp_context_set_foreground(color)
          # Draw points
          pdb.gimp_pencil(drawable, 4, ctrlPoints)
         x = x + spacing + tile_size
        x = 17
        if y_counter < tile_size:
         y = y + 1
        else:
         y = y + spacing
         y_counter = 0
            
       # Top
       x = 2
       y = 2
       spacing = 5
       x_counter = 0
            
       while x < width:
        while y < height:
         # Get color
         color = pdb.gimp_color_picker(image, drawable, x, y, FALSE, FALSE, 0)
         # Set end point
         ctrlPoints = [x,y-1,x,y-2]
         if color.a == 1:
          # Set color
          pdb.gimp_context_set_foreground(color)
          # Draw points
          pdb.gimp_pencil(drawable, 4, ctrlPoints)
         y = y + spacing + tile_size
        y = 2
        if x_counter < tile_size:
         x = x + 1
        else:
         x = x + spacing
         x_counter = 0

       # Left
       x = 2
       y = 2
       spacing = 5
       y_counter = 0
            
       while y < height:
        while x < width:
         # Get color
         color = pdb.gimp_color_picker(image, drawable, x, y, FALSE, FALSE, 0)
         # Set end point
         ctrlPoints = [x-1,y,x-2,y]
         if color.a == 1:
          # Set color
          pdb.gimp_context_set_foreground(color)
          # Draw points
          pdb.gimp_pencil(drawable, 4, ctrlPoints)
         x = x + spacing + tile_size
        x = 2
        if y_counter < tile_size:
         y = y + 1
        else:
         y = y + spacing
         y_counter = 0

       # Down
       x = 2
       y = 17
       spacing = 5
       x_counter = 0
            
       while x < width:
        while y < height:
         # Get color
         color = pdb.gimp_color_picker(image, drawable, x, y, FALSE, FALSE, 0)
         # Set end point
         ctrlPoints = [x,y+1,x,y+2]
         if color.a == 1:
          # Set color
          pdb.gimp_context_set_foreground(color)
          # Draw points
          pdb.gimp_pencil(drawable, 4, ctrlPoints)
         y = y + spacing + tile_size
        y = 17
        if x_counter < tile_size:
         x = x + 1
        else:
         x = x + spacing
         x_counter = 0

register(
       "python_fu_add_pixels_to_tiles",
       "Add a few pixels to tiles",
       "Add a few pixels to tiles",
       "Ivan Enzhaev (nickname: 8Observer8; email: 8observer8@gmail.com)",
       "Ivan Enzhaev (nickname: 8Observer8; email: 8observer8@gmail.com)",
       "8/18/2015",
       "AddPxToTiles",
       "*",
       [
        (PF_INT, "tile_size", "Tile Size", 16)
       ],
       [],
       python_fu_add_pixels_to_tiles,
       menu="<Image>/Filters/Map",
)

main()

This is the result:

2258992--151049--TileSetWidthSolition.png

I want to show you the solution again. Maybe you know a better solution.

The problem (see on nose of bird):

I solved this problem by this script and by my script.

The solution is a new spritesheet:

2295344–154413–add_pixels_to_tiles.py.txt (3 KB)

Just so you know there is a fix for the problem you are having that is readily available inside Unity without additional software.
blizzy gave you the answer (padding) to the issue. The fix to this problem is shown in the 2D section of the learning material.