How about a new minimal IF engine with complete source file control?

That’s extremely interesting actually. Do you have a link to a website or a repo? I totally agree with what you said about Twine and Snowman, I feel exactly the same way. In the following days, I will have completed an MVP of an extremely minimal engine that will basically replicate Snowman to an extent, but giving the user full freedom regarding the organization of their text, code and styles, as well as a lot of extra customization options. I’d love to hear your opinion when I publish it, and I would also love to take a better look at Rez!

1 Like

Yep Repo, Docs. Happy to take a look at what you release. FYI Rez is written in Elixir and compiles to JS/HTML.

3 Likes

I’m super excited to finally share iffinity with you!

It’s in an alpha state, but I think it is more than a working MVP! You can view the source code in the link, as well as its complete documentation here. As I mentioned previously, it is heavily based on Twine/Snowman, but I think it grants a lot more freedom to the author. It is distributed as an npm package, so you can just npm install it if you want to play around with it. There are a couple of example stories in the repo, and after installing it you can also create a working template project with ifc init and see the engine in action right away.

I can’t wait for your opinions/suggestions/thoughts! Cheers!

5 Likes

Great name!

3 Likes

Cool. I think you’ve nailed the deployment story (a definite weakness for Rez) which is a key thing when proposing a new tool. I think I would definitely have tried this back when I started to get frustrated with Twine.

3 Likes

This looks really interesting. Sugarcube, which I’ve used for a lot of stuff, doesn’t support code-heavy passages that well, and I haven’t tried Snowman, but as an even more lightweight alternative this is definitely something I’ll have to check out.

1 Like

Looking forward to your thoughts and suggestions if you do try it out! I’m also open to collaborating on the codebase itself if anyone is interested :slight_smile:

2 Likes

Okay, I did a minimal bit of testing by trying to port over a WIP I’m making using Sugarcube (Twee) + Typescript. It didn’t exactly work? I was using esbuild to turn the Typescript files into one large JS file I could include in the Sugarcube project, but when I tried that with Iffinity it kept giving me a white screen plus Uncaught SyntaxError: expected expression, got '<' while compiling ejs in the console. The game worked when I didn’t include the JS file in iff-config.json, but since most of the functionality is in the Javascript it’s just a bunch of empty divs without it. (My code is on Github if you want to look, with most things in the src2 folder and export/index.html containing the exported HTML file. It doesn’t really do anything, though, and the game isn’t even done yet, so I don’t know how much that would help.)

A few other questions I have:

When configuring the story JS file and CSS file in iff-config.json, is there any way to have multiple JS/CSS files in one line? e.g. multiple CSS files for the story CSS? The Typescript type says it only accepts a string, not a list of strings (file names). I couldn’t figure it out.

Is there a way to edit the HTML around the area where the current snippet is rendered (the equivalent to altering Sugarcube’s special StoryInterface passage)?

With all that said, the amount of work put into this is still really impressive. I have basically no experience working on Node packages, so I don’t think I could help with development much, but I wanna see where this goes.

2 Likes

Thank you so much for trying iffinity out! Feedback from real users is the most valuable thing at this stage.

So, I took a look at your project and, strangle enough, by opening the exported vapormall.js file in VSCode and saving it without changing anything, just allowing VSCode to format it, I don’t get the error you mentioned (which I did get before, like you). I sincerely have no idea why this happens, probably has something to do with how esbuild exports TS to JS, but I’ll definitely need to look into this. For the time being, if you would like, please “pretty format” vapormall.js and try again, to see if everything else works out for you moving forward. I’m extremely interested to find out! Here it is (42.1 KB), formatted, for your convenience (I added an .md extension so that I could upload it).

Now, regarding your questions:

  1. There is no way for the time being to have multiple JS and CSS story files, which is quite stupid of me. I’ll patch this as soon as I can. As a matter of fact, I’ll make all script fields in the configuration file of type string | string[], so that you can have as many as you like. This part of the design is not very clean, for example libraries are lists of strings, story JS/CSS are a string expecting a single file and tag-based JS/CSS are strings that however allow multiple space-separated files like "script1.js script2.js", which is yikes. But it’s not hard to fix, so I’ll do it promptly.

  2. I’m not familiar with SugarCube, but I was thinking how to deal with this myself. Being minimal and all, I decided to do a little refactoring. For the time being, the output html is roughly like this:

...
<body>
    <div id="iff-snippet">
        ... active snippet content ....
    </div>
</body>

So, right now, you can add things around it be prepending/appending elements directly to the <body>, using jQuery, for example.

I’m thinking of adding another “wrapper” layer around the active snippet, so that the author can have more freedom to do stuff like what you said, without the ugliness of having to mess with the body itself:

<body>
    <div id="iff-story">
        <div id="iff-snippet">
            ... active snippet content ....
        </div>
    </div>
</body>

I will also change this as soon as possible (it will help in other aspects of the engine, too). For the time being, you can experiment with prepending/appending stuff to the <body> directly, via JS.

I’m really looking forward to hearing from you and for the next steps in your project!

2 Likes

Actually you helped me find a very tricky bug (obviously it was my fault and not esbuild, like, obviously…)! Thank you so much! I fixed it, but I’ll need some time before I upload a new version.

2 Likes

Made it!

v0.3.1 is now out and I think it’s quite better than before.

