Ideas for hiding spawning

Hi all, no technical problem in this one but just a call for ideas :slight_smile:

I have a mechanic in my game where players will revist the same screens they initially walked through but at night.
image
image

And currently, I’m using a clone of the same scenes for the nighttime route to get that job done.

Since I don’t want them to see items they have already collected reappear, however, I made it so that once clicked/collected, variables in the format of project.[insert item object name here]=true; keep track of which items should be gone. I then use that statement to determine whether the item should be removed from the game in their nighttime equivalent…

However, every time that check is executed to see whether the item(s) have been removed during the day scene in order to make it match the new night one, there is a brief delay where if an item has been collected, the item flickers into existence for a second before disappearing, since its default opacity state is 1. Even if I did the opposite and set it to be invisible and to reappear if the item hasn’t been collected, it still visibly “spawns” in.

So, I need ideas for a method by which to more effectively hide this brief flicker of the items that occurs as a result of script delay. I’ll be brainstorming too, and report back on anything I come up with myself :smiley:

there are 2 ways i can think of, but both may need a bit of refactoring.

the first is that you can try to put the day and night versions right next to each other, then in a separate layer you have a frame that covers both the day and night versions. this way, if you hide an item during the day, it will also be hidden at night.
image
in this picture, you would put the items in the middle layer and the day/night versions in the bottom layer. the top layer isn’t needed, but if you must have things that appear on top of the items, you can use that.

there are some issues with this you will want to keep in mind though:

  • remembering to use the right layer is potentially annoying
  • if the items look slightly different during the day and at night, this will not work very well because you’d kinda be forced to use the same sprite. (i can think of a potential way to resolve this, so let me know if you want me to show you. but it’s probably a bit complicated)

the second way is to just add a fade-to-black transition. instead of making sure everything is prepared the moment you enter the frame, you spend that frame in pitch black, and then you just fade in.

but keep in mind these issues:

  • fading out of the previous scene is kind of annoying, since instead of just using gotoAndStop(frameNumber) or something, you have to fade to black before switching the frame. technically you don’t have to do this, but it looks jarring if you cut to black and only do a fade-in.
  • the obvious way to do a fade is to put a black box over everything and change its opacity, but (if i remember correctly) if you do this, the black box will actually cover all the mouse clicks, even if it’s transparent. so if the black box is invisible and fully covering the screen, nothing behind it is clickable. the solution would be to move the box out of the way when it’s invisible, so that you can click behind it again.
3 Likes

Thanks for your ideas!!!

I was able to create a fade out/in which does solve the issue, however I am unsure if it looks good ^^; I mean it’s functional, but it’s king of boring/slow to me, but maybe that’s because I’m used to speeding through each scene in order to playtest mechanics. X)
fadeexample

I have yet to try your other solution of layering items and putting the day/night scenes side by side, but I should be able to get to that today. That one seems like it’ll result in my original vision of instant scene change with keeping assets loaded/removed without impairment.

Buuuuut, now that I’ve had time to think, I was thinking instead of just a fade to black or even your layering idea above, to make things more interesting by using a similar method by replacing the fade tween with three bushes that “jump” into view then “jump” out of view in reverse order, all within a second or two. (that will take longer to provide an example for as I have to draw the bushes XD)

I think I’m mostly torn between that bush idea and your idea of side-by-siding the scenes. What do we think?

1 Like

Here is the real comparison, by the way. The other gif was just me showing the fade rather than the solution being fixed

No fade (asset pops into view):
nofadeexample

Fade (asset load hidden):
fadeexamplenight

this looks really good!!!

2 Likes

Thanks! Do you have any thoughts/preferences on the method of transition? :) It’s really down to aesthetics at this point, I’m really clueless when it comes to appealing game design since ive only been doing this for 6 months and have only made 1 game in that time before this one…

hard to put myself in the fresh eyes of a new player sometimes when ive been starting at the workings for months ^^;

using bushes rather than a simple fade would definitely be more aesthetically pleasing. if you want to go even further, you could also use lighter/darker bushes depending on whether it is day or night.

1 Like

It looks really good, I don’t now what I would change

1 Like