Dating Sim Engine (DSE) 4.1! Day Planner and Event Manager

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Dating Sim Engine (DSE) 4.1! Day Planner and Event Manager

#1 Post by qirien »


One common element of simulation-style VNs is a planner of some kind where you choose between various options for different things. Then the game decides what events happen based on things you've already done, statistics, affection points, or things like that. This framework should make it easier for game writers to do that.

PyTom wrote the original version, but I wanted to integrate it with screens for Our Personal Space, so I updated it.
Sample Daily Planner
Sample Daily Planner
It includes a sample game that shows how to define periods of time, when events should happen, and things like that. The sample code has lots of comments and explains things pretty well, so please start there to learn how to use it. The main files you will want to change are:
  • main.rpy - This has the "start" label in it which is where the game starts.
  • events.rpy - This is where all the events are defined.
  • styles.rpy - If you want to change how it looks.
Documentation is provided as comments inside each file, for now. If you would like to improve the documentation, I would love your help!

Download the Dating Sim Engine:
https://github.com/renpy/dse/releases/latest


-------------------------------------------------------------------------------
Changelog
v3.0 - Initial re-release
v3.1 - More consistent styles, Fixed a bug where it would crash if you asked it not to display the stats label or value, More comments directing users to the parts they probably wish to change
v3.11 - Fixed a bug where skipping periods would not work properly
v3.12 - Added hidden stat feature
v4.0 - Changed to be compatible with the new GUI system. Also renamed most files to make it obvious which were part of the DSE.
v4.1 - Fixed variables being accessed before initialized. Thanks isak grozny!
Last edited by qirien on Wed Nov 06, 2019 2:29 pm, edited 7 times in total.
Finished games:
Image
Image
Image

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#2 Post by noeinan »

Nice! I'll have to check it out. :)
Image

Image
Image

Brother O'Fart
Newbie
Posts: 10
Joined: Thu Feb 19, 2015 10:55 am
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#3 Post by Brother O'Fart »

Sounds great! Will give it a try myself! :)

User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#4 Post by sasquatchii »

I just downloaded this because it looks AMAZING! But I got this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While parsing C:\Users\Laura\In The Air\renpy-6.18.3-sdk\dse/game/event_dispatcher (2).rpy.
ScriptError: Name u'events_end_day' is defined twice, at game/event_dispatcher.rpy:235 and game/event_dispatcher (2).rpy:235.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\bootstrap.py", line 288, in bootstrap
    renpy.main.main()
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\main.py", line 284, in main
    renpy.game.script.load_script() # sets renpy.game.script.
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\script.py", line 181, in load_script
    self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\script.py", line 498, in load_appropriate_file
    self.finish_load(stmts, initcode, filename=rpyfn)
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\script.py", line 336, in finish_load
    bad_node.filename, bad_node.linenumber))
ScriptError: Name u'events_end_day' is defined twice, at game/event_dispatcher.rpy:235 and game/event_dispatcher (2).rpy:235.

Windows-7-6.1.7601-SP1
Ren'Py 6.99.3.404
Not sure what I did wrong... any ideas?
ImageImage

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#5 Post by qirien »

It looks like maybe you had an older version of the DSE already in there, and when you unzipped the new one, instead of replacing the files it made two versions of the same file, one with a (2) on the end.

I'm not sure which version of the file is newest, so you could either delete the older versions if there are two of certain files, or you could delete the dse directory and unzip it again.

Let me know if that works!
Finished games:
Image
Image
Image

User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#6 Post by sasquatchii »

qirien wrote:It looks like maybe you had an older version of the DSE already in there, and when you unzipped the new one, instead of replacing the files it made two versions of the same file, one with a (2) on the end.

I'm not sure which version of the file is newest, so you could either delete the older versions if there are two of certain files, or you could delete the dse directory and unzip it again.

Let me know if that works!

Oh, duh!

Yes, that worked!! I just deleted both DSE's, reinstalled it, and booted it up and now it's working perfectly. Thanks so much, I'm excited to be able to use this in my game :D
ImageImage

