chrismaltby / gb-studio

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system
https://www.gbstudio.dev
MIT License
8.57k stars 471 forks source link

Issues with the "Show Connections" feature #1402

Open kevinfoley opened 6 months ago

kevinfoley commented 6 months ago

In GB Studio 3.2.1, I've been experiencing issues with Connections. The first issue is the most important

GB Studio Bug

My game is broken into a series of stages. I have a script for going to each scene, e.g. "Go to Stage 1", "Go to Stage 2", etc. In any stage, the player can press "Select" to reload the current scene (calling the relevant script). When the player beats the stage, I run a "Stage Complete" script which in turn runs a "Go to Next Stage" script that works like this (pseudo-code):

if (currentStage is stage_1): call script Go_To_Stage_2
else if (currentStage is stage_2) call script Go_To_Stage_3
else if (currentStage is stage_3) call script Go_To_Stage_4
// Etc etc

(This seems like a stupid setup but I could find no other way to achieve "go to the next stage" in a reusable script).

There are many actors in each stage that can potentially call the "Go to Next Stage" script, creating many connections.

This setup apparently wreaks havoc with the connections system. Often, when I deselect a scene, the connections for that scene are not cleared. After selecting a few scenes, the "Game World" view will be covered with so many connections that I can no longer do any work, and I have to change views (e.g. to "Sprites") and back in order to clear the connections. Unfortunately, I can't just set Show Connections to None or I won't be able to see where the Player Start is located...

chrismaltby commented 6 months ago

Hi @kevinfoley I've just fixed the issue where Player Start wasn't visible when Show Connections was set to None so in the next release this will work as expected :-)

For your specific project setup I wonder if having a Level Switcher scene would help

Setup would be something like this

Screenshot 2024-05-08 at 14 57 01

I've zipped up that test project (made with v3.2.1) you can check out here NextSceneTest.zip

Not too different from your setup but at least you'd only end up with a single scene connected to all the others

kevinfoley commented 6 months ago

@chrismaltby Thanks for the prompt reply! I'll try that out!

kevinfoley commented 6 months ago

@chrismaltby Unfortunately, using a Level Switcher scene doesn't solve the issue.

I did figure out a workaround. If I deselect the current scene (by clicking the gray background behind the scenes) before selecting a new scene, the connections are hidden. In other words:

This causes the bug:

  1. Select scene "Stage 1"
  2. Select scene "Stage 2"
  3. Select scene "Stage 3"

This avoids the bug:

  1. Select scene "Stage 1"
  2. Deselect the scene
  3. Select scene "Stage 2"
  4. Deselect the scene
  5. Select scene "Stage 3"
chrismaltby commented 6 months ago

@kevinfoley do you mind sharing your project folder? I'm unable to reproduce the issue you're seeing where connections don't clear when switching scenes even when trying to recreate the setup you're describing

kevinfoley commented 6 months ago

I will try to put together a simple example project when I have time.