├── .import ├── icon.png-487276ed1e3a0c39cad0279d744ee560.md5 ├── icon.png-487276ed1e3a0c39cad0279d744ee560.stex ├── snow-expansion.png-803d8658d68e6e113f484137eea12d16.md5 └── snow-expansion.png-803d8658d68e6e113f484137eea12d16.stex ├── Map ├── Background.shader ├── GrassTileSet.tres ├── World.gd ├── World.tscn ├── snow-expansion.png └── snow-expansion.png.import ├── default_env.tres ├── icon.png ├── icon.png.import └── project.godot /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5: -------------------------------------------------------------------------------- 1 | source_md5="8dd9ff1eebf38898a54579d8c01b0a88" 2 | dest_md5="da70afec3c66d4e872db67f808e12edb" 3 | 4 | -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gingerageous/OpenSimplexNoiseTilemapTutorial/465332604209cacc4240ca60eb5b3ec7642339eb/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex -------------------------------------------------------------------------------- /.import/snow-expansion.png-803d8658d68e6e113f484137eea12d16.md5: -------------------------------------------------------------------------------- 1 | source_md5="ce3299cd7ff5a273acbb0dc7e4fd2325" 2 | dest_md5="ae865c716030dec839b88f592372160a" 3 | 4 | -------------------------------------------------------------------------------- /.import/snow-expansion.png-803d8658d68e6e113f484137eea12d16.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gingerageous/OpenSimplexNoiseTilemapTutorial/465332604209cacc4240ca60eb5b3ec7642339eb/.import/snow-expansion.png-803d8658d68e6e113f484137eea12d16.stex -------------------------------------------------------------------------------- /Map/Background.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | 3 | void fragment(){ 4 | COLOR = texture(TEXTURE, UV); 5 | float num = 1.0 - UV.y; 6 | COLOR.a = num; 7 | } -------------------------------------------------------------------------------- /Map/GrassTileSet.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="TileSet" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Map/snow-expansion.png" type="Texture" id=1] 4 | 5 | [resource] 6 | 0/name = "snow-expansion.png 0" 7 | 0/texture = ExtResource( 1 ) 8 | 0/tex_offset = Vector2( 0, 0 ) 9 | 0/modulate = Color( 1, 1, 1, 1 ) 10 | 0/region = Rect2( 0, 0, 128, 112 ) 11 | 0/tile_mode = 1 12 | 0/autotile/bitmask_mode = 1 13 | 0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 511, Vector2( 0, 1 ), 446, Vector2( 0, 2 ), 219, Vector2( 0, 3 ), 59, Vector2( 0, 4 ), 146, Vector2( 0, 5 ), 176, Vector2( 0, 6 ), 63, Vector2( 1, 0 ), 255, Vector2( 1, 1 ), 443, Vector2( 1, 2 ), 63, Vector2( 1, 3 ), 58, Vector2( 1, 4 ), 56, Vector2( 1, 5 ), 152, Vector2( 1, 6 ), 63, Vector2( 2, 0 ), 447, Vector2( 2, 1 ), 506, Vector2( 2, 2 ), 438, Vector2( 2, 3 ), 182, Vector2( 2, 4 ), 27, Vector2( 2, 5 ), 24, Vector2( 2, 6 ), 63, Vector2( 3, 0 ), 507, Vector2( 3, 1 ), 187, Vector2( 3, 2 ), 504, Vector2( 3, 3 ), 434, Vector2( 3, 4 ), 54, Vector2( 3, 5 ), 18, Vector2( 3, 6 ), 63, Vector2( 4, 0 ), 510, Vector2( 4, 1 ), 190, Vector2( 4, 2 ), 155, Vector2( 4, 3 ), 178, Vector2( 4, 4 ), 432, Vector2( 4, 5 ), 48, Vector2( 4, 6 ), 63, Vector2( 5, 0 ), 191, Vector2( 5, 1 ), 442, Vector2( 5, 2 ), 218, Vector2( 5, 3 ), 440, Vector2( 5, 4 ), 216, Vector2( 5, 5 ), 144, Vector2( 6, 0 ), 254, Vector2( 6, 1 ), 250, Vector2( 6, 2 ), 154, Vector2( 6, 3 ), 248, Vector2( 6, 4 ), 26, Vector2( 6, 5 ), 16, Vector2( 7, 0 ), 251, Vector2( 7, 1 ), 186, Vector2( 7, 2 ), 62, Vector2( 7, 3 ), 184, Vector2( 7, 4 ), 50, Vector2( 7, 5 ), 448 ] 14 | 0/autotile/icon_coordinate = Vector2( 1, 4 ) 15 | 0/autotile/tile_size = Vector2( 16, 16 ) 16 | 0/autotile/spacing = 0 17 | 0/autotile/occluder_map = [ ] 18 | 0/autotile/navpoly_map = [ ] 19 | 0/autotile/priority_map = [ ] 20 | 0/autotile/z_index_map = [ ] 21 | 0/occluder_offset = Vector2( 0, 0 ) 22 | 0/navigation_offset = Vector2( 0, 0 ) 23 | 0/shapes = [ ] 24 | 0/z_index = 0 25 | -------------------------------------------------------------------------------- /Map/World.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | var noise 4 | var map_size = Vector2(80, 60) 5 | var grass_cap = 0.5 6 | var road_caps = Vector2(0.3, 0.05) 7 | var enviroment_caps = Vector3(0.4, 0.3, 0.04) 8 | 9 | func _ready(): 10 | randomize() 11 | noise = OpenSimplexNoise.new() 12 | noise.seed = randi() 13 | noise.octaves = 1.0 14 | noise.period = 12 15 | # noise.persistence = 0.7 16 | make_grass_map() 17 | make_road_map() 18 | make_enviroment_map() 19 | make_background() 20 | 21 | func make_grass_map(): 22 | for x in map_size.x: 23 | for y in map_size.y: 24 | var a = noise.get_noise_2d(x,y) 25 | if a < grass_cap: 26 | $Grass.set_cell(x,y,0) 27 | 28 | $Grass.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y)) 29 | 30 | func make_road_map(): 31 | for x in map_size.x: 32 | for y in map_size.y: 33 | var a = noise.get_noise_2d(x,y) 34 | if a < road_caps.x and a > road_caps.y: 35 | $Roads.set_cell(x,y,0) 36 | $Roads.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y)) 37 | 38 | func make_enviroment_map(): 39 | for x in map_size.x: 40 | for y in map_size.y: 41 | var a = noise.get_noise_2d(x,y) 42 | if a < enviroment_caps.x and a > enviroment_caps.y or a < enviroment_caps.z: 43 | var chance = randi() % 100 44 | if chance < 2: 45 | 46 | var num = randi() % 4 47 | $Enviroment.set_cell(x,y, num) 48 | 49 | 50 | 51 | func make_background(): 52 | for x in map_size.x: 53 | for y in map_size.y: 54 | if $Grass.get_cell(x,y) == -1: 55 | if $Grass.get_cell(x,y-1) == 0: 56 | $Background.set_cell(x,y,0) 57 | 58 | $Background.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y)) 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Map/World.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=9 format=2] 2 | 3 | [ext_resource path="res://Map/World.gd" type="Script" id=1] 4 | [ext_resource path="res://Map/Background.shader" type="Shader" id=2] 5 | [ext_resource path="res://Map/snow-expansion.png" type="Texture" id=3] 6 | [ext_resource path="res://Map/GrassTileSet.tres" type="TileSet" id=4] 7 | 8 | [sub_resource type="ShaderMaterial" id=1] 9 | shader = ExtResource( 2 ) 10 | 11 | [sub_resource type="TileSet" id=2] 12 | 0/name = "snow-expansion.png 0" 13 | 0/texture = ExtResource( 3 ) 14 | 0/tex_offset = Vector2( 0, 0 ) 15 | 0/material = SubResource( 1 ) 16 | 0/modulate = Color( 1, 1, 1, 1 ) 17 | 0/region = Rect2( 257, 128, 80, 48 ) 18 | 0/tile_mode = 1 19 | 0/autotile/bitmask_mode = 1 20 | 0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 16, Vector2( 1, 0 ), 48, Vector2( 2, 0 ), 56, Vector2( 3, 0 ), 56, Vector2( 4, 0 ), 24 ] 21 | 0/autotile/icon_coordinate = Vector2( 3, 0 ) 22 | 0/autotile/tile_size = Vector2( 16, 48 ) 23 | 0/autotile/spacing = 0 24 | 0/autotile/occluder_map = [ ] 25 | 0/autotile/navpoly_map = [ ] 26 | 0/autotile/priority_map = [ Vector3( 3, 0, 2 ) ] 27 | 0/autotile/z_index_map = [ ] 28 | 0/occluder_offset = Vector2( 0, 0 ) 29 | 0/navigation_offset = Vector2( 0, 0 ) 30 | 0/shapes = [ ] 31 | 0/z_index = 0 32 | 33 | [sub_resource type="TileSet" id=3] 34 | 0/name = "Roads" 35 | 0/texture = ExtResource( 3 ) 36 | 0/tex_offset = Vector2( 0, 0 ) 37 | 0/modulate = Color( 1, 1, 1, 1 ) 38 | 0/region = Rect2( 128, 128, 128, 96 ) 39 | 0/tile_mode = 1 40 | 0/autotile/bitmask_mode = 1 41 | 0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 511, Vector2( 0, 1 ), 446, Vector2( 0, 2 ), 219, Vector2( 0, 3 ), 59, Vector2( 0, 4 ), 146, Vector2( 0, 5 ), 176, Vector2( 1, 0 ), 255, Vector2( 1, 1 ), 443, Vector2( 1, 2 ), 63, Vector2( 1, 3 ), 58, Vector2( 1, 4 ), 56, Vector2( 1, 5 ), 152, Vector2( 2, 0 ), 447, Vector2( 2, 1 ), 506, Vector2( 2, 2 ), 438, Vector2( 2, 3 ), 182, Vector2( 2, 4 ), 27, Vector2( 2, 5 ), 24, Vector2( 3, 0 ), 507, Vector2( 3, 1 ), 187, Vector2( 3, 2 ), 504, Vector2( 3, 3 ), 434, Vector2( 3, 4 ), 54, Vector2( 3, 5 ), 18, Vector2( 4, 0 ), 510, Vector2( 4, 1 ), 190, Vector2( 4, 2 ), 155, Vector2( 4, 3 ), 178, Vector2( 4, 4 ), 432, Vector2( 4, 5 ), 48, Vector2( 5, 0 ), 191, Vector2( 5, 1 ), 442, Vector2( 5, 2 ), 218, Vector2( 5, 3 ), 440, Vector2( 5, 4 ), 216, Vector2( 5, 5 ), 144, Vector2( 6, 0 ), 254, Vector2( 6, 1 ), 250, Vector2( 6, 2 ), 154, Vector2( 6, 3 ), 248, Vector2( 6, 4 ), 26, Vector2( 6, 5 ), 16, Vector2( 7, 0 ), 251, Vector2( 7, 1 ), 186, Vector2( 7, 2 ), 62, Vector2( 7, 3 ), 184, Vector2( 7, 4 ), 50, Vector2( 7, 5 ), 464 ] 42 | 0/autotile/icon_coordinate = Vector2( 0, 0 ) 43 | 0/autotile/tile_size = Vector2( 16, 16 ) 44 | 0/autotile/spacing = 0 45 | 0/autotile/occluder_map = [ ] 46 | 0/autotile/navpoly_map = [ ] 47 | 0/autotile/priority_map = [ ] 48 | 0/autotile/z_index_map = [ ] 49 | 0/occluder_offset = Vector2( 0, 0 ) 50 | 0/navigation_offset = Vector2( 0, 0 ) 51 | 0/shapes = [ ] 52 | 0/z_index = 0 53 | 54 | [sub_resource type="TileSet" id=4] 55 | 0/name = "snow-expansion.png 0" 56 | 0/texture = ExtResource( 3 ) 57 | 0/tex_offset = Vector2( 0, 0 ) 58 | 0/modulate = Color( 1, 1, 1, 1 ) 59 | 0/region = Rect2( 256, 0, 16, 16 ) 60 | 0/tile_mode = 0 61 | 0/occluder_offset = Vector2( 0, 0 ) 62 | 0/navigation_offset = Vector2( 0, 0 ) 63 | 0/shapes = [ ] 64 | 0/z_index = 0 65 | 1/name = "snow-expansion.png 1" 66 | 1/texture = ExtResource( 3 ) 67 | 1/tex_offset = Vector2( 0, 0 ) 68 | 1/modulate = Color( 1, 1, 1, 1 ) 69 | 1/region = Rect2( 256, 16, 16, 16 ) 70 | 1/tile_mode = 0 71 | 1/occluder_offset = Vector2( 0, 0 ) 72 | 1/navigation_offset = Vector2( 0, 0 ) 73 | 1/shapes = [ ] 74 | 1/z_index = 0 75 | 2/name = "snow-expansion.png 2" 76 | 2/texture = ExtResource( 3 ) 77 | 2/tex_offset = Vector2( 0, 0 ) 78 | 2/modulate = Color( 1, 1, 1, 1 ) 79 | 2/region = Rect2( 320, 0, 16, 16 ) 80 | 2/tile_mode = 0 81 | 2/occluder_offset = Vector2( 0, 0 ) 82 | 2/navigation_offset = Vector2( 0, 0 ) 83 | 2/shapes = [ ] 84 | 2/z_index = 0 85 | 3/name = "snow-expansion.png 3" 86 | 3/texture = ExtResource( 3 ) 87 | 3/tex_offset = Vector2( 0, 0 ) 88 | 3/modulate = Color( 1, 1, 1, 1 ) 89 | 3/region = Rect2( 336, 0, 16, 16 ) 90 | 3/tile_mode = 0 91 | 3/occluder_offset = Vector2( 0, 0 ) 92 | 3/navigation_offset = Vector2( 0, 0 ) 93 | 3/shapes = [ ] 94 | 3/z_index = 0 95 | 96 | [node name="World" type="Node2D"] 97 | script = ExtResource( 1 ) 98 | 99 | [node name="Background" type="TileMap" parent="."] 100 | tile_set = SubResource( 2 ) 101 | cell_size = Vector2( 16, 16 ) 102 | format = 1 103 | 104 | [node name="Grass" type="TileMap" parent="."] 105 | tile_set = ExtResource( 4 ) 106 | cell_size = Vector2( 16, 16 ) 107 | format = 1 108 | 109 | [node name="Roads" type="TileMap" parent="."] 110 | z_index = 1 111 | tile_set = SubResource( 3 ) 112 | cell_size = Vector2( 16, 16 ) 113 | format = 1 114 | 115 | [node name="Enviroment" type="TileMap" parent="."] 116 | z_index = 1 117 | tile_set = SubResource( 4 ) 118 | cell_size = Vector2( 16, 16 ) 119 | format = 1 120 | 121 | [node name="Camera2D" type="Camera2D" parent="."] 122 | position = Vector2( 512.322, 300.509 ) 123 | -------------------------------------------------------------------------------- /Map/snow-expansion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gingerageous/OpenSimplexNoiseTilemapTutorial/465332604209cacc4240ca60eb5b3ec7642339eb/Map/snow-expansion.png -------------------------------------------------------------------------------- /Map/snow-expansion.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/snow-expansion.png-803d8658d68e6e113f484137eea12d16.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Map/snow-expansion.png" 13 | dest_files=[ "res://.import/snow-expansion.png-803d8658d68e6e113f484137eea12d16.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gingerageous/OpenSimplexNoiseTilemapTutorial/465332604209cacc4240ca60eb5b3ec7642339eb/icon.png -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Educational_RPG" 19 | run/main_scene="res://Map/World.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [rendering] 23 | 24 | environment/default_clear_color=Color( 0.101961, 0.156863, 0.188235, 1 ) 25 | environment/default_environment="res://default_env.tres" 26 | --------------------------------------------------------------------------------