User avatar
AsHLeX
Miko-Class Veteran
Posts: 556
Joined: Wed Dec 25, 2013 1:09 pm
Completed: Starlight Dreamers, Mysterious Melody, Town of Memories, Marked, To Fly, The Change, Him From The Past, A Forgotten Memory
Projects: Cafe Mysteria
Location: Malaysia
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#7 Post by AsHLeX »

I know this is a pretty odd question and i'm not sure if here is the right place to post it...but how to I change the colour of the stats bar? (Like from the default blue and white to say... pink, for example. Changing the theme doesn't change the colour and a blue bar looks kind of odd on a yellow background.

P.S: Thanks for this ^_^ It's really helpful.

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#8 Post by qirien »

Hey, this is a fine place to post it!

The bars probably should change when you change themes... but because we've customized them a bit, they don't. The normal bars for the Round Rectangle theme don't look like stat-raising game bars, so we've been using the ones from the (old?) Outline theme.

If you want to change the bars, you can open up options.rpy and look for these lines below the theme:

Code: Select all

    theme.outline_bars(
        inside="#fff",
        idle="#003c78",
        hover="#0050a0")
If you want to keep the look and just change the color, you can change the colors here. If you are using a completely different theme and want to use its default bars, you can just delete these lines.

Hope this helps!
Finished games:
Image
Image
Image

User avatar
AsHLeX
Miko-Class Veteran
Posts: 556
Joined: Wed Dec 25, 2013 1:09 pm
Completed: Starlight Dreamers, Mysterious Melody, Town of Memories, Marked, To Fly, The Change, Him From The Past, A Forgotten Memory
Projects: Cafe Mysteria
Location: Malaysia
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#9 Post by AsHLeX »

Thank you so much!!! It did...immensely :D

User avatar
AsHLeX
Miko-Class Veteran
Posts: 556
Joined: Wed Dec 25, 2013 1:09 pm
Completed: Starlight Dreamers, Mysterious Melody, Town of Memories, Marked, To Fly, The Change, Him From The Past, A Forgotten Memory
Projects: Cafe Mysteria
Location: Malaysia
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#10 Post by AsHLeX »

Edit: (After browsing around the Q&A forums I found the answer. Thanks!!!)

Mii
Newbie
Posts: 11
Joined: Thu Feb 19, 2015 9:26 am
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#11 Post by Mii »

is there anyway to store the choices made in the planner so that the player can either make a choice of what they want to do during the week or just repeat their last chosen activities for the week?

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#12 Post by qirien »

Yes, good idea, that's not too hard to do. The main reason you wouldn't do this would be to encourage the user to think about their choices each time, but for some schedules it might make sense for the default to be what they did last time.

Open up main.rpy and look for "label day:" You should see where we initialize each of these variables and reset them every day; it looks like this:

Code: Select all

    # Here, we want to set up some of the default values for the
    # day planner. In a more complicated game, we would probably
    # want to add and remove choices from the dp_ variables
    # (especially dp_period_acts) to reflect the choices the
    # user has available.

    $ morning_act = None
    $ afternoon_act = None
    $ evening_act = None
What we want to do is not run that every day, but only run it one time. That way these variables will stay the same from day to day unless the user changes them. But we have to initialize them at first or the game doesn't know about these variables. So, cut that code, and paste it up above under the "label start:", so it looks like this:

Code: Select all

# This is the entry point into the game.
label start:

    # Initialize the default values of some of the variables used in
    # the game.
    $ day = 0
    $ morning_act = None
    $ afternoon_act = None
    $ evening_act = None

That should do what you want.
Finished games:
Image
Image
Image

Mii
Newbie
Posts: 11
Joined: Thu Feb 19, 2015 9:26 am
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#13 Post by Mii »

thank you so much! it worked perfectly. i figured i would at least have it as an option to make the game feel less grindy to the player.

JodoKaden
Newbie
Posts: 1
Joined: Tue Jun 16, 2015 12:46 pm
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#14 Post by JodoKaden »

I'm sorry if this is a really stupid question, but how do you install this framework?

Which file in Ren'py do I want to put it in?

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

#15 Post by qirien »

Unzip the file into your Ren'Py projects directory, where it will appear as a project when you start Ren'Py. You can then modify it to meet your own needs, or, if you want to combine it with an exisiting project, you can copy all the .rpy files in the dse/game subdirectory into your own project's game subdirectory.
Finished games:
Image
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users