Outil de test : LS_SEED pour reproduire une map procédurale précise
Le seed est loggué à chaque génération (MapManager.loadProceduralMap) « pour reproduire une map fautive », mais aucun injecteur n'existait : reproduire la map d'un gamelog utilisateur (ex : seed=1794824738987 du P1 v0.15.1, ennemis figés) exigeait un patch à la main — impossible sans modifier le code entre deux tests. LS_SEED suit le pattern LS_LEVEL (Game.java) : variable d'env lue à la construction du MapConfig, invalide/absente = seed temps réel (comportement normal inchangé).
This commit is contained in:
parent
4a94a2e367
commit
415afe19f5
@ -47,7 +47,26 @@ public class MapConfig {
|
|||||||
this.minMapHeight = (int)((-3 * MapManager.TILE_SIZE) + MapManager.PROC_START_POS.y);
|
this.minMapHeight = (int)((-3 * MapManager.TILE_SIZE) + MapManager.PROC_START_POS.y);
|
||||||
this.maxMapHeight = (int)((3 * MapManager.TILE_SIZE) + MapManager.PROC_START_POS.y);
|
this.maxMapHeight = (int)((3 * MapManager.TILE_SIZE) + MapManager.PROC_START_POS.y);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LS_SEED (env) : reproduire une map procédurale PRÉCISE — le seed
|
||||||
|
* est loggué à chaque génération (MapManager.loadProceduralMap)
|
||||||
|
* précisément POUR reproduire les maps fautives des gamelogs
|
||||||
|
* utilisateur, mais aucun injecteur n'existait : la reproduction
|
||||||
|
* exigeait un patch à la main. Outil de test/dev, même pattern que
|
||||||
|
* LS_LEVEL (Game.java). Absent/invalide = seed temps réel
|
||||||
|
* (comportement normal).
|
||||||
|
*/
|
||||||
|
String seedEnv = System.getenv("LS_SEED");
|
||||||
|
if (seedEnv != null && !seedEnv.isEmpty()) {
|
||||||
|
try {
|
||||||
|
this.proceduralSeed = Long.parseLong(seedEnv.trim());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
GameLog.w("LS-MAP", "LS_SEED invalide ('" + seedEnv + "'), seed temps réel utilisé");
|
||||||
this.proceduralSeed = System.currentTimeMillis();
|
this.proceduralSeed = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.proceduralSeed = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
spawnSegments = new HashMap<>();
|
spawnSegments = new HashMap<>();
|
||||||
mainSegments = new HashMap<>();
|
mainSegments = new HashMap<>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user