Dating Sim Engine (DSE) 4.0! 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
Veteran
Posts: 453
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Contact:

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

#1 Post by qirien » Wed Apr 08, 2015 2:50 pm


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.
screenshot0002.png
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.
Last edited by qirien on Thu Mar 01, 2018 2:41 pm, edited 6 times in total.
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

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

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

#2 Post by noeinan » Sun Apr 12, 2015 7:42 pm

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 » Wed Apr 15, 2015 6:09 am

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

User avatar
sasquatchii
Miko-Class Veteran
Posts: 516
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 » Mon May 11, 2015 11:25 pm

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?
ImageImageImage

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

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

#5 Post by qirien » Tue May 12, 2015 9:29 am

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
In progress: Our Personal Space 2: Space to Grow

User avatar
sasquatchii
Miko-Class Veteran
Posts: 516
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 » Tue May 12, 2015 11:39 pm

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
ImageImageImage

User avatar
AsHLeX
Veteran
Posts: 467
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 » Thu May 21, 2015 10:09 am

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
Veteran
Posts: 453
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Contact:

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

#8 Post by qirien » Thu May 21, 2015 11:54 am

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
In progress: Our Personal Space 2: Space to Grow

User avatar
AsHLeX
Veteran
Posts: 467
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 » Thu May 21, 2015 12:49 pm

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

User avatar
AsHLeX
Veteran
Posts: 467
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 » Fri May 22, 2015 9:47 am

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 » Mon Jun 15, 2015 11:29 pm

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
Veteran
Posts: 453
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Contact:

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

#12 Post by qirien » Tue Jun 16, 2015 1:20 am

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
In progress: Our Personal Space 2: Space to Grow

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 » Tue Jun 16, 2015 2:52 am

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 » Tue Jun 16, 2015 12:47 pm

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
Veteran
Posts: 453
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Contact:

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

#15 Post by qirien » Tue Jun 16, 2015 10:58 pm

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
In progress: Our Personal Space 2: Space to Grow

Post Reply

Who is online

Users browsing this forum: sDextra