@Cerfeuil, you can check the changelog here (v0.3.0 is the one with the actual changes, v0.3.1 is the latest but has nothing else, just a dependency I forgot). Also, the documentation was refactored to reflect the changes, and I think that the page on the configuration file is the most interesting for you. I’m really looking forward to your comments and feedback, and I really hope that you keep on with the port of your game to iffinity!

Cheers, and thank you once more!

3 Likes

I think I read that your engine can output a base template to work with, but do you have a sample game?

2 Likes

ifc init indeed produces a template, but it actually is a working extremely basic “game” that you can compile with ifc and try it out on your browser. Also, the examples folder in the repo has 2 other projects. They are not, however, actual “games”, but are mostly made to test aspects of the engine. You can try them out as well, mainly in order to get a feel on how the engine works. I believe that if you are familiar with Twine (and especially with Snowman), you’ll feel right at home.

One of my short-term goals is to make a small “showcase” game that features some actual gameplay, and I’ll also try to port The Ship (my IFComp entry) to iffinity.

It goes without saying that if you end up making anything in iffinity, however simple or small, reach out to me so I can add it (or a link to it) in the repo :slight_smile:

2 Likes

I have no idea what I’m doing with node.js, but maybe you can help me. Win10.

I’m running node.js 18.18.0, but I didn’t install that Chocolatey thing that was an option.

I opened the cmd.exe and ran npm install -g iffinity. It downloaded.

Anytime I run ifc, I get an “error: inexistent, empty or malformed config file. aborting.”

Any ideas?

Yes, that is correct! That is the message from ifc when you try to compile a project (by writing ifc) and it doesn’t exist. So, you’ll need to follow the steps in the readme: create a new directory, navigate into it, and either: 1) run ifc init inside that directory and let it guide you, or 2) create the iff-config.json file manually and start building your project. After any of these steps, run ifc inside your project’s directory to compile it and output an HTML. Please, make sure you have read the repo’s readme (ideally the wiki too).

In any case, it seems that you have installed iffinity properly. You can also check its version with ifc -v and I’d also recommend checking the general feel, commands and options of the iffinity compiler with ifc -h.

Hope that helps, cheers!

1 Like

That helped perfectly! Thanks a bunch!

I’m excited to try it out. :slight_smile:

1 Like

I had a stupid-busy weekend. I’ll look at the logo and iffinity soon.

I know there’s no pressure, but just letting you know. :slight_smile:

Edit: I recently saw this post and thought to myself, I could have sworn I sent this as a private message. I must be getting old. :wink:

1 Like

Alright, just tried out the newest version. The updated iffinity branch is on Github, and the improvements are super helpful. Didn’t run into any bugs this time! I can already see a lot of places where this would be much more useful than Sugarcube for my project.

A few more notes/questions:

  • I couldn’t figure out a good way to prepend/append stuff to the <body> directly, even with the iff-story div added–admittedly I didn’t spend much time on it, and just ended copy-pasting the “wrapper HTML” around every single snippet. I only have two snippets so far, and probably won’t end up with that many, so this works for me. I wasn’t using the wrapper HTML for much besides styling, anyway.
  • The documentation here says the story object should have methods like showSnippet and getSnippet, but those methods don’t work for me, and it doesn’t seem to have them when I print it in the console? Granted I’m not great with this stuff, so maybe I screwed something up. But getting showSnippet to work would be really helpful for something I want to add to my project (a transition between an exploration/battle screen).

Thank you for working on this!

2 Likes

Thank you so much for keeping on trying iffinity out, and for your invaluable comments!

  • To prepend/append stuff directly to the <body>, you can use jQuery like so:
$(function () {
    $("body").append(...);
});

The reason I added #iff-story was so that you can have something to add stuff to that doesn’t get “flushed” on every snippet change (like what happens to #iff-snippet). This is true for the <body> as well, of course, but I wanted to offer the author a way to do so without having to mess with the <body> directly. Also, #iff-story was added for future use by the engine. So, feel free to add stuff either to #iff-story or to the <body> directly, but never forget that whatever you do to these won’t be refreshed/changed by the engine whenever the snippet changes; only changes made to the #iff-snippet element are “reset” on each snippet change.

  • The story object indeed has all the methods that are referenced in the documentation but, because they are methods, they are not shown with console.log (which only shows stuff like properties and data fields for objects). The methods are there. To make absolutely sure, you can try for example console.log(story.showSnippet) instead of console.log(story).

Hope that clears things a bit. Looking forward to more of your thoughts/comments/ways to use the engine, and to how your game will evolve. Thanks once again for using iffinity!

2 Likes

Hi everyone!

I just released the first beta version of iffinity (v0.4.0, including awesome logos made by @HAL9000) and I decided to attempt to get a bit more exposure.

Therefore, I made a new topic to try and reach out to more IF creators. I also created an iffinity tag in the forum. So, if you have any more thoughts/questions/feedback etc, feel free to respond to the aforementioned topic or even start a new one with the iffinity tag!

Small note for anyone who may already be playing around with iffinity, the latest version has a few breaking changes; they most probably won’t affect you, but you never know. Please make sure to check out the changelog.

Hope you like the latest version and I’m really looking forward to your feedback and, hopefully, your iffinity creations. Cheers!

4 Likes