diff --git a/Notes/README.md b/Notes/README.md index 98acb1c..e4e10be 100644 --- a/Notes/README.md +++ b/Notes/README.md @@ -23,7 +23,7 @@ var direction = (jet.target.global_position - jet.global_position).normalized() Can we normalize rotation and from that treat slices of the circle as specific command zones? I.E if target a jet in front and and to the right by 45 degrees we yaw instead of roll? -Imagine the current situation is us observing our CPU controlled jet from +Imagining the current situation is us observing our CPU controlled jet from the 3rd person view from behind. The jet is level to the horizon of our world. The target jet position is behind and slightly to the right corner of the screen. ____________________________________________ @@ -37,6 +37,28 @@ ____________________________________________ | X | ____________________________________________ +-- SOHCAHTOA + +-- sin = Opposite/Hypotenuse +-- cos = Adjacent/Hypotenuse +-- tan = Opposite/Adjacent + +Maybe aha moment, if I create a right angled triangles per plane then we can figure out radians from the aquired angles. +=O ^ + +We already have a hypotenuse value based on the 'distance'. +We have the target position and our position. +Thus, if certain target values are above or below we use one or the other to gague the 90 degree angle point + + let x1 = 5; + let y1 = 5; + let rotation = 8; // in degrees + let magnitude = 7; // our distance + // got bellow from AI during 500 lines challenge; not sure what this is doing just yet + let radians = (rotation + 180) % 360; + const x2 = x1 + magnitude * Math.cos(radians); + const y2 = y1 + magnitude * Math.sin(radians); + We must roll the jet to +90 degrees left or -90 right and then pitch up in order to turn towards target. OR yaw left or right to turn. What conditions should we use to determin which to use? Distance from and to? @@ -47,29 +69,6 @@ how do we confirm what set of actions to do/maintain? A queue and check over tim Can we able to get the 'delta' in cpu_controller utside of '_process'/'_physics_process'? If queue do we push "rotate towards using xyz pattern" as a command/state to check until met? - - -If in rotate towards - - - - - - - - - - - - - - - - - - - - diff --git a/Notes/scrshot_2026-10-31 22:01:23.png b/Notes/scrshot_2026-10-31 22:01:23.png new file mode 100644 index 0000000..e0bfef5 Binary files /dev/null and b/Notes/scrshot_2026-10-31 22:01:23.png differ diff --git a/Notes/scrshot_2026-10-31 22:01:23.png.import b/Notes/scrshot_2026-10-31 22:01:23.png.import new file mode 100644 index 0000000..ad54ab3 --- /dev/null +++ b/Notes/scrshot_2026-10-31 22:01:23.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://fde2fvqtfias" +path="res://.godot/imported/scrshot_2026-10-31 22:01:23.png-ea38935c18fe54a50229a4759efcb462.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Notes/scrshot_2026-10-31 22:01:23.png" +dest_files=["res://.godot/imported/scrshot_2026-10-31 22:01:23.png-ea38935c18fe54a50229a4759efcb462.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Notes/scrshot_2026-11-01 15:59:01.png b/Notes/scrshot_2026-11-01 15:59:01.png new file mode 100644 index 0000000..4b7681e Binary files /dev/null and b/Notes/scrshot_2026-11-01 15:59:01.png differ diff --git a/Notes/scrshot_2026-11-01 15:59:01.png.import b/Notes/scrshot_2026-11-01 15:59:01.png.import new file mode 100644 index 0000000..d2fb427 --- /dev/null +++ b/Notes/scrshot_2026-11-01 15:59:01.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvebpk7j4sxn3" +path="res://.godot/imported/scrshot_2026-11-01 15:59:01.png-b49b72cbc21cd7f23ef317b486d9800f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Notes/scrshot_2026-11-01 15:59:01.png" +dest_files=["res://.godot/imported/scrshot_2026-11-01 15:59:01.png-b49b72cbc21cd7f23ef317b486d9800f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Notes/scrshot_2026-11-01 16:08:02.png b/Notes/scrshot_2026-11-01 16:08:02.png new file mode 100644 index 0000000..ece45b3 Binary files /dev/null and b/Notes/scrshot_2026-11-01 16:08:02.png differ diff --git a/Notes/scrshot_2026-11-01 16:08:02.png.import b/Notes/scrshot_2026-11-01 16:08:02.png.import new file mode 100644 index 0000000..f3d226b --- /dev/null +++ b/Notes/scrshot_2026-11-01 16:08:02.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://k31f0oydc2bl" +path="res://.godot/imported/scrshot_2026-11-01 16:08:02.png-1731f74adb3e861c17e68b31c0ea9978.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Notes/scrshot_2026-11-01 16:08:02.png" +dest_files=["res://.godot/imported/scrshot_2026-11-01 16:08:02.png-1731f74adb3e861c17e68b31c0ea9978.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scripts/controllers/cpu_system/cpu_controller.gd b/scripts/controllers/cpu_system/cpu_controller.gd index e17cd3c..86fd3de 100644 --- a/scripts/controllers/cpu_system/cpu_controller.gd +++ b/scripts/controllers/cpu_system/cpu_controller.gd @@ -34,12 +34,10 @@ func assign_jet_target(jet: Jet) -> void: func process_jet_plan(jet: Jet) -> void: if not is_instance_valid(jet.target): return - var target_local_position: Vector3 = jet.to_local(jet.target.global_position) var target_direction: Vector3 = target_local_position.normalized() jet.target_ray.target_position = target_direction * 8 - if maxf(target_direction.z, 0.0) == 0.0: get_node("../../base_ui/target_position_fb").text = "infront" jet.controller.cpu.no_action() @@ -50,12 +48,13 @@ func process_jet_plan(jet: Jet) -> void: jet.controller.cpu.yaw_left() elif maxf(target_direction.y, 0.5) == 0.5: - get_node("../../base_ui/target_position_ab").text = "above" jet.controller.cpu.no_action() if target_direction.y > 0.2: + get_node("../../base_ui/target_position_ab").text = "above" jet.controller.cpu.pitch_up() elif target_direction.y < -0.2: + get_node("../../base_ui/target_position_ab").text = "below" jet.controller.cpu.pitch_down() elif maxf(target_direction.y, -0.5) == -0.5: @@ -87,7 +86,7 @@ func process_jet_plan(jet: Jet) -> void: # NOTE: (From GPT) Mostly works but with precession nor do I really understand it... - #var forward_dot: float = target_direction.dot(Vector3.UP) + #var forward_dot: float = target_direction.dot(Vector3.UP) #if forward_dot >= cos(deg_to_rad(37.5)): #get_node("../../base_ui/target_position_fb").text = "infront" #jet.controller.cpu.no_action()