Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional Text / Page Data Model Changes / Image Support (?) #36

Open
amiantos opened this issue Apr 7, 2023 · 0 comments
Open

Conditional Text / Page Data Model Changes / Image Support (?) #36

amiantos opened this issue Apr 7, 2023 · 0 comments

Comments

@amiantos
Copy link
Owner

amiantos commented Apr 7, 2023

  • It would be really great to do conditional text on pages. I believe I've been reluctant to include it because I want to keep Gamebook Engine relatively simple, and believe that being constrained forces creativity and so on. But at the same time, it's annoying to have to create two different decisions that lead to two different pages. On the other hand, having to write two separate pages may inspire you creatively... I don't know!
  • If we were to consider conditional page content, I think a change to a block-based data model for pages would be good. For example...
{
    "page": {
        "uuid": "...",
        "type": "ending",
        "consequences": [],
        "decisions": [],
        "content": [
            {
                "uuid": "...",
                "type": "markdown",
                "content": "Start of page content...",
                "match_style": "match_all",
                "rules": []
            },
            {
                "uuid": "...",
                "type": "markdown",
                "content": "Some special content",
                "match_style": "match_all",
                "rules": [
                    {
                        "uuid": "...",
                        "attribute_uuid": "...",
                        "value": 1,
                        "type": "equal"
                    }
                ]
            },
            {
                "uuid": "...",
                "type": "markdown",
                "content": "...and the rest of the content",
                "rules": []
            }
        ]
    }
}

We can imagine other types of blocks... {"type": "image", "url": "https://..."} perhaps? (But obviously embedding images from the web isn't something that would actually work. Gamebooks with images would have to be distributed in a zip/container similar to Apple Work suite files... anyway...)

@amiantos amiantos changed the title Conditional Text / Page Data Model Changes Conditional Text / Page Data Model Changes / Image Support (?) Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant