Questions Calendar System as well as one about dialogic

Godot Version

4.6

Question

I haven’t done gamedev stuff in a bit so I thought I’d try to make a riff on Persona (not the RPG stuff though since I have a budget of $0). I have two questions related to this:

  1. I am using the plugin “Dialogic” for dialogue stuff. I’m wondering, how much should one dialogic script be reused? For example: Lets say on many mornings in the game you want the following routine to happen:

[Teacher says some crap]

[Question]

[Answer question]

[Teacher says more crap based on response]

Would I make one dialogic script to handle every time this would happen, changing the dialogue in some way by inputting it into some function, or would I just create a dialogic script for every instance of this happening. Could I still do the former if there is dialogue of different lengths?

2. Calendar crap. Lets say you have a calendar of X days, and on certain days you want certain events to happen and certain legally distinct “acquaintance associations” to only appear on certain days. Essentially, I need to store a list of dates with events (oftentimes multiple but never more than three since I am having days split into three parts).

Right now I have global variables for the day, month, year. Given all of this, what would be the best practice for everything?

For clarification:

-Need to store possible events for mornings and evenings.

-Need to store what hangouts are available for afternoons.

-Etc.

Thank you for any help or support you give.

About the calendar. I would use an integer for the game day. 0 is the first day of the game, 1 is the second day. Then have a conversion function that converts this internal day number to a day/month/year string that can be presented to the player. For example, day 0 could be February 3rd, 2026 and day 306 would be December 6th, 2026. Working with integer days would be much easier tha working with actual dates.

Or you could even use numbering where 0 is the first day’s morning, 1 is the first day’s afternoon, 2 is the first day’s evening, 3 is the second day’s morning and so on. It is now easy to bind the events to integers. And if you at some point want to change the starting date of the game, you can do it easily by changing how the convert_int_time_to_date_string works. With integers it is also easy to calculate how far apart some events are. For example, if you need to move some event 2 days forward, just add 6 to the integer time.

1 Like

Building on this..

For the events, you can make them a custom resource or even maybe a simple enum.

And for triggering certain events for certain days, you can create a dictionary with Day(int) as key, and Array of events as values. So each day you can check which events should happen.

If you mean day of the week by ‘ceratin days’, like on Mondays event A should happen and on Tuesdays event A and B should happen, then you can make the keys of this dictionary as Day of the Week (can be an enum again).

  • A custom resource or enum or dictionary for Events
  • A dictionary for keeping the list of events by Day (int) or Days of Week (enum)
  • An enum for Days of Week (Monday to Sunday..)
  • A function to calculate which day (int) corresponds to which Days of Week.