Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: This Grand Life  (Read 7713 times)

0 Members and 1 Guest are viewing this topic.

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
This Grand Life
« on: October 18, 2017, 02:05:32 pm »
Hey everyone,

I've been working on a project using SFML for a while now, and didn't realize this subforum for our projects existed here! It's written in C++, I use all the SFML modules except networking and also use SFGUI for the user interface.

My project is This Grand Life, a personal finance simulator where you create a character, manage their money and help them achieve their life goals.

You can download a demo from Itch.io or IndieDB.

It's also going to be coming to Steam on 23rd October, 2017.


Here's a list of features and screenshots:


  • Balancing Needs - Core game loop of balancing short-term needs such as hunger, fun, hygiene and health with long-term goals like happiness, wealth and education.


  • Stylised City Maps - The game map is based on a real major city, thanks to satellite imagery from the European Space Agency!


  • Education System - Study courses and graduate with qualifications, required for some higher level occupations.


  • Careers and Employment - Prestigious career paths like Banking and Chef, plus lower level occupations like Janitor and Salesperson.


  • Progressive Taxation System - The more you earn, the higher your tax bracket.


  • Possessions - Fridges, TVs and Computers which help with your short-term needs.


  • Collectibles - Collect stamps, coins and other rare items to achieve your long-term goals.


  • Subscription Services - Sign up for services that make life easier, like grocery delivery or cable TV.


  • Special Events - Home Robbery, Hotdog Eating Competition, Steam Sales and more.
  • Investment and Debt - Borrow money to achieve your goals or invest for a future where you won't have to work. Minimum repayments and interest rates calculated realistically.


  • Real Estate - Buy properties through an auction system. Live in it yourself or rent out your properties to tenants.


  • Life Expenses - Electricity bills, rent, loan repayments and consequences for not paying them on time.


  • Traits/Privilege System - Begin life with advantages like rich parents, or disadvantages like alcoholism.


  • Tutorial - An interactive tutorial where your mother tells you to get a job.


If any of you have played Jones In The Fast Lane, it is my inspiration for creating This Grand Life!

« Last Edit: October 18, 2017, 11:51:16 pm by Parsley »

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: This Grand Life
« Reply #1 on: October 18, 2017, 02:59:30 pm »
Love the artstyle and music. Looks great! Good job! You should contact SFML Projects to have more visibility!
GitHub
Code Concept
Twitter
Rosme on IRC/Discord

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: This Grand Life
« Reply #2 on: October 18, 2017, 03:30:20 pm »
Thanks, I'll get in contact with that SFML Projects as well!

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: This Grand Life
« Reply #3 on: October 18, 2017, 07:28:08 pm »
The skin you've written for SFGUI looks lovely and so does all the other art. By the way, SFGUI Windows have a has a close button that you can enable too.
Back to C++ gamedev with SFML in May 2023

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: This Grand Life
« Reply #4 on: October 18, 2017, 07:50:26 pm »
Awesome, the UI style reminds me a lot of Sim City 3000. Any chance for rounded edges? :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: This Grand Life
« Reply #5 on: October 18, 2017, 11:55:32 pm »
Looks great! :)

And it's really awesome to see SFGUI used in such a project.

Btw. is Tribe Of Pok also built with SFML?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: This Grand Life
« Reply #6 on: October 19, 2017, 12:02:42 am »
@FRex I've actually got about 20 different skins/themes which I've defined in a .txt file, and each location has a unique skin. It takes a long time to load them all (about 75% of startup time) but is worth it in the end! I did try using the built-in close button initially but from memory I ran into trouble with it. I think it was 'sticky' or maybe didn't feel like I was clicking it when I thought I did or something? I ended up rolling my own close that I can just Pack() in anywhere.

@Mario I'm not sure there's rounded edge functionality in SFGUI, at least I haven't encountered it.

@eXpl0it3r Yes Tribe Of Pok also used SFML, I totally forgot. I didn't use SFGUI though, I rolled my own UI and it was a nightmare!

Sub

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: This Grand Life
« Reply #7 on: October 20, 2017, 12:11:58 am »
Don't really have much to say other than that this looks great.  It reminds me a bit of the game Drug Wars which I had a ton of fun with when I was younger.  Keep it up :)

