diff --git a/hs_err_pid11232.log b/hs_err_pid11232.log new file mode 100644 index 000000000..0b81fb472 --- /dev/null +++ b/hs_err_pid11232.log @@ -0,0 +1,770 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000055b4ba43, pid=11232, tid=944 +# +# JRE version: OpenJDK Runtime Environment Temurin-17.0.7+7 (17.0.7+7) (build 17.0.7+7) +# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (17.0.7+7, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) +# Problematic frame: +# C [gdx-box2d64.dll+0xba43] +# +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# +# If you would like to submit a bug report, please visit: +# https://github.com/adoptium/adoptium-support/issues +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- S U M M A R Y ------------ + +Command Line: -XX:+ShowCodeDetailsInExceptionMessages com.csse3200.game.desktop.DesktopLauncher + +Host: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz, 8 cores, 15G, Windows 11 , 64 bit Build 22621 (10.0.22621.2070) +Time: Thu Sep 7 18:58:06 2023 E. Australia Standard Time elapsed time: 14.571400 seconds (0d 0h 0m 14s) + +--------------- T H R E A D --------------- + +Current thread (0x00000199029352f0): JavaThread "main" [_thread_in_native, id=944, stack(0x00000070b6100000,0x00000070b6200000)] + +Stack: [0x00000070b6100000,0x00000070b6200000], sp=0x00000070b61fdfb0, free space=1015k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [gdx-box2d64.dll+0xba43] + +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +j com.badlogic.gdx.physics.box2d.World.jniCreateBody(JIFFFFFFFFZZZZZF)J+0 +j com.badlogic.gdx.physics.box2d.World.createBody(Lcom/badlogic/gdx/physics/box2d/BodyDef;)Lcom/badlogic/gdx/physics/box2d/Body;+80 +j com.csse3200.game.physics.PhysicsEngine.createBody(Lcom/badlogic/gdx/physics/box2d/BodyDef;)Lcom/badlogic/gdx/physics/box2d/Body;+16 +j com.csse3200.game.physics.components.PhysicsComponent.(Lcom/csse3200/game/physics/PhysicsEngine;)V+51 +j com.csse3200.game.physics.components.PhysicsComponent.()V+7 +j com.csse3200.game.entities.factories.ProjectileFactory.createBaseProjectile(Lcom/badlogic/gdx/math/Vector2;)Lcom/csse3200/game/entities/Entity;+30 +j com.csse3200.game.entities.factories.ProjectileFactory.createFireBall(SLcom/badlogic/gdx/math/Vector2;Lcom/badlogic/gdx/math/Vector2;)Lcom/csse3200/game/entities/Entity;+8 +j com.csse3200.game.components.RicochetComponent.onCollisionEnd(Lcom/badlogic/gdx/physics/box2d/Fixture;Lcom/badlogic/gdx/physics/box2d/Fixture;)V+92 +j com.csse3200.game.components.RicochetComponent$$Lambda$102+0x00000008001b4200.handle(Ljava/lang/Object;Ljava/lang/Object;)V+12 +j com.csse3200.game.events.EventHandler.lambda$2(Ljava/lang/Object;Ljava/lang/Object;Lcom/csse3200/game/events/listeners/EventListener;)V+6 +j com.csse3200.game.events.EventHandler$$Lambda$100+0x00000008001ae9d0.accept(Ljava/lang/Object;)V+12 +j java.lang.Iterable.forEach(Ljava/util/function/Consumer;)V+30 java.base@17.0.7 +J 1963 c1 com.csse3200.game.events.EventHandler.forEachListener(Ljava/lang/String;Ljava/util/function/Consumer;)V (25 bytes) @ 0x000001990712c3d4 [0x000001990712c0e0+0x00000000000002f4] +j com.csse3200.game.events.EventHandler.trigger(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V+13 +j com.csse3200.game.physics.PhysicsContactListener.triggerEventOn(Lcom/badlogic/gdx/physics/box2d/Fixture;Ljava/lang/String;Lcom/badlogic/gdx/physics/box2d/Fixture;)V+52 +j com.csse3200.game.physics.PhysicsContactListener.endContact(Lcom/badlogic/gdx/physics/box2d/Contact;)V+25 +j com.badlogic.gdx.physics.box2d.World.endContact(J)V+23 +v ~StubRoutines::call_stub +j com.badlogic.gdx.physics.box2d.World.jniDestroyBody(JJ)V+0 +j com.badlogic.gdx.physics.box2d.World.destroyBody(Lcom/badlogic/gdx/physics/box2d/Body;)V+42 +j com.csse3200.game.physics.PhysicsEngine.destroyBody(Lcom/badlogic/gdx/physics/box2d/Body;)V+16 +j com.csse3200.game.physics.components.PhysicsComponent.dispose()V+8 +j com.csse3200.game.entities.Entity.dispose()V+22 +J 2280 c2 com.csse3200.game.entities.Entity.update()V (55 bytes) @ 0x000001990e95b0d0 [0x000001990e95ace0+0x00000000000003f0] +J 2167 c1 com.csse3200.game.entities.EntityService.update()V (39 bytes) @ 0x000001990717ef94 [0x000001990717ec20+0x0000000000000374] +j com.csse3200.game.screens.MainGameScreen.render(F)V+10 +J 2295 c1 com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update()Z (217 bytes) @ 0x00000199071b88fc [0x00000199071b7b80+0x0000000000000d7c] +j com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop()V+111 +j com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.(Lcom/badlogic/gdx/ApplicationListener;Lcom/badlogic/gdx/backends/lwjgl3/Lwjgl3ApplicationConfiguration;)V+269 +j com.csse3200.game.desktop.DesktopLauncher.main([Ljava/lang/String;)V+19 +v ~StubRoutines::call_stub + +siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000003600000002 + + +Register to memory mapping: + +RIP=0x0000000055b4ba43 gdx-box2d64.dll +RAX=0x0000000055b8f060 gdx-box2d64.dll +RBX=0x0000003600000002 is an unknown value +RCX=0x00000199299b04e0 points into unknown readable memory: 0x000001992fb30080 | 80 00 b3 2f 99 01 00 00 +RDX=0x00000000000000b8 is an unknown value +RSP=0x00000070b61fdfb0 is pointing into the stack for thread: 0x00000199029352f0 +RBP=0x00000199299b0510 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 +RSI=0x00000199299b04e0 points into unknown readable memory: 0x000001992fb30080 | 80 00 b3 2f 99 01 00 00 +RDI=0x0000000000000148 is an unknown value +R8 =0x00000199299b04e0 points into unknown readable memory: 0x000001992fb30080 | 80 00 b3 2f 99 01 00 00 +R9 =0x0000000000000002 is an unknown value +R10=0x0000000000000001 is an unknown value +R11=0x0000000000000001 is an unknown value +R12=0x0000000000000006 is an unknown value +R13={method} {0x0000019923dac578} 'jniCreateBody' '(JIFFFFFFFFZZZZZF)J' in 'com/badlogic/gdx/physics/box2d/World' +R14=0x00000070b61fe280 is pointing into the stack for thread: 0x00000199029352f0 +R15=0x00000199029352f0 is a thread + + +Registers: +RAX=0x0000000055b8f060, RBX=0x0000003600000002, RCX=0x00000199299b04e0, RDX=0x00000000000000b8 +RSP=0x00000070b61fdfb0, RBP=0x00000199299b0510, RSI=0x00000199299b04e0, RDI=0x0000000000000148 +R8 =0x00000199299b04e0, R9 =0x0000000000000002, R10=0x0000000000000001, R11=0x0000000000000001 +R12=0x0000000000000006, R13=0x0000019923dac570, R14=0x00000070b61fe280, R15=0x00000199029352f0 +RIP=0x0000000055b4ba43, EFLAGS=0x0000000000010202 + +Top of Stack: (sp=0x00000070b61fdfb0) +0x00000070b61fdfb0: 0000000000000020 00000199029352f0 +0x00000070b61fdfc0: 00000070b61fe0e0 00000070b61fdfc8 +0x00000070b61fdfd0: 0000019923dac570 00000199029352f0 +0x00000070b61fdfe0: 00007fff890a37f8 00000199299b04e0 +0x00000070b61fdff0: 00000070b61fe090 0000000000000148 +0x00000070b61fe000: 00000070b61fe1d8 0000000000000000 +0x00000070b61fe010: 0000019923dac570 0000000055b60e22 +0x00000070b61fe020: 00000070b61fe1f0 00000070b61fe170 +0x00000070b61fe030: 00000070b61fe0d0 00000070b61fe0d0 +0x00000070b61fe040: 0000007000000003 0000019923dac570 +0x00000070b61fe050: 00000199029352f0 0000000000000001 +0x00000070b61fe060: 0000019923ddc500 0000000055b666e6 +0x00000070b61fe070: 00000199029352f0 00000070b61fe280 +0x00000070b61fe080: 00000070b61fe1d8 000001990e2a8f0b +0x00000070b61fe090: 0000000000000002 0000000000000000 +0x00000070b61fe0a0: 0000000000000000 40a0000000000000 + +Instructions: (pc=0x0000000055b4ba43) +0x0000000055b4b943: f6 48 8d 2d b5 16 03 00 48 8d 3d 0e 37 04 00 4c +0x0000000055b4b953: 8d 2d f7 31 03 00 4c 8d 25 55 32 03 00 eb 1a 83 +0x0000000055b4b963: fe 0d 7e 11 41 b8 49 00 00 00 4c 89 ea 4c 89 e1 +0x0000000055b4b973: e8 18 82 02 00 48 83 c3 01 48 63 c6 39 5c 85 00 +0x0000000055b4b983: 7d 03 83 c6 01 48 81 fb 80 02 00 00 40 88 34 1f +0x0000000055b4b993: 75 cd c6 05 a4 36 04 00 01 48 83 c4 28 5b 5e 5f +0x0000000055b4b9a3: 5d 41 5c 41 5d c3 90 66 0f 1f 44 00 00 57 56 53 +0x0000000055b4b9b3: 48 83 ec 20 8b 41 08 48 89 cf 85 c0 7e 1d 31 f6 +0x0000000055b4b9c3: 31 db 48 8b 07 83 c3 01 48 8b 4c 30 08 48 83 c6 +0x0000000055b4b9d3: 10 e8 a7 08 00 00 39 5f 08 7f e7 48 8b 0f 48 83 +0x0000000055b4b9e3: c4 20 5b 5e 5f e9 93 08 00 00 90 66 90 41 55 41 +0x0000000055b4b9f3: 54 55 57 56 53 48 83 ec 38 48 63 da 48 89 ce 83 +0x0000000055b4ba03: fb 00 0f 84 95 01 00 00 0f 8e 6f 01 00 00 81 fb +0x0000000055b4ba13: 80 02 00 00 0f 8f 23 01 00 00 48 8d 05 3c 36 04 +0x0000000055b4ba23: 00 44 0f b6 24 18 41 80 fc 0d 4c 89 e3 0f 87 da +0x0000000055b4ba33: 00 00 00 48 8d 2c de 48 8b 5d 10 48 85 db 74 1d +0x0000000055b4ba43: 48 8b 03 48 89 45 10 48 89 d8 48 83 c4 38 5b 5e +0x0000000055b4ba53: 5f 5d 41 5c 41 5d c3 66 0f 1f 44 00 00 48 63 46 +0x0000000055b4ba63: 08 4c 8b 2e 3b 46 0c 0f 84 40 01 00 00 48 c1 e0 +0x0000000055b4ba73: 04 b9 00 40 00 00 4d 63 e4 49 8d 7c 05 00 e8 ea +0x0000000055b4ba83: 07 00 00 48 89 c3 48 89 47 08 48 8d 05 6c 15 03 +0x0000000055b4ba93: 00 46 8b 24 a0 b8 00 40 00 00 99 41 f7 fc 45 89 +0x0000000055b4baa3: e5 44 89 27 44 0f af e8 41 81 fd 00 40 00 00 0f +0x0000000055b4bab3: 8f 9b 00 00 00 83 f8 01 7e 23 49 63 d4 83 e8 01 +0x0000000055b4bac3: 45 31 c0 49 89 d1 48 8d 0c 13 49 f7 d9 41 83 c0 +0x0000000055b4bad3: 01 4a 89 0c 09 48 01 d1 41 39 c0 75 f0 45 29 e5 +0x0000000055b4bae3: 4d 63 ed 4a c7 04 2b 00 00 00 00 48 8b 03 48 89 +0x0000000055b4baf3: 45 10 83 46 08 01 48 89 d8 48 83 c4 38 5b 5e 5f +0x0000000055b4bb03: 5d 41 5c 41 5d c3 0f 1f 80 00 00 00 00 48 8d 15 +0x0000000055b4bb13: 39 30 03 00 48 8d 0d b2 30 03 00 48 8d 2c de 41 +0x0000000055b4bb23: b8 70 00 00 00 e8 63 80 02 00 48 8b 5d 10 48 85 +0x0000000055b4bb33: db 0f 85 09 ff ff ff e9 21 ff ff ff 90 89 d9 48 + + +Stack slot to memory mapping: +stack at sp + 0 slots: 0x0000000000000020 is an unknown value +stack at sp + 1 slots: 0x00000199029352f0 is a thread +stack at sp + 2 slots: 0x00000070b61fe0e0 is pointing into the stack for thread: 0x00000199029352f0 +stack at sp + 3 slots: 0x00000070b61fdfc8 is pointing into the stack for thread: 0x00000199029352f0 +stack at sp + 4 slots: {method} {0x0000019923dac578} 'jniCreateBody' '(JIFFFFFFFFZZZZZF)J' in 'com/badlogic/gdx/physics/box2d/World' +stack at sp + 5 slots: 0x00000199029352f0 is a thread +stack at sp + 6 slots: 0x00007fff890a37f8 jvm.dll +stack at sp + 7 slots: 0x00000199299b04e0 points into unknown readable memory: 0x000001992fb30080 | 80 00 b3 2f 99 01 00 00 + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000019945829930, length=15, elements={ +0x00000199029352f0, 0x000001992289c270, 0x000001992289d5c0, 0x00000199228b4cf0, +0x00000199228b56a0, 0x00000199228b6050, 0x00000199228b6a00, 0x00000199228d4710, +0x00000199228d60d0, 0x00000199228d9ba0, 0x0000019922a54540, 0x0000019922a5c400, +0x00000199282ebcb0, 0x0000019928308e50, 0x000001992848ee40 +} + +Java Threads: ( => current thread ) +=>0x00000199029352f0 JavaThread "main" [_thread_in_native, id=944, stack(0x00000070b6100000,0x00000070b6200000)] + 0x000001992289c270 JavaThread "Reference Handler" daemon [_thread_blocked, id=11072, stack(0x00000070b6800000,0x00000070b6900000)] + 0x000001992289d5c0 JavaThread "Finalizer" daemon [_thread_blocked, id=22304, stack(0x00000070b6900000,0x00000070b6a00000)] + 0x00000199228b4cf0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=38084, stack(0x00000070b6a00000,0x00000070b6b00000)] + 0x00000199228b56a0 JavaThread "Attach Listener" daemon [_thread_blocked, id=36756, stack(0x00000070b6b00000,0x00000070b6c00000)] + 0x00000199228b6050 JavaThread "Service Thread" daemon [_thread_blocked, id=9528, stack(0x00000070b6c00000,0x00000070b6d00000)] + 0x00000199228b6a00 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=6752, stack(0x00000070b6d00000,0x00000070b6e00000)] + 0x00000199228d4710 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=29964, stack(0x00000070b6e00000,0x00000070b6f00000)] + 0x00000199228d60d0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=26296, stack(0x00000070b6f00000,0x00000070b7000000)] + 0x00000199228d9ba0 JavaThread "Sweeper thread" daemon [_thread_blocked, id=22916, stack(0x00000070b7000000,0x00000070b7100000)] + 0x0000019922a54540 JavaThread "Notification Thread" daemon [_thread_blocked, id=42676, stack(0x00000070b7100000,0x00000070b7200000)] + 0x0000019922a5c400 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=36360, stack(0x00000070b7300000,0x00000070b7400000)] + 0x00000199282ebcb0 JavaThread "AssetManager" daemon [_thread_blocked, id=3208, stack(0x00000070b7e00000,0x00000070b7f00000)] + 0x0000019928308e50 JavaThread "LWJGL3 Timer" daemon [_thread_blocked, id=6460, stack(0x00000070b7d00000,0x00000070b7e00000)] + 0x000001992848ee40 JavaThread "AssetManager" daemon [_thread_blocked, id=9240, stack(0x00000070b8600000,0x00000070b8700000)] + +Other Threads: + 0x000001992284de30 VMThread "VM Thread" [stack: 0x00000070b6700000,0x00000070b6800000] [id=10960] + 0x00000199029c0db0 WatcherThread [stack: 0x00000070b7200000,0x00000070b7300000] [id=27932] + 0x00000199029a8220 GCTaskThread "GC Thread#0" [stack: 0x00000070b6200000,0x00000070b6300000] [id=14644] + 0x00000199282ee260 GCTaskThread "GC Thread#1" [stack: 0x00000070b7f00000,0x00000070b8000000] [id=23820] + 0x0000019928362920 GCTaskThread "GC Thread#2" [stack: 0x00000070b8000000,0x00000070b8100000] [id=29132] + 0x0000019928362bd0 GCTaskThread "GC Thread#3" [stack: 0x00000070b8100000,0x00000070b8200000] [id=25340] + 0x0000019928173090 GCTaskThread "GC Thread#4" [stack: 0x00000070b8200000,0x00000070b8300000] [id=20448] + 0x0000019928174b70 GCTaskThread "GC Thread#5" [stack: 0x00000070b8300000,0x00000070b8400000] [id=39288] + 0x0000019928173b50 GCTaskThread "GC Thread#6" [stack: 0x00000070b8400000,0x00000070b8500000] [id=29680] + 0x0000019928173e00 GCTaskThread "GC Thread#7" [stack: 0x00000070b8500000,0x00000070b8600000] [id=16976] + 0x00000199029b8e40 ConcurrentGCThread "G1 Main Marker" [stack: 0x00000070b6300000,0x00000070b6400000] [id=41492] + 0x00000199029b9850 ConcurrentGCThread "G1 Conc#0" [stack: 0x00000070b6400000,0x00000070b6500000] [id=24708] + 0x00000199226e4660 ConcurrentGCThread "G1 Refine#0" [stack: 0x00000070b6500000,0x00000070b6600000] [id=9124] + 0x00000199226e5f30 ConcurrentGCThread "G1 Service" [stack: 0x00000070b6600000,0x00000070b6700000] [id=40108] + +Threads with active compile tasks: + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap address: 0x0000000704800000, size: 4024 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) not mapped +Compressed class space mapped at: 0x0000000800000000-0x0000000840000000, reserved size: 1073741824 +Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x40000000 + +GC Precious Log: + CPUs: 8 total, 8 available + Memory: 16090M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 252M + Heap Max Capacity: 4024M + Pre-touch: Disabled + Parallel Workers: 8 + Concurrent Workers: 2 + Concurrent Refinement Workers: 8 + Periodic GC: Disabled + +Heap: + garbage-first heap total 258048K, used 78331K [0x0000000704800000, 0x0000000800000000) + region size 2048K, 9 young (18432K), 1 survivors (2048K) + Metaspace used 16809K, committed 17024K, reserved 1114112K + class space used 1554K, committed 1664K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, OA=open archive, CA=closed archive, TAMS=top-at-mark-start (previous, next) +| 0|0x0000000704800000, 0x0000000704a00000, 0x0000000704a00000|100%|HS| |TAMS 0x0000000704800000, 0x0000000704800000| Complete +| 1|0x0000000704a00000, 0x0000000704c00000, 0x0000000704c00000|100%|HC| |TAMS 0x0000000704a00000, 0x0000000704a00000| Complete +| 2|0x0000000704c00000, 0x0000000704e00000, 0x0000000704e00000|100%|HC| |TAMS 0x0000000704c00000, 0x0000000704c00000| Complete +| 3|0x0000000704e00000, 0x0000000705000000, 0x0000000705000000|100%|HC| |TAMS 0x0000000704e00000, 0x0000000704e00000| Complete +| 4|0x0000000705000000, 0x0000000705200000, 0x0000000705200000|100%|HC| |TAMS 0x0000000705000000, 0x0000000705000000| Complete +| 5|0x0000000705200000, 0x0000000705400000, 0x0000000705400000|100%|HC| |TAMS 0x0000000705200000, 0x0000000705200000| Complete +| 6|0x0000000705400000, 0x0000000705600000, 0x0000000705600000|100%|HC| |TAMS 0x0000000705400000, 0x0000000705400000| Complete +| 7|0x0000000705600000, 0x0000000705800000, 0x0000000705800000|100%|HC| |TAMS 0x0000000705600000, 0x0000000705600000| Complete +| 8|0x0000000705800000, 0x0000000705a00000, 0x0000000705a00000|100%|HC| |TAMS 0x0000000705800000, 0x0000000705800000| Complete +| 9|0x0000000705a00000, 0x0000000705c00000, 0x0000000705c00000|100%|HC| |TAMS 0x0000000705a00000, 0x0000000705a00000| Complete +| 10|0x0000000705c00000, 0x0000000705e00000, 0x0000000705e00000|100%|HC| |TAMS 0x0000000705c00000, 0x0000000705c00000| Complete +| 11|0x0000000705e00000, 0x0000000706000000, 0x0000000706000000|100%|HC| |TAMS 0x0000000705e00000, 0x0000000705e00000| Complete +| 12|0x0000000706000000, 0x0000000706200000, 0x0000000706200000|100%|HC| |TAMS 0x0000000706000000, 0x0000000706000000| Complete +| 13|0x0000000706200000, 0x0000000706400000, 0x0000000706400000|100%|HC| |TAMS 0x0000000706200000, 0x0000000706200000| Complete +| 14|0x0000000706400000, 0x0000000706600000, 0x0000000706600000|100%|HC| |TAMS 0x0000000706400000, 0x0000000706400000| Complete +| 15|0x0000000706600000, 0x0000000706800000, 0x0000000706800000|100%|HC| |TAMS 0x0000000706600000, 0x0000000706600000| Complete +| 16|0x0000000706800000, 0x0000000706a00000, 0x0000000706a00000|100%|HC| |TAMS 0x0000000706800000, 0x0000000706800000| Complete +| 17|0x0000000706a00000, 0x0000000706c00000, 0x0000000706c00000|100%|HC| |TAMS 0x0000000706a00000, 0x0000000706a00000| Complete +| 18|0x0000000706c00000, 0x0000000706e00000, 0x0000000706e00000|100%|HC| |TAMS 0x0000000706c00000, 0x0000000706c00000| Complete +| 19|0x0000000706e00000, 0x0000000707000000, 0x0000000707000000|100%|HC| |TAMS 0x0000000706e00000, 0x0000000706e00000| Complete +| 20|0x0000000707000000, 0x0000000707200000, 0x0000000707200000|100%|HC| |TAMS 0x0000000707000000, 0x0000000707000000| Complete +| 21|0x0000000707200000, 0x0000000707400000, 0x0000000707400000|100%|HC| |TAMS 0x0000000707200000, 0x0000000707200000| Complete +| 22|0x0000000707400000, 0x0000000707600000, 0x0000000707600000|100%|HC| |TAMS 0x0000000707400000, 0x0000000707400000| Complete +| 23|0x0000000707600000, 0x0000000707800000, 0x0000000707800000|100%|HC| |TAMS 0x0000000707600000, 0x0000000707600000| Complete +| 24|0x0000000707800000, 0x0000000707a00000, 0x0000000707a00000|100%|HC| |TAMS 0x0000000707800000, 0x0000000707800000| Complete +| 25|0x0000000707a00000, 0x0000000707c00000, 0x0000000707c00000|100%|HC| |TAMS 0x0000000707a00000, 0x0000000707a00000| Complete +| 26|0x0000000707c00000, 0x0000000707e00000, 0x0000000707e00000|100%|HC| |TAMS 0x0000000707c00000, 0x0000000707c00000| Complete +| 27|0x0000000707e00000, 0x0000000708000000, 0x0000000708000000|100%|HC| |TAMS 0x0000000707e00000, 0x0000000707e00000| Complete +| 28|0x0000000708000000, 0x0000000708200000, 0x0000000708200000|100%|HC| |TAMS 0x0000000708000000, 0x0000000708000000| Complete +| 29|0x0000000708200000, 0x0000000708400000, 0x0000000708400000|100%|HC| |TAMS 0x0000000708200000, 0x0000000708200000| Complete +| 30|0x0000000708400000, 0x0000000708600000, 0x0000000708600000|100%| O| |TAMS 0x0000000708400000, 0x0000000708400000| Untracked +| 31|0x0000000708600000, 0x0000000708760400, 0x0000000708800000| 68%| O| |TAMS 0x0000000708600000, 0x0000000708600000| Untracked +| 32|0x0000000708800000, 0x0000000708800000, 0x0000000708a00000| 0%| F| |TAMS 0x0000000708800000, 0x0000000708800000| Untracked +| 33|0x0000000708a00000, 0x0000000708a00000, 0x0000000708c00000| 0%| F| |TAMS 0x0000000708a00000, 0x0000000708a00000| Untracked +| 34|0x0000000708c00000, 0x0000000708c00000, 0x0000000708e00000| 0%| F| |TAMS 0x0000000708c00000, 0x0000000708c00000| Untracked +| 35|0x0000000708e00000, 0x0000000708e00000, 0x0000000709000000| 0%| F| |TAMS 0x0000000708e00000, 0x0000000708e00000| Untracked +| 36|0x0000000709000000, 0x0000000709000000, 0x0000000709200000| 0%| F| |TAMS 0x0000000709000000, 0x0000000709000000| Untracked +| 37|0x0000000709200000, 0x0000000709200000, 0x0000000709400000| 0%| F| |TAMS 0x0000000709200000, 0x0000000709200000| Untracked +| 38|0x0000000709400000, 0x0000000709400000, 0x0000000709600000| 0%| F| |TAMS 0x0000000709400000, 0x0000000709400000| Untracked +| 39|0x0000000709600000, 0x0000000709600000, 0x0000000709800000| 0%| F| |TAMS 0x0000000709600000, 0x0000000709600000| Untracked +| 40|0x0000000709800000, 0x0000000709800000, 0x0000000709a00000| 0%| F| |TAMS 0x0000000709800000, 0x0000000709800000| Untracked +| 41|0x0000000709a00000, 0x0000000709a00000, 0x0000000709c00000| 0%| F| |TAMS 0x0000000709a00000, 0x0000000709a00000| Untracked +| 42|0x0000000709c00000, 0x0000000709c00000, 0x0000000709e00000| 0%| F| |TAMS 0x0000000709c00000, 0x0000000709c00000| Untracked +| 43|0x0000000709e00000, 0x0000000709e00000, 0x000000070a000000| 0%| F| |TAMS 0x0000000709e00000, 0x0000000709e00000| Untracked +| 44|0x000000070a000000, 0x000000070a000000, 0x000000070a200000| 0%| F| |TAMS 0x000000070a000000, 0x000000070a000000| Untracked +| 45|0x000000070a200000, 0x000000070a200000, 0x000000070a400000| 0%| F| |TAMS 0x000000070a200000, 0x000000070a200000| Untracked +| 46|0x000000070a400000, 0x000000070a400000, 0x000000070a600000| 0%| F| |TAMS 0x000000070a400000, 0x000000070a400000| Untracked +| 47|0x000000070a600000, 0x000000070a600000, 0x000000070a800000| 0%| F| |TAMS 0x000000070a600000, 0x000000070a600000| Untracked +| 48|0x000000070a800000, 0x000000070a800000, 0x000000070aa00000| 0%| F| |TAMS 0x000000070a800000, 0x000000070a800000| Untracked +| 49|0x000000070aa00000, 0x000000070aa00000, 0x000000070ac00000| 0%| F| |TAMS 0x000000070aa00000, 0x000000070aa00000| Untracked +| 50|0x000000070ac00000, 0x000000070ac00000, 0x000000070ae00000| 0%| F| |TAMS 0x000000070ac00000, 0x000000070ac00000| Untracked +| 51|0x000000070ae00000, 0x000000070ae00000, 0x000000070b000000| 0%| F| |TAMS 0x000000070ae00000, 0x000000070ae00000| Untracked +| 52|0x000000070b000000, 0x000000070b000000, 0x000000070b200000| 0%| F| |TAMS 0x000000070b000000, 0x000000070b000000| Untracked +| 53|0x000000070b200000, 0x000000070b200000, 0x000000070b400000| 0%| F| |TAMS 0x000000070b200000, 0x000000070b200000| Untracked +| 54|0x000000070b400000, 0x000000070b400000, 0x000000070b600000| 0%| F| |TAMS 0x000000070b400000, 0x000000070b400000| Untracked +| 55|0x000000070b600000, 0x000000070b600000, 0x000000070b800000| 0%| F| |TAMS 0x000000070b600000, 0x000000070b600000| Untracked +| 56|0x000000070b800000, 0x000000070b800000, 0x000000070ba00000| 0%| F| |TAMS 0x000000070b800000, 0x000000070b800000| Untracked +| 57|0x000000070ba00000, 0x000000070ba00000, 0x000000070bc00000| 0%| F| |TAMS 0x000000070ba00000, 0x000000070ba00000| Untracked +| 58|0x000000070bc00000, 0x000000070bc00000, 0x000000070be00000| 0%| F| |TAMS 0x000000070bc00000, 0x000000070bc00000| Untracked +| 59|0x000000070be00000, 0x000000070be00000, 0x000000070c000000| 0%| F| |TAMS 0x000000070be00000, 0x000000070be00000| Untracked +| 60|0x000000070c000000, 0x000000070c000000, 0x000000070c200000| 0%| F| |TAMS 0x000000070c000000, 0x000000070c000000| Untracked +| 61|0x000000070c200000, 0x000000070c200000, 0x000000070c400000| 0%| F| |TAMS 0x000000070c200000, 0x000000070c200000| Untracked +| 62|0x000000070c400000, 0x000000070c400000, 0x000000070c600000| 0%| F| |TAMS 0x000000070c400000, 0x000000070c400000| Untracked +| 63|0x000000070c600000, 0x000000070c600000, 0x000000070c800000| 0%| F| |TAMS 0x000000070c600000, 0x000000070c600000| Untracked +| 64|0x000000070c800000, 0x000000070c800000, 0x000000070ca00000| 0%| F| |TAMS 0x000000070c800000, 0x000000070c800000| Untracked +| 65|0x000000070ca00000, 0x000000070ca00000, 0x000000070cc00000| 0%| F| |TAMS 0x000000070ca00000, 0x000000070ca00000| Untracked +| 66|0x000000070cc00000, 0x000000070cc00000, 0x000000070ce00000| 0%| F| |TAMS 0x000000070cc00000, 0x000000070cc00000| Untracked +| 67|0x000000070ce00000, 0x000000070ce00000, 0x000000070d000000| 0%| F| |TAMS 0x000000070ce00000, 0x000000070ce00000| Untracked +| 68|0x000000070d000000, 0x000000070d000000, 0x000000070d200000| 0%| F| |TAMS 0x000000070d000000, 0x000000070d000000| Untracked +| 69|0x000000070d200000, 0x000000070d200000, 0x000000070d400000| 0%| F| |TAMS 0x000000070d200000, 0x000000070d200000| Untracked +| 70|0x000000070d400000, 0x000000070d400000, 0x000000070d600000| 0%| F| |TAMS 0x000000070d400000, 0x000000070d400000| Untracked +| 71|0x000000070d600000, 0x000000070d600000, 0x000000070d800000| 0%| F| |TAMS 0x000000070d600000, 0x000000070d600000| Untracked +| 72|0x000000070d800000, 0x000000070d800000, 0x000000070da00000| 0%| F| |TAMS 0x000000070d800000, 0x000000070d800000| Untracked +| 73|0x000000070da00000, 0x000000070da00000, 0x000000070dc00000| 0%| F| |TAMS 0x000000070da00000, 0x000000070da00000| Untracked +| 74|0x000000070dc00000, 0x000000070dc00000, 0x000000070de00000| 0%| F| |TAMS 0x000000070dc00000, 0x000000070dc00000| Untracked +| 75|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000, 0x000000070de00000| Untracked +| 76|0x000000070e000000, 0x000000070e000000, 0x000000070e200000| 0%| F| |TAMS 0x000000070e000000, 0x000000070e000000| Untracked +| 77|0x000000070e200000, 0x000000070e200000, 0x000000070e400000| 0%| F| |TAMS 0x000000070e200000, 0x000000070e200000| Untracked +| 78|0x000000070e400000, 0x000000070e400000, 0x000000070e600000| 0%| F| |TAMS 0x000000070e400000, 0x000000070e400000| Untracked +| 79|0x000000070e600000, 0x000000070e600000, 0x000000070e800000| 0%| F| |TAMS 0x000000070e600000, 0x000000070e600000| Untracked +| 80|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000, 0x000000070e800000| Untracked +| 81|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000, 0x000000070ea00000| Untracked +| 82|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000, 0x000000070ec00000| Untracked +| 83|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000, 0x000000070ee00000| Untracked +| 84|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000, 0x000000070f000000| Untracked +| 85|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000, 0x000000070f200000| Untracked +| 86|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000, 0x000000070f400000| Untracked +| 87|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000, 0x000000070f600000| Untracked +| 88|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000, 0x000000070f800000| Untracked +| 89|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000, 0x000000070fa00000| Untracked +| 90|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000, 0x000000070fc00000| Untracked +| 91|0x000000070fe00000, 0x000000070fe00000, 0x0000000710000000| 0%| F| |TAMS 0x000000070fe00000, 0x000000070fe00000| Untracked +| 92|0x0000000710000000, 0x0000000710000000, 0x0000000710200000| 0%| F| |TAMS 0x0000000710000000, 0x0000000710000000| Untracked +| 93|0x0000000710200000, 0x0000000710200000, 0x0000000710400000| 0%| F| |TAMS 0x0000000710200000, 0x0000000710200000| Untracked +| 94|0x0000000710400000, 0x0000000710400000, 0x0000000710600000| 0%| F| |TAMS 0x0000000710400000, 0x0000000710400000| Untracked +| 95|0x0000000710600000, 0x0000000710600000, 0x0000000710800000| 0%| F| |TAMS 0x0000000710600000, 0x0000000710600000| Untracked +| 96|0x0000000710800000, 0x0000000710800000, 0x0000000710a00000| 0%| F| |TAMS 0x0000000710800000, 0x0000000710800000| Untracked +| 97|0x0000000710a00000, 0x0000000710a00000, 0x0000000710c00000| 0%| F| |TAMS 0x0000000710a00000, 0x0000000710a00000| Untracked +| 98|0x0000000710c00000, 0x0000000710c00000, 0x0000000710e00000| 0%| F| |TAMS 0x0000000710c00000, 0x0000000710c00000| Untracked +| 99|0x0000000710e00000, 0x0000000710e00000, 0x0000000711000000| 0%| F| |TAMS 0x0000000710e00000, 0x0000000710e00000| Untracked +| 100|0x0000000711000000, 0x0000000711000000, 0x0000000711200000| 0%| F| |TAMS 0x0000000711000000, 0x0000000711000000| Untracked +| 101|0x0000000711200000, 0x0000000711200000, 0x0000000711400000| 0%| F| |TAMS 0x0000000711200000, 0x0000000711200000| Untracked +| 102|0x0000000711400000, 0x0000000711400000, 0x0000000711600000| 0%| F| |TAMS 0x0000000711400000, 0x0000000711400000| Untracked +| 103|0x0000000711600000, 0x0000000711600000, 0x0000000711800000| 0%| F| |TAMS 0x0000000711600000, 0x0000000711600000| Untracked +| 104|0x0000000711800000, 0x0000000711800000, 0x0000000711a00000| 0%| F| |TAMS 0x0000000711800000, 0x0000000711800000| Untracked +| 105|0x0000000711a00000, 0x0000000711a00000, 0x0000000711c00000| 0%| F| |TAMS 0x0000000711a00000, 0x0000000711a00000| Untracked +| 106|0x0000000711c00000, 0x0000000711c00000, 0x0000000711e00000| 0%| F| |TAMS 0x0000000711c00000, 0x0000000711c00000| Untracked +| 107|0x0000000711e00000, 0x0000000711e00000, 0x0000000712000000| 0%| F| |TAMS 0x0000000711e00000, 0x0000000711e00000| Untracked +| 108|0x0000000712000000, 0x0000000712000000, 0x0000000712200000| 0%| F| |TAMS 0x0000000712000000, 0x0000000712000000| Untracked +| 109|0x0000000712200000, 0x0000000712200000, 0x0000000712400000| 0%| F| |TAMS 0x0000000712200000, 0x0000000712200000| Untracked +| 110|0x0000000712400000, 0x0000000712400000, 0x0000000712600000| 0%| F| |TAMS 0x0000000712400000, 0x0000000712400000| Untracked +| 111|0x0000000712600000, 0x0000000712600000, 0x0000000712800000| 0%| F| |TAMS 0x0000000712600000, 0x0000000712600000| Untracked +| 112|0x0000000712800000, 0x0000000712800000, 0x0000000712a00000| 0%| F| |TAMS 0x0000000712800000, 0x0000000712800000| Untracked +| 113|0x0000000712a00000, 0x0000000712a00000, 0x0000000712c00000| 0%| F| |TAMS 0x0000000712a00000, 0x0000000712a00000| Untracked +| 114|0x0000000712c00000, 0x0000000712c00000, 0x0000000712e00000| 0%| F| |TAMS 0x0000000712c00000, 0x0000000712c00000| Untracked +| 115|0x0000000712e00000, 0x0000000712e00000, 0x0000000713000000| 0%| F| |TAMS 0x0000000712e00000, 0x0000000712e00000| Untracked +| 116|0x0000000713000000, 0x0000000713000000, 0x0000000713200000| 0%| F| |TAMS 0x0000000713000000, 0x0000000713000000| Untracked +| 117|0x0000000713200000, 0x0000000713300800, 0x0000000713400000| 50%| E| |TAMS 0x0000000713200000, 0x0000000713200000| Complete +| 118|0x0000000713400000, 0x0000000713600000, 0x0000000713600000|100%| E|CS|TAMS 0x0000000713400000, 0x0000000713400000| Complete +| 119|0x0000000713600000, 0x000000071371ea70, 0x0000000713800000| 55%| S|CS|TAMS 0x0000000713600000, 0x0000000713600000| Complete +| 120|0x0000000713800000, 0x0000000713a00000, 0x0000000713a00000|100%| E|CS|TAMS 0x0000000713800000, 0x0000000713800000| Complete +| 121|0x0000000713a00000, 0x0000000713c00000, 0x0000000713c00000|100%| E| |TAMS 0x0000000713a00000, 0x0000000713a00000| Complete +| 122|0x0000000713c00000, 0x0000000713e00000, 0x0000000713e00000|100%| E|CS|TAMS 0x0000000713c00000, 0x0000000713c00000| Complete +| 123|0x0000000713e00000, 0x0000000714000000, 0x0000000714000000|100%| E|CS|TAMS 0x0000000713e00000, 0x0000000713e00000| Complete +| 124|0x0000000714000000, 0x0000000714200000, 0x0000000714200000|100%| E|CS|TAMS 0x0000000714000000, 0x0000000714000000| Complete +| 125|0x0000000714200000, 0x0000000714400000, 0x0000000714400000|100%| E|CS|TAMS 0x0000000714200000, 0x0000000714200000| Complete + +Card table byte_map: [0x0000019916fc0000,0x00000199177a0000] _byte_map_base: 0x000001991379c000 + +Marking Bits (Prev, Next): (CMBitMap*) 0x00000199029a8830, (CMBitMap*) 0x00000199029a8870 + Prev Bits: [0x0000019917f80000, 0x000001991be60000) + Next Bits: [0x000001991be60000, 0x000001991fd40000) + +Polling page: 0x0000019906d50000 + +Metaspace: + +Usage: + Non-class: 14.90 MB used. + Class: 1.52 MB used. + Both: 16.42 MB used. + +Virtual space: + Non-class space: 64.00 MB reserved, 15.00 MB ( 23%) committed, 1 nodes. + Class space: 1.00 GB reserved, 1.62 MB ( <1%) committed, 1 nodes. + Both: 1.06 GB reserved, 16.62 MB ( 2%) committed. + +Chunk freelists: + Non-Class: 1.05 MB + Class: 14.29 MB + Both: 15.34 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 21.00 MB +CDS: off +MetaspaceReclaimPolicy: balanced + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - new_chunks_are_fully_committed: 0. + - uncommit_free_chunks: 1. + - use_allocation_guard: 0. + - handle_deallocations: 1. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 140. +num_arena_deaths: 0. +num_vsnodes_births: 2. +num_vsnodes_deaths: 0. +num_space_committed: 264. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 439. +num_chunk_merges: 0. +num_chunk_splits: 304. +num_chunks_enlarged: 246. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120000Kb used=1135Kb max_used=1135Kb free=118864Kb + bounds [0x000001990e840000, 0x000001990eab0000, 0x0000019915d70000] +CodeHeap 'profiled nmethods': size=120000Kb used=4399Kb max_used=4399Kb free=115600Kb + bounds [0x0000019906d70000, 0x00000199071c0000, 0x000001990e2a0000] +CodeHeap 'non-nmethods': size=5760Kb used=1666Kb max_used=1692Kb free=4093Kb + bounds [0x000001990e2a0000, 0x000001990e510000, 0x000001990e840000] + total_blobs=3396 nmethods=2301 adapters=1007 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 14.417 Thread 0x00000199228d60d0 2293 3 com.badlogic.gdx.scenes.scene2d.Stage::act (18 bytes) +Event: 14.417 Thread 0x00000199228d60d0 nmethod 2293 0x00000199071b6c10 code [0x00000199071b6de0, 0x00000199071b6ff8] +Event: 14.431 Thread 0x00000199228d60d0 2294 3 com.badlogic.gdx.backends.lwjgl3.audio.OpenALLwjgl3Audio::update (43 bytes) +Event: 14.432 Thread 0x00000199228d60d0 nmethod 2294 0x00000199071b7110 code [0x00000199071b72e0, 0x00000199071b7708] +Event: 14.433 Thread 0x00000199228d60d0 2295 ! 3 com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window::update (217 bytes) +Event: 14.435 Thread 0x00000199228d60d0 nmethod 2295 0x00000199071b7890 code [0x00000199071b7b80, 0x00000199071b8d68] +Event: 14.435 Thread 0x00000199228d60d0 2296 3 com.badlogic.gdx.backends.lwjgl3.DefaultLwjgl3Input::update (12 bytes) +Event: 14.435 Thread 0x00000199228d60d0 nmethod 2296 0x00000199071b9410 code [0x00000199071b95c0, 0x00000199071b9728] +Event: 14.435 Thread 0x00000199228d60d0 2297 3 com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window::shouldClose (8 bytes) +Event: 14.435 Thread 0x00000199228d60d0 nmethod 2297 0x00000199071b9810 code [0x00000199071b99a0, 0x00000199071b9ae8] +Event: 14.499 Thread 0x00000199228d60d0 2298 3 com.badlogic.gdx.math.Affine2::preMul (170 bytes) +Event: 14.500 Thread 0x00000199228d60d0 nmethod 2298 0x00000199071b9b90 code [0x00000199071b9d20, 0x00000199071b9ef8] +Event: 14.532 Thread 0x00000199228d60d0 2299 3 com.csse3200.game.entities.Entity::getComponent (20 bytes) +Event: 14.533 Thread 0x00000199228d60d0 nmethod 2299 0x00000199071ba010 code [0x00000199071ba220, 0x00000199071baa88] +Event: 14.533 Thread 0x00000199228d60d0 2300 3 com.badlogic.gdx.utils.IntMap::put (116 bytes) +Event: 14.534 Thread 0x00000199228d60d0 nmethod 2300 0x00000199071bad10 code [0x00000199071baf00, 0x00000199071bb638] +Event: 14.548 Thread 0x00000199228d4710 2301 4 com.badlogic.gdx.utils.LongMap::locateKey (55 bytes) +Event: 14.551 Thread 0x00000199228d4710 nmethod 2301 0x000001990e95ba10 code [0x000001990e95bb80, 0x000001990e95bcb8] +Event: 14.552 Thread 0x00000199228d60d0 2302 3 sun.nio.cs.SingleByte$Encoder::encode (32 bytes) +Event: 14.552 Thread 0x00000199228d60d0 nmethod 2302 0x00000199071bb890 code [0x00000199071bba40, 0x00000199071bbc38] + +GC Heap History (4 events): +Event: 1.353 GC heap before +{Heap before GC invocations=0 (full 0): + garbage-first heap total 258048K, used 22528K [0x0000000704800000, 0x0000000800000000) + region size 2048K, 11 young (22528K), 0 survivors (0K) + Metaspace used 13708K, committed 13888K, reserved 1114112K + class space used 1242K, committed 1344K, reserved 1048576K +} +Event: 1.358 GC heap after +{Heap after GC invocations=1 (full 0): + garbage-first heap total 258048K, used 3632K [0x0000000704800000, 0x0000000800000000) + region size 2048K, 2 young (4096K), 2 survivors (4096K) + Metaspace used 13708K, committed 13888K, reserved 1114112K + class space used 1242K, committed 1344K, reserved 1048576K +} +Event: 7.019 GC heap before +{Heap before GC invocations=1 (full 0): + garbage-first heap total 258048K, used 73264K [0x0000000704800000, 0x0000000800000000) + region size 2048K, 8 young (16384K), 2 survivors (4096K) + Metaspace used 15049K, committed 15232K, reserved 1114112K + class space used 1378K, committed 1472K, reserved 1048576K +} +Event: 7.023 GC heap after +{Heap after GC invocations=2 (full 0): + garbage-first heap total 258048K, used 4603K [0x0000000704800000, 0x0000000800000000) + region size 2048K, 1 young (2048K), 1 survivors (2048K) + Metaspace used 15049K, committed 15232K, reserved 1114112K + class space used 1378K, committed 1472K, reserved 1048576K +} + +Dll operation events (10 events): +Event: 0.009 Loaded shared library C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\java.dll +Event: 0.172 Loaded shared library C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\net.dll +Event: 0.175 Loaded shared library C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\nio.dll +Event: 0.183 Loaded shared library C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\zip.dll +Event: 0.262 Loaded shared library C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\verify.dll +Event: 0.271 Loaded shared library C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\jimage.dll +Event: 0.342 Loaded shared library C:\Users\Jason\AppData\Local\Temp\libgdxJason\e787ab0a\gdx64.dll +Event: 0.414 Loaded shared library C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7\lwjgl.dll +Event: 0.949 Loaded shared library C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7\lwjgl_opengl.dll +Event: 2.346 Loaded shared library C:\Users\Jason\AppData\Local\Temp\libgdxJason\888fe1bc\gdx-box2d64.dll + +Deoptimization events (20 events): +Event: 11.419 Thread 0x00000199029352f0 DEOPT PACKING pc=0x00000199070e733f sp=0x00000070b61ff090 +Event: 11.419 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe538 mode 0 +Event: 11.419 Thread 0x00000199029352f0 DEOPT PACKING pc=0x00000199070e96bc sp=0x00000070b61fef70 +Event: 11.419 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe388 mode 0 +Event: 11.419 Thread 0x00000199029352f0 DEOPT PACKING pc=0x00000199070e6e54 sp=0x00000070b61ff090 +Event: 11.419 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe538 mode 0 +Event: 11.419 Thread 0x00000199029352f0 DEOPT PACKING pc=0x00000199070e96bc sp=0x00000070b61fef20 +Event: 11.419 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe338 mode 0 +Event: 11.420 Thread 0x00000199029352f0 DEOPT PACKING pc=0x00000199070e733f sp=0x00000070b61ff090 +Event: 11.420 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe538 mode 0 +Event: 11.420 Thread 0x00000199029352f0 DEOPT PACKING pc=0x00000199070f96af sp=0x00000070b61feff0 +Event: 11.420 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe458 mode 0 +Event: 11.420 Thread 0x00000199029352f0 DEOPT PACKING pc=0x00000199070e96bc sp=0x00000070b61feec0 +Event: 11.420 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe310 mode 0 +Event: 12.301 Thread 0x00000199029352f0 DEOPT PACKING pc=0x000001990713f4d4 sp=0x00000070b61ff0d0 +Event: 12.301 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2face3 sp=0x00000070b61fe4e8 mode 0 +Event: 13.532 Thread 0x00000199029352f0 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000001990e9368c8 relative=0x00000000000006e8 +Event: 13.532 Thread 0x00000199029352f0 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000001990e9368c8 method=com.csse3200.game.entities.Entity.update()V @ 46 c2 +Event: 13.532 Thread 0x00000199029352f0 DEOPT PACKING pc=0x000001990e9368c8 sp=0x00000070b61ff330 +Event: 13.532 Thread 0x00000199029352f0 DEOPT UNPACKING pc=0x000001990e2fa1a3 sp=0x00000070b61ff2e8 mode 2 + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 0.444 Thread 0x00000199029352f0 Exception (0x0000000713b6d358) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.444 Thread 0x00000199029352f0 Exception (0x0000000713b6d6e8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.466 Thread 0x00000199029352f0 Exception (0x000000071382f2e8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.466 Thread 0x00000199029352f0 Exception (0x000000071382f648) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.502 Thread 0x00000199029352f0 Exception (0x00000007138bf6f8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.502 Thread 0x00000199029352f0 Exception (0x00000007138bfa78) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.839 Thread 0x00000199029352f0 Exception (0x000000071390bdc0) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] +Event: 0.948 Thread 0x00000199029352f0 Exception (0x0000000713629478) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.948 Thread 0x00000199029352f0 Exception (0x0000000713629820) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.950 Thread 0x00000199029352f0 Exception (0x00000007136336f8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 0.950 Thread 0x00000199029352f0 Exception (0x00000007136339d8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 1.097 Thread 0x00000199029352f0 Exception (0x000000071355f330) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 256] +Event: 1.114 Thread 0x00000199029352f0 Exception (0x00000007135e0ff8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 516] +Event: 1.147 Thread 0x00000199029352f0 Exception (0x0000000713225a78) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] +Event: 1.148 Thread 0x00000199029352f0 Exception (0x000000071322fe98) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] +Event: 2.357 Thread 0x00000199029352f0 Exception (0x0000000713f1c8d0) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] +Event: 10.843 Thread 0x00000199029352f0 Exception (0x0000000713eabff0) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] +Event: 10.893 Thread 0x00000199029352f0 Exception (0x00000007134121c0) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] +Event: 11.001 Thread 0x00000199029352f0 Exception (0x000000071356a548) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] +Event: 11.004 Thread 0x00000199029352f0 Exception (0x0000000713574200) +thrown [s\src\hotspot\share\interpreter\linkResolver.cpp, line 759] + +VM Operations (20 events): +Event: 1.353 Executing VM operation: G1CollectForAllocation +Event: 1.358 Executing VM operation: G1CollectForAllocation done +Event: 1.424 Executing VM operation: HandshakeAllThreads +Event: 1.424 Executing VM operation: HandshakeAllThreads done +Event: 2.431 Executing VM operation: Cleanup +Event: 2.431 Executing VM operation: Cleanup done +Event: 6.599 Executing VM operation: HandshakeAllThreads +Event: 6.599 Executing VM operation: HandshakeAllThreads done +Event: 6.599 Executing VM operation: Cleanup +Event: 6.599 Executing VM operation: Cleanup done +Event: 7.019 Executing VM operation: G1TryInitiateConcMark +Event: 7.023 Executing VM operation: G1TryInitiateConcMark done +Event: 9.024 Executing VM operation: Cleanup +Event: 9.024 Executing VM operation: Cleanup done +Event: 11.025 Executing VM operation: Cleanup +Event: 11.025 Executing VM operation: Cleanup done +Event: 12.025 Executing VM operation: Cleanup +Event: 12.025 Executing VM operation: Cleanup done +Event: 13.025 Executing VM operation: Cleanup +Event: 13.026 Executing VM operation: Cleanup done + +Events (20 events): +Event: 10.730 loading class java/io/ObjectStreamClass$2 +Event: 10.730 loading class java/io/ObjectStreamClass$2 done +Event: 10.730 loading class java/io/ClassCache$CacheRef +Event: 10.730 loading class java/io/ClassCache$CacheRef done +Event: 10.730 loading class java/io/ObjectStreamClass$FieldReflectorKey +Event: 10.730 loading class java/io/ObjectStreamClass$FieldReflectorKey done +Event: 10.730 loading class java/io/ObjectStreamClass$FieldReflector +Event: 10.730 loading class java/io/ObjectStreamClass$FieldReflector done +Event: 10.730 loading class java/io/ObjectStreamClass$ExceptionInfo +Event: 10.730 loading class java/io/ObjectStreamClass$ExceptionInfo done +Event: 10.761 Thread 0x0000019922992660 Thread added: 0x0000019922992660 +Event: 10.794 Thread 0x0000019927685bc0 Thread added: 0x0000019927685bc0 +Event: 10.888 loading class jdk/internal/reflect/UnsafeIntegerFieldAccessorImpl +Event: 10.888 loading class jdk/internal/reflect/UnsafeIntegerFieldAccessorImpl done +Event: 11.182 Thread 0x0000019927685bc0 Thread exited: 0x0000019927685bc0 +Event: 11.187 Thread 0x00000199285847a0 Thread added: 0x00000199285847a0 +Event: 11.382 Thread 0x00000199285847a0 Thread exited: 0x00000199285847a0 +Event: 11.399 Thread 0x0000019922992660 Thread exited: 0x0000019922992660 +Event: 11.423 Thread 0x0000019928583360 Thread added: 0x0000019928583360 +Event: 11.832 Thread 0x0000019928583360 Thread exited: 0x0000019928583360 + + +Dynamic libraries: +0x00007ff7eea60000 - 0x00007ff7eea6e000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\java.exe +0x00007ff808d30000 - 0x00007ff808f44000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ff807200000 - 0x00007ff8072c4000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ff8063f0000 - 0x00007ff806794000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ff8069d0000 - 0x00007ff806ae1000 C:\WINDOWS\System32\ucrtbase.dll +0x00007fffe8bf0000 - 0x00007fffe8c09000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\VCRUNTIME140.dll +0x00007fffe8c10000 - 0x00007fffe8c27000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\jli.dll +0x00007ff806f40000 - 0x00007ff8070ea000 C:\WINDOWS\System32\USER32.dll +0x00007ff806230000 - 0x00007ff806256000 C:\WINDOWS\System32\win32u.dll +0x00007ff807390000 - 0x00007ff8073b9000 C:\WINDOWS\System32\GDI32.dll +0x00007ffff3bd0000 - 0x00007ffff3e5f000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.2070_none_2713e6537381f706\COMCTL32.dll +0x00007ff8062d0000 - 0x00007ff8063e9000 C:\WINDOWS\System32\gdi32full.dll +0x00007ff808420000 - 0x00007ff8084c7000 C:\WINDOWS\System32\msvcrt.dll +0x00007ff806110000 - 0x00007ff8061aa000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ff807dd0000 - 0x00007ff807e01000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffff1550000 - 0x00007ffff155c000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\vcruntime140_1.dll +0x00007fffad2b0000 - 0x00007fffad341000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\msvcp140.dll +0x00007fff88740000 - 0x00007fff89388000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\server\jvm.dll +0x00007ff806e90000 - 0x00007ff806f40000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ff8072e0000 - 0x00007ff807386000 C:\WINDOWS\System32\sechost.dll +0x00007ff807900000 - 0x00007ff807a17000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffff12b0000 - 0x00007ffff12ba000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007fffe6a60000 - 0x00007fffe6a69000 C:\WINDOWS\SYSTEM32\WSOCK32.dll +0x00007ff800b70000 - 0x00007ff800ba4000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ff807f20000 - 0x00007ff807f91000 C:\WINDOWS\System32\WS2_32.dll +0x00007ff8050d0000 - 0x00007ff8050e8000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffff14d0000 - 0x00007ffff14da000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\jimage.dll +0x00007ff803790000 - 0x00007ff8039be000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ff807470000 - 0x00007ff8077fa000 C:\WINDOWS\System32\combase.dll +0x00007ff807800000 - 0x00007ff8078d7000 C:\WINDOWS\System32\OLEAUT32.dll +0x00007ff800b30000 - 0x00007ff800b62000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ff8061b0000 - 0x00007ff80622a000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007fffc03e0000 - 0x00007fffc0405000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\java.dll +0x00007fffe0d70000 - 0x00007fffe0d88000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\zip.dll +0x00007ff8084d0000 - 0x00007ff808ce6000 C:\WINDOWS\System32\SHELL32.dll +0x00007ff804090000 - 0x00007ff80497a000 C:\WINDOWS\SYSTEM32\windows.storage.dll +0x00007ff803f50000 - 0x00007ff80408e000 C:\WINDOWS\SYSTEM32\wintypes.dll +0x00007ff807e10000 - 0x00007ff807f03000 C:\WINDOWS\System32\SHCORE.dll +0x00007ff807bb0000 - 0x00007ff807c0e000 C:\WINDOWS\System32\shlwapi.dll +0x00007ff806040000 - 0x00007ff806066000 C:\WINDOWS\SYSTEM32\profapi.dll +0x00007fffe89a0000 - 0x00007fffe89b9000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\net.dll +0x00007ffff9ae0000 - 0x00007ffff9c17000 C:\WINDOWS\SYSTEM32\WINHTTP.dll +0x00007ff8055b0000 - 0x00007ff805619000 C:\WINDOWS\system32\mswsock.dll +0x00007fffdf8f0000 - 0x00007fffdf905000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\nio.dll +0x00007fffeca30000 - 0x00007fffeca40000 C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\verify.dll +0x0000000055ef0000 - 0x0000000055f19000 C:\Users\Jason\AppData\Local\Temp\libgdxJason\e787ab0a\gdx64.dll +0x00007fffc8b80000 - 0x00007fffc8bf5000 C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7\lwjgl.dll +0x00007fffc4370000 - 0x00007fffc45c9000 C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7\jemalloc.dll +0x00007fffc8010000 - 0x00007fffc8071000 C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7\glfw.dll +0x00007fffc7fc0000 - 0x00007fffc8006000 C:\WINDOWS\SYSTEM32\dinput8.dll +0x00007fffe8bd0000 - 0x00007fffe8be1000 C:\WINDOWS\SYSTEM32\xinput1_4.dll +0x00007ff805d50000 - 0x00007ff805d7c000 C:\WINDOWS\SYSTEM32\DEVOBJ.dll +0x00007ff805d80000 - 0x00007ff805dce000 C:\WINDOWS\SYSTEM32\cfgmgr32.dll +0x00007ff803600000 - 0x00007ff80362b000 C:\WINDOWS\SYSTEM32\dwmapi.dll +0x00007fffec0b0000 - 0x00007fffec2b1000 C:\WINDOWS\SYSTEM32\inputhost.dll +0x00007ff802e30000 - 0x00007ff802f63000 C:\WINDOWS\SYSTEM32\CoreMessaging.dll +0x00007ff8031f0000 - 0x00007ff80329b000 C:\WINDOWS\system32\uxtheme.dll +0x00007ff807a20000 - 0x00007ff807b47000 C:\WINDOWS\System32\MSCTF.dll +0x00007ff805820000 - 0x00007ff80582c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.DLL +0x00007fffb4480000 - 0x00007fffb4617000 C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7\OpenAL.dll +0x00007ff806bd0000 - 0x00007ff806d6c000 C:\WINDOWS\System32\ole32.dll +0x00007ff8073c0000 - 0x00007ff807470000 C:\WINDOWS\System32\clbcatq.dll +0x00007ffff4dc0000 - 0x00007ffff4e5d000 C:\WINDOWS\System32\MMDevApi.dll +0x00007ffff3880000 - 0x00007ffff3a6c000 C:\WINDOWS\SYSTEM32\AUDIOSES.DLL +0x00007ff8039c0000 - 0x00007ff8039d5000 C:\WINDOWS\SYSTEM32\resourcepolicyclient.dll +0x00007ff805e30000 - 0x00007ff805e7d000 C:\WINDOWS\SYSTEM32\powrprof.dll +0x00007ff805e10000 - 0x00007ff805e23000 C:\WINDOWS\SYSTEM32\UMPDC.dll +0x00007fffea6c0000 - 0x00007fffea7c0000 C:\WINDOWS\SYSTEM32\opengl32.dll +0x00007fffec940000 - 0x00007fffec96d000 C:\WINDOWS\SYSTEM32\GLU32.dll +0x00007ff8032d0000 - 0x00007ff803308000 C:\WINDOWS\SYSTEM32\dxcore.dll +0x00007ff800440000 - 0x00007ff80048a000 C:\WINDOWS\SYSTEM32\directxdatabasehelper.dll +0x00007ffff1d80000 - 0x00007ffff1eb5000 C:\Windows\System32\AppXDeploymentClient.dll +0x00007fff86a30000 - 0x00007fff87b5b000 C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_972605d1f505d0d6\igxelpicd64.dll +0x00007ff803310000 - 0x00007ff803408000 C:\WINDOWS\system32\dxgi.dll +0x00007fff98ed0000 - 0x00007fff99025000 C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_972605d1f505d0d6\igdml64.dll +0x00007ffff6890000 - 0x00007ffff6cc8000 C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_972605d1f505d0d6\igdgmm64.dll +0x00007ff806260000 - 0x00007ff8062cb000 C:\WINDOWS\System32\WINTRUST.dll +0x00007ff8067a0000 - 0x00007ff806907000 C:\WINDOWS\System32\CRYPT32.dll +0x00007ff805880000 - 0x00007ff805892000 C:\WINDOWS\SYSTEM32\MSASN1.dll +0x00007fffecfc0000 - 0x00007ffff0e6d000 C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_972605d1f505d0d6\igc64.dll +0x00007fffc4310000 - 0x00007fffc436d000 C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7\lwjgl_opengl.dll +0x00007ffff12f0000 - 0x00007ffff141d000 C:\WINDOWS\SYSTEM32\textinputframework.dll +0x00007ffffc050000 - 0x00007ffffc3bc000 C:\WINDOWS\SYSTEM32\CoreUIComponents.dll +0x00007fffc0d20000 - 0x00007fffc0d89000 C:\WINDOWS\system32\Oleacc.dll +0x0000000055b40000 - 0x0000000055b9a000 C:\Users\Jason\AppData\Local\Temp\libgdxJason\888fe1bc\gdx-box2d64.dll + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.2070_none_2713e6537381f706;C:\Users\Jason\.vscode\extensions\redhat.java-1.21.0-win32-x64\jre\17.0.7-win32-x86_64\bin\server;C:\Users\Jason\AppData\Local\Temp\libgdxJason\e787ab0a;C:\Users\Jason\AppData\Local\Temp\lwjglJason\3.3.1-build-7;C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_972605d1f505d0d6;C:\Users\Jason\AppData\Local\Temp\libgdxJason\888fe1bc + +VM Arguments: +jvm_args: -XX:+ShowCodeDetailsInExceptionMessages +java_command: com.csse3200.game.desktop.DesktopLauncher +java_class_path (initial): C:\Users\Jason\Desktop\repos\2023-studio-3\source\desktop\bin\main;\csse3200-game-core\bin\default;C:\Users\Jason\Desktop\repos\2023-studio-3\source\core\bin\main;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-backend-lwjgl3\1.11.0\58a96db4cd349be4292d547856aa1e1c5f065f4e\gdx-backend-lwjgl3-1.11.0.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-platform\1.11.0\697fb13eada6d3c6ca648c9788692b0159add126\gdx-platform-1.11.0-natives-desktop.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-box2d-platform\1.11.0\62ff9baa1e57a11e0a4428a38c9660bf9f312fdc\gdx-box2d-platform-1.11.0-natives-desktop.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-tools\1.11.0\a5d30eafd0f2fbab314efdf6d98ebc27388b7c0a\gdx-tools-1.11.0.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx-controllers\gdx-controllers-desktop\2.2.2\625b3bdbe803e9c4af181b4791202cfcf776d805\gdx-controllers-desktop-2.2.2.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-backend-lwjgl\1.11.0\33555a2cf8b4d9db4122b2fe42e7674b343d8b4\gdx-backend-lwjgl-1.11.0.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-freetype\1.11.0\a3634ad2e6c56d251268d6ab5c0f66eee2841f2c\gdx-freetype-1.11.0.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-backend-headless\1.11.0\3c3d0c951db72891d894df1725d09179fd0bca00\gdx-backend-headless-1.11.0.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\net.dermetfan.libgdx-utils\libgdx-utils-box2d\0.13.4\918d79a20ea3c898cdb3611782c5b2bfa6ec575b\libgdx-utils-box2d-0.13.4.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-box2d\1.11.0\ad4facee800dd945d6d6e93dea2936bc135b5f\gdx-box2d-1.11.0.jar;C:\Users\Jason\.gradle\caches\modules-2\files-2.1\net.dermetfan.libgdx-utils\libgdx-utils\0.13.4\27affad2873d1c9c366a2290f +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 264241152 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4219469824 {product} {ergonomic} + size_t MaxNewSize = 2531262464 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + bool ShowCodeDetailsInExceptionMessages = true {manageable} {command line} + size_t SoftMaxHeapSize = 4219469824 {manageable} {ergonomic} + bool UseCompressedClassPointers = true {product lp64_product} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags + #1: stderr all=off uptime,level,tags + +Environment Variables: +PATH=C:\Program Files\Git\\.fly\bin;C:\Users\Jason\AppData\Local\Android\Sdk\platform-tools;C:\Users\Jason\AppData\Local\Android\Sdk\emulator;C:\Users\Jason\.fly\bin;C:\Users\Jason\.nvm\versions\node\v16.20.1\bin;C:\Users\Jason\AppData\Local\Android\Sdk\platform-tools;C:\Users\Jason\AppData\Local\Android\Sdk\emulator;C:\Users\Jason\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Jason\bin;C:\Python311\Scripts;C:\Python311;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\dotnet;C:\Program Files\MATLAB\R2022a\runtime\win64;C:\Program Files\MATLAB\R2022a\bin;C:\Program Files\MATLAB\R2021b\bin;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Program Files (x86)\Pololu\USB AVR Programmer v2\bin;C:\Program Files\PuTTY;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\Jason\.console-ninja\.bin;C:\Users\Jason\.console-ninja\.bin;C:\Users\Jason\AppData\Local\Programs\Python\Launcher;C:\Users\Jason\AppData\Local\Microsoft\WindowsApps;C:\Users\Jason\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Jason\AppData\Roaming\npm;C:\Users\Jason\.fly\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl +USERNAME=Jason +SHELL=C:\Program Files\Git\usr\bin\bash.exe +DISPLAY=needs-to-be-defined +LANG=en_US.UTF-8 +TERM=xterm-256color +TMPDIR=C:\Users\Jason\AppData\Local\Temp +OS=Windows_NT +PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 140 Stepping 1, GenuineIntel +TMP=C:\Users\Jason\AppData\Local\Temp +TEMP=C:\Users\Jason\AppData\Local\Temp + + + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 22621 (10.0.22621.2070) +OS uptime: 7 days 20:05 hours +Hyper-V role detected + +CPU: total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 140 stepping 1 microcode 0xac, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, avx512f, avx512dq, avx512cd, avx512bw, avx512vl, sha, fma, vzeroupper, avx512_vpopcntdq, avx512_vpclmulqdq, avx512_vaes, avx512_vnni, clflush, clflushopt, clwb, avx512_vbmi2, avx512_vbmi, hv + +Memory: 4k page, system-wide physical 16090M (3757M free) +TotalPageFile size 22490M (AvailPageFile size 4101M) +current process WorkingSet (physical memory assigned to process): 548M, peak: 2015M +current process commit charge ("private bytes"): 729M, peak: 2205M + +vm_info: OpenJDK 64-Bit Server VM (17.0.7+7) for windows-amd64 JRE (17.0.7+7), built on Apr 18 2023 22:10:42 by "temurin" with MS VC++ 16.7 (VS2019) + +END. diff --git a/source/core/assets/configs/tower.json b/source/core/assets/configs/tower.json index 004dda33c..fe44c4d17 100644 --- a/source/core/assets/configs/tower.json +++ b/source/core/assets/configs/tower.json @@ -13,5 +13,10 @@ "health": 20, "baseAttack": 0, "cost": 1 + }, + "TNTTower": { + "health": 10, + "baseAttack": 5, + "cost": 1 } } \ No newline at end of file diff --git a/source/core/assets/images/Dusty_MoonBG.png b/source/core/assets/images/Dusty_MoonBG.png new file mode 100644 index 000000000..aabbd3547 Binary files /dev/null and b/source/core/assets/images/Dusty_MoonBG.png differ diff --git a/source/core/assets/images/ingamebg.png b/source/core/assets/images/ingamebg.png new file mode 100644 index 000000000..0fbc1c543 Binary files /dev/null and b/source/core/assets/images/ingamebg.png differ diff --git a/source/core/assets/images/projectiles/basic_projectile.atlas b/source/core/assets/images/projectiles/basic_projectile.atlas new file mode 100644 index 000000000..2f09b83bf --- /dev/null +++ b/source/core/assets/images/projectiles/basic_projectile.atlas @@ -0,0 +1,34 @@ + +basic_projectile.png +size: 256, 32 +format: RGBA8888 +filter: Nearest, Nearest +repeat: none +projectile + rotate: false + xy: 2, 2 + size: 36, 19 + orig: 36, 19 + offset: 0, 0 + index: 4 +projectileFinal + rotate: false + xy: 103, 3 + size: 30, 18 + orig: 30, 18 + offset: 0, 0 + index: 3 +projectile + rotate: false + xy: 40, 2 + size: 30, 19 + orig: 30, 19 + offset: 0, 0 + index: 2 +projectile + rotate: false + xy: 72, 2 + size: 29, 19 + orig: 29, 19 + offset: 0, 0 + index: 1 diff --git a/source/core/assets/images/projectiles/basic_projectile.png b/source/core/assets/images/projectiles/basic_projectile.png new file mode 100644 index 000000000..abf6cfc59 Binary files /dev/null and b/source/core/assets/images/projectiles/basic_projectile.png differ diff --git a/source/core/assets/images/projectiles/mobProjectile.atlas b/source/core/assets/images/projectiles/mobProjectile.atlas new file mode 100644 index 000000000..d069c0394 --- /dev/null +++ b/source/core/assets/images/projectiles/mobProjectile.atlas @@ -0,0 +1,41 @@ + +mobProjectile.png +size: 128, 32 +format: RGBA8888 +filter: Nearest, Nearest +repeat: none +rotate + rotate: false + xy: 80, 2 + size: 24, 23 + orig: 24, 23 + offset: 0, 0 + index: -1 +rotate + rotate: false + xy: 28, 2 + size: 24, 23 + orig: 24, 23 + offset: 0, 0 + index: -1 +default + rotate: false + xy: 54, 2 + size: 24, 23 + orig: 24, 23 + offset: 0, 0 + index: -1 +rotate + rotate: false + xy: 2, 2 + size: 24, 23 + orig: 24, 23 + offset: 0, 0 + index: -1 +rotate + rotate: false + xy: 54, 2 + size: 24, 23 + orig: 24, 23 + offset: 0, 0 + index: -1 diff --git a/source/core/assets/images/projectiles/mobProjectile.png b/source/core/assets/images/projectiles/mobProjectile.png new file mode 100644 index 000000000..919476050 Binary files /dev/null and b/source/core/assets/images/projectiles/mobProjectile.png differ diff --git a/source/core/assets/images/projectiles/projectile.png b/source/core/assets/images/projectiles/projectile2.png similarity index 100% rename from source/core/assets/images/projectiles/projectile.png rename to source/core/assets/images/projectiles/projectile2.png diff --git a/source/core/assets/images/terrain_use.png b/source/core/assets/images/terrain_use.png new file mode 100644 index 000000000..59ddab66d Binary files /dev/null and b/source/core/assets/images/terrain_use.png differ diff --git a/source/core/assets/images/towers/TNTTower.atlas b/source/core/assets/images/towers/TNTTower.atlas new file mode 100644 index 000000000..d74b23a05 --- /dev/null +++ b/source/core/assets/images/towers/TNTTower.atlas @@ -0,0 +1,104 @@ + +TNTTower.png +size: 1024, 128 +format: RGBA8888 +filter: Nearest, Nearest +repeat: none +default + rotate: false + xy: 773, 104 + size: 20, 17 + orig: 20, 17 + offset: 0, 0 + index: 0 +dig + rotate: false + xy: 2, 21 + size: 20, 17 + orig: 20, 17 + offset: 0, 0 + index: 4 +dig + rotate: false + xy: 751, 104 + size: 20, 17 + orig: 20, 17 + offset: 0, 0 + index: 1 +dig + rotate: false + xy: 2, 2 + size: 20, 17 + orig: 20, 17 + offset: 0, 0 + index: 3 +dig + rotate: false + xy: 24, 21 + size: 20, 17 + orig: 20, 17 + offset: 0, 0 + index: 0 +dig + rotate: false + xy: 751, 85 + size: 20, 17 + orig: 20, 17 + offset: 0, 0 + index: 5 +dig + rotate: false + xy: 24, 2 + size: 20, 17 + orig: 20, 17 + offset: 0, 0 + index: 2 +explode + rotate: false + xy: 2, 40 + size: 105, 81 + orig: 105, 81 + offset: 0, 0 + index: 2 +explode + rotate: false + xy: 109, 40 + size: 105, 81 + orig: 105, 81 + offset: 0, 0 + index: 4 +explode + rotate: false + xy: 216, 40 + size: 105, 81 + orig: 105, 81 + offset: 0, 0 + index: 1 +explode + rotate: false + xy: 323, 40 + size: 105, 81 + orig: 105, 81 + offset: 0, 0 + index: 6 +explode + rotate: false + xy: 430, 40 + size: 105, 81 + orig: 105, 81 + offset: 0, 0 + index: 3 +explode + rotate: false + xy: 537, 40 + size: 105, 81 + orig: 105, 81 + offset: 0, 0 + index: 0 +explode + rotate: false + xy: 644, 40 + size: 105, 81 + orig: 105, 81 + offset: 0, 0 + index: 5 diff --git a/source/core/assets/images/towers/TNTTower.png b/source/core/assets/images/towers/TNTTower.png new file mode 100644 index 000000000..bec8f5268 Binary files /dev/null and b/source/core/assets/images/towers/TNTTower.png differ diff --git a/source/core/src/main/com/csse3200/game/ai/tasks/AITaskComponent.java b/source/core/src/main/com/csse3200/game/ai/tasks/AITaskComponent.java index 88b4eb61e..7b4dd37da 100644 --- a/source/core/src/main/com/csse3200/game/ai/tasks/AITaskComponent.java +++ b/source/core/src/main/com/csse3200/game/ai/tasks/AITaskComponent.java @@ -67,7 +67,7 @@ private PriorityTask getHighestPriorityTask() { } } - private void changeTask(PriorityTask desiredTask) { + public void changeTask(PriorityTask desiredTask) { logger.debug("{} Changing to task {}", this, desiredTask); if (currentTask != null) { currentTask.stop(); diff --git a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java index 94146d3ea..b8f318de2 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -5,11 +5,13 @@ import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; +import com.csse3200.game.components.ProjectileEffects; import com.csse3200.game.input.DropInputComponent; import com.csse3200.game.areas.terrain.TerrainFactory; import com.csse3200.game.areas.terrain.TerrainFactory.TerrainType; import com.csse3200.game.entities.Entity; import com.csse3200.game.entities.factories.*; +import com.csse3200.game.physics.PhysicsLayer; import com.csse3200.game.utils.math.GridPoint2Utils; import com.csse3200.game.utils.math.RandomUtils; import com.csse3200.game.services.ResourceService; @@ -23,24 +25,28 @@ import static com.csse3200.game.entities.factories.NPCFactory.createGhost; -import com.csse3200.game.entities.factories.ProjectileFactory; import java.util.ArrayList; /** Forest area for the demo game with trees, a player, and some enemies. */ public class ForestGameArea extends GameArea { private static final Logger logger = LoggerFactory.getLogger(ForestGameArea.class); + private static final int NUM_BUILDINGS = 4; + + private static final int NUM_WALLS = 7; + private static final int NUM_TREES = 0; private static final int NUM_GHOSTS = 0; private static final int NUM_GRUNTS = 5; - private static final int NUM_BUILDINGS = 4; + private static final int NUM_BOSS=4; - private static final int NUM_WALLS = 7; + private Timer bossSpawnTimer; private int bossSpawnInterval = 10000; // 1 minute in milliseconds + private static final int NUM_WEAPON_TOWERS = 3; - private static final GridPoint2 PLAYER_SPAWN = new GridPoint2(0, 15); + private static final GridPoint2 PLAYER_SPAWN = new GridPoint2(0, 0); // Temporary spawn point for testing private static final float WALL_WIDTH = 0.1f; @@ -48,6 +54,7 @@ public class ForestGameArea extends GameArea { // Required to load assets before using them private static final String[] forestTextures = { + "images/ingamebg.png", "images/projectiles/projectile.png", "images/box_boy_leaf.png", "images/background/building1.png", @@ -83,8 +90,13 @@ public class ForestGameArea extends GameArea { "images/towers/wallTower.png", "images/background/building2.png", "images/iso_grass_3.png", + + "images/terrain_use.png", + "images/Dusty_MoonBG.png", + "images/economy/scrap.png", - "images/towers/mine_tower.png" + "images/towers/mine_tower.png", + "images/towers/TNTTower.png" }; private static final String[] forestTextureAtlases = { "images/terrain_iso_grass.atlas", @@ -94,7 +106,10 @@ public class ForestGameArea extends GameArea { "images/towers/turret01.atlas", "images/xenoGrunt.atlas", "images/mobs/robot.atlas", - "images/mobs/rangeBossRight.atlas" + "images/mobs/rangeBossRight.atlas", + "images/towers/TNTTower.atlas", + "images/projectiles/basic_projectile.atlas", + "images/projectiles/mobProjectile.atlas" }; private static final String[] forestSounds = { "sounds/Impact4.ogg", @@ -112,6 +127,7 @@ public class ForestGameArea extends GameArea { // Variables to be used with spawn projectile methods. This is the variable // that should occupy the direction param. private static final int towardsMobs = 100; + private static final int towardsTowers = 0; private Entity bossKing1; private Entity bossKing2; @@ -134,18 +150,18 @@ public void create() { displayUI(); spawnTerrain(); - spawnBuilding1(); - spawnBuilding2(); - spawnMountains(); +// spawnBuilding1(); +// spawnBuilding2(); +// spawnMountains(); player = spawnPlayer(); player.getEvents().addListener("spawnWave", this::spawnXenoGrunts); playMusic(); // Types of projectile - spawnAoeProjectile(new Vector2(0, 10), player, towardsMobs, new Vector2(2f, 2f), 1); - spawnProjectile(new Vector2(0, 10), player, towardsMobs, new Vector2(2f, 2f)); - spawnMultiProjectile(new Vector2(0, 10), player, towardsMobs, 20, new Vector2(2f, 2f), 7); + spawnEffectProjectile(new Vector2(0, 10), PhysicsLayer.PLAYER, towardsMobs, new Vector2(2f, 2f), ProjectileEffects.BURN, true); +// spawnProjectile(new Vector2(0, 10), player, towardsMobs, new Vector2(2f, 2f)); +// spawnMultiProjectile(new Vector2(0, 10), player, towardsMobs, 20, new Vector2(2f, 2f), 7); spawnXenoGrunts(); spawnGhosts(); @@ -156,6 +172,8 @@ public void create() { bossKing1 = spawnBossKing1(); bossKing2 = spawnBossKing2(); + spawnTNTTower(); + playMusic(); } @@ -219,10 +237,6 @@ private void spawnBuilding2() { private void spawnMountains() { ArrayList fixedPositions = new ArrayList<>(); //Generating ArrayList - fixedPositions.add(new GridPoint2(5, 8)); - fixedPositions.add(new GridPoint2(12, 4)); - fixedPositions.add(new GridPoint2(20, 10)); - fixedPositions.add(new GridPoint2(33, 17)); for (GridPoint2 fixedPos : fixedPositions) { Entity tree = ObstacleFactory.createMountain(); @@ -270,13 +284,27 @@ private Entity spawnBossKing1() { * Spawns a projectile that only heads towards the enemies in its lane. * * @param position The position of the Entity that's shooting the projectile. - * @param target The enemy entities of the "shooter". + * @param targetLayer The enemy layer of the "shooter". * @param direction The direction the projectile should head towards. * @param speed The speed of the projectiles. * */ - private void spawnProjectile(Vector2 position, Entity target, int direction, Vector2 speed) { - Entity Projectile = ProjectileFactory.createFireBall(target, new Vector2(direction, position.y), speed); + private void spawnProjectile(Vector2 position, short targetLayer, int direction, Vector2 speed) { + Entity Projectile = ProjectileFactory.createFireBall(targetLayer, new Vector2(direction, position.y), speed); + Projectile.setPosition(position); + spawnEntity(Projectile); + } + /** + * Spawns a projectile specifically for general mobs/xenohunters + * + * @param position The position of the Entity that's shooting the projectile. + * @param targetLayer The enemy layer of the "shooter". + * @param direction The direction the projectile should head towards. + * @param speed The speed of the projectiles. + * + */ + private void spawnMobBall(Vector2 position, short targetLayer, int direction, Vector2 speed) { + Entity Projectile = ProjectileFactory.createMobBall(targetLayer, new Vector2(direction, position.y), speed); Projectile.setPosition(position); spawnEntity(Projectile); } @@ -285,14 +313,14 @@ private void spawnProjectile(Vector2 position, Entity target, int direction, Vec * Spawns a projectile to be used for multiple projectile function. * * @param position The position of the Entity that's shooting the projectile. - * @param target The enemy entities of the "shooter". + * @param targetLayer The enemy layer of the "shooter". * @param space The space between the projectiles' destination. * @param direction The direction the projectile should head towards. * @param speed The speed of the projectiles. * */ - private void spawnProjectile(Vector2 position, Entity target, int space, int direction, Vector2 speed) { - Entity Projectile = ProjectileFactory.createFireBall(target, new Vector2(direction, position.y + space), speed); + private void spawnProjectile(Vector2 position, short targetLayer, int space, int direction, Vector2 speed) { + Entity Projectile = ProjectileFactory.createFireBall(targetLayer, new Vector2(direction, position.y + space), speed); Projectile.setPosition(position); spawnEntity(Projectile); } @@ -359,16 +387,16 @@ private Entity spawnBossKing2() { * the starting point but different destinations. * * @param position The position of the Entity that's shooting the projectile. - * @param target The enemy entities of the "shooter". + * @param targetLayer The enemy layer of the "shooter". * @param direction The direction the projectile should head towards. * @param space The space between the projectiles' destination. * @param speed The speed of the projectiles. * @param quantity The amount of projectiles to spawn. */ - private void spawnMultiProjectile(Vector2 position, Entity target, int direction, int space, Vector2 speed, int quantity) { + private void spawnMultiProjectile(Vector2 position, short targetLayer, int direction, int space, Vector2 speed, int quantity) { int half = quantity / 2; for (int i = 0; i < quantity; i++) { - spawnProjectile(position, target, space * half, direction, speed); + spawnProjectile(position, targetLayer, space * half, direction, speed); --half; } } @@ -377,13 +405,15 @@ private void spawnMultiProjectile(Vector2 position, Entity target, int direction * Returns projectile that can do an area of effect damage * * @param position The position of the Entity that's shooting the projectile. - * @param target The enemy entities of the "shooter". + * @param targetLayer The enemy layer of the "shooter". * @param direction The direction the projectile should head towards. * @param speed The speed of the projectiles. - * @param aoeSize The size of the area of effect. + * @param effect Type of effect. + * @param aoe Whether it is an aoe projectile. */ - private void spawnAoeProjectile(Vector2 position, Entity target, int direction, Vector2 speed, int aoeSize) { - Entity Projectile = ProjectileFactory.createAOEFireBall(target, new Vector2(direction, position.y), speed, aoeSize); + private void spawnEffectProjectile(Vector2 position, short targetLayer, int direction, Vector2 speed, + ProjectileEffects effect, boolean aoe) { + Entity Projectile = ProjectileFactory.createEffectProjectile(targetLayer, new Vector2(direction, position.y), speed, effect, aoe); Projectile.setPosition(position); spawnEntity(Projectile); } @@ -401,6 +431,18 @@ private void spawnWeaponTower() { } } + private void spawnTNTTower() { + GridPoint2 minPos = new GridPoint2(0, 0); + GridPoint2 maxPos = terrain.getMapBounds(0).sub(2, 2); + + for (int i = 0; i < NUM_WEAPON_TOWERS; i++) { + GridPoint2 randomPos = RandomUtils.random(minPos, maxPos); + Entity weaponTower = TowerFactory.createTNTTower(); + spawnEntityAt(weaponTower, randomPos, true, true); + } + + } + private void playMusic() { Music music = ServiceLocator.getResourceService().getAsset(backgroundMusic, Music.class); diff --git a/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java b/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java index e46855636..991a3589d 100644 --- a/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java +++ b/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java @@ -1,30 +1,39 @@ package com.csse3200.game.areas.terrain; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.BitmapFont; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.maps.tiled.TiledMap; import com.badlogic.gdx.maps.tiled.TiledMapRenderer; import com.badlogic.gdx.maps.tiled.TiledMapTileLayer; import com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell; -import com.badlogic.gdx.maps.tiled.renderers.HexagonalTiledMapRenderer; -import com.badlogic.gdx.maps.tiled.renderers.IsometricTiledMapRenderer; import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; +import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; import com.badlogic.gdx.math.GridPoint2; +import com.badlogic.gdx.scenes.scene2d.Stage; +import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.utils.viewport.ScreenViewport; +import com.badlogic.gdx.utils.viewport.Viewport; import com.csse3200.game.areas.terrain.TerrainComponent.TerrainOrientation; import com.csse3200.game.components.CameraComponent; -import com.csse3200.game.utils.math.RandomUtils; import com.csse3200.game.services.ResourceService; import com.csse3200.game.services.ServiceLocator; +import static com.csse3200.game.screens.MainGameScreen.viewportHeight; +import static com.csse3200.game.screens.MainGameScreen.viewportWidth; + /** Factory for creating game terrains. */ public class TerrainFactory { - private static final GridPoint2 MAP_SIZE = new GridPoint2(40, 26); - private static final int TUFT_TILE_COUNT = 0; - private static final int ROCK_TILE_COUNT = 0; + public static final GridPoint2 MAP_SIZE = new GridPoint2(20, 8); - private final OrthographicCamera camera; + private static OrthographicCamera camera; private final TerrainOrientation orientation; + private static Stage stage; + private Texture whiteTexture; /** * Create a terrain factory with Orthogonal orientation @@ -33,6 +42,18 @@ public class TerrainFactory { */ public TerrainFactory(CameraComponent cameraComponent) { this(cameraComponent, TerrainOrientation.ORTHOGONAL); + camera.position.set(viewportWidth / 2f, (viewportHeight / 2f), 10); + Viewport viewport = new ScreenViewport(camera); + viewport.update(viewportWidth, viewportHeight, true); + stage = new Stage(viewport, new SpriteBatch()); + + camera.update(); + + Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888); + pixmap.setColor(1, 1, 1, 1); + pixmap.fill(); + whiteTexture = new Texture(pixmap); + pixmap.dispose(); } /** @@ -58,39 +79,18 @@ public TerrainComponent createTerrain(TerrainType terrainType) { switch (terrainType) { case FOREST_DEMO: TextureRegion orthoGrass = - new TextureRegion(resourceService.getAsset("images/terrain 2 normal.png", Texture.class)); - TextureRegion orthoTuft = - new TextureRegion(resourceService.getAsset("images/grass_2.png", Texture.class)); - TextureRegion orthoRocks = - new TextureRegion(resourceService.getAsset("images/grass_3.png", Texture.class)); - return createForestDemoTerrain(0.5f, orthoGrass, orthoTuft, orthoRocks); - case FOREST_DEMO_ISO: - - TextureRegion isoGrass = - new TextureRegion(resourceService.getAsset("images/iso_grass_1.png", Texture.class)); - TextureRegion isoTuft = - new TextureRegion(resourceService.getAsset("images/iso_grass_2.png", Texture.class)); - TextureRegion isoRocks = - new TextureRegion(resourceService.getAsset("images/iso_grass_3.png", Texture.class)); - return createForestDemoTerrain(1f, isoGrass, isoTuft, isoRocks ); - case FOREST_DEMO_HEX: - - TextureRegion hexGrass = - new TextureRegion(resourceService.getAsset("images/terrain 2 hex.png", Texture.class)); - TextureRegion hexTuft = - new TextureRegion(resourceService.getAsset("images/hex_grass_2.png", Texture.class)); - TextureRegion hexRocks = - new TextureRegion(resourceService.getAsset("images/hex_grass_3.png", Texture.class)); - return createForestDemoTerrain(1f , hexGrass, hexTuft, hexRocks); + new TextureRegion(resourceService.getAsset("images/terrain_use.png", Texture.class)); + return createForestDemoTerrain(1f, orthoGrass); + default: return null; } } private TerrainComponent createForestDemoTerrain( - float tileWorldSize, TextureRegion grass, TextureRegion grassTuft, TextureRegion rocks) { + float tileWorldSize, TextureRegion grass) { GridPoint2 tilePixelSize = new GridPoint2(grass.getRegionWidth(), grass.getRegionHeight()); - TiledMap tiledMap = createForestDemoTiles(tilePixelSize, grass, grassTuft, rocks); + TiledMap tiledMap = createForestDemoTiles(tilePixelSize, grass); TiledMapRenderer renderer = createRenderer(tiledMap, tileWorldSize / tilePixelSize.x); return new TerrainComponent(camera, tiledMap, renderer, orientation, tileWorldSize); } @@ -99,64 +99,76 @@ private TiledMapRenderer createRenderer(TiledMap tiledMap, float tileScale) { switch (orientation) { case ORTHOGONAL: return new OrthogonalTiledMapRenderer(tiledMap, tileScale); - case ISOMETRIC: - return new IsometricTiledMapRenderer(tiledMap, tileScale); - case HEXAGONAL: - return new HexagonalTiledMapRenderer(tiledMap, tileScale); default: return null; } } - private TiledMap createForestDemoTiles( - GridPoint2 tileSize, TextureRegion grass, TextureRegion grassTuft, TextureRegion rocks) { + private TiledMap createForestDemoTiles(GridPoint2 tileSize, TextureRegion grass) { TiledMap tiledMap = new TiledMap(); - TerrainTile grassTile = new TerrainTile(grass); - TerrainTile grassTuftTile = new TerrainTile(grassTuft); - TerrainTile rockTile = new TerrainTile(rocks); - TiledMapTileLayer layer = new TiledMapTileLayer(MAP_SIZE.x, MAP_SIZE.y, tileSize.x, tileSize.y); - // Create base grass - fillTiles(layer, MAP_SIZE, grassTile); + // Create a background layer + TiledMapTileLayer backgroundLayer = new TiledMapTileLayer(20, 8, tileSize.x, tileSize.y); + TextureRegion backgroundTextureRegion = new TextureRegion(ServiceLocator.getResourceService().getAsset("images/ingamebg.png", Texture.class)); + + // Create a single cell for the entire background image + Cell cell = new Cell(); + cell.setTile(new StaticTiledMapTile(backgroundTextureRegion)); + backgroundLayer.setCell(0, 0, cell); - // Add some grass and rocks - fillTilesAtRandom(layer, MAP_SIZE, grassTuftTile, TUFT_TILE_COUNT); - fillTilesAtRandom(layer, MAP_SIZE, rockTile, ROCK_TILE_COUNT); + tiledMap.getLayers().add(backgroundLayer); + + // Create a grass layer + TerrainTile grassTile = new TerrainTile(grass); + TiledMapTileLayer grassLayer = new TiledMapTileLayer(20, 8, tileSize.x, tileSize.y); + fillTiles(grassLayer, new GridPoint2(20, 8), grassTile); + tiledMap.getLayers().add(grassLayer); + + // Create lanes (invisible) + int numberOfLanes = 8; + int laneHeight = 1; // Height of each lane in tiles + int mapWidth = 20; + int mapHeight = 8; + int laneTileHeight = mapHeight / numberOfLanes; + + for (int i = 0; i < numberOfLanes; i++) { + TiledMapTileLayer laneLayer = new TiledMapTileLayer(mapWidth, laneHeight, tileSize.x, tileSize.y); + fillInvisibleTiles(laneLayer, new GridPoint2(mapWidth, laneHeight)); + tiledMap.getLayers().add(laneLayer); + } - tiledMap.getLayers().add(layer); return tiledMap; } - private static void fillTilesAtRandom( - TiledMapTileLayer layer, GridPoint2 mapSize, TerrainTile tile, int amount) { - GridPoint2 min = new GridPoint2(0, 0); - GridPoint2 max = new GridPoint2(mapSize.x - 1, mapSize.y - 1); - - for (int i = 0; i < amount; i++) { - GridPoint2 tilePos = RandomUtils.random(min, max); - Cell cell = layer.getCell(tilePos.x, tilePos.y); - cell.setTile(tile); + private void fillInvisibleTiles(TiledMapTileLayer layer, GridPoint2 mapSize) { + for (int x = 0; x < mapSize.x; x++) { + for (int y = 0; y < mapSize.y; y++) { + Cell cell = new Cell(); + // Set an invisible tile (using a transparent texture) + StaticTiledMapTile invisibleTile = new StaticTiledMapTile(new TextureRegion(whiteTexture)); + cell.setTile(invisibleTile); + layer.setCell(x, y, cell); + } } } private static void fillTiles(TiledMapTileLayer layer, GridPoint2 mapSize, TerrainTile tile) { + BitmapFont font = new BitmapFont(); + TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); + textButtonStyle.font = font; + textButtonStyle.fontColor = Color.WHITE; for (int x = 0; x < mapSize.x; x++) { for (int y = 0; y < mapSize.y; y++) { Cell cell = new Cell(); cell.setTile(tile); layer.setCell(x, y, cell); + TextButton button = new TextButton("" + x + y * 20, textButtonStyle); + stage.addActor(button); } } } - /** - * This enum should contain the different terrains in your game, e.g. forest, cave, home, all with - * the same oerientation. But for demonstration purposes, the base code has the same level in 3 - * different orientations. - */ public enum TerrainType { - FOREST_DEMO, - FOREST_DEMO_ISO, - FOREST_DEMO_HEX + FOREST_DEMO } } diff --git a/source/core/src/main/com/csse3200/game/areas/terrain/TerrainGrid.java b/source/core/src/main/com/csse3200/game/areas/terrain/TerrainGrid.java new file mode 100644 index 000000000..667af8742 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/areas/terrain/TerrainGrid.java @@ -0,0 +1,4 @@ +package com.csse3200.game.areas.terrain; + +public class TerrainGrid { +} diff --git a/source/core/src/main/com/csse3200/game/components/AoeComponent.java b/source/core/src/main/com/csse3200/game/components/AoeComponent.java deleted file mode 100644 index 93403e8aa..000000000 --- a/source/core/src/main/com/csse3200/game/components/AoeComponent.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.csse3200.game.components; - -import com.badlogic.gdx.physics.box2d.Fixture; -import com.csse3200.game.entities.Entity; -import com.csse3200.game.physics.BodyUserData; -import com.csse3200.game.physics.components.HitboxComponent; -import com.csse3200.game.services.ServiceLocator; - -import com.badlogic.gdx.utils.Array; - -public class AoeComponent extends Component { - private final float radius; - private HitboxComponent hitboxComponent; - - /** - * Constructor for the AoEComponent. - * - * @param radius The radius of the area-of-effect. - */ - public AoeComponent(float radius) { - this.radius = radius; - } - - @Override - public void create() { - entity.getEvents().addListener("collisionStart", this::onCollisionStart); - entity.getEvents().addListener("collisionEnd", this::onCollisionEnd); - hitboxComponent = entity.getComponent(HitboxComponent.class); - } - - private void onCollisionStart(Fixture me, Fixture other) { - // Nothing to do on collision start - } - - private void onCollisionEnd(Fixture me, Fixture other) { - if (hitboxComponent.getFixture() != me) { - // Not triggered by hitbox, ignore - return; - } - applyAoeDamage(); - } - /** - * Apply damage to all entities within the area of effect (radius). - */ - public void applyAoeDamage() { - Entity hostEntity = getEntity(); - CombatStatsComponent hostCombatStats = hostEntity.getComponent(CombatStatsComponent.class); - - if (hostCombatStats == null) { - // The host entity does not have a CombatStatsComponent to deal damage - return; - } - - Array nearbyEntities = ServiceLocator.getEntityService().getNearbyEntities(hostEntity, radius); - - for (Entity targetEntity : nearbyEntities) { - CombatStatsComponent targetCombatStats = targetEntity.getComponent(CombatStatsComponent.class); - if (targetCombatStats != null) { - targetCombatStats.hit(hostCombatStats); - } - } - } -} diff --git a/source/core/src/main/com/csse3200/game/components/EffectsComponent.java b/source/core/src/main/com/csse3200/game/components/EffectsComponent.java new file mode 100644 index 000000000..036f68592 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/EffectsComponent.java @@ -0,0 +1,169 @@ +package com.csse3200.game.components; + +import com.badlogic.gdx.physics.box2d.Fixture; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.factories.ProjectileFactory; +import com.csse3200.game.physics.BodyUserData; +import com.csse3200.game.physics.PhysicsLayer; +import com.csse3200.game.physics.components.HitboxComponent; +import com.csse3200.game.services.ServiceLocator; + +import com.badlogic.gdx.utils.Timer; + +import com.badlogic.gdx.utils.Array; + +import java.util.ArrayList; + +public class EffectsComponent extends Component { + private final float radius; + private final ProjectileEffects effect; + private final boolean aoe; + private HitboxComponent hitboxComponent; + private final short targetLayer; + private ArrayList burnEntities = new ArrayList<>(); + + /** + * Constructor for the AoEComponent. + * + * @param radius The radius of the area-of-effect. + */ + public EffectsComponent(short targetLayer, float radius, ProjectileEffects effect, boolean aoe) { + this.targetLayer = targetLayer; + this.radius = radius; + this.effect = effect; + this.aoe = aoe; + } + + @Override + public void create() { + entity.getEvents().addListener("collisionStart", this::onCollisionStart); + entity.getEvents().addListener("collisionEnd", this::onCollisionEnd); + hitboxComponent = entity.getComponent(HitboxComponent.class); + } + + private void onCollisionStart(Fixture me, Fixture other) { + // Nothing to do on collision start + } + + private void onCollisionEnd(Fixture me, Fixture other) { + if (hitboxComponent.getFixture() != me) { + // Not triggered by hitbox, ignore + return; + } + + if (!PhysicsLayer.contains(targetLayer, other.getFilterData().categoryBits)) { + // Doesn't match our target layer, ignore + return; + } + + // Get the other entity involved in the collision + Entity otherEntity = ((BodyUserData) other.getBody().getUserData()).entity; + CombatStatsComponent otherCombatStats = otherEntity.getComponent(CombatStatsComponent.class); + if (otherCombatStats == null) { + // The other entity does not have a CombatStatsComponent + return; + } + + switch (effect) { + case FIREBALL -> { + if (aoe) { + applyAoeEffect(ProjectileEffects.FIREBALL); + } + } + case BURN -> { + if (aoe) { + applyAoeEffect(ProjectileEffects.BURN); + } else { + applySingleEffect(ProjectileEffects.BURN, otherCombatStats); + } + } + case SLOW -> {} + case STUN -> {} + } + } + + /** + * Used for singe targeting projectiles to apply effects entity it collides with. + * @param effect effect to be applied to entity + */ + public void applySingleEffect(ProjectileEffects effect, CombatStatsComponent targetCombatStats) { + Entity hostEntity = getEntity(); + CombatStatsComponent hostCombatStats = hostEntity.getComponent(CombatStatsComponent.class); + + if (hostCombatStats == null) { + // The host entity does not have a CombatStatsComponent to deal damage + return; + } + + switch (effect) { + case FIREBALL -> {} + case BURN -> { + burnEffect(targetCombatStats, hostCombatStats); + } + case SLOW -> {} + case STUN -> {} + } + } + /** + * Used for aoe projectiles to apply effects to all entities within the area of effect (radius). + * @param effect effect to be applied to entities within radius + */ + public void applyAoeEffect(ProjectileEffects effect) { + Entity hostEntity = getEntity(); + CombatStatsComponent hostCombatStats = hostEntity.getComponent(CombatStatsComponent.class); + + if (hostCombatStats == null) { + // The host entity does not have a CombatStatsComponent to deal damage + return; + } + + Array nearbyEntities = ServiceLocator.getEntityService().getNearbyEntities(hostEntity, radius); + + for (int i = 0; i < nearbyEntities.size; i++) { + Entity targetEntity = nearbyEntities.get(i); + CombatStatsComponent targetCombatStats = targetEntity.getComponent(CombatStatsComponent.class); + if (targetCombatStats != null) { + switch (effect) { + case FIREBALL -> { + fireballEffect(targetCombatStats, hostCombatStats); + } + case BURN -> { + burnEffect(targetCombatStats, hostCombatStats); + } + case SLOW -> {} + case STUN -> {} + } + } + } + } + + private void fireballEffect(CombatStatsComponent target, CombatStatsComponent host) { + target.hit(host); + } + + private void burnEffect(CombatStatsComponent target, CombatStatsComponent host) { + // Ensure burn effects aren't applied multiple times by same projectile + if (burnEntities.contains(target)) { + return; + } + burnEntities.add(target); + + // Create a timer task to apply the effect repeatedly + int numberOfTicks = 5; + long delay = 1; + Timer.schedule(new Timer.Task() { + private int count = 0; + + @Override + public void run() { + if (count < numberOfTicks) { + target.hit(host); + count++; + } else { + // Ensure to cancel the task when it's done + this.cancel(); + } + } + }, delay, delay); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/MobProjectileAnimationController.java b/source/core/src/main/com/csse3200/game/components/MobProjectileAnimationController.java new file mode 100644 index 000000000..e1a55775e --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/MobProjectileAnimationController.java @@ -0,0 +1,23 @@ +package com.csse3200.game.components; + +import com.csse3200.game.rendering.AnimationRenderComponent; + + +public class MobProjectileAnimationController extends Component { + AnimationRenderComponent animator; + + /** + * Creation call for a TowerAnimationController, fetches the animationRenderComponent that this controller will + * be attached to and registers all the event listeners required to trigger the animations and sounds. + */ + @Override + public void create() { + super.create(); + animator = this.entity.getComponent(AnimationRenderComponent.class); + entity.getEvents().addListener("rotate", this::animateStartRotate); + } + + void animateStartRotate() { + animator.startAnimation("rotate"); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/ProjectileEffects.java b/source/core/src/main/com/csse3200/game/components/ProjectileEffects.java new file mode 100644 index 000000000..39259b414 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/ProjectileEffects.java @@ -0,0 +1,8 @@ +package com.csse3200.game.components; + +public enum ProjectileEffects { + FIREBALL, //fireball projectile - deals damage based on baseAttack + BURN, //burn projectile - does 5 extra ticks of damage over 5 seconds + SLOW, //slow projectile - slows entity by half for 5 seconds + STUN //stun projectile - stuns entity for 5 seconds +} diff --git a/source/core/src/main/com/csse3200/game/components/RicochetComponent.java b/source/core/src/main/com/csse3200/game/components/RicochetComponent.java new file mode 100644 index 000000000..f2732375e --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/RicochetComponent.java @@ -0,0 +1,60 @@ +package com.csse3200.game.components; + +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.physics.box2d.Body; +import com.badlogic.gdx.physics.box2d.Fixture; +import com.csse3200.game.ai.tasks.AITaskComponent; +import com.csse3200.game.components.tasks.TrajectTask; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.factories.ProjectileFactory; +import com.csse3200.game.physics.BodyUserData; +import com.csse3200.game.physics.PhysicsLayer; +import com.csse3200.game.physics.components.HitboxComponent; +import com.csse3200.game.physics.components.PhysicsComponent; +import com.csse3200.game.services.ServiceLocator; + +/** + * Ricochet based on target layers. + * Basically a bouncing effect that continues to bounce off entities + * Possible extensions: Have a limitied amount of bounce until self-destruct. + */ +public class RicochetComponent extends Component { + private short targetLayer; + private HitboxComponent hitBoxComponent; + + public RicochetComponent(short targetLayer) { + this.targetLayer = targetLayer; + } + + @Override + public void create() { + entity.getEvents().addListener("collisionEnd", this::onCollisionEnd); + hitBoxComponent = entity.getComponent(HitboxComponent.class); + } + + /** + * After collision ends, make another fireball that spawns just before the original one. This assumes + * that the original fireball is already deleted. Set TouchAttackComponent disposeOnHit to true. + * @param me + * @param other + */ + private void onCollisionEnd(Fixture me, Fixture other) { + if(hitBoxComponent.getFixture() != me) return; + + if(!PhysicsLayer.contains(targetLayer, other.getFilterData().categoryBits)) return; + + Entity projectile = ((BodyUserData) me.getBody().getUserData()).entity; + + Entity newProjectile = ProjectileFactory.createRicochetFireball(PhysicsLayer.NPC, new Vector2(100, projectile.getPosition().y + getRandomNumFrom(-250, 250)), new Vector2(2f, 2f)); + newProjectile.setPosition((float) (projectile.getPosition().x -1.5), (float) (projectile.getPosition().y)); + + // projectile.getComponent(AITaskComponent.class).addTask(new TrajectTask(new Vector2(100, projectile.getPosition().y + 50))); + + + ServiceLocator.getEntityService().register(newProjectile); + } + + private int getRandomNumFrom(int min, int max) { + return (int) (Math.random() * (max - min) + min); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/SelfDestructOnHitComponent.java b/source/core/src/main/com/csse3200/game/components/SelfDestructOnHitComponent.java new file mode 100644 index 000000000..cf42fbb32 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/SelfDestructOnHitComponent.java @@ -0,0 +1,44 @@ +package com.csse3200.game.components; + +import com.badlogic.gdx.physics.box2d.Fixture; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.physics.BodyUserData; +import com.csse3200.game.physics.PhysicsLayer; +import com.csse3200.game.physics.components.HitboxComponent; + +/** + * This specific entity will self-destruct after the collisionEnd + * event if the targetLayer matches. + * Possible extensions to take in an array of entities instead. + */ +public class SelfDestructOnHitComponent extends Component { + private short targetLayer; + private HitboxComponent hitboxComponent; + + /** + * Create a component that self-destructs based on a specified targetLayer. + * @param targetLayer Physic's layer of the target collider. + */ + public SelfDestructOnHitComponent(short targetLayer) { + this.targetLayer = targetLayer; + } + + @Override + public void create() { + entity.getEvents().addListener("collisionEnd", this::onCollisionEnd); + hitboxComponent = entity.getComponent(HitboxComponent.class); + } + + private void onCollisionEnd(Fixture me, Fixture other) { + if (hitboxComponent.getFixture() != me) + return; + + if (!PhysicsLayer.contains(targetLayer, other.getFilterData().categoryBits)) + return; + + Entity selfEntity = ((BodyUserData) me.getBody().getUserData()).entity; + + selfEntity.setFlagForDelete(true); + } + +} diff --git a/source/core/src/main/com/csse3200/game/components/TouchAttackComponent.java b/source/core/src/main/com/csse3200/game/components/TouchAttackComponent.java index 152f49c91..c42945db3 100644 --- a/source/core/src/main/com/csse3200/game/components/TouchAttackComponent.java +++ b/source/core/src/main/com/csse3200/game/components/TouchAttackComponent.java @@ -58,7 +58,7 @@ public TouchAttackComponent(short targetLayer, float knockback, boolean disposeO @Override public void create() { entity.getEvents().addListener("collisionStart", this::onCollisionStart); - entity.getEvents().addListener("collisionEnd", this::onCollisionEnd); + // entity.getEvents().addListener("collisionEnd", this::onCollisionEnd); combatStats = entity.getComponent(CombatStatsComponent.class); hitboxComponent = entity.getComponent(HitboxComponent.class); } @@ -100,8 +100,11 @@ private void onCollisionStart(Fixture me, Fixture other) { } } - private void onCollisionEnd(Fixture me, Fixture other) { - // Nothing to do on collision end + public void setDisposeOnHit(boolean disposeOnHit) { + this.disposeOnHit = disposeOnHit; } + // private void onCollisionEnd(Fixture me, Fixture other) { + // // Nothing to do on collision end + // } } diff --git a/source/core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.java b/source/core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.java new file mode 100644 index 000000000..9c808a557 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.java @@ -0,0 +1,34 @@ +package com.csse3200.game.components.projectile; + +import com.csse3200.game.components.Component; +import com.csse3200.game.rendering.AnimationRenderComponent; +import com.csse3200.game.services.ServiceLocator; //used for sound + +public class ProjectileAnimationController extends Component{ + /** Event name constants */ + private static final String START = "startProjectile"; + private static final String FINAL = "startProjectileFinal"; + + /** Animation name constants */ + private static final String START_ANIM = "projectile"; + private static final String FINAL_ANIM = "projectileFinal"; + + AnimationRenderComponent animator; + + @Override + public void create() { + super.create(); + animator = this.entity.getComponent(AnimationRenderComponent.class); + entity.getEvents().addListener(START, this::animateStart); + entity.getEvents().addListener(FINAL, this::animateFinal); + + } + + void animateStart() { + animator.startAnimation(START_ANIM); + } + + void animateFinal() { + animator.startAnimation(FINAL_ANIM); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java b/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java index 45632f99c..aaba29da7 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/MobAttackTask.java @@ -126,7 +126,7 @@ public void updateMobState() { mobState = STATE.STOW; } else { owner.getEntity().getEvents().trigger(FIRING); - Entity newProjectile = ProjectileFactory.createFireBall(owner.getEntity(), new Vector2(0, owner.getEntity().getPosition().y), new Vector2(2f,2f)); + Entity newProjectile = ProjectileFactory.createMobBall(PhysicsLayer.PLAYER, new Vector2(0, owner.getEntity().getPosition().y), new Vector2(2f,2f)); newProjectile.setPosition((float) (owner.getEntity().getPosition().x), (float) (owner.getEntity().getPosition().y)); newProjectile.setScale(-1f, 0.5f); ServiceLocator.getEntityService().register(newProjectile); diff --git a/source/core/src/main/com/csse3200/game/components/tasks/TNTTowerCombatTask.java b/source/core/src/main/com/csse3200/game/components/tasks/TNTTowerCombatTask.java new file mode 100644 index 000000000..c55a92450 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/tasks/TNTTowerCombatTask.java @@ -0,0 +1,173 @@ +package com.csse3200.game.components.tasks; + + +import com.badlogic.gdx.math.Vector2; +import com.csse3200.game.ai.tasks.DefaultTask; +import com.csse3200.game.ai.tasks.PriorityTask; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.EntityService; +import com.csse3200.game.physics.PhysicsEngine; +import com.csse3200.game.physics.PhysicsLayer; +import com.csse3200.game.physics.raycast.RaycastHit; +import com.csse3200.game.services.GameTime; +import com.csse3200.game.services.ServiceLocator; + +/** + * The TNTTowerCombatTask runs the AI for the TNTTower class. The tower will scan for targets in a straight line + * from its center point until a point at (x + maxRange, y), where x,y are the coordinates of the tower's center + * position. This component should be added to an AiTaskComponent attached to the tower instance. + */ +public class TNTTowerCombatTask extends DefaultTask implements PriorityTask { + // Constants + private static final int INTERVAL = 1; // time interval to scan for enemies in seconds + private static final short TARGET = PhysicsLayer.NPC; // The type of targets that the tower will detect + // the following four constants are the event names that will be triggered in the state machine + private static final String DIG = "digStart"; + private static final String EXPLOSION = "explodeStart"; + private static final String DEFAULT = "defaultStart"; + private static final String DAMAGE = "TNTDamageStart"; + + + // class attributes + private final int priority; // The active priority this task will have + private final float maxRange; + private Vector2 towerPosition = new Vector2(10, 10); // initial placeholder value - will be overwritten + private final Vector2 maxRangePosition = new Vector2(); + private final PhysicsEngine physics; + private final GameTime timeSource; + private long endTime; + private final RaycastHit hit = new RaycastHit(); + private boolean readToDelete = false; + + private enum STATE { + IDLE, EXPLODE, REMOVE + } + private STATE towerState = STATE.IDLE; + + /** + * @param priority Task priority when targets are detected (0 when nothing detected). Must be a positive integer. + * @param maxRange Maximum effective range of the weapon tower. This determines the detection distance of targets + */ + public TNTTowerCombatTask(int priority, float maxRange) { + this.priority = priority; + this.maxRange = maxRange; + physics = ServiceLocator.getPhysicsService().getPhysics(); + timeSource = ServiceLocator.getTimeSource(); + + } + + /** + * Starts the Task running, triggers the initial "defaultStart" event. + */ + @Override + public void start() { + super.start(); + // Set the tower's coordinates + this.towerPosition = owner.getEntity().getCenterPosition(); + this.maxRangePosition.set(towerPosition.x + maxRange, towerPosition.y); + // Default mode + owner.getEntity().getEvents().trigger(DEFAULT); + + endTime = timeSource.getTime() + (INTERVAL * 500); + } + + /** + * The update method is what is run every time the TaskRunner in the AiTaskComponent calls update(). + * triggers events depending on the presence or otherwise of targets in the detection range + */ + @Override + public void update() { + if (timeSource.getTime() >= endTime) { + updateTowerState(); + endTime = timeSource.getTime() + (INTERVAL * 1000); + } + } + + /** + * TNT tower state machine. Updates tower state by scanning for mobs, and + * triggers the appropriate events corresponding to the STATE enum. + */ + public void updateTowerState() { + // configure tower state depending on target visibility + + switch (towerState) { + case IDLE -> { + // targets detected in idle mode - start deployment + if (isTargetVisible()) { + owner.getEntity().getEvents().trigger(DIG); + towerState = STATE.EXPLODE; + } else { + owner.getEntity().getEvents().trigger(DEFAULT); + } + } + case EXPLODE -> { + owner.getEntity().getEvents().trigger(EXPLOSION); + owner.getEntity().getEvents().trigger(DAMAGE); + towerState = STATE.REMOVE; + } + case REMOVE -> { + readToDelete = true; + } + } + + + } + /** + * For stopping the running task + */ + @Override + public void stop() { + super.stop(); + } + + /** + * Returns the current priority of the task. + * @return active priority value if targets detected, inactive priority otherwise + */ + @Override + public int getPriority() { + + if (isReadyToDelete()) { + owner.getEntity().setFlagForDelete(true); + return -1; + } else { + return priority; + } + } + + /** + * Fetches the active priority of the Task if a target is visible. + * @return (int) active priority if a target is visible, -1 otherwise + */ + private int getActivePriority() { + + return !isTargetVisible() ? 0 : priority; + } + + /** + * Fetches the inactive priority of the Task if a target is not visible. + * @return (int) -1 if a target is not visible, active priority otherwise + */ + private int getInactivePriority() { + + return isTargetVisible() ? priority : 0; + } + + /** + * Uses a raycast to determine whether there are any targets in detection range + * @return true if a target is visible, false otherwise + */ + private boolean isTargetVisible() { + // If there is an obstacle in the path to the max range point, mobs visible. + return physics.raycast(towerPosition, maxRangePosition, TARGET, hit); + } + + private boolean isReadyToDelete() { + + return readToDelete; + } +} + + + + diff --git a/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java b/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java index bae13b0fd..82cde5225 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java @@ -112,7 +112,11 @@ public void updateTowerState() { } else { owner.getEntity().getEvents().trigger(FIRING); // this might be changed to an event which gets triggered everytime the tower enters the firing state - Entity newProjectile = ProjectileFactory.createFireBall(owner.getEntity(), new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f,2f)); + Entity newProjectile = ProjectileFactory.createFireBall(PhysicsLayer.PLAYER, new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f,2f)); + + // * TEMPORARYYYYYYY + // Entity newProjectile = ProjectileFactory.createRicochetFireball(PhysicsLayer.NPC, new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f,2f)); + newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.75), (float) (owner.getEntity().getPosition().y + 0.75)); ServiceLocator.getEntityService().register(newProjectile); } diff --git a/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java b/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java index 0741355b1..56c81912b 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java @@ -3,12 +3,24 @@ import com.badlogic.gdx.math.Vector2; import com.csse3200.game.ai.tasks.DefaultTask; import com.csse3200.game.ai.tasks.PriorityTask; +import com.csse3200.game.services.GameTime; /** Trajects a projectile from an entity towards the enemy entities */ public class TrajectTask extends DefaultTask implements PriorityTask { private final int priority = 10; private MovementTask movementTask; private Vector2 destination; + private static final String START = "startProjectile"; + private static final String FINAL = "startProjectileFinal"; + + + + private enum STATE { + START, FINAL + } + private STATE projectileState = STATE.START; + + private GameTime projectSpawn; /** * @param destination The destination that the projectile will move towards. @@ -26,8 +38,17 @@ public void start() { movementTask = new MovementTask(destination); movementTask.create(owner); movementTask.start(); - - this.owner.getEntity().getEvents().trigger("trajectStart"); + + this.owner.getEntity().getEvents().trigger(START); + this.owner.getEntity().getEvents().trigger("rotate"); + } + + public void switchProjectileState() { + switch (projectileState) { + case START: + this.owner.getEntity().getEvents().trigger(FINAL); + projectileState = STATE.FINAL; + } } @Override @@ -36,6 +57,7 @@ public void update() { movementTask.update(); if (movementTask.getStatus() != Status.ACTIVE) { movementTask.start(); + switchProjectileState(); } } @@ -43,6 +65,7 @@ public void update() { public void stop() { super.stop(); movementTask.stop(); + this.owner.getEntity().getEvents().trigger(FINAL); } @Override diff --git a/source/core/src/main/com/csse3200/game/components/tower/TNTAnimationController.java b/source/core/src/main/com/csse3200/game/components/tower/TNTAnimationController.java new file mode 100644 index 000000000..1f092dab5 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/tower/TNTAnimationController.java @@ -0,0 +1,49 @@ +package com.csse3200.game.components.tower; + +import com.csse3200.game.components.Component; +import com.csse3200.game.rendering.AnimationRenderComponent; + +/** + * This class listens to events relevant to TNTTower entity's state and plays the animation when one + * of the events is triggered. + */ +public class TNTAnimationController extends Component { + private AnimationRenderComponent animator; + + /** + * Creation call for a TNTAnimationController, fetches the animationRenderComponent that this controller will + * be attached to and registers all the event listeners required to trigger the animations and sounds. + */ + @Override + public void create() { + super.create(); + animator = this.entity.getComponent(AnimationRenderComponent.class); + entity.getEvents().addListener("digStart", this::animateDig); + entity.getEvents().addListener("defaultStart", this::animateDefault); + entity.getEvents().addListener("explodeStart",this::animateExplode); + + } + + /** + * Triggers the "dig" animation for the entity. + * This method should be invoked when the entity enters the digging state. + */ + void animateDig() { + animator.startAnimation("dig"); + } + + /** + * Triggers the "default" animation for the entity. + * This method should be invoked when the entity returns to its default state. + */ + void animateDefault() { animator.startAnimation("default");} + + /** + * Triggers the "explode" animation for the entity. + * This method should be invoked when the entity enters the explosion state. + */ + void animateExplode() { animator.startAnimation("explode"); + + } + +} diff --git a/source/core/src/main/com/csse3200/game/components/tower/TNTDamageComponent.java b/source/core/src/main/com/csse3200/game/components/tower/TNTDamageComponent.java new file mode 100644 index 000000000..c019b92fd --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/tower/TNTDamageComponent.java @@ -0,0 +1,142 @@ +package com.csse3200.game.components.tower; + +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.physics.box2d.Body; +import com.badlogic.gdx.physics.box2d.Fixture; +import com.badlogic.gdx.utils.Array; +import com.csse3200.game.ai.tasks.AITaskComponent; +import com.csse3200.game.components.CombatStatsComponent; +import com.csse3200.game.components.Component; +import com.csse3200.game.components.maingame.MainGameActions; +import com.csse3200.game.components.tasks.WaitTask; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.physics.BodyUserData; +import com.csse3200.game.physics.PhysicsLayer; +import com.csse3200.game.physics.components.HitboxComponent; +import com.csse3200.game.physics.components.PhysicsComponent; +import com.csse3200.game.physics.components.PhysicsMovementComponent; +import com.csse3200.game.services.ServiceLocator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Class responsible for applying damage and knock-back to nearby entities when triggered. + * Utilizes HitboxComponent and CombatStatsComponent for functionality. + */ +public class TNTDamageComponent extends Component { + private static final Logger logger = LoggerFactory.getLogger(TNTDamageComponent.class); + private short targetLayer; + private float knockbackForce = 0f; + private float radius; + private CombatStatsComponent combatStats; + private HitboxComponent hitboxComponent; + + /** + * Default constructor for creating a component without knockback. + * + * @param targetLayer The physics layer of the target entities' collider. + */ + public TNTDamageComponent(short targetLayer) { + this.targetLayer = targetLayer; + } + + /** + * Overloaded constructor for creating a component with knockback and radius. + * + * @param targetLayer The physics layer of the target entities' collider. + * @param knockback The force of the knockback. + * @param radius The radius within which entities will be affected. + */ + public TNTDamageComponent(short targetLayer, float knockback, float radius) { + this.targetLayer = targetLayer; + this.knockbackForce = knockback; + this.radius = radius; + } + + /** + * Initializes the component and registers event listeners. + */ + @Override + public void create() { + entity.getEvents().addListener("TNTDamageStart", this::applyTNTDamage); + combatStats = entity.getComponent(CombatStatsComponent.class); + hitboxComponent = entity.getComponent(HitboxComponent.class); + } + + /** + * Scans all nearby entities within a given radius and applies damage and knockback to them. + */ + private void applyTNTDamage() { + // Fetch nearby entities + Array allEntities = ServiceLocator.getEntityService().getEntities(); + + for (int i = 0; i < allEntities.size; i++) { + Entity otherEntity = allEntities.get(i); + + if (entity == otherEntity) continue; // Skip the source entity + + Vector2 positionSource = entity.getPosition(); + Vector2 positionOther = otherEntity.getPosition(); + + if (positionSource.dst(positionOther) <= radius) { + HitboxComponent sourceHitbox = entity.getComponent(HitboxComponent.class); + HitboxComponent otherHitbox = otherEntity.getComponent(HitboxComponent.class); + + // Check for null components and log specifics + if (sourceHitbox == null || otherHitbox == null) { + if (sourceHitbox == null) { + logger.debug("Warning: Source Entity without HitboxComponent. Source Entity: " + entity); + } + if (otherHitbox == null) { + logger.debug("Warning: Other Entity without HitboxComponent. Other Entity: " + otherEntity); + } + continue; + } + + applyDamage(sourceHitbox.getFixture(), otherHitbox.getFixture()); + } + } + } + + + /** + * Applies damage and knockback to a specific entity based on their physics fixtures. + * + * @param me The fixture representing this entity. + * @param other The fixture representing the target entity. + */ + private void applyDamage(Fixture me, Fixture other) { + if (hitboxComponent.getFixture() != me) { + // Not triggered by hitbox, ignore + return; + } + + if (!PhysicsLayer.contains(targetLayer, other.getFilterData().categoryBits)) { + // Doesn't match our target layer, ignore + return; + } + + // Try to attack target. + Entity target = ((BodyUserData) other.getBody().getUserData()).entity; + CombatStatsComponent targetStats = target.getComponent(CombatStatsComponent.class); + if (targetStats != null) { + targetStats.hit(combatStats); + } + + // apply knock-back + PhysicsComponent physicsComponent = target.getComponent(PhysicsComponent.class); + PhysicsMovementComponent movementComponent = target.getComponent(PhysicsMovementComponent.class); + + if (physicsComponent != null && knockbackForce > 0f) { + // Disable regular movement temporarily + if (movementComponent != null) { + movementComponent.applyKnockback(0.5f); // Disable movement for 0.5 seconds + } + + Body targetBody = physicsComponent.getBody(); + Vector2 direction = target.getCenterPosition().sub(entity.getCenterPosition()).nor(); + Vector2 impulse = direction.scl(knockbackForce); + targetBody.applyLinearImpulse(impulse, targetBody.getWorldCenter(), true); + } + } +} \ No newline at end of file diff --git a/source/core/src/main/com/csse3200/game/entities/Entity.java b/source/core/src/main/com/csse3200/game/entities/Entity.java index e1cf2735c..676292dfb 100644 --- a/source/core/src/main/com/csse3200/game/entities/Entity.java +++ b/source/core/src/main/com/csse3200/game/entities/Entity.java @@ -252,6 +252,10 @@ public void update() { for (Component component : createdComponents) { component.triggerUpdate(); } + if (isFlaggedForDelete) { + dispose(); + return; + } } /** @@ -281,7 +285,7 @@ public boolean getFlagForDelete() { * @param condition true to flag for deletion, false to unflag */ public void setFlagForDelete(boolean condition) { - isFlaggedForDelete = condition; + this.isFlaggedForDelete = condition; } @Override diff --git a/source/core/src/main/com/csse3200/game/entities/EntityService.java b/source/core/src/main/com/csse3200/game/entities/EntityService.java index c8c8823df..9c20b93d4 100644 --- a/source/core/src/main/com/csse3200/game/entities/EntityService.java +++ b/source/core/src/main/com/csse3200/game/entities/EntityService.java @@ -85,7 +85,9 @@ public Array getEntities() { public Array getNearbyEntities(Entity source, float radius) { Array nearbyEntities = new Array(); Array allEntities = ServiceLocator.getEntityService().getEntities(); - for (Entity otherEntity : allEntities) { + for (int i = 0; i < allEntities.size; i++) { + Entity otherEntity = allEntities.get(i); + if (source == otherEntity) continue; // Skip the source entity Vector2 positionSource = source.getPosition(); diff --git a/source/core/src/main/com/csse3200/game/entities/configs/TNTTowerConfigs.java b/source/core/src/main/com/csse3200/game/entities/configs/TNTTowerConfigs.java new file mode 100644 index 000000000..2dbd2e53d --- /dev/null +++ b/source/core/src/main/com/csse3200/game/entities/configs/TNTTowerConfigs.java @@ -0,0 +1,10 @@ +package com.csse3200.game.entities.configs; + +/** + * Defines a basic set of properties stored in entities config files to be loaded by Entity Factories. + */ +public class TNTTowerConfigs { + public int health = 1; + public int baseAttack = 0; + public int cost = 1; +} diff --git a/source/core/src/main/com/csse3200/game/entities/configs/baseTowerConfigs.java b/source/core/src/main/com/csse3200/game/entities/configs/baseTowerConfigs.java index 13c6fe19b..d0c920d0c 100644 --- a/source/core/src/main/com/csse3200/game/entities/configs/baseTowerConfigs.java +++ b/source/core/src/main/com/csse3200/game/entities/configs/baseTowerConfigs.java @@ -7,4 +7,5 @@ public class baseTowerConfigs { public WeaponTowerConfig weapon = new WeaponTowerConfig(); public WallTowerConfig wall = new WallTowerConfig(); public IncomeTowerConfig income = new IncomeTowerConfig(); + public TNTTowerConfigs TNTTower = new TNTTowerConfigs(); } \ No newline at end of file diff --git a/source/core/src/main/com/csse3200/game/entities/factories/ObstacleFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/ObstacleFactory.java index f863cbfb2..c271ea2d6 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/ObstacleFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/ObstacleFactory.java @@ -69,6 +69,7 @@ public static Entity createMountain() { public static Entity createWall(float width, float height) { Entity wall = new Entity() .addComponent(new PhysicsComponent().setBodyType(BodyType.StaticBody)) + // * TMEPORARRYY WALLL .addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE)); wall.setScale(width, height); return wall; diff --git a/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java index 33d596599..503df0b93 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java @@ -1,15 +1,21 @@ package com.csse3200.game.entities.factories; -import com.csse3200.game.components.AoeComponent; +import com.badlogic.gdx.graphics.g2d.Animation; +import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import com.csse3200.game.components.EffectsComponent; +import com.csse3200.game.components.ProjectileEffects; import com.csse3200.game.components.TouchAttackComponent; +import com.csse3200.game.components.RicochetComponent; import com.csse3200.game.components.tasks.TrajectTask; import com.csse3200.game.ai.tasks.AITaskComponent; import com.csse3200.game.components.CombatStatsComponent; +import com.csse3200.game.components.MobProjectileAnimationController; import com.csse3200.game.entities.configs.BaseEntityConfig; import com.csse3200.game.entities.configs.NPCConfigs; import com.csse3200.game.files.FileLoader; import com.csse3200.game.entities.Entity; -import com.csse3200.game.rendering.TextureRenderComponent; +import com.csse3200.game.rendering.AnimationRenderComponent; +import com.csse3200.game.services.ServiceLocator; import com.csse3200.game.physics.PhysicsLayer; import com.csse3200.game.physics.PhysicsUtils; import com.csse3200.game.physics.components.ColliderComponent; @@ -17,60 +23,126 @@ import com.csse3200.game.physics.components.PhysicsComponent; import com.csse3200.game.physics.components.PhysicsMovementComponent; import com.badlogic.gdx.math.Vector2; +import com.csse3200.game.components.projectile.ProjectileAnimationController; /** * Responsible for creating projectiles within the game. */ public class ProjectileFactory { + /** Animation constants */ + private static final String BASE_PROJECTILE_ATLAS = "images/projectiles/basic_projectile.atlas"; + private static final String START_ANIM = "projectile"; + private static final String FINAL_ANIM = "projectileFinal"; + private static final float START_SPEED = 0.1f; + private static final float FINAL_SPEED = 0.1f; private static final NPCConfigs configs = FileLoader.readClass(NPCConfigs.class, "configs/NPCs.json"); + /** + * Creates a single-targeting projectile with specified effect + * + * @param targetLayer The enemy layer that the projectile collides with. + * @param destination The destination the projectile heads towards. + * @param speed The speed of the projectile. + * @param effect Specified effect from the ProjectileEffects enums + * @return Returns a new single-target projectile entity + */ + public static Entity createEffectProjectile(short targetLayer, Vector2 destination, Vector2 speed, ProjectileEffects effect, boolean aoe) { + Entity projectile = createFireBall(targetLayer, destination, speed); + + switch(effect) { + case FIREBALL -> { + projectile.addComponent(new EffectsComponent(targetLayer, 3, ProjectileEffects.FIREBALL, aoe)); + } + case BURN -> { + projectile.addComponent(new EffectsComponent(targetLayer, 3, ProjectileEffects.BURN, aoe)); + } + case SLOW -> { + projectile.addComponent(new EffectsComponent(targetLayer, 3, ProjectileEffects.SLOW, aoe)); + } + case STUN -> { + projectile.addComponent(new EffectsComponent(targetLayer, 3, ProjectileEffects.STUN, aoe)); + } + } + return projectile; + } + + /** + * Create a pierce fireball. + * Pierce fireball is basically a fireball that does damage but won't self destruct on hit. + */ + public static Entity createPierceFireBall(short targetLayer, Vector2 destination, Vector2 speed) { + Entity fireBall = createFireBall(targetLayer, destination, speed); + fireBall.getComponent(TouchAttackComponent.class).setDisposeOnHit(false); + + return fireBall; + } + + /** + * Create a ricochet fireball. + * Ricochet fireball bounces off specified targets while applying intended effects i.e. damage + */ + public static Entity createRicochetFireball(short targetLayer, Vector2 destination, Vector2 speed) { + Entity fireBall = createFireBall(targetLayer, destination, speed); + fireBall.addComponent(new RicochetComponent(targetLayer)); + + return fireBall; + } + /** * Creates a fireball Entity. * - * @param target The enemy entities that the projectile collides with. + * @param targetLayer The enemy layer that the projectile collides with. * @param destination The destination the projectile heads towards. * @param speed The speed of the projectile. * @return Returns a new fireball projectile entity. */ - public static Entity createFireBall(Entity target, Vector2 destination, Vector2 speed) { - BaseEntityConfig config = configs.fireBall; + public static Entity createFireBall(short targetLayer, Vector2 destination, Vector2 speed) { + Entity projectile = createBaseProjectile(targetLayer, destination, speed); - Entity projectile = createBaseProjectile(target, destination); + AnimationRenderComponent animator = + new AnimationRenderComponent( + ServiceLocator.getResourceService() + .getAsset(BASE_PROJECTILE_ATLAS, TextureAtlas.class)); + animator.addAnimation(START_ANIM, START_SPEED, Animation.PlayMode.NORMAL); + animator.addAnimation(FINAL_ANIM, FINAL_SPEED, Animation.PlayMode.NORMAL); projectile - .addComponent(new TextureRenderComponent("images/projectiles/projectile.png")) - .addComponent(new ColliderComponent().setSensor(true)) - - // This is the component that allows the projectile to damage a specified target. - .addComponent(new TouchAttackComponent(PhysicsLayer.PLAYER, 1.5f, true)) - .addComponent(new CombatStatsComponent(config.health, config.baseAttack)); + .addComponent(animator) + .addComponent(new ProjectileAnimationController()); + // .addComponent(new SelfDestructOnHitComponent(PhysicsLayer.OBSTACLE)); - projectile - .getComponent(TextureRenderComponent.class).scaleEntity(); - - projectile - .getComponent(PhysicsMovementComponent.class).setSpeed(speed); +// projectile +// .getComponent(TextureRenderComponent.class).scaleEntity(); return projectile; } - + /** - * Creates an AOE fireball Entity. + * Creates a projectile specifically for mobs to shoot * - * @param target The enemy entities that the projectile collides with. + * @param targetLayer The enemy layer that the projectile collides with. * @param destination The destination the projectile heads towards. * @param speed The speed of the projectile. - * @param aoeSize The size of the AOE. - * @return Returns the new aoe projectile entity. + * @return Returns a new fireball projectile entity. */ - public static Entity createAOEFireBall(Entity target, Vector2 destination, Vector2 speed, int aoeSize) { - BaseEntityConfig config = configs.fireBall; - Entity projectile = createFireBall(target, destination, speed); + public static Entity createMobBall(short targetLayer, Vector2 destination, Vector2 speed) { + Entity projectile = createBaseProjectile(targetLayer, destination, speed); + + AnimationRenderComponent animator = + new AnimationRenderComponent( + ServiceLocator.getResourceService() + .getAsset("images/projectiles/mobProjectile.atlas", TextureAtlas.class)); + + animator.addAnimation("rotate", 0.15f, Animation.PlayMode.LOOP); + + projectile + .addComponent(animator) + .addComponent(new MobProjectileAnimationController()); + projectile - // This is the component that allows the projectile to damage a specified target. - .addComponent(new AoeComponent(aoeSize)); + .getComponent(AnimationRenderComponent.class).scaleEntity(); return projectile; } @@ -78,11 +150,15 @@ public static Entity createAOEFireBall(Entity target, Vector2 destination, Vecto /** * Creates a generic projectile entity that can be used for multiple types of * projectiles. * - * @param target The enemy entities that the projectile collides with. + * @param targetLayer The enemy layer that the projectile collides with. * @param destination The destination the projectile heads towards. + * @param speed The speed of the projectile. * @return Returns a generic projectile entity. */ - public static Entity createBaseProjectile(Entity target, Vector2 destination) { + public static Entity createBaseProjectile(short targetLayer, Vector2 + destination, Vector2 speed) { + BaseEntityConfig config = configs.fireBall; + AITaskComponent aiComponent = new AITaskComponent() .addTask(new TrajectTask(destination)); @@ -91,7 +167,16 @@ public static Entity createBaseProjectile(Entity target, Vector2 destination) { .addComponent(new PhysicsComponent()) .addComponent(new PhysicsMovementComponent()) .addComponent(new HitboxComponent().setLayer(PhysicsLayer.PROJECTILE)) - .addComponent(aiComponent); + .addComponent(aiComponent) + .addComponent(new ColliderComponent().setSensor(true)) + // This is the component that allows the projectile to damage a + // specified target. + // Original knockback value: 1.5f + .addComponent(new TouchAttackComponent(targetLayer, 1.5f, true)) + .addComponent(new CombatStatsComponent(config.health, config.baseAttack)); + + projectile + .getComponent(PhysicsMovementComponent.class).setSpeed(speed); return projectile; } diff --git a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java index 04dab2a54..93aa93794 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java @@ -1,5 +1,10 @@ package com.csse3200.game.entities.factories; +import com.csse3200.game.components.TouchAttackComponent; +import com.csse3200.game.components.tasks.TNTTowerCombatTask; +import com.csse3200.game.components.tower.TNTAnimationController; +import com.csse3200.game.components.tower.TNTDamageComponent; +import com.csse3200.game.entities.configs.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.badlogic.gdx.graphics.Texture; @@ -13,14 +18,10 @@ import com.csse3200.game.components.tower.TowerAnimationController; import com.csse3200.game.components.tasks.CurrencyTask; import com.csse3200.game.entities.Entity; -import com.csse3200.game.entities.configs.WallTowerConfig; import com.csse3200.game.physics.PhysicsLayer; import com.csse3200.game.physics.components.ColliderComponent; import com.csse3200.game.physics.components.HitboxComponent; import com.csse3200.game.physics.components.PhysicsComponent; -import com.csse3200.game.entities.configs.WeaponTowerConfig; -import com.csse3200.game.entities.configs.IncomeTowerConfig; -import com.csse3200.game.entities.configs.baseTowerConfigs; import com.csse3200.game.files.FileLoader; import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.rendering.TextureRenderComponent; @@ -36,8 +37,18 @@ public class TowerFactory { private static final int COMBAT_TASK_PRIORITY = 2; private static final int WEAPON_TOWER_MAX_RANGE = 40; + private static final int TNT_TOWER_MAX_RANGE = 6; + private static final int TNT_TOWER_RANGE = 5; + private static final int TNT_KNOCK_BACK_FORCE = 10; private static final String WALL_IMAGE = "images/towers/wallTower.png"; private static final String TURRET_ATLAS = "images/towers/turret01.atlas"; + private static final String TNT_ATLAS = "images/towers/TNTTower.atlas"; + private static final String DEFAULT_ANIM = "default"; + private static final float DEFAULT_SPEED= 0.2f; + private static final String DIG_ANIM = "dig"; + private static final float DIG_SPEED = 0.2f; + private static final String EXPLODE_ANIM = "explode"; + private static final float EXPLODE_SPEED = 0.2f; private static final String IDLE_ANIM = "idle"; private static final float IDLE_SPEED = 0.3f; private static final String DEPLOY_ANIM = "deploy"; @@ -88,6 +99,41 @@ public static Entity createWallTower() { } + /** + * Create a type of TNT that explodes once it detects a mob within a certain range. + * Upon detonation, the TNT will apply both knock-back and health damage to the affected mobs + * @return entity + */ + public static Entity createTNTTower() { + Entity TNTTower = createBaseTower(); + TNTTowerConfigs config = configs.TNTTower; + + AITaskComponent aiTaskComponent = new AITaskComponent() + .addTask(new TNTTowerCombatTask(COMBAT_TASK_PRIORITY, TNT_TOWER_MAX_RANGE)); + + AnimationRenderComponent animator = + new AnimationRenderComponent( + ServiceLocator.getResourceService() + .getAsset(TNT_ATLAS, TextureAtlas.class)); + + animator.addAnimation(DIG_ANIM, DIG_SPEED, Animation.PlayMode.NORMAL); + animator.addAnimation(DEFAULT_ANIM,DEFAULT_SPEED, Animation.PlayMode.NORMAL); + animator.addAnimation(EXPLODE_ANIM,EXPLODE_SPEED, Animation.PlayMode.NORMAL); + + TNTTower + .addComponent(new CombatStatsComponent(config.health, config.baseAttack)) + .addComponent(new CostComponent(config.cost)) + .addComponent(new TNTDamageComponent(PhysicsLayer.NPC,TNT_KNOCK_BACK_FORCE,TNT_TOWER_RANGE)) + .addComponent(aiTaskComponent) + .addComponent(animator) + .addComponent(new TNTAnimationController()); + + TNTTower.getComponent(AnimationRenderComponent.class).scaleEntity(); + + return TNTTower; + } + + /** * Creates a weaponry tower that shoots at mobs - This will most likely need to be extended * once other types of weapon towers are developed diff --git a/source/core/src/main/com/csse3200/game/physics/components/PhysicsMovementComponent.java b/source/core/src/main/com/csse3200/game/physics/components/PhysicsMovementComponent.java index 9acbf4f64..e1f88cb1d 100644 --- a/source/core/src/main/com/csse3200/game/physics/components/PhysicsMovementComponent.java +++ b/source/core/src/main/com/csse3200/game/physics/components/PhysicsMovementComponent.java @@ -12,6 +12,7 @@ public class PhysicsMovementComponent extends Component implements MovementController { private static final Logger logger = LoggerFactory.getLogger(PhysicsMovementComponent.class); private Vector2 maxSpeed = Vector2Utils.ONE; + private float skipMovementTime = 0f; // in seconds, for knockback private PhysicsComponent physicsComponent; private Vector2 targetPosition; @@ -24,12 +25,24 @@ public void create() { @Override public void update() { + if (skipMovementTime > 0) { + skipMovementTime -= 0.02f; + return; + } if (movementEnabled && targetPosition != null) { Body body = physicsComponent.getBody(); updateDirection(body); } } + /** + * Applies knock-back to the entity by disabling its movement for a specified duration. + * @param duration The time (in seconds) for which the entity's movement will be disabled. + */ + public void applyKnockback(float duration) { + this.skipMovementTime = duration; + } + /** * Enable/disable movement for the controller. Disabling will immediately set velocity to 0. * diff --git a/source/core/src/main/com/csse3200/game/rendering/AnimationRenderComponent.java b/source/core/src/main/com/csse3200/game/rendering/AnimationRenderComponent.java index 2c403e26b..8f52f18bb 100644 --- a/source/core/src/main/com/csse3200/game/rendering/AnimationRenderComponent.java +++ b/source/core/src/main/com/csse3200/game/rendering/AnimationRenderComponent.java @@ -179,7 +179,7 @@ protected void draw(SpriteBatch batch) { @Override public void dispose() { - atlas.dispose(); + // atlas.dispose(); super.dispose(); } } diff --git a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java index 651909937..cebd5352c 100644 --- a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java @@ -1,5 +1,5 @@ package com.csse3200.game.screens; -import com.badlogic.gdx.graphics.Pixmap; +import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.ScreenAdapter; @@ -13,6 +13,7 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.ScreenViewport; import com.badlogic.gdx.utils.viewport.Viewport; import com.csse3200.game.GdxGame; @@ -50,7 +51,7 @@ public class MainGameScreen extends ScreenAdapter { private static final Logger logger = LoggerFactory.getLogger(MainGameScreen.class); private static final String[] mainGameTextures = {"images/heart.png"}; - private static final Vector2 CAMERA_POSITION = new Vector2(10f, 7.5f); + private static final Vector2 CAMERA_POSITION = new Vector2(10f, 5.64f); private final GdxGame game; private final Renderer renderer; @@ -60,43 +61,30 @@ public class MainGameScreen extends ScreenAdapter { static int screenWidth = Gdx.graphics.getWidth(); static int screenHeight = Gdx.graphics.getHeight(); + + public static int viewportWidth = screenWidth; public static int viewportHeight= screenHeight; - public static final int NUM_LANES = 8; - public static final float LANE_HEIGHT = viewportHeight / NUM_LANES; + + private OrthographicCamera camera; private SpriteBatch batch; - private Texture whiteTexture; + private Texture backgroundTexture; public MainGameScreen(GdxGame game) { this.game = game; - batch = new SpriteBatch(); - Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888); - pixmap.setColor(1, 1, 1, 1); - pixmap.fill(); - whiteTexture = new Texture(pixmap); - pixmap.dispose(); - camera = new OrthographicCamera(); camera.setToOrtho(false, viewportWidth, viewportHeight); camera.position.set(viewportWidth / 2, viewportHeight / 2, 0); + + batch = new SpriteBatch(); + Viewport viewport = new ScreenViewport(camera); stage = new Stage(viewport, new SpriteBatch()); - BitmapFont font = new BitmapFont(); - TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); - textButtonStyle.font = font; - textButtonStyle.fontColor = Color.WHITE; - for (int y = 0; y < 8; y++) { - for (int x = 0; x < 20; x++) { - TextButton button = new TextButton("" + x + y * 20, textButtonStyle); - stage.addActor(button); - } - } - logger.debug("Initialising main game screen services"); ServiceLocator.registerTimeSource(new GameTime()); @@ -132,16 +120,12 @@ public MainGameScreen(GdxGame game) { public void render(float delta) { physicsEngine.update(); ServiceLocator.getEntityService().update(); + + batch.setProjectionMatrix(camera.combined); batch.begin(); batch.draw(backgroundTexture, 0, 0, viewportWidth, viewportHeight); batch.end(); - batch.begin(); - for (int i = 0; i < NUM_LANES; i++) { - float yPosition = i * LANE_HEIGHT; - batch.draw(whiteTexture, 0, yPosition, viewportWidth, 2); - } - batch.end(); renderer.render(); stage.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 30f)); @@ -177,7 +161,7 @@ public void dispose() { ServiceLocator.getEntityService().dispose(); ServiceLocator.getRenderService().dispose(); ServiceLocator.getResourceService().dispose(); - whiteTexture.dispose(); + ServiceLocator.clear(); } @@ -185,7 +169,7 @@ private void loadAssets() { logger.debug("Loading assets"); ResourceService resourceService = ServiceLocator.getResourceService(); resourceService.loadTextures(mainGameTextures); - backgroundTexture = new Texture("images/background/background1.png"); // Load the background image + backgroundTexture = new Texture("images/Dusty_MoonBG.png"); // Load the background image ServiceLocator.getResourceService().loadAll(); } diff --git a/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java b/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java index 1e5c4fb27..040278787 100644 --- a/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java +++ b/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java @@ -1,36 +1,42 @@ package com.csse3200.game.entities.factories; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.badlogic.gdx.math.Vector; import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; import com.csse3200.game.components.CombatStatsComponent; -import com.csse3200.game.components.Component; +import com.csse3200.game.components.CostComponent; import com.csse3200.game.components.TouchAttackComponent; import com.csse3200.game.entities.Entity; -import com.csse3200.game.entities.EntityService; -import com.csse3200.game.areas.ForestGameArea; import com.csse3200.game.extensions.GameExtension; +import com.csse3200.game.physics.PhysicsLayer; import com.csse3200.game.physics.PhysicsService; -import com.csse3200.game.physics.components.ColliderComponent; import com.csse3200.game.physics.components.HitboxComponent; import com.csse3200.game.physics.components.PhysicsComponent; import com.csse3200.game.physics.components.PhysicsMovementComponent; +import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.rendering.DebugRenderer; import com.csse3200.game.rendering.RenderService; import com.csse3200.game.services.GameTime; import com.csse3200.game.services.ResourceService; import com.csse3200.game.services.ServiceLocator; +import org.junit.Ignore; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import java.security.Provider; +import java.util.Arrays; @ExtendWith(GameExtension.class) class ProjectileFactoryTest { - private String[] texture = {"images/projectiles/projectile.png"}; private Entity projectile; @BeforeEach @@ -44,14 +50,15 @@ public void setUp() { ServiceLocator.registerRenderService(render); ResourceService resourceService = new ResourceService(); ServiceLocator.registerResourceService(resourceService); - resourceService.loadTextures(texture); + // resourceService.loadTextures(texture); + // resourceService.loadTextureAtlases(atlas); resourceService.loadAll(); - ServiceLocator.getResourceService() - .getAsset("images/projectiles/projectile.png", Texture.class); + // ServiceLocator.getResourceService() + // .getAsset("images/projectiles/basic_projectile.atlas", TextureAtlas.class); Vector2 destination = new Vector2(0.1f, 0.1f); - Vector2 speed = new Vector2(0.2f, 0.2f); - - projectile = ProjectileFactory.createBaseProjectile(new Entity(), destination); + short targetLayer = PhysicsLayer.PLAYER; + Vector2 speed = new Vector2(2f, 2f); + projectile = ProjectileFactory.createBaseProjectile(targetLayer, destination, speed); } @Test