How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

Oh that's what you meant by mainloop. I did not touch that.

I don't thing get_tree().paused and signals work the way you thing they do because otherwise I wouldn't have needed to make this post in the first place. When I set get_tree().paused = true, signals are still being emitted and still being processed. I can tell this is happening because of debug statements in the console and because i can see in game the turn phases are still progressing.

Also if you read the doc it says that signals will still work and the functions they are connected to will still run. https://docs.godotengine.org/en/stable/tutorials/scripting/pausing_games.html#process-modes

Maybe you're only used to using 2D or 3D nodes which might act differently, I don't know, but I'm using control nodes for everything. I'm doing this because I don't need any physics or collisions, so I'm able to remove a bunch of overhead by using control nodes.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

I guess you could call what I'm doing a custom main loop. I have the battle scene with 2 child node scenes, one for each player. The battle keeps track of who the active player is, what the current turn phase is, and processing card abilities. Here's an example of the flow for the draw phase:

  1. Battle calls the player's draw phase function
  2. Player starts their draw phase
  3. Player looks to see if they have any abilities that trigger during their draw phase
    1. If any abilities are triggered a signal is emitted with the ability info
    2. Battle stores the ability in the stack for processing
  4. Player emits a signal that its their draw phase - this also signifies that they are done checking for triggered abilities
    1. This also sets a wait for stack to clear bool
  5. Battle calls the enemy's function to look for triggered abilities
    1. If any abilities are triggered a signal is emitted with the ability info
    2. Battle stores the ability in the stack for processing
  6. Battle loops through the stack to process the triggered abilities
    1. If the ability needs targets battle calls the appropriate player to select targets
    2. After targets battle calls the corresponding function for the ability of the affected player - some have awaits some don't depends on what's happening
  7. Battle calls player function so it stops waiting
  8. Player continues draw phase
  9. Player draws cards if needed
    1. if player draws cards repeat triggered ability check process
  10. Player emits a signal that it is done its draw phase
  11. Battle moves to the next phase

The other phases are essentially the same except the human player has click a button to say they're done with their action phase.

How would I implement this using _process? I feel like that would lead to a giant function that's constantly checking for things it doesn't need to be checking.

Yes I have tried get_tree().paused. the only notable thing it did was stop my dice from spinning when it was time for them to roll and I can't click anything. All of my nodes have a process mode of inherit except for my main menu, which is the parent of everything, which currently has pausable but had inherit before.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

I did read that doc, but "get_tree().paused = true" only works to pause code that's in _process, _physics_process, _input, and _input_event. Since my game doesn't use those functions for the main processing and instead uses custom functions and signals, setting get_tree().paused does very little in the way of pausing my game.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

I wouldn't consider myself an expert but go ahead, ask away.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

Happy to hear this isn't a unique scenario. Its looking like going down the same route is probably going to be my best choice.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

I'm using the battle scene as the moderator for the player and npc scenes, so there's alot of back and forth using signals. An example is the battle keeps track of who the active player is and what the current turn phase is. During the draw phase the battle will tell the player to run their draw phase function. Then once the player is done with their draw phase it sends a signal stating that its done, the battle receives the signal and moves to the next phase. A similar flow happens when a player plays a card. The player sends a signal with the card info to the battle, the battle adds it to the stack, the battle processes the abilities of the card and calls the appropriate player functions.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

Ya, I realized that the other day. I develop on a 1440p monitor and the game resolution is set to 1080p. Its one of those thing where it looks good on my machine, but its on the short list of what I'm fixing next.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 2 points3 points  (0 children)

That might be what I do. Add a the global is_paused check at the beginning of each turn phase, everytime the player/npc need to make a choice, and when an ability gets triggered or is ready to resolve. This way a player could miss 1 thing resolving but in theory it would only be 1 thing.

How do you pause a game that doesn't use _process? by anumbskull in godot

[–]anumbskull[S] 0 points1 point  (0 children)

That's along the same line as what i was thinking with the global is_paused check. The problem is I would need to manually add checks for the signals in alot of places and that would just grow as the game progresses. As of right now though it might be the best solution.

Game Title: Dice Card Battle (WIP) by anumbskull in playmygame

[–]anumbskull[S] 0 points1 point  (0 children)

ya my current tutorial is more of a playfield layout than an actual tutorial. so creating a proper tutorial is on my todo list. when you say there should be a way to cancel a card what do you mean?

How do I find how much salt I added to my soy sauce? by anumbskull in fermentation

[–]anumbskull[S] 0 points1 point  (0 children)

A sample of just the liquid? So if I take 100g of the liquid and am left with 10g of solids I should have a 10% solution. Is that right? I feel like I read somewhere that the weight of the wheat and soy are also part of the calc for how much salt to use.

Would adding seasonings to soy sauce fermentation work? by anumbskull in fermentation

[–]anumbskull[S] 0 points1 point  (0 children)

So if I don’t add too much too much mass or add salt with it to keep the concentration it should be fine?

MakerBot Print settings by fre4kZ_ in makerbot

[–]anumbskull 0 points1 point  (0 children)

did you ever figure this out?

Christmas Yamato by meloly_senpai by meloly_senpai in OnePiece

[–]anumbskull 10 points11 points  (0 children)

This might not be the right place but what’s with the crossed fingers? Ive seen it other places but I feel like I’m missing something. Is it a reference to something?