edit:  Any chance this will also come out for Linux when it's done?
« Last Edit: October 20, 2017, 12:25:28 am by Sub »

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: This Grand Life
« Reply #8 on: October 20, 2017, 01:56:13 am »
Thanks for the kind words. I've never used Linux before or ported to it so have no idea how hard it would be. I know SFML is compatible so at least that angle's covered. If the game gets popular enough I might look into it, but at the moment there's no plans for anything other than Windows PC.

Sub

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: This Grand Life
« Reply #9 on: October 21, 2017, 12:51:32 am »
Fair enough.  Not a huge deal, I just downloaded the demo and it seems to work perfectly on wine. 

It's pretty cool.  Music actually reminds me of the sims, which seems appropriate.  Only suggestion I have is that it'd be awesome if the game were playable through a keyboard or controller.  Like when a new dialogue comes up, it'd be nice if it had focus so you could press enter to close it rather than having to move the mouse over. 

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: This Grand Life
« Reply #10 on: October 21, 2017, 09:47:39 pm »
I hadn't thought about using the enter key to close the popup windows, I'll look into that  :)

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: This Grand Life
« Reply #11 on: October 23, 2017, 09:48:38 am »
This looks indeed like a cool classic tycoon game, congrats on the release!

And of course I'm very happy to see SFGUI being extensively used in a finished product, that's really nice.

Quote
It takes a long time to load them all (about 75% of startup time) but is worth it in the end!
Mind sharing the template files with me? I'm sure it can be optimized.

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: This Grand Life
« Reply #12 on: October 23, 2017, 10:52:26 pm »
Hi Tank, thanks for making SFGUI, it's really great and made the UI aspects so much easier to handle!

I have attached the theme.txt, where each of the theme IDs are grouped together. I'm loading it using:

desktop.LoadThemeFromFile("theme.txt");

The above part takes maybe 50% of the time (very roughly). Then for each theme ID in that file I call the below SetGenericDesktopSettings for the font size, which takes maybe 25% of the time. I set the font size in the app rather than the .txt file because it can change depending on the player's settings.

SetGenericDesktopSettings(sfg::Desktop& desktop, std::string id)
{
    //Widget types
    std::vector<std::string> widgets;
    widgets.push_back("Button");
    widgets.push_back("Label");
    widgets.push_back("Frame");
    widgets.push_back("Entry");

    std::vector<std::string>::iterator itW = widgets.begin();
    while(itW != widgets.end())
    {
        //Set font sizes
        std::string fontStr = *itW + "#" + id + *itW;
        std::string largeFontStr = *itW + "#" + id + "Large" + *itW;
        desktop.SetProperty(fontStr, "FontSize", m_imageM->GetDefaultCharSize());
        desktop.SetProperty(largeFontStr, "FontSize", m_imageM->GetDefaultLargeCharSize());

        ++itW;
    }
}

Sorry I can't provide a complete example, the way I load the theme ID strings is a bit more complicated and too large to paste here.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: This Grand Life
« Reply #13 on: October 24, 2017, 02:37:45 am »
SFGUI theme loading is a bit "suboptimal". It causes a widget hierarchy refresh for every statement read from the file, which given a big enough file and enough widgets can lead to a lot of waiting.

Either load the theme file and set the font sizes before creating all your widgets or manually take care of refreshing once you know you are done. Something like this:
#include <SFGUI/Engines/BREW.hpp>

...

class MyOptimizedBREW : public sfg::eng::BREW
{
public:
        void SetAutoRefresh( bool enable ) { sfg::eng::BREW::SetAutoRefresh( enable ); }
};

...

desktop.UseEngine<MyOptimizedBREW>();

...

MyOptimizedBREW& engine = static_cast<MyBREW&>(desktop.GetEngine());
engine.SetAutoRefresh(false);
desktop.LoadThemeFromFile("theme.txt");
SetGenericDesktopSettings(desktop, ...);
engine.SetAutoRefresh(true);
sfg::Widget::RefreshAll();
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: This Grand Life
« Reply #14 on: October 24, 2017, 04:03:04 am »
Thanks binary1248, I'll have a look into disabling the refresh!