Thoughts on using Love/Hate for a roguelike?

Announcements, support questions, and discussion for Love/Hate.
Post Reply
joeykid6
Posts: 17
Joined: Thu Feb 07, 2019 1:57 pm

Thoughts on using Love/Hate for a roguelike?

Post by joeykid6 »

Hi Tony and everyone,

I'm developing a space roguelike prototype at the moment, which means a few things:
1) It's turn based.
2) Most of the NPCs are not in a scene at any given moment, so they don't really need to be stored as game objects, only as data.
3) Even though they're not in scene, they still have a chance to get their emotional state and relationship values updated every turn by procedural events.

At the heart of the prototype is a utility AI quest generator which will use current emotion and relationship data along with procedural templating to (hopefully) generate interesting quests.

I'm considering using Love/Hate to manage the simulation of factions, personal relationships, and emotional reactions that take place procedurally across the game world, but I wanted to get your thoughts on this use case.

I know you've talked before about customizing L/H for turn-based play by adjusting the game time. However, this is also a case where I probably wouldn't even use the built-in gameObject components, since executing a lot of the procedural stuff would happen through code which generates events and updates C# objects in the background.

Does L/H seem like a fit for this? If so, could you say a bit about how you might approach it (or at least what you might be concerned about)?

Thanks as always!
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Thoughts on using Love/Hate for a roguelike?

Post by Tony Li »

Hi,

I'd create empty GameObjects just as holders for the faction member data. (FactionMember is a MonoBehaviour.)

As you mentioned, handling turn-based play is easy. Set GameTime.mode to Custom, and increment GameTime.time each turn.
joeykid6
Posts: 17
Joined: Thu Feb 07, 2019 1:57 pm

Re: Thoughts on using Love/Hate for a roguelike?

Post by joeykid6 »

Excellent, thanks so much. I will give that a go.
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Thoughts on using Love/Hate for a roguelike?

Post by Tony Li »

Glad to help!
joeykid6
Posts: 17
Joined: Thu Feb 07, 2019 1:57 pm

Re: Thoughts on using Love/Hate for a roguelike?

Post by joeykid6 »

Hey Tony,

Finally getting back to this project after a long delay. When you have a moment, I just want to confirm a couple of things about L/H and turn-based play:

1) It looks like the GameTime.mode I'd want to use for turn-based play is now called "Manual" not "Custom." So...

Code: Select all

GameTime.mode = GameTimeMode.Manual;
Correct?

2) Can I just set GameTime.mode once in the Awake/Start of something like a turn manager class and then forget about it? That is, will it then essentially just wait for me to increment GameTime.time after that, with L/H listening for when I do?

3) It seems like I can set GameTime.deltaTime to a fixed rate like 1/60th of a second using this approach, since turns will happen totally independent of frame updates?

3) Also, using this approach, will I need to keep track of the current manual time increment across saves? It seems like no, but I just wanted to double check.

Sorry for all the questions; up until now, Unity's Time class has always been a bit of a black box for me.

Let me know what you think, thanks!
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Thoughts on using Love/Hate for a roguelike?

Post by Tony Li »

Hi,
joeykid6 wrote: Tue Feb 22, 2022 2:59 pm1) It looks like the GameTime.mode I'd want to use for turn-based play is now called "Manual" not "Custom." So...

Code: Select all

GameTime.mode = GameTimeMode.Manual;
Correct?
Yes.
joeykid6 wrote: Tue Feb 22, 2022 2:59 pm2) Can I just set GameTime.mode once in the Awake/Start of something like a turn manager class and then forget about it? That is, will it then essentially just wait for me to increment GameTime.time after that, with L/H listening for when I do?
Yes.
joeykid6 wrote: Tue Feb 22, 2022 2:59 pm3) It seems like I can set GameTime.deltaTime to a fixed rate like 1/60th of a second using this approach, since turns will happen totally independent of frame updates?
Yes, you can do that, but Love/Hate doesn't do anything with Gametime.deltaTime.
joeykid6 wrote: Tue Feb 22, 2022 2:59 pm3) Also, using this approach, will I need to keep track of the current manual time increment across saves? It seems like no, but I just wanted to double check.
Yes. When you load a saved game, restore GameTime.time. Faction Members clean up their memory based on the current value of GameTime.time.
joeykid6
Posts: 17
Joined: Thu Feb 07, 2019 1:57 pm

Re: Thoughts on using Love/Hate for a roguelike?

Post by joeykid6 »

Wonderful! As always, thanks for the quick, thoughtful response. I own like 175 unity assets and you consistently provide the best support of any dev I've ever contacted.

Take care,
Joe
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Thoughts on using Love/Hate for a roguelike?

Post by Tony Li »

Thanks! Happy to help.
Post Reply