Browse Source

added sound effect and improved shaders

master
Weird Constructor 4 years ago
parent
commit
d6d983311f
  1. 1
      .gitignore
  2. 53
      assets/audio/audacity/mining_beam.aup
  3. BIN
      assets/audio/audacity/mining_beam_data/e00/d00/e000028a.au
  4. BIN
      assets/audio/audacity/mining_beam_data/e00/d00/e000031c.au
  5. BIN
      assets/audio/audacity/mining_beam_data/e00/d00/e00008ca.au
  6. BIN
      assets/audio/audacity/mining_beam_data/e00/d00/e0000bd2.au
  7. BIN
      assets/audio/audacity/mining_beam_data/e00/d00/e0000c61.au
  8. BIN
      assets/audio/audacity/mining_beam_data/e00/d00/e0000e35.au
  9. BIN
      assets/audio/lmms/mining_laser.mmpz
  10. 21
      assets/audio/lmms/presets/laser.xpf
  11. 21
      assets/audio/lmms/presets/saw1.xpf
  12. BIN
      assets/audio/sounds/mining_beam.wav
  13. 2
      godot_bind/src/voxel_structure.rs
  14. 4
      godot_project/gamelib/main.wl
  15. BIN
      godot_project/gdnative/libsscg_gd.so
  16. 6
      godot_project/scenes/entities/VoxelStructure.tscn
  17. 0
      godot_project/scenes/entities/materials/voxel_cursor_material.tres
  18. 0
      godot_project/scenes/entities/materials/voxel_material.shader
  19. 3
      godot_project/scenes/entities/materials/voxel_material.tres
  20. 0
      godot_project/scenes/entities/materials/voxel_mine_material.tres
  21. 32
      godot_project/scenes/system_map/MiningBeamSound.gd
  22. 4
      godot_project/scenes/system_map/drone.gd
  23. 3
      godot_project/scenes/system_map/gui_blur.shader
  24. 76
      godot_project/scenes/system_map/system_map.tscn
  25. BIN
      godot_project/sounds/mining_beam.wav
  26. 21
      godot_project/sounds/mining_beam.wav.import
  27. 1
      update_proj_assets.sh

1
.gitignore vendored

@ -12,3 +12,4 @@ target/
/godot/Godot_v3.1.1-stable_win64.exe
/godot/Godot_v3.1.1-stable_win64.exe.zip
/godot_project/.import/
*.bak

53
assets/audio/audacity/mining_beam.aup

@ -0,0 +1,53 @@
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
<project xmlns="http://audacity.sourceforge.net/xml/" projname="mining_beam_data" version="1.3.0" audacityversion="2.2.1" sel0="-0.0000071272" sel1="4.0992218977" vpos="0" h="0.0000000000" zoom="91.5527343750" rate="44100.0" snapto="off" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
<tags>
<tag name="ARTIST" value="Weird Constructor"/>
</tags>
<wavetrack name="Audio Track" channel="2" linked="0" mute="0" solo="1" height="150" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="-0.13000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="5733">
<waveblock start="0">
<simpleblockfile filename="e0000e35.au" len="5733" min="0.0" max="0.0" rms="0.0"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
<waveclip offset="-0.00000713" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="397932">
<waveblock start="0">
<simpleblockfile filename="e000031c.au" len="166508" min="-0.301361" max="0.316315" rms="0.128178"/>
</waveblock>
<waveblock start="166508">
<simpleblockfile filename="e000028a.au" len="231424" min="-0.311493" max="0.316772" rms="0.106072"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" channel="2" linked="0" mute="1" solo="0" height="150" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="405583">
<waveblock start="0">
<simpleblockfile filename="e0000c61.au" len="145140" min="-0.444946" max="0.370087" rms="0.123801"/>
</waveblock>
<waveblock start="145140">
<simpleblockfile filename="e00008ca.au" len="260443" min="-0.529694" max="0.442139" rms="0.125822"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" channel="2" linked="0" mute="1" solo="0" height="150" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="-0.00000713" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="180776">
<waveblock start="0">
<simpleblockfile filename="e0000bd2.au" len="180776" min="-0.527222" max="0.368958" rms="0.127012"/>
</waveblock>
</sequence>
<envelope numpoints="1">
<controlpoint t="0.000000000000" val="1.000000000000"/>
</envelope>
</waveclip>
</wavetrack>
</project>

BIN
assets/audio/audacity/mining_beam_data/e00/d00/e000028a.au

Binary file not shown.

BIN
assets/audio/audacity/mining_beam_data/e00/d00/e000031c.au

Binary file not shown.

BIN
assets/audio/audacity/mining_beam_data/e00/d00/e00008ca.au

Binary file not shown.

BIN
assets/audio/audacity/mining_beam_data/e00/d00/e0000bd2.au

Binary file not shown.

BIN
assets/audio/audacity/mining_beam_data/e00/d00/e0000c61.au

Binary file not shown.

BIN
assets/audio/audacity/mining_beam_data/e00/d00/e0000e35.au

Binary file not shown.

BIN
assets/audio/lmms/mining_laser.mmpz

Binary file not shown.

21
assets/audio/lmms/presets/laser.xpf

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!DOCTYPE lmms-project>
<lmms-project creator="LMMS" creatorversion="1.2.1" type="instrumenttracksettings" version="1.0">
<head/>
<instrumenttracksettings solo="0" type="0" muted="0" name="laser" height="32">
<instrumenttrack pan="0" basenote="57" usemasterpitch="1" vol="100" fxch="0" pitch="0" pitchrange="1">
<instrument name="tripleoscillator">
<tripleoscillator wavetype1="3" userwavefile1="" wavetype2="6" userwavefile2="" phoffset0="0" phoffset1="0" phoffset2="0" stphdetun0="0" stphdetun1="0" stphdetun2="0" finel0="0" finer0="0" finel1="4" finer1="0" finel2="0" finer2="0" modalgo1="2" coarse0="0" vol0="33" modalgo2="2" coarse1="-12" vol1="33" modalgo3="2" vol2="19" coarse2="0" pan0="0" pan1="0" pan2="0" userwavefile0="" wavetype0="2"/>
</instrument>
<eldata fcut="10491" fwet="1" ftype="0" fres="0.5">
<elvol latt="0" lspd_syncmode="0" sustain="1" lamt="0" rel="0.313" lspd_numerator="4" dec="0.5" lshp="0" att="0" x100="0" amt="1" ctlenvamt="0" lspd="0.1" userwavefile="" pdel="0" lspd_denominator="4" hold="0.5" lpdel="0"/>
<elcut latt="0" lspd_syncmode="0" sustain="0.5" lamt="0" rel="0.1" lspd_numerator="4" dec="0.5" lshp="0" att="0" x100="0" amt="0" ctlenvamt="0" lspd="0.1" userwavefile="" pdel="0" lspd_denominator="4" hold="0.5" lpdel="0"/>
<elres latt="0" lspd_syncmode="0" sustain="0.5" lamt="0" rel="0.1" lspd_numerator="4" dec="0.5" lshp="0" att="0" x100="0" amt="0" ctlenvamt="0" lspd="0.1" userwavefile="" pdel="0" lspd_denominator="4" hold="0.5" lpdel="0"/>
</eldata>
<chordcreator chordrange="1" chord-enabled="1" chord="0"/>
<arpeggiator arp-enabled="0" arp="0" arpmiss="0" arpmode="0" arpcycle="0" arpskip="0" arptime_syncmode="0" arptime_numerator="4" arptime_denominator="4" arptime="100" arpgate="100" arprange="1" arpdir="0"/>
<midiport fixedoutputnote="-1" inputchannel="0" inputcontroller="0" readable="0" writable="0" fixedinputvelocity="-1" fixedoutputvelocity="-1" outputchannel="1" outputcontroller="0" basevelocity="63" outputprogram="1"/>
<fxchain numofeffects="0" enabled="1"/>
</instrumenttrack>
</instrumenttracksettings>
</lmms-project>

