Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Tonbi's random map generator
Tsukihime
post Sep 14 2011, 10:23 AM
Post #1


Level 25
Group Icon

Group: Revolutionary
Posts: 560
Type: None
RM Skill: Undisclosed
Rev Points: 25




Has anyone used this frequently in their games?
I've been looking for some map generators (mainly because I'm lazy) and came across this (fairly old script) but it does its job.

It generates the map when you call it, taking in a set of parameters, a set of tiles and events, and puts something together.
It then saves the map in your data folder so you can take it and copy it over to an existing map to use it.

As I don't really like how it takes some time (4-5 seconds) to load the map, I just use it to generate the map and then move it into my game.
But you can use it to create dungeons that are completely unique every time you go into it.

So for example I would draw two maps (start, and finish), but then let the generator handle everything in between so I can lengthen the dungeon without putting much effort into it.

I found it on another forum, don't know if it's already been posted here (though I guess it would, since it seems like a popular thing to have)

http://save-point.org/showthread.php?tid=1641

This post has been edited by Tsukihime: Sep 14 2011, 10:26 AM


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
Redd
post Sep 14 2011, 02:26 PM
Post #2


:<
Group Icon

Group: Revolutionary
Posts: 2,312
Type: Developer
RM Skill: Advanced




This belongs in RGSS Script Submissions. Moving smile.gif

But I like the idea of this script, I've played it only in a game called Pokemon Mystery Dungeon, and the Mystery Dungeon part is the... randomly generated dungeons...
It gives the player a different experience every time. Although your game COULD be looked at as "not enough effort put into it"


__________________________
Go to the top of the page
 
+Quote Post
   
Mr. Bump
post Sep 14 2011, 08:04 PM
Post #3


Level 1
Group Icon

Group: Member
Posts: 5
Type: Writer
RM Skill: Beginner




I know that Near Fantastica has a similar script

Near Fantastica's Dynamic Maps
CODE
#================================
# ? Dynamic Maps
#================================
# ?By: Near Fantastica
# Date: 05.09.05
# Version: 1
#================================

module Map
#--------------------------------------------------------------
@map_data = {}
#--------------------------------------------------------------------------
def Map.set_map(map, map_id)
@map_data[map_id] = map
end
#--------------------------------------------------------------------------
def Map.data(map_id)
return @map_data[map_id]
end
end

class Map_Data
#--------------------------------------------------------------
attr_accessor :map_id
attr_accessor :map
attr_accessor :tileset_name
attr_accessor :autotile_names
attr_accessor :panorama_name
attr_accessor :panorama_hue
attr_accessor :fog_name
attr_accessor :fog_hue
attr_accessor :fog_opacity
attr_accessor :fog_blend_type
attr_accessor :fog_zoom
attr_accessor :fog_sx
attr_accessor :fog_sy
attr_accessor :battleback_name
attr_accessor :passages
attr_accessor :priorities
attr_accessor :terrain_tags
attr_accessor :display_x
attr_accessor :display_y
attr_accessor :need_refresh
attr_accessor :events
attr_accessor :common_events
attr_accessor :fog_ox
attr_accessor :fog_oy
attr_accessor :fog_tone
attr_accessor :fog_tone_target
attr_accessor :fog_tone_duration
attr_accessor :fog_opacity_duration
attr_accessor :fog_opacity_target
attr_accessor :scroll_direction
attr_accessor :scroll_rest
attr_accessor :scroll_speed
attr_accessor :fow_on
attr_accessor :fow_grid
attr_accessor :fow_range
#-------------------------------------------------------------
def initialize
@map_id = 0
@map = 0
@tileset_name = 0
@autotile_names = 0
@panorama_name = 0
@panorama_hue = 0
@fog_name = 0
@fog_hue = 0
@fog_opacity = 0
@fog_blend_type = 0
@fog_zoom = 0
@fog_sx = 0
@fog_sy = 0
@battleback_name = 0
@passages = 0
@priorities = 0
@terrain_tags = 0
@display_x = 0
@display_y = 0
@need_refresh = 0
@events = 0
@common_events = 0
@fog_ox = 0
@fog_oy = 0
@fog_tone = 0
@fog_tone_target = 0
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
@scroll_direction = 0
@scroll_rest = 0
@scroll_speed = 0
@fow_on = 0 # FOW
@fow_grid = 0 # FOW
@fow_range = 0 # FOW
end
end

class Game_Map




