diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fd1947..1e57400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,16 @@ _(vide — prochaine fonctionnalité)_ - **NPE sur glyphes absents de l'atlas de fonte** (le « / » manquait : trou dans `GuiText.characters` → crash au `setText` du message d'erreur) — gardes null dans `GuiText.generateRenderers` + libellés sans « / » +- **Multi : le client Android crashait au GAME_JOIN** (retour v0.11.0 coop + émulateur) : le matchmaker transmet l'ip du hôte TELLE QU'IL LA VOIT — + derrière NAT/loopback le client tentait 127.0.0.1:2829 = lui-même → + tcpOut null → NPE ; `Network.addPlayer` réécrit une ip loopback vers + l'hôte du matchmaker (logs LS-NET) ; serveur Node durci contre les acks + sans jeu connu (un ack post-purge tuait tout le serveur → tous les + clients timeout) ; `LS_MP_AUTOJOIN=1` pour la coop desktop de test ; + épreuve réelle : pairing OK, join sans crash, les deux côtés dans le + niveau multiplayer (la visibilité croisée des joueurs reste le chantier + handshake P2P) - **IA : acquisition impossible hors ligne de vue** (retour v0.11.0 : « ils tentent pas de venir me chercher ») : l'acquisition exigeait la LOS, toujours coupée sur les cartes multi-niveaux → IDLE planté ; désormais @@ -56,11 +66,14 @@ _(vide — prochaine fonctionnalité)_ (≤ 300 px) sinon re-tir — plus d'ennemis hors NavMesh - **Gel complet du MacBook au ballon** (retour v0.12.0 desktop : « ta - version desktop fait planter le macbook en softlock ») : le reader TCP - multi spinait à 100% CPU PAR connexion morte — `readLine()` rend null - instantanément quand le pair ferme la connexion et - `socket.isConnected()` ne passe jamais false (état local) ; fix = EOF -> - log + break + gardes sur les readLine imbriqués + version desktop fait planter le macbook en softlock ») : DEUX spins à + 100% CPU — (1) le reader TCP sur connexion MORTE : `readLine()` rend + null instantanément quand le pair ferme, `socket.isConnected()` ne passe + jamais false (état local) → fix = EOF → log + break + gardes sur les + readLine imbriqués ; (2) le writer TCP sur connexion VIVE (QA v0.12.0) : + le `wait()` 2017 était inatteignable (`if (!initialising)`) → boucle + synchronisée serrée à fond pendant tout le multi, un cœur par client ; + fix = `while (messages.isEmpty()) wait()` ### Modifié - Lobby multi refait selon la DA (cadres néon du menu principal, cadre diff --git a/TODO.md b/TODO.md index f64516e..1632a0a 100644 --- a/TODO.md +++ b/TODO.md @@ -127,7 +127,6 @@ commande ligne) : LANCER serveur mort, export logs) = PASS 26/26 + captures revues visuellement ; reste la coop desktop+émulateur (10.0.2.2) à jouer avec le matchmaker local (les inputs Android marchent maintenant) -- [ ] Angle mort vertical de l'acquisition IA (rayons horizontaux seuls, - [ ] **Portes fonctionnelles + salles multi-niveaux** (feedback v0.11.0, "rendre les portes utilisables par les joueurs pour passer dans d'autres parties de la map") — GROS chantier, s'articule avec les @@ -141,10 +140,6 @@ commande ligne) : y+100 fixe) : joueur directement au-dessus/dessous jamais acquis — atténué par le NavMesh + suivi de cible ; amélioration possible (raycast vertical ou cone de vision) -- [ ] Macos.zip = natives Intel uniquement (crash UnsatisfiedLinkError - liblwjgl sur Mac ARM : les natives x64 ne se chargent pas depuis une - JVM aarch64) — DOC plus forte nécessaire dans README/CHANGELOG - (macos.zip = Intel + JVM Rosetta uniquement ; macos-arm64.zip = Apple Silicon) OU publier les deux jeux de natives dans le même zip (+2 Mo) @@ -426,7 +421,6 @@ reste du portage Android. v0.10.0 P3) — FAIT : garde unifiée checkOptionsCount() - [x] presetIndex du lobby désynchronisé du serveur persisté (QA v0.10.0 P3) — FAIT : aligné sur mp_host/mp_port au chargement -- [ ] Angle mort vertical de l'acquisition IA (rayons horizontaux seuls, - [ ] **Portes fonctionnelles + salles multi-niveaux** (feedback v0.11.0, "rendre les portes utilisables par les joueurs pour passer dans d'autres parties de la map") — GROS chantier, s'articule avec les @@ -440,9 +434,5 @@ reste du portage Android. y+100 fixe) : joueur directement au-dessus/dessous jamais acquis — atténué par le NavMesh + suivi de cible ; amélioration possible (raycast vertical ou cone de vision) -- [ ] Macos.zip = natives Intel uniquement (crash UnsatisfiedLinkError - liblwjgl sur Mac ARM : les natives x64 ne se chargent pas depuis une - JVM aarch64) — DOC plus forte nécessaire dans README/CHANGELOG - (macos.zip = Intel + JVM Rosetta uniquement ; macos-arm64.zip = Apple Silicon) OU publier les deux jeux de natives dans le même zip (+2 Mo) diff --git a/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/GuiText.java b/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/GuiText.java index 841b9bd..6e4ab0c 100644 --- a/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/GuiText.java +++ b/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/GuiText.java @@ -159,6 +159,13 @@ public class GuiText extends Component implements Bounded { case ':': s = font.getSprite("colon"); break; + case '-': + // POURQUOI ce cas : l'atlas 2017 nomme le tiret "dash" + // (fonts/atlas.txt:40) — getSprite("-") échouait -> + // SpriteNotFound -> caractère sauté (trou dans le texte : + // "Serveur 2 3 : emulateur", QA v0.12.0 P2). + s = font.getSprite("dash"); + break; default: try { s = font.getSprite(String.valueOf(text.charAt(i))); diff --git a/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/multiplayer/Network.java b/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/multiplayer/Network.java index 2e49482..c69533f 100644 --- a/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/multiplayer/Network.java +++ b/dethsquare/core/src/main/java/com/ezardlabs/dethsquare/multiplayer/Network.java @@ -395,7 +395,6 @@ public class Network { private static class TCPWriter extends Thread { private final Socket socket; private final ArrayList messages = new ArrayList<>(); - private boolean initialising = true; TCPWriter(Socket socket) { super("TCPWriter"); @@ -407,9 +406,19 @@ public class Network { try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()))) { while (true) { synchronized (messages) { - if (!initialising) { + /* + * Attendre tant que la file est VIDE. L'original 2017 + * ('if (!initialising) wait()') n'appelait JAMAIS wait() + * (initialising restait true) -> boucle synchronisée + * serrée à 100% CPU PAR CONNEXION TCP VIVE pendant tout + * le multi — le vrai responsable du gel du MacBook au + * ballon (le reader TCP dormait bien, lui). wait() est + * réveillé par sendMessage() via notify() ; quand + * l'iterateur de sortie s'exécute, la file est + * garantie non vide. + */ + while (messages.isEmpty()) { messages.wait(); - initialising = false; } while (!messages.isEmpty()) { String[] s = messages.remove(0); @@ -422,7 +431,7 @@ public class Network { } } } catch (IOException | InterruptedException e) { - e.printStackTrace(); + GameLog.e("LS-NET", "Multiplayer : writer TCP interrompu", e); } } diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/NavMesh.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/NavMesh.java index 1311b61..faecc2a 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/NavMesh.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/NavMesh.java @@ -175,6 +175,40 @@ public class NavMesh { } } + /** + * Ensemble des NavPoints joignables depuis {@code start} en AU PLUS + * {@code maxLinks} liens (tous types confondus), start exclu. + * + * POURQUOI ce helper : l'idle patrol de Behaviour (retour utilisateur + * v0.12.0 "aucun idle pattern, plantés là") doit choisir une destination + * PROCHE et REELLEMENT joignable — or NavPoint.Link est package-private : + * com.ezardlabs.lostsector.ai ne peut pas itérer les liens lui-même. + * Le BFS borné vit donc ici, à côté du graphe qu'il parcourt. + */ + public static NavPoint[] getReachableNavPoints(NavPoint start, int maxLinks) { + if (start == null || maxLinks <= 0) return new NavPoint[0]; + ArrayList found = new ArrayList<>(); + HashSet visited = new HashSet<>(); + ArrayDeque queue = new ArrayDeque<>(); + ArrayDeque depths = new ArrayDeque<>(); + visited.add(start); + queue.add(start); + depths.add(0); + while (!queue.isEmpty()) { + NavPoint p = queue.pop(); + int depth = depths.pop(); + if (depth >= maxLinks) continue; + for (NavPoint.Link l : p.links) { + if (visited.add(l.target)) { + found.add(l.target); + queue.add(l.target); + depths.add(depth + 1); + } + } + } + return found.toArray(new NavPoint[0]); + } + public static NavPoint getNavPoint(Vector2 position) { return getNavPoint(position.x, position.y); } diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/ai/Behaviour.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/ai/Behaviour.java index ea17758..bb39cdb 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/ai/Behaviour.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/ai/Behaviour.java @@ -21,6 +21,8 @@ import com.ezardlabs.lostsector.NavMesh.NavPoint; import com.ezardlabs.lostsector.levels.MissionLevel; import com.ezardlabs.lostsector.objects.Entity; +import java.util.ArrayList; + public abstract class Behaviour { private float moveSpeed; private final boolean willPatrol; @@ -41,6 +43,35 @@ public abstract class Behaviour { private int directionToLook = 0; private final int visionLayerMask = Layers.getLayerMask("Player", "Objective", "Solid"); + /* + * Cible injoignable (retour utilisateur v0.12.0 "plantés là") : une cible + * acquise par proximité mais SANS chemin NavMesh (joueur sur une étagère + * non joignable — cas prouvé en repro desktop : l'étagère de spawn (40,24) + * n'est atteignable par AUCUN lien du graphe) laissait l'ennemi figé en + * TRACKING indéfiniment. Au-delà de PATH_FAIL_DROP_TIME sans chemin, la + * cible est abandonnée : l'ennemi repart en IDLE et le fallback objectif + * le renvoie attaquer le cryopod — un ennemi ne reste plus jamais planté. + */ + private static final long PATH_FAIL_DROP_TIME = 3000; + private long pathFailStart = 0; + + /* + * IDLE vivant (retour utilisateur v0.12.0 "aucun idle pattern, plantés + * là") : willPatrol était un champ mort 2017 (stocké, jamais lu). Une + * patrouille minimale : en IDLE sans cible, micro-déplacement NavMesh + * vers un NavPoint aléatoire à <= PATROL_RADIUS liens, nouveau choix + * seulement à l'arrivée ou après PATROL_INTERVAL (throttle : jamais par + * frame). L'acquisition joueur prime toujours : la patrouille est + * abandonnée dès que visionCheck pose une cible. + */ + private static final long PATROL_INTERVAL = 4000; + private static final int PATROL_RADIUS = 5; + private NavPoint[] patrolPath = null; + private int patrolIndex = 0; + private NavPoint patrolFrom = null; + private NavPoint patrolDestination = null; + private long nextPatrolChoice = 0; + private StateMachine stateMachine = new StateMachine<>(); private Transform transform; private Transform target; @@ -157,12 +188,23 @@ public abstract class Behaviour { visionCheck(); if (target == null && objectives != null) { target = getObjectiveTarget(); - targetIsObjective = target != null; + if (target != null) { + targetIsObjective = true; + // Curseur de chemin remis à zéro : une re-acquisition + // (même cible) avec un chemin déjà consommé en cache + // repartirait sinon d'un index au bout du chemin + // (immobilité silencieuse). + pathIndex = 0; + } } } switch (stateMachine.getState()) { case IDLE: - animationState = AnimationState.IDLE; + // IDLE vivant : micro-patrouille NavMesh si aucune cible (le + // fallback objectif pose une cible en <= 1 s en Defend, la + // patrouille n'a donc le temps de vivre que sans objectifs — + // Exterminate, ou entre deux acquisitions). + animationState = willPatrol && target == null ? patrol() : AnimationState.IDLE; break; case TRACKING: animationState = move(); @@ -217,42 +259,153 @@ public abstract class Behaviour { private AnimationState move() { path = getPath(); - if (path != null && path.length > 0) { - if (pathIndex < path.length - 1) { - float direction = Mathf.clamp(path[pathIndex + 1].position.x - path[pathIndex].position.x, -1, 1); - transform.translate(moveSpeed * direction * Time.fpsScaling60, 0); - transform.scale.x = direction; + if (path == null || path.length == 0) { + /* + * Cible injoignable (aucun chemin NavMesh, cellule hors graphe ou + * isolée) : on laisse un délai de grâce (chute en cours, cellule + * en transition) puis on ABANDONNE la cible au lieu de rester + * planté indéfiniment — le fallback objectif reprend la main. + * Prouvé en repro desktop v0.12.x : des ennemis restaient figés + * en "aucun chemin NavMesh vers Player" quand le joueur se + * tenait sur une étagère non joignable (cellule (40,24) de + * defense0, joignable par aucun lien du graphe). + */ + if (pathFailStart == 0) { + pathFailStart = System.currentTimeMillis(); + } else if (System.currentTimeMillis() - pathFailStart > PATH_FAIL_DROP_TIME) { + GameLog.d("LS-AI", transform.gameObject.name + " : cible " + + (target != null ? target.gameObject.name : "?") + + " injoignable (aucun chemin NavMesh depuis " + + PATH_FAIL_DROP_TIME / 1000 + " s), cible abandonnée"); + target = null; + targetIsObjective = false; + pathFailStart = 0; + } + if (target != null && Time.frameCount % 300 == 0) { + GameLog.d("LS-AI", transform.gameObject.name + " : aucun chemin NavMesh vers " + + target.gameObject.name + " ennemi=" + transform.position + + " ciblePos=" + target.position); + } + return AnimationState.IDLE; + } + pathFailStart = 0; + if (pathIndex < path.length - 1) { + float direction = Mathf.clamp(path[pathIndex + 1].position.x - path[pathIndex].position.x, -1, 1); + transform.translate(moveSpeed * direction * Time.fpsScaling60, 0); + transform.scale.x = direction; - if (transform.gameObject.rigidbody.velocity.y > transform.gameObject.rigidbody.gravity) { - return AnimationState.FALLING; - } else if (path[pathIndex + 1].position.y < path[pathIndex].position.y) { - if (animationState != AnimationState.JUMPING) { - jump(Math.abs(path[pathIndex + 1].position.y - path[pathIndex].position.y)); - } - return AnimationState.JUMPING; - } else if (direction == 0) { - return AnimationState.IDLE; - } else { - return AnimationState.MOVING; + if (transform.gameObject.rigidbody.velocity.y > transform.gameObject.rigidbody.gravity) { + return AnimationState.FALLING; + } else if (path[pathIndex + 1].position.y < path[pathIndex].position.y) { + if (animationState != AnimationState.JUMPING) { + jump(Math.abs(path[pathIndex + 1].position.y - path[pathIndex].position.y)); } + return AnimationState.JUMPING; + } else if (direction == 0) { + return AnimationState.IDLE; + } else { + return AnimationState.MOVING; } } /* - * Poursuite impossible : aucun chemin NavMesh vers la cible (cellule - * de l'ennemi ou de la cible isolée du graphe, ou cible sur la même - * cellule -> path de longueur 1 consommé). Limite DOCUMENTÉE, pas - * hackée : l'ennemi reste sur place plutôt que de se téléporter. - * Log throttlé / 300 frames (politique AGENTS.md) pour diagnostiquer - * à distance les zones du niveau où la poursuite cale. + * Chemin consommé (cible sur la cellule finale ou adjacente) : la + * transition ATTACKING (portée + LOS) prend le relais ; sinon on + * attend immobile sans loguer en boucle. */ - if (target != null && Time.frameCount % 300 == 0) { - GameLog.d("LS-AI", transform.gameObject.name + " : aucun chemin NavMesh vers " - + target.gameObject.name + " ennemi=" + transform.position - + " ciblePos=" + target.position); + return AnimationState.IDLE; + } + + /** + * IDLE vivant : micro-patrouille NavMesh (retour utilisateur v0.12.0). + * Marche le long d'un chemin vers un NavPoint aléatoire proche ; nouveau + * choix seulement à l'arrivée ou après PATROL_INTERVAL. La reprise de + * poursuite (acquisition joueur/objectif) coupe la patrouille sans état + * résiduel : move() recalcule son propre chemin via getPath(). + */ + private AnimationState patrol() { + if (patrolPath == null || patrolIndex >= patrolPath.length - 1) { + // Arrivé (ou jamais parti) : nouveau choix seulement au prochain + // créneau — l'anim idle tourne entre deux déplacements. + if (System.currentTimeMillis() < nextPatrolChoice) return AnimationState.IDLE; + choosePatrolDestination(); + nextPatrolChoice = System.currentTimeMillis() + PATROL_INTERVAL; + if (patrolPath == null || patrolPath.length < 2) return AnimationState.IDLE; + } else { + // Cellule courante changée (en marche / chute) : chemin recalcule + // depuis la cellule réelle vers la MÊME destination. + NavPoint self = NavMesh.getNavPoint(transform.position.x, transform.position.y); + if (self != null && !self.equals(patrolFrom)) { + patrolFrom = self; + patrolPath = NavMesh.getPath(self, patrolDestination); + patrolIndex = 0; + if (patrolPath.length < 2) { + patrolPath = null; + return AnimationState.IDLE; + } + } + } + if (patrolIndex < patrolPath.length - 1) { + float direction = Mathf.clamp( + patrolPath[patrolIndex + 1].position.x - patrolPath[patrolIndex].position.x, -1, 1); + transform.translate(moveSpeed * direction * Time.fpsScaling60, 0); + transform.scale.x = direction; + + if (transform.gameObject.rigidbody.velocity.y > transform.gameObject.rigidbody.gravity) { + return AnimationState.FALLING; + } else if (patrolPath[patrolIndex + 1].position.y < patrolPath[patrolIndex].position.y) { + if (animationState != AnimationState.JUMPING) { + jump(Math.abs(patrolPath[patrolIndex + 1].position.y - patrolPath[patrolIndex].position.y)); + } + return AnimationState.JUMPING; + } else if (direction == 0) { + return AnimationState.IDLE; + } else { + return AnimationState.MOVING; + } } return AnimationState.IDLE; } + private void choosePatrolDestination() { + patrolPath = null; + patrolDestination = null; + NavPoint self = NavMesh.getNavPoint(transform.position.x, transform.position.y); + if (self == null) return; + NavPoint[] candidates = NavMesh.getReachableNavPoints(self, PATROL_RADIUS); + if (candidates.length == 0) return; + // Filtre géométrique : un lien FALL peut traverser 16 cellules en un + // seul saut de graphe — sans ce filtre la "patrouille à ~5 cellules" + // envoyait l'ennemi tomber d'un étage à l'autre. + ArrayList proches = new ArrayList<>(); + for (NavPoint c : candidates) { + if (Math.abs(c.position.x - self.position.x) <= PATROL_RADIUS * 100f + && Math.abs(c.position.y - self.position.y) <= PATROL_RADIUS * 100f) { + proches.add(c); + } + } + if (proches.isEmpty()) return; + NavPoint dest = proches.get((int) (Math.random() * proches.size())); + NavPoint[] p = NavMesh.getPath(self, dest); + if (p.length == 1) { + // Cellule adjacente : getPath rend [dest] (non "marchable" par la + // boucle ci-dessus) — on synthétise le pas direct. + p = new NavPoint[]{ + self, + dest + }; + } else if (p.length == 0) { + return; + } + patrolDestination = dest; + patrolFrom = self; + patrolPath = p; + patrolIndex = 0; + // 1 ligne PAR CHOIX de destination (toutes les ~4 s max) : trace QUI + // patrouille, OÙ il va et la longueur du chemin (politique AGENTS.md). + GameLog.d("LS-AI", transform.gameObject.name + " : idle -> patrouille vers navpoint " + + dest.id + " " + dest.position + " (" + p.length + " pas)"); + } + private void jump(float distance) { transform.gameObject.rigidbody.velocity.y = (float) -Math.sqrt(2.5 * distance) - 2; } @@ -349,6 +502,9 @@ public abstract class Behaviour { } target = best; targetIsObjective = false; + // Curseur de chemin remis à zéro (cf. fallback objectif : une + // re-acquisition sur un chemin consommé restait sinon figée). + pathIndex = 0; return; } if (targetIsObjective) { @@ -448,7 +604,18 @@ public abstract class Behaviour { case COLD: return "FROZEN_SHATTER"; case KUBROW: - return "DIE_KUBROW_" + getDirection(attackOrigin); + /* + * POURQUOI pas de "DIE_KUBROW_*" : l'atlas ennemi + * (data/enemies/anim.json) ne contient AUCUNE animation de + * mort kubrow — le retour "DIE_KUBROW_FRONT" plantait + * AnimationState.valueOf en IllegalArgumentException FATALE + * dès qu'un ennemi mourait sous les crocs du Kubrow (crash + * de la mission Defense prouvé en repro desktop v0.12.x). + * Réutilisation de l'anim de mort au corps à corps (une + * morsure est un coup de près) en attendant un art dédié + * (TODO art : die_kubrow_front/back). + */ + return "DIE_SLASH_" + getDirection(attackOrigin); default: System.err.println("Unknown damage type: " + damageType); return null; @@ -475,7 +642,15 @@ public abstract class Behaviour { protected abstract static class Builder { float moveSpeed = 10; float visionRange = 2000; - boolean willPatrol = false; + /* + * POURQUOI le défaut passe à true (v0.12.x) : willPatrol était un + * champ mort 2017 (stocké, jamais lu) et tous les ennemis passaient + * explicitement false — d'où le retour "aucun idle pattern, plantés + * là". Un ennemi patrouille désormais PAR DÉFAUT en IDLE ; un + * comportement statique reste possible via setWillPatrol(false) + * (ex : WereDrahk, qui garde son false explicite). + */ + boolean willPatrol = true; public T setMoveSpeed(float moveSpeed) { this.moveSpeed = moveSpeed; diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/DeraCrewman.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/DeraCrewman.java index 50a840f..4bd94c9 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/DeraCrewman.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/DeraCrewman.java @@ -38,7 +38,7 @@ public class DeraCrewman extends Crewman { fired = false; } } - }).setMoveSpeed(10).setVisionRange(2000).setWillPatrol(false).create()); + }).setMoveSpeed(10).setVisionRange(2000).create()); } @Override diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/ProvaCrewman.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/ProvaCrewman.java index e699357..e0cdd32 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/ProvaCrewman.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/ProvaCrewman.java @@ -11,7 +11,6 @@ public class ProvaCrewman extends Crewman { .setDamageFrame(2) .setMoveSpeed(10) .setVisionRange(2000) - .setWillPatrol(false) .create()); } diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/SupraCrewman.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/SupraCrewman.java index 3e2fde1..8d389b0 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/SupraCrewman.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/crewmen/SupraCrewman.java @@ -54,7 +54,7 @@ public class SupraCrewman extends Crewman { fired = false; } } - }).setMoveSpeed(10).setVisionRange(2000).setWillPatrol(false).create()); + }).setMoveSpeed(10).setVisionRange(2000).create()); } @Override diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/moas/ShockwaveMoa.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/moas/ShockwaveMoa.java index db8ae29..0144cfb 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/moas/ShockwaveMoa.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/enemies/corpus/moas/ShockwaveMoa.java @@ -26,7 +26,6 @@ public class ShockwaveMoa extends Moa { .setDamageFrame(7) .setMoveSpeed(10) .setVisionRange(2000) - .setWillPatrol(false) .create()); } diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/EscMenu.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/EscMenu.java index 27a40fb..77fab14 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/EscMenu.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/EscMenu.java @@ -19,7 +19,14 @@ public class EscMenu extends Menu { menu.gameObject.setActive(false); open(); })), - new Vector2(Screen.width / 2 - 600, Screen.height / 2 - 500)); + /* + * Position en référentiel GUI comme MainMenu (960-600, + * 540-500) — l'original utilisait Screen.width/2-600 en + * PIXELS BRUTS : le panneau du pause était décentré dès que + * scale != 1 (QA v0.12.0 P2 : panneau décalé à droite sur + * Android 2400px vs desktop 1920). + */ + new Vector2(960 - 600, 540 - 500)); settingsMenu.setActive(false); } diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/SettingsMenu.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/SettingsMenu.java index d52c150..f8c0dc7 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/SettingsMenu.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/objects/menus/SettingsMenu.java @@ -51,8 +51,18 @@ public class SettingsMenu extends Script { new Vector2(transform.position.offset(550, 881.25f))).transform.setParent(transform); GameObject.instantiate(new GameObject("Menu Button Text", menuText), new Vector2( + /* + * Position HAUT-DROITE du panneau (offset y 132 = y GUI ~172, + * device ~215) : l'original (offset y 943.75 -> y GUI ~984) + * sortait de la zone visible Android (864 GUI sur un écran + * 20:9) — l'utilisateur était ENFERMÉ dans les Settings + * (bouton MENU incliquable + TouchControls masqué + pas + * d'ESCAPE au touch, QA v0.12.0 P1). Sur desktop la position + * passe du bas au haut du panneau : sortie naturelle en + * haut à droite, comme les cercles de tabs. + */ transform.position.offset(837.5f - menuText.getWidth() / 2, - 943.75f - menuText.getFontSize() / 2))).transform.setParent(transform); + 132f - menuText.getFontSize() / 2))).transform.setParent(transform); GameObject.instantiate(new GameObject("Settings Tab Manager", new SettingsTabManager(new AudioSettingsTab(), new GraphicsSettingsTab(), new ControlsSettingsTab())), diff --git a/scripts/test-android.sh b/scripts/test-android.sh index c4473ed..a284690 100755 --- a/scripts/test-android.sh +++ b/scripts/test-android.sh @@ -195,17 +195,17 @@ fresh_launch tap "$TAP_SURVIVAL" wait_log "LS-LEVEL: Level 'survival' fully loaded" 25 || echo "WARN : Survival pas confirmé (check 7)" sleep 25 # la stat LS-RENDER est 1 ligne/300 frames — à ~15 fps - # (swiftshader) ça fait 12-20 s entre deux lignes +# (swiftshader) ça fait 12-20 s entre deux lignes shot "$SHOT-7-survival.png" check "7a. Survival chargé" "LS-LEVEL: Loading level 'survival'" # 7b via le gamelog pullé (ring 4000 lignes) : la stat logcat peut être # évacuée par la rotation du buffer système pendant le scénario. adb pull "/sdcard/Android/data/$PKG/files/gamelog-latest.txt" /tmp/gamelog-7b.txt >/dev/null 2>&1 if grep -qE "LS-RENDER: visible=[1-9]" /tmp/gamelog-7b.txt 2>/dev/null; then - echo "PASS : 7b. rendu non vide (visible>0, stat dans gamelog)" + echo "PASS : 7b. rendu non vide (visible>0, stat dans gamelog)" else - echo "FAIL : 7b. aucune stat LS-RENDER positive (voir capture)" >&2 - fails=$((fails + 1)) + echo "FAIL : 7b. aucune stat LS-RENDER positive (voir capture)" >&2 + fails=$((fails + 1)) fi check_not "7c. aucun crash en Survival" "FATAL EXCEPTION" @@ -217,6 +217,20 @@ sleep 5 shot "$SHOT-8-settings-menu.png" check "8a. Settings ouvre sans crash (menu)" "touch action -> MOUSE_LEFT down" check_not "8b. aucun crash au Settings menu" "FATAL EXCEPTION" +# Sortie du panneau : le bouton MENU est en haut à droite (fix QA v0.12.0 +# P1 : il était à y GUI 984, hors écran 864 -> utilisateur enfermé). +adb shell input tap 1497 215 +sleep 4 +shot "$SHOT-8c-settings-sortie.png" +# 8c via le gamelog pullé (la stat logcat peut être évacuée par rotation) +adb pull "/sdcard/Android/data/$PKG/files/gamelog-latest.txt" /tmp/gamelog-8c.txt >/dev/null 2>&1 +if grep -qE "MOUSE_LEFT down .1497" /tmp/gamelog-8c.txt 2>/dev/null; then + echo "PASS : 8c. sortie Settings au bouton MENU (tap haut-droit logué)" +else + echo "FAIL : 8c. tap MENU (1497,215) jamais reçu (voir capture 8c)" >&2 + fails=$((fails + 1)) +fi +check_not "8d. aucun crash à la sortie Settings" "FATAL EXCEPTION" adb shell am force-stop "$PKG" 2>/dev/null || true # --- 9 : Settings du menu PAUSE (fix barre entière) ------------------------