Apr. 16th, 2020

Work Post

Apr. 16th, 2020 03:03 am
relee: Picture of Relee Starbreeze, Wizard (Default)
3:49am - Let's take another look at my current problem.

The plain and simple of it is that the scene being shifted off can't do anything after it's been deleted. That's pretty obvious when stated that way, but it's harder to see in practice what's happening. So I've got to do it a different way. Somehow the scene must trigger a scene transition without requiring it to exist afterwards to finish off processes. Either that or stick around longer to clean things up, but I'm not sure how long it would need, or how to tell when it was done.

4:00am - I went back to the program I was borrowing some systems from and looked at how they handled this problem. It looks like rather than deleting the scene immediately, they just use a remove_child() method on it.

4:17am - I'm having some crazy thoughts, trying to fix this. Like, 'Maybe the scenes should just never be deleted, only removed and paused in the background?' That would make it so that NPCs would stay were they were when the player left the scene, instead of reverting to their spawn points. So it's an interesting thought.

4:28am - Instead of just doing the thing as I'm trying to figure it out, let's stop and think about what I was about to do.

While going through the code I realized that the TeleportAction has a local variable connecting it to the local_map instance. This makes it easy to run a method on the localmap, like a method to connect it to a signal. So I could make the local_map free itself after... no that won't work...

The more I look at it the more it seems that freeing up resources by removing scenes is just the wrong way to handle this.

I don't even know how much resources it'll take and how much will be available. So it's hard to make judgements before things go wrong and you have to fix them. They say there's no sense optimizing at the start, but this sort of thing should be a no-brainer, and I'm struggling with it. Maybe I'm wrong?

I need advice from people with more specific experience. I'll ask around.

4:49am - I'm going to put work on hold while I try and figure this out. As it is though, if I switch to having all my scenes loaded all the time, I might have to put together some sort of organizing system to keep them in relation that's different from simply calling their file names... We'll see...

6:41am - I talked with a friend and he encouraged me to try my idea of loading all the scenes into memory at once instead of loading them from files on demand. It might be better that way anyhow, I've seen other games that preload everything and it makes loading times in-game negligible. There's also the benefit of making it so that NPCs retain their positions when the player leaves and returns to an area, so that's a thing too. It's not really neccesary but it might be nice.

To get this working I'll be putting in code to load all of the scenes at the start, and when they go off the tree they'll need code to pause them. That should work, I think.

The tricky thing will be changing how the transitions work, since previously the transitions took a sort of file tag to find the scene to switch to. Now the scenes will already be loaded into variables, so there'll have to be something else. Maybe a key-value pair system like a dictionary? That might work...

8:42am - I got pretty distracted and now I'm exhausted, so the rest of this will have to wait for next time.

Profile

relee: Picture of Relee Starbreeze, Wizard (Default)
Relee Squirrel

July 2023

S M T W T F S
      1
23456 78
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 10th, 2025 07:58 am
Powered by Dreamwidth Studios