#--------------------------------------------------------------
def setup(map_id)
save_map(@map_id)
if Map.data(map_id) == nil
setup_map(map_id)
else
load_map(map_id)
end
end
#--------------------------------------------------------------
def setup_map(map_id)
@map_id = map_id
@map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
tileset = $data_tilesets[@map.tileset_id]
@tileset_name = tileset.tileset_name
@autotile_names = tileset.autotile_names
@panorama_name = tileset.panorama_name
@panorama_hue = tileset.panorama_hue
@fog_name = tileset.fog_name
@fog_hue = tileset.fog_hue
@fog_opacity = tileset.fog_opacity
@fog_blend_type = tileset.fog_blend_type
@fog_zoom = tileset.fog_zoom
@fog_sx = tileset.fog_sx
@fog_sy = tileset.fog_sy
@battleback_name = tileset.battleback_name
@passages = tileset.passages
@priorities = tileset.priorities
@terrain_tags = tileset.terrain_tags
@display_x = 0
@display_y = 0
@need_refresh = false
@events = {}
for i in @map.events.keys
@events[i] = Game_Event.new(@map_id, @map.events[i])
end
@common_events = {}
for i in 1...$data_common_events.size
@common_events[i] = Game_CommonEvent.new(i)
end
@fog_ox = 0
@fog_oy = 0
@fog_tone = Tone.new(0, 0, 0, 0)
@fog_tone_target = Tone.new(0, 0, 0, 0)
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 4
end
#-----------------------------------------------------------
def load_map(map_id)
map_data = Map.data(map_id)
@map_id = map_data.map_id
@map = map_data.map
@tileset_name = map_data.tileset_name
@autotile_names = map_data.autotile_names
@panorama_name = map_data.panorama_name
@panorama_hue = map_data.panorama_hue
@fog_name = map_data.fog_name
@fog_hue = map_data.fog_hue
@fog_opacity = map_data.fog_opacity
@fog_blend_type = map_data.fog_blend_type
@fog_zoom = map_data.fog_zoom
@fog_sx = map_data.fog_sx
@fog_sy = map_data.fog_sy
@battleback_name = map_data.battleback_name
@passages = map_data.passages
@priorities = map_data.priorities
@terrain_tags = map_data.terrain_tags
@display_x = map_data.display_x
@display_y = map_data.display_y
@need_refresh = map_data.need_refresh
@events = map_data.events
@common_events = map_data.common_events
@fog_ox = map_data.fog_ox
@fog_oy = map_data.fog_oy
@fog_tone = map_data.fog_tone
@fog_tone_target = map_data.fog_tone_target
@fog_tone_duration = map_data.fog_tone_duration
@fog_opacity_duration = map_data.fog_opacity_duration
@fog_opacity_target = map_data.fog_opacity_target
@scroll_direction = map_data.scroll_direction
@scroll_rest = map_data.scroll_rest
@scroll_speed = map_data.scroll_speed
@fow_on = map_data.fow_on # FOW
@fow_grid = map_data.fow_grid # FOW
@fow_range = map_data.fow_range # FOW
end
#--------------------------------------------------------------
def save_map(map_id)
return if map_id == 0
map_data = Map_Data.new
map_data.map_id = map_id
map_data.map = @map
map_data.tileset_name = @tileset_name
map_data.autotile_names = @autotile_names
map_data.panorama_name = @panorama_name
map_data.panorama_hue = @panorama_hue
map_data.fog_name = @fog_name
map_data.fog_hue = @fog_hue
map_data.fog_opacity = @fog_opacity
map_data.fog_blend_type = @fog_blend_type
map_data.fog_zoom = @fog_zoom
map_data.fog_sx = @fog_sx
map_data.fog_sy = @fog_sy
map_data.battleback_name = @battleback_name
map_data.passages = @passages
map_data.priorities = @priorities
map_data.terrain_tags = @terrain_tags
map_data.display_x = @display_x
map_data.display_y = @display_y
map_data.need_refresh = @need_refresh
map_data.events = @events
map_data.common_events = @common_events
map_data.fog_ox = @fog_ox
map_data.fog_oy = @fog_oy
map_data.fog_tone = @fog_tone
map_data.fog_tone_target = @fog_tone_target
map_data.fog_tone_duration = @fog_tone_duration
map_data.fog_opacity_duration = @fog_opacity_duration
map_data.fog_opacity_target = @fog_opacity_target
map_data.scroll_direction = @scroll_direction
map_data.scroll_rest = @scroll_rest
map_data.scroll_speed = @scroll_speed
map_data.fow_on = @fow_on # FOW
map_data.fow_grid = @fow_grid # FOW
map_data.fow_range = @fow_range # FOW
Map.set_map(map_data, map_id)
end
end


They're pretty cool scripts smile.gif
Go to the top of the page
 
+Quote Post
   
Tsukihime
post Sep 15 2011, 05:07 AM
Post #4


Level 25
Group Icon

Group: Revolutionary
Posts: 560
Type: None
RM Skill: Undisclosed
Rev Points: 25




Any thread with instructions on how to use?
It looks like I just have to call the setup function, but not sure if there are some other features that aren't obvious from a quick scan of the code.


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 04:57 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker