查看: 2949|回复: 6

[已经过期] 如何制作超大地图

[复制链接]
梦石
0
星屑
50
在线时间
9 小时
注册时间
2015-7-4
回帖
3
发表于 2015-7-9 21:50:00 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我想做一个超大地图的世界,里面内容丰富,需要用到外观地图,迷宫地图和内部地图。可是RMVA只能用一种,这要怎么办?
有没有什么方法可已解决图块不足的问题?

无限の剣制

梦石
0
星屑
10450
在线时间
5019 小时
注册时间
2013-2-28
回帖
4942

开拓者贵宾

发表于 2015-7-9 22:20:16 | 显示全部楼层
回复

使用道具 举报

梦石
1
星屑
23246
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2015-7-9 22:20:45 | 显示全部楼层
个人建议你别这么做,因为你八成无法处理游戏效率的问题,制作出来的游戏很有可能会卡的不行
回复

使用道具 举报

梦石
0
星屑
70
在线时间
1083 小时
注册时间
2013-3-29
回帖
2158
发表于 2015-7-9 22:24:01 | 显示全部楼层
无限图层、远景。。

坑的进度如上                                                                                                        点击↑
回复

使用道具 举报

梦石
0
星屑
155
在线时间
129 小时
注册时间
2014-2-22
回帖
206
发表于 2015-7-10 12:55:30 | 显示全部楼层
500*500你想做多大………………善用PS和图块,不行就用图层
很多年了呢,坑还是没填完…………(草
回复

使用道具 举报

污染源

梦石
2
星屑
10410
在线时间
2369 小时
注册时间
2012-2-25
回帖
921
发表于 2015-7-10 20:23:35 | 显示全部楼层
你不可能会把所有图块都用上,所以可以在数据库里面设定地图,把ABCDE换成你需要的图块。
PS:你也许会卡死
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-7-10 20:33:02 | 显示全部楼层
本帖最后由 tseyik 于 2015-7-10 20:46 编辑

持接地圖
不用看了,實驗了並不能用不同圖塊
Connected Maps[pre lang="ruby"]=begin

#===============================================================================

Title: Connected Maps

Author: Tsukihime

Date: Apr 2, 2013

--------------------------------------------------------------------------------

** Change log

Apr 2

   - added note-tag shortcut for width and height

Mar 17, 2013

   - updated to support area map addon

   - combined encounter lists

   - fixed bug where transferring was not done correctly

   - Initial release

--------------------------------------------------------------------------------   

** Terms of Use

* Free to use in commercial/non-commercial projects

* No real support. The script is provided as-is

* Will do bug fixes, but no compatibility patches

* Features may be requested but no guarantees, especially if it is non-trivial

* Credits to Tsukihime in your project

* Preserve this header

--------------------------------------------------------------------------------

** Description



This script allows you to connect maps together, providing a seamless

transition from one map to another. You can create a map in separate parts

and then connect it all together to produce one large map. This allows you

to exceed the 500x500 limit imposed by the editor.



--------------------------------------------------------------------------------

** Usage



Place this script below Materials and above Main.



To connect a map to another, write a note-tag in the map object



   <connect map: map_id offset_x offset_y>

   <connect map: map_id offset_x offset_y recurse_limit>

   

The map_id is the ID of the map that you want to the current map.

Offset_x and Offset_y is the position that the new map will be placed.



You can use the letter "w" for offset_x to mean the width of the map.

You can use the letter "h" for offset_y to mean the height of the map.



The recurse_limit is special and will be described later.



-- Positioning modes --



There are two types of map connecting modes in this script.



1. Absolute connection.

    All offsets are specified relative to the current map, where the

    origin is located at (0, 0), the upper-left corner of the current map.



2. Recursive connection.

    All offsets are specified relative to the parent map, where the

    origin is the position of the upper-left corner of the parent map.

   

If you are using recursive mode, you can use the recurse limit in the note-tag.

  

The recurse limit is meant to save you some effort when connecting maps.

For example, suppose you have the following connection between two maps, A

and B



A --> B

B --> A



The recurse limit allows you to specify how many times these connections

should repeat. For example, if recurse limit is 2, then the connection is

allowed to repeat twice



A --> B --> A --> B --> A -> B -> A



There are some rules to follow when connecting maps



1. You start from the top-left, and connect maps to the right or below. You

    cannot connect maps to the left or above, so plan carefully.

   

2. Maps that do not have equal dimensions will leave empty black squares that

    are not passable.

   

3. Events can only reference events on the same map. They cannot reference

    events from other maps.



#===============================================================================

=end

$imported = {} if $imported.nil?

$imported["TH_ConnectedMaps"] = true

#===============================================================================

# ** Configuration

#===============================================================================

module TH

  module Connected_Maps

   

    # Recursive mode allows you to connect maps relative to each other.

    # Set this to false if youp refer absolute positioning. Though I think

    # it is easier to leave it as recursive.

    Recursive_Mode = true

   

    Regex = /<connect[-_ ]map: (\d+)\s+(w|-?\d+)\s+(h|-?\d+)\s*(\d+)?>/im

  end

end

#===============================================================================

# ** Rest of script

#===============================================================================

module RPG

  class Map

   

    def connected_maps

      return @connected_maps unless @connected_maps.nil?

      load_notetag_connected_maps

      return @connected_maps

    end

   

    def load_notetag_connected_maps

      @connected_maps = []

      res = self.note.scan(TH::Connected_Maps::Regex)

      res.each {|result|

        map_id = result[0].to_i

        offset_x = result[1] ? (result[1].downcase == "w" ? self.width : result[1].to_i) : 0

        offset_y = result[2] ? (result[2].downcase == "h" ? self.height : result[2].to_i) : 0

        recurse_limit = result[3] ? result[3].to_i : 1

        @connected_maps.push([map_id, offset_x, offset_y, recurse_limit])

      }

    end  

  end

  

  class Event

    def update_for_map_connection(offset)

      @pages.each {|page|

        update_page_events(page, offset)

      }

    end

   

    def update_page_events(page, offset)

      page.list.each {|cmd|

        case cmd.code

        when 111 # cond branch, character (0, 1, 2, ...)

          cmd.parameters[1] += offset if cmd.parameters[0] == 6 && cmd.parameters[1] > 0

        when 122 # variables, character (0, 1 2, ... )

          cmd.parameters[5] += offset if cmd.parameters[4] == 5 && cmd.parameters[5] > 0

        when 203 # set event location

          cmd.parameters[0] += offset if cmd.parameters[0] > 0

          cmd.parameters[2] += offset if cmd.parameters[1] == 2 && cmd.parameters[2] > 0

        when 205, 212, 213 # move route, animation, and balloon

          cmd.parameters[0] += offset if cmd.parameters[0] > 0

        end

      }

    end

  end

end



class Game_Map

  

  alias :th_connected_maps_setup :setup

  def setup(map_id)

    @new_width = nil

    @new_height = nil

    th_connected_maps_setup(map_id)

    add_connected_maps(@map, {})

    @map.width ||= @new_width

    @map.height ||= @new_height

  end

  

  alias :th_connected_maps_width :width

  def width

    @new_width || th_connected_maps_width

  end

  

  alias :th_connected_maps_height :height

  def height

    @new_height || th_connected_maps_height

  end

  

  #-----------------------------------------------------------------------------

  # Connect maps together with the current map. The recursive limit is a global

  # limit, not a local limit, and is based on the number of times a map has

  # been visited. TO-DO: implement as BFS...

  #-----------------------------------------------------------------------------

  def add_connected_maps(map, visited, ox=0, oy=0)

    map.connected_maps.each {|map_id, offset_x, offset_y, recurse_limit|

      visited[map_id] ||= 1

      return if visited[map_id] > recurse_limit

      visited[map_id] += 1

      conmap = load_data(sprintf("Data/Map%03d.rvdata2", map_id))

      setup_connected_map(map_id, ox, oy, offset_x, offset_y)

      combine_maps(conmap.data, ox + offset_x, oy + offset_y)

      combine_encounters(conmap.encounter_list)

      combine_events(conmap.events, ox + offset_x, oy + offset_y, @events.keys.max || 0)

      add_connected_maps(conmap, visited, ox + offset_x, oy + offset_y)

    }

  end

  

  #-----------------------------------------------------------------------------

  # Setup map metadata

  #-----------------------------------------------------------------------------

  def setup_connected_map(map_id, ox, oy, offset_x, offset_y)

  end

  

  #-----------------------------------------------------------------------------

  # Extend the current map's tilemap with the new map's tile map. Resize

  # only if needed. Remember that we are always connecting to the right or

  # bottom.

  #-----------------------------------------------------------------------------

  def combine_maps(new_data, ox, oy)

    new_x = ox + new_data.xsize >= width ? ox + new_data.xsize : width

    new_y = oy + new_data.ysize >= height ? oy + new_data.ysize : height

    @new_width =  new_x

    @new_height = new_y

    @map.data.resize(new_x, new_y, @map.data.zsize)

    for z in 0 ... 4

      for x in 0 ... new_data.xsize

        for y in 0 ... new_data.ysize

          next if ox + x < 0 || oy + y < 0

          @map.data[ox + x, oy + y, z] = new_data[x, y, z]

        end

      end

    end

  end

  

  #-----------------------------------------------------------------------------

  # Extend the current map's encounters with the new map's events, updating all

  # events and event references as necessary

  #-----------------------------------------------------------------------------

  def combine_encounters(new_enc_list)

    @map.encounter_list.concat(new_enc_list)

  end

  

  #-----------------------------------------------------------------------------

  # Extend the current map's events with the new map's events, updating all

  # events and event references as necessary

  #-----------------------------------------------------------------------------

  def combine_events(events, ofs_x, ofs_y, ofs_evt)

    new_events = {}

    events.each {|id, event|

      new_id = id + ofs_evt

      event.id = new_id

      event.x += ofs_x

      event.y += ofs_y

      event.update_for_map_connection(ofs_evt)

      @map.events[new_id] = event

      new_events[new_id] = event

    }

    setup_new_events(new_events)

  end

  

  #-----------------------------------------------------------------------------

  # Set up our new events

  #-----------------------------------------------------------------------------

  def setup_new_events(events)

    events.each do |i, event|

      @events = Game_Event.new(@map_id, event)

    end

  end

end[/pre]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部