21
assets/audio/lmms/presets/saw1.xpf

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!DOCTYPE lmms-project>
<lmms-project creator="LMMS" creatorversion="1.2.1" type="instrumenttracksettings" version="1.0">
<head/>
<instrumenttracksettings solo="0" type="0" muted="0" name="TripleOscillator" height="32">
<instrumenttrack pan="0" basenote="57" usemasterpitch="1" vol="100" fxch="0" pitch="0" pitchrange="1">
<instrument name="tripleoscillator">
<tripleoscillator wavetype1="3" userwavefile1="" wavetype2="2" userwavefile2="" phoffset0="0" phoffset1="0" phoffset2="0" stphdetun0="0" stphdetun1="0" stphdetun2="0" finel0="0" finer0="0" finel1="4" finer1="0" finel2="4" finer2="0" modalgo1="2" coarse0="0" vol0="33" modalgo2="2" coarse1="-12" vol1="25" modalgo3="2" vol2="36" coarse2="-24" pan0="0" pan1="0" pan2="0" userwavefile0="" wavetype0="2"/>
</instrument>
<eldata fcut="14000" fwet="0" ftype="0" fres="0.5">
<elvol latt="0" lspd_syncmode="0" sustain="1" lamt="0" rel="1.206" lspd_numerator="4" dec="0.5" lshp="0" att="0" x100="0" amt="1" ctlenvamt="0" lspd="0.1" userwavefile="" pdel="0" lspd_denominator="4" hold="0.5" lpdel="0"/>
<elcut latt="0" lspd_syncmode="0" sustain="0.5" lamt="0" rel="0.1" lspd_numerator="4" dec="0.5" lshp="0" att="0" x100="0" amt="0" ctlenvamt="0" lspd="0.1" userwavefile="" pdel="0" lspd_denominator="4" hold="0.5" lpdel="0"/>
<elres latt="0" lspd_syncmode="0" sustain="0.5" lamt="0" rel="0.1" lspd_numerator="4" dec="0.5" lshp="0" att="0" x100="0" amt="0" ctlenvamt="0" lspd="0.1" userwavefile="" pdel="0" lspd_denominator="4" hold="0.5" lpdel="0"/>
</eldata>
<chordcreator chordrange="1" chord-enabled="0" chord="0"/>
<arpeggiator arp-enabled="0" arp="0" arpmiss="0" arpmode="0" arpcycle="0" arpskip="0" arptime_syncmode="0" arptime_numerator="4" arptime_denominator="4" arptime="100" arpgate="100" arprange="1" arpdir="0"/>
<midiport fixedoutputnote="-1" inputchannel="0" inputcontroller="0" readable="0" writable="0" fixedinputvelocity="-1" fixedoutputvelocity="-1" outputchannel="1" outputcontroller="0" basevelocity="63" outputprogram="1"/>
<fxchain numofeffects="0" enabled="0"/>
</instrumenttrack>
</instrumenttracksettings>
</lmms-project>

BIN
assets/audio/sounds/mining_beam.wav

Binary file not shown.

2
godot_bind/src/voxel_structure.rs

@ -64,7 +64,7 @@ impl VoxStruct {
let voxel_material =
ResourceLoader::godot_singleton().load(
GodotString::from_str("res://scenes/system_map/voxel_material.tres"),
GodotString::from_str("res://scenes/entities/materials/voxel_material.tres"),
GodotString::from_str("ShaderMaterial"),
false).unwrap().cast::<Material>().unwrap();

4
godot_project/gamelib/main.wl

@ -19,8 +19,8 @@
fuel_capacity = 1000,
fuel_per_sec = 10,
max_kg_fuel_factor = 200,
# cargo_max_m3 = 2000,
cargo_max_m3 = 222,
cargo_max_m3 = 2000,
# cargo_max_m3 = 222,
cargo_max_kg = 10000,
},
},

BIN
godot_project/gdnative/libsscg_gd.so

Binary file not shown.

6
godot_project/scenes/entities/VoxelStructure.tscn

@ -2,8 +2,8 @@
[ext_resource path="res://scenes/entities/VoxelStructure.gd" type="Script" id=1]
[ext_resource path="res://scenes/entities/scripts/VoxStruct2.gdns" type="Script" id=2]
[ext_resource path="res://scenes/system_map/voxel_cursor_material.tres" type="Material" id=3]
[ext_resource path="res://scenes/system_map/voxel_mine_material.tres" type="Material" id=4]
[ext_resource path="res://scenes/entities/materials/voxel_cursor_material.tres" type="Material" id=3]
[ext_resource path="res://scenes/entities/materials/voxel_mine_material.tres" type="Material" id=4]
[sub_resource type="CubeMesh" id=1]
size = Vector3( 1.2, 1.2, 1.2 )
@ -23,11 +23,13 @@ script = ExtResource( 2 )
[node name="CursorBox" type="MeshInstance" parent="VoxStruct"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -9, 0, -30 )
visible = false
mesh = SubResource( 1 )
material/0 = ExtResource( 3 )
[node name="MineBox" type="MeshInstance" parent="VoxStruct"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -9, 0, -30 )
visible = false
mesh = SubResource( 1 )
material/0 = ExtResource( 4 )

0
godot_project/scenes/system_map/voxel_cursor_material.tres → godot_project/scenes/entities/materials/voxel_cursor_material.tres

0
godot_project/scenes/system_map/voxel_material.shader → godot_project/scenes/entities/materials/voxel_material.shader

3
godot_project/scenes/system_map/voxel_material.tres → godot_project/scenes/entities/materials/voxel_material.tres

@ -1,6 +1,7 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=2]
[ext_resource path="res://scenes/system_map/voxel_material.shader" type="Shader" id=1]
[ext_resource path="res://scenes/entities/materials/voxel_material.shader" type="Shader" id=1]
[resource]
shader = ExtResource( 1 )

0
godot_project/scenes/system_map/voxel_mine_material.tres → godot_project/scenes/entities/materials/voxel_mine_material.tres

32
godot_project/scenes/system_map/MiningBeamSound.gd

@ -0,0 +1,32 @@
extends AudioStreamPlayer
var is_playing = false
var disable_timer = Timer.new()
var enable_tween = Tween.new()
func _ready():
disable_timer.connect("timeout", self, "disable_beam_now")
enable_tween.interpolate_method(self, "foo", -60.0, 0.0, 1.0, Tween.TRANS_LINEAR, Tween.EASE_IN)
enable_tween.interpolate_property(self, "volume_db", -10.0, 0.0, 1, Tween.TRANS_LINEAR, Tween.EASE_IN)
func foo(f):
print("FOOO", f)
func enable_beam():
disable_timer.stop()
print("ENABLE BEAM")
if not is_playing:
self.volume_db = -60.0
# enable_tween.set_active(true)
# enable_tween.reset(self)
enable_tween.start()
self.play()
is_playing = true
func disable_beam_now():
is_playing = false
self.stop()
func disable_beam():
if is_playing:
disable_timer.start(0.7)

4
godot_project/scenes/system_map/drone.gd

@ -36,7 +36,7 @@ func set_active(is_active):
if test_mode:
self.set_translation(
self.get_parent().get_node("ship").get_translation()
+ Vector3(0, 140, 0))
+ Vector3(0, 120, 0))
else:
self.set_translation(
self.get_parent().get_node("ship").get_translation()
@ -103,6 +103,7 @@ func stop_mining():
mining_vox = null
mining_pos = null
mining_info = null
$MiningBeamSound.disable_beam()
func process_mining_gun(delta):
var cast = self.get_child(0)
@ -150,6 +151,7 @@ func process_mining_gun(delta):
mining_vox.set_marker_status(true, true)
mining_time = 0.0
marker_vox = vox
$MiningBeamSound.enable_beam()
else:
vox.looking_at_nothing()
mining_pos = null

3
godot_project/scenes/system_map/gui_blur.shader

@ -7,7 +7,6 @@ void fragment() {
if (ui.a > 0.1) {
COLOR = mix(ui, screen_blur, 0.3);
} else {
COLOR = texture(SCREEN_TEXTURE, SCREEN_UV);
COLOR = ui;
}
}

76
godot_project/scenes/system_map/system_map.tscn

@ -1,16 +1,18 @@
[gd_scene load_steps=21 format=2]
[gd_scene load_steps=22 format=2]
[ext_resource path="res://gdnative/libsscg_gd.tres" type="GDNativeLibrary" id=1]
[ext_resource path="res://scenes/ships/ship_1.tscn" type="PackedScene" id=2]
[ext_resource path="res://scenes/system_map/drone.gd" type="Script" id=3]
[ext_resource path="res://scenes/system_map/voxel_mine_material.tres" type="Material" id=4]
[ext_resource path="res://scenes/system_map/crosshair.tscn" type="PackedScene" id=5]
[ext_resource path="res://crosshair.png" type="Texture" id=6]
[ext_resource path="res://scenes/system_map/SystemMapGUIControl.gd" type="Script" id=7]
[ext_resource path="res://fonts/DejaVuSans-Bold.ttf" type="DynamicFontData" id=8]
[ext_resource path="res://scenes/system_map/GUIDrawing.gdns" type="Script" id=9]
[ext_resource path="res://scenes/system_map/Grid.tscn" type="PackedScene" id=10]
[ext_resource path="res://music/Ryan_Andersen_-_07_-_Synthwave.ogg" type="AudioStream" id=11]
[ext_resource path="res://scenes/entities/materials/voxel_mine_material.tres" type="Material" id=4]
[ext_resource path="res://crosshair.png" type="Texture" id=5]
[ext_resource path="res://sounds/mining_beam.wav" type="AudioStream" id=6]
[ext_resource path="res://scenes/system_map/MiningBeamSound.gd" type="Script" id=7]
[ext_resource path="res://scenes/system_map/SystemMapGUIControl.gd" type="Script" id=8]
[ext_resource path="res://fonts/DejaVuSans-Bold.ttf" type="DynamicFontData" id=9]
[ext_resource path="res://scenes/system_map/gui_blur.shader" type="Shader" id=10]
[ext_resource path="res://scenes/system_map/GUIDrawing.gdns" type="Script" id=11]
[ext_resource path="res://scenes/system_map/Grid.tscn" type="PackedScene" id=12]
[ext_resource path="res://music/Ryan_Andersen_-_07_-_Synthwave.ogg" type="AudioStream" id=13]
[sub_resource type="NativeScript" id=1]
resource_name = "SystemMap"
@ -33,7 +35,7 @@ size = 25
outline_size = 2
use_mipmaps = true
use_filter = true
font_data = ExtResource( 8 )
font_data = ExtResource( 9 )
[sub_resource type="DynamicFont" id=5]
size = 12
@ -41,25 +43,10 @@ outline_size = 1
outline_color = Color( 0.160784, 0.160784, 0.160784, 1 )
use_mipmaps = true
use_filter = true
font_data = ExtResource( 8 )
font_data = ExtResource( 9 )
[sub_resource type="Shader" id=14]
code = "shader_type canvas_item;
void fragment() {
vec4 screen_blur = texture(SCREEN_TEXTURE, SCREEN_UV, 2.0);
vec4 ui = texture(TEXTURE, UV);
if (ui.a > 0.1) {
COLOR = mix(ui, screen_blur, 0.3);
} else {
COLOR = texture(SCREEN_TEXTURE, SCREEN_UV);
}
}"
[sub_resource type="ShaderMaterial" id=13]
shader = SubResource( 14 )
[sub_resource type="ShaderMaterial" id=6]
shader = ExtResource( 10 )
[sub_resource type="SpatialMaterial" id=7]
albedo_color = Color( 1, 0.72549, 0, 1 )
@ -103,18 +90,6 @@ fov = 80.0
near = 0.01
far = 4712.0
[node name="crosshair" parent="Drone/Camera" instance=ExtResource( 5 )]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 )
visible = false
[node name="SpotLight" type="SpotLight" parent="Drone/Camera"]
visible = false
layers = 2
spot_range = 22.5656
spot_attenuation = 2.0
spot_angle = 23.0086
spot_angle_attenuation = 0.554785
[node name="OmniLight" type="OmniLight" parent="Drone/Camera"]
light_energy = 0.75
light_indirect_energy = 0.75
@ -123,12 +98,18 @@ omni_attenuation = 4.59479
[node name="Sprite3D" type="Sprite3D" parent="Drone/Camera"]
transform = Transform( 0.00772604, 0, 0, 0, 0.00772604, 0, 0, 0, 1, 0, 0, -0.0510799 )
texture = ExtResource( 6 )
texture = ExtResource( 5 )
[node name="MiningBeamSound" type="AudioStreamPlayer" parent="Drone"]
stream = ExtResource( 6 )
volume_db = -9.248
script = ExtResource( 7 )
[node name="GUI" type="Control" parent="."]
editor/display_folded = true
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 7 )
script = ExtResource( 8 )
__meta__ = {
"_edit_use_anchors_": false
}
@ -186,7 +167,8 @@ __meta__ = {
}
[node name="ViewportContainer" type="ViewportContainer" parent="GUI"]
material = SubResource( 13 )
editor/display_folded = true
material = SubResource( 6 )
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = -1280.0
@ -199,7 +181,7 @@ handle_input_locally = false
render_target_update_mode = 3
[node name="GUIDrawing" type="Node2D" parent="GUI/ViewportContainer/Viewport"]
script = ExtResource( 9 )
script = ExtResource( 11 )
[node name="Sun Sphere" type="MeshInstance" parent="."]
transform = Transform( 30, 0, 0, 0, 30, 0, 0, 0, 30, 0.00144982, -0.00536215, -0.00533855 )
@ -234,14 +216,14 @@ light_cull_mask = 4294967293
shadow_bias = 1.57
shadow_contact = 11.3
shadow_reverse_cull_face = true
omni_range = 2500.0
omni_range = 800.0
omni_attenuation = 0.0281641
omni_shadow_detail = 0
[node name="Grid" parent="." instance=ExtResource( 10 )]
[node name="Grid" parent="." instance=ExtResource( 12 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -6, 0 )
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 11 )
stream = ExtResource( 13 )
bus = "Music"
[connection signal="resized" from="GUI" to="GUI" method="_on_GUI_resized"]

BIN
godot_project/sounds/mining_beam.wav

Binary file not shown.

21
godot_project/sounds/mining_beam.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/mining_beam.wav-cd93fe6e01aab4c86bbd4af12f7bacb8.sample"
[deps]
source_file="res://sounds/mining_beam.wav"
dest_files=[ "res://.import/mining_beam.wav-cd93fe6e01aab4c86bbd4af12f7bacb8.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

1
update_proj_assets.sh

@ -0,0 +1 @@
cp assets/audio/sounds/*.wav godot_project/sounds/
Loading…
Cancel
Save