WIP update to terrian tileset

- Updating the terrian tileset as terrian_cl (Terrian City Limits) so that it's better optimized to work with the auto tile engine.
- Fixed typo in gitignore
This commit is contained in:
Anthony Wilcox 2019-11-29 11:05:56 -05:00
parent 4d7ba09097
commit 2f7b47fa4d
10 changed files with 194 additions and 44 deletions

63
.gitattributes vendored Normal file
View file

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

View file

@ -1,5 +1,10 @@
# Created by https://www.gitignore.io/api/linux,godot,macos,backup,windows,visualstudiocode
# Edit at https://www.gitignore.io/?templates=linux,godot,macos,backup,windows,visualstudiocode
### Audio ###
*.wav
*.ogg
# Created by https://www.gitignore.io/api/linux,godot,macos,backup,windows,dotnetcore,executable,monodevelop,visualstudiocode
# Edit at https://www.gitignore.io/?templates=linux,godot,macos,backup,windows,dotnetcore,executable,monodevelop,visualstudiocode
### Backup ###
*.bak
@ -8,6 +13,28 @@
*.orig
*.tmp
### DotnetCore ###
# .NET Core build folders
/bin
/obj
# Common node modules locations
/node_modules
/wwwroot/node_modules
### Executable ###
*.app
*.bat
*.cgi
*.com
*.exe
*.gadget
*.jar
*.pif
*.vb
*.wsf
### Godot ###
# Godot-specific ignores
@ -61,6 +88,16 @@ Network Trash Folder
Temporary Items
.apdisk
### MonoDevelop ###
#User Specific
*.userprefs
*.usertasks
#Mono Project Files
*.pidb
*.resources
test-results/
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
@ -98,4 +135,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/linux,godot,macos,backup,windows,visualstudiocode
# End of https://www.gitignore.io/api/linux,godot,macos,backup,windows,dotnetcore,executable,monodevelop,visualstudiocode

BIN
assets/terrain_cl.ase Normal file

Binary file not shown.

BIN
src/graphics/terrain_cl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/terrain_cl.png-d78bff616c0deecb3dc6c30085d2553c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/terrain_cl.png"
dest_files=[ "res://.import/terrain_cl.png-d78bff616c0deecb3dc6c30085d2553c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

24
src/graphics/terrian.tres Normal file
View file

@ -0,0 +1,24 @@
[gd_resource type="TileSet" load_steps=2 format=2]
[ext_resource path="res://graphics/terrain_cl.png" type="Texture" id=1]
[resource]
0/name = "terrain_cl.png 0"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 16, 288 )
0/tile_mode = 1
0/autotile/bitmask_mode = 1
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 511, Vector2( 0, 1 ), 7, Vector2( 0, 2 ), 7, Vector2( 0, 3 ), 311, Vector2( 0, 4 ), 311, Vector2( 0, 5 ), 292, Vector2( 0, 6 ), 292, Vector2( 0, 7 ), 484, Vector2( 0, 8 ), 500, Vector2( 0, 9 ), 448, Vector2( 0, 10 ), 448, Vector2( 0, 11 ), 457, Vector2( 0, 12 ), 457, Vector2( 0, 13 ), 73, Vector2( 0, 14 ), 73, Vector2( 0, 15 ), 79, Vector2( 0, 16 ), 79 ]
0/autotile/icon_coordinate = Vector2( 0, 0 )
0/autotile/tile_size = Vector2( 16, 16 )
0/autotile/spacing = 0
0/autotile/occluder_map = [ ]
0/autotile/navpoly_map = [ ]
0/autotile/priority_map = [ ]
0/autotile/z_index_map = [ ]
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shapes = [ ]
0/z_index = 0

View file

@ -15,7 +15,8 @@ _global_script_class_icons={
[application]
config/name="CityLimits"
config/name="City Limits"
run/main_scene="res://world.tscn"
config/icon="res://icon.png"
[rendering]

25
src/world.gd Normal file
View file

@ -0,0 +1,25 @@
extends Node2D
var noise : OpenSimplexNoise
var map_size = Vector2(80, 60)
var grass_cap = 0.5
var road_caps = Vector2(0.3, 0.05)
func _ready():
randomize()
noise = OpenSimplexNoise.new()
noise.seed = randi()
noise.octaves = 1.5
noise.period = 12
make_terrian_map()
func make_terrian_map():
for x in map_size.x:
for y in map_size.y:
var a = noise.get_noise_2d(x, y)
if a < grass_cap:
$Terrian.set_cell(x, y, 0)
$Terrian.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y))

View file

@ -1,10 +1,12 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://graphics/roads.tres" type="TileSet" id=1]
[ext_resource path="res://world.gd" type="Script" id=1]
[ext_resource path="res://graphics/terrian.tres" type="TileSet" id=2]
[node name="Node2D" type="Node2D"]
script = ExtResource( 1 )
[node name="Roads" type="TileMap" parent="."]
tile_set = ExtResource( 1 )
[node name="Terrian" type="TileMap" parent="."]
tile_set = ExtResource( 2 )
cell_size = Vector2( 16, 16 )
format = 1

View file

@ -1,36 +0,0 @@
extends Node2D
var noise : OpenSimplexNoise
var map_size = Vector2(80, 60)
var grass_cap = 0.5
var road_caps = Vector2(0.3, 0.05)
func _ready():
randomize()
noise = OpenSimplexNoise.new()
noise.seed = randi()
noise.octaves = 1.5
noise.period = 12
make_grass_map()
make_road_map()
func make_grass_map():
for x in map_size.x:
for y in map_size.y:
var a = noise.get_noise_2d(x, y)
if a < grass_cap:
$Grass.set_cell(x, y, 0)
$Grass.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y))
func make_road_map():
for x in map_size.x:
for y in map_size.y:
var a = noise.get_noise_2d(x, y)
if a < road_caps.x and a > road_caps.y:
$Roads.set_cell(x, y, 0)
$Roads.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y))