07th-mod / 07th-mod/umineko-question
[SPOILER] Backgrounds drawn with the mbg command appear slightly corrupted [SPOILER]
- Lingua principale
- C#
- Stelle
- 98
- Fork
- 10
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
> why does this cg have random black stuff near the top left corner? is this normal?

closeup

Image `garden_se1a` is drawn with
```asm
mcl a,0
mbg black,22
mbg garden_Se1a,8
```
me:
> it looks like the "black" pixels are just any pixel in the image which has the same value as the top left pixel
> that's why there are also some random other pixels which are black
> the game engine has a special mode where it uses the top left pixel as the transparent color (like a green-screen)
> and in this special case they've drawn the background with a different function than normal which uses this mode
> I know how to fix it but I probably won't in case it breaks something, but thanks for letting us know about this issue
> I'll make a record of it on github
To fix this issue, you can either
- As per the nscript reference, add `c` to the image processing tags https://07th-mod.github.io/ponscripter-fork/api/#lsp eg
- `stralias garden_Se1a,":b;bmp\background\garden\garden_se1a.png"` becomes
- `stralias garden_Se1a,":bc;bmp\background\garden\garden_se1a.png"`
- Don't just blindly apply this to all `background` images - while most images in the `background` folder don't have alpha, the images in the `efe` folder do have alpha (and possibly someother images).
- Add an alpha channel to all images (these bg images are all RGB not RGBA). I think the engine will automatically use for alpha images
I dont think I'll actually fix it though, because the artifacting is small and this only happens when background is not drawn with the `bg` command, plus some other conditions.
----
O[A] mentioned there is a flag called `force-png-alpha` , see here for more details: https://07th-mod.github.io/ponscripter-fork/#/?id=image-transparency . However I'm worried turning it on might break anything which relies on this behavior, like the below image (I haven't tested whether it would actually be afffected though - the specific tag for the image would probably overrule the force-png-alpha)

`stralias PRI_efe,":ba;bmp\background\subway\pri_efe.png" ;地下牢 格子スプライト`
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Il problema descrive una corruzione della trasparenza durante il disegno degli sfondi con il comando 'mbg'. La correzione comporta la modifica dei tag di elaborazione delle immagini nei file di script, in particolare l'aggiunta di 'c' allo stralias per determinate immagini di sfondo. Cercare le definizioni di stralias per le immagini di sfondo (come garden_Se1a) nei file di script e verificare se manca il tag 'c'. Testare la modifica eseguendo il gioco per vedere se gli artefatti neri scompaiono senza influenzare altre immagini con canali alfa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- game-dev
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 65/100