Jump to content

kurin

Member
  • Content Count

    51
  • Joined

  • Last visited

  • Days Won

    4

kurin last won the day on August 29

kurin had the most liked content!

1 Follower

About kurin

  • Rank
    i keep screaming but god won't answer (ʘ‿ʘ )
  • Birthday 05/12/2000

Profile Information

  • Gender
    Not Telling
  • Location
    the void
  • Interests
    art and writing

RPG Maker Information

  • RM Skill -
    Artist

Recent Profile Visitors

11,598 profile views

Single Status Update

See all updates by kurin

  1. what's some good mapping advice y'all have? I feel like making maps is one of my weaker points with rpg maker.

    1. Show previous comments  3 more
    2. kurin

      kurin

      @Kayzee shift mapping is still something I have trouble understanding. what exactly makes it different from regular mapping?

    3. PhoenixSoul

      PhoenixSoul

      Holding down Shift (left Shift actually) and right clicking on a specific tile will pull that tile's configuration into memory, and then holding Shift and left-clicking will place an exact copy of that configuration.

      It's simple, though I can only imagine it wasn't easy to program...lolz

    4. Kayzee

      Kayzee

      It basically allows you to copy and paste things without updating autotiles. This allows you to put tiles next to each other that would otherwise be impossible, which I heavily use in the screenshot I posted. And yeah you have to hold shift while copying and while pasting for it to work right. Honestly not sure why though. Seems to me that either it could always copy the exact tiles and hold shift while pasting to turn off updating autotiles, or holding shift while coping could mark the clipboard to not update autotiles and you wouldn't need to hold shift while pasting.

       

      Also: While I obviously never saw any of the RPG Maker source code, I did write code for VX Ace to update autotiles in-game (for my dungeon generator). And let me tell you, autotiles are kind of a mess. :P Just... Just look at this monstrosity:

       

      Spoiler
      
      class Game_Map
        
        def update_all_autotiles
          @map.data.update_all_autotiles
        end
        
        def update_autotiles_at(x, y)
          @map.data.update_autotiles_at(x, y)
        end
        
      end
      
      class Table
        
        def update_all_autotiles
          for i in 0...xsize
            for j in 0...ysize
              update_autotile(i, j, 0)
              update_autotile(i, j, 1)
            end
          end
        end
        
        def update_autotiles_at(x, y)
          x1 = [x - 1, 0].max
          x2 = [x + 1, xsize].min
          y1 = [y - 1, 0].max
          y2 = [y + 1, ysize].min
          for i in x1..x2
            for j in y1..y2
              update_autotile(i, j, 0)
              update_autotile(i, j, 1)
            end
          end
        end
        
        def autotile_edge(autotile, x, y, z)
          x = x % xsize if $game_map.loop_horizontal?
          y = y % ysize if $game_map.loop_vertical?
          # Special dungeon logic
          # makes overlay grass tiles "grow" out of walls. 
          if z == 1 && $game_map.note_field[:grass_walls] 
            return false if $game_map.region_id(x, y) == 1 || $game_map.region_id(x, y) == 4
          end
          $game_map.valid?(x, y) && autotile != autotile_type(x, y, z)
        end
        
        def autotile_wall_edge(autotile, x, y, z)
          if (autotile / 8) % 2 == 1
            return false if autotile_type(x, y, z) + 8 == autotile
          end
          autotile_edge(autotile, x, y, z)
        end
        
        def update_autotile(x, y, z) 
          autotile = autotile_type(x, y, z)
          return if autotile < 0
          index = 0
          case get_autotile_group(autotile)
          when 2
            l = autotile_edge(autotile, x - 1, y, z)
            r = autotile_edge(autotile, x + 1, y, z)
            index = waterfall_autotile_index(l,r)
          when 1
            l = autotile_wall_edge(autotile, x - 1, y, z)
            r = autotile_wall_edge(autotile, x + 1, y, z)
            u = autotile_edge(autotile, x, y - 1, z)
            d = autotile_edge(autotile, x, y + 1, z)
            index = wall_autotile_index(u,d,l,r)
          when 0
            l = autotile_edge(autotile, x - 1, y, z)
            r = autotile_edge(autotile, x + 1, y, z)
            u = autotile_edge(autotile, x, y - 1, z)
            d = autotile_edge(autotile, x, y + 1, z)
            ul = autotile_edge(autotile, x - 1, y - 1, z)
            ur = autotile_edge(autotile, x + 1, y - 1, z)
            dl = autotile_edge(autotile, x - 1, y + 1, z)
            dr = autotile_edge(autotile, x + 1, y + 1, z)
            index = normal_autotile_index(u,d,l,r,ul,ur,dl,dr)
          end
          self[x, y, z] = get_autotile_tile_id(autotile, index)
        end
        
        def get_autotile_tile_id(autotile, index)
          2048 + (48 * autotile) + index
        end
        
        def autotile_type(x, y, z)
          tile = self[x, y, z] || 0
          tile >= 2048 ? (tile - 2048) / 48 : -1
        end
        
       def get_autotile_group(autotile)
          return unless autotile
          return 2 if autotile == 5 or autotile == 7 or 
                      autotile == 9 or autotile == 11 or
                      autotile == 13 or autotile == 15
          return 1 if autotile >= 48 and autotile <= 79
          return 1 if autotile >= 88 and autotile <= 95
          return 1 if autotile >= 104 and autotile <= 111
          return 1 if autotile >= 120 and autotile <= 127
          return 0
        end
        
        def waterfall_autotile_index(l,r)
          edge = 0
          edge |= 1 if l
          edge |= 2 if r
          return edge
        end
        
        def wall_autotile_index(u,d,l,r)
          edge = 0
          edge |= 1 if l
          edge |= 2 if u
          edge |= 4 if r
          edge |= 8 if d
          return edge
        end
        
        def normal_autotile_index(u,d,l,r,ul,ur,dl,dr)
          edge = 0
          edge |= 1 if l
          edge |= 2 if u
          edge |= 4 if r
          edge |= 8 if d
          corner = 0
          case edge
          when 0
            corner |= 1 if ul
            corner |= 2 if ur
            corner |= 4 if dr
            corner |= 8 if dl
            return corner
          when 1
            corner |= 1 if ur
            corner |= 2 if dr
            return 16 | corner
          when 2
            corner |= 1 if dr
            corner |= 2 if dl
            return 20 | corner
          when 4
            corner |= 1 if dl
            corner |= 2 if ul
            return 24 | corner
          when 8
            corner |= 1 if ul
            corner |= 2 if ur
            return 28 | corner
          when 5
            return 32
          when 10
            return 33
          when 3
            return dr ? 35 : 34
          when 6
            return dl ? 37 : 36
          when 12
            return ul ? 39 : 38
          when 9
            return ur ? 41 : 40
          when 7 
            return 42
          when 11
            return 43
          when 13
            return 44
          when 14
            return 45
          when 15
            return 46
          else
            return 47
          end
        end 
        
      end

       

       

      So many special cases and hardcoded tile numbers! So really I imagine shift-mapping was actually pretty easy to program. It's normal mapping that seems tricky to program to me. :3

×