update: deepseek redid the entire interface which is even better-looking (while I was implementing a save system). Since this is purely CSS, it’s very simple to change the entire display (colors, shapes, font formatting etc), or even make custom themes for it. At this stage though the engine itself doesn’t exist, meaning this is all hard-coded in a file.

It’s also fully mobile friendly but of course that’s basics.

At this point with the save and flag system it has everything needed to make ‘simpler’ VNs, provided you code them yourself in the files, but again this is just a fun little project lol. It’s not gonna be the next renpy or even publicly released lol.


I’m kind of on a VN binge these days (unfortunately it seems there is nothing as good as Virtue’s Last Reward, Ace Attorney and Paranormasight out there but I digress), and I had this terrible idea one night that it might be possible to make a web-based VN engine, that not only lets you code your game, but lets people play games made with it too.

So I asked deepseek how it would do exactly that. What kind of tech would you need? Is it even possible to make this?

And the answer of course is yes, it is. Everything is made with JS these days so that’s not surprising.

This would allow VNs to be not only created (or recreated) on any device, but also played on any device, since this runs in a browser window.

The prototype picture you see attached to this post is basically all Deepseek-made based on my design decisions - except the pictures, which I shamelessly stole off Google for the prototype.

At this stage the game is hard-coded into a JS file. It consists of nodes, with a node being a Javascript object that tracks a line of text or a choice. Every time you click, we move to the next node in line. A node has text, a background picture, a character asset (just one for the prototype), and a character name to display who is speaking.

There are also flags you can set in a node, which if you don’t code are variables that track progress. In the preview picture above, one choice is locked (replaced by ???) because the player has not ‘enabled’ the correct flag for it yet, i.e. not visited the node that sets this flag to true. This simple system is enough to allow more complex, non-linear storylines already - though there is no save system in the prototype (but it wouldn’t be very complicated to make).

This is what a node looks like in the code:

{
    id: 'node_5',
    type: 'choice',
    character: 'Anna',
    sprite: 'anna.png',
    background: 'school.png',
    speaker: 'Anna',
    text: 'What should we do next?',
    choices: [
      {
        text: 'Go to the library',
        next: 'library_node1',
        require: { hasLibraryPass: true } // Optional: only show if player has this flag
      },
      {
        text: 'Go to the cafeteria',
        next: 'cafeteria_node1'
      }
    ]
  },

If the engine were to exist of course a more intuitive, visual and streamlined system (allowing to efficiently string nodes along so you can focus on the writing) would be created. But it would render somehow like that in the code.

On the display side it’s literally just a few html <divs> styled and nested. You start the game by opening the html file and it just works. Deepseek took care of all of that without even asking it to, including displaying the choices this way which I honestly really like. It feels sleek and modern compared to the “let’s take up the entire screen with buttons”, but of course in this case we only need to make 2 choices fit.

Being HTML though it’s very easy to rearrange the blocks or style them differently. As much as I know HTML and CSS it’s cool that I don’t have to make this myself to test the first prototype.

I’m not sure I want to actually continue making this engine because, you know, a 200-line prototype is one thing, but turning this into an actual full engine with WYSIWYG development capabilities AND playable capabilities (and all that entails i.e. saving, options, animations, text control, etc.) is of course going to be a lot more work for basically nothing but a hobby project that exists to prove this is possible lol.

But I really like this little prototype and wanted to share :)

  • call_me_xale@lemmy.zip
    link
    fedilink
    arrow-up
    12
    arrow-down
    8
    ·
    edit-2
    21 days ago

    Fuck vibe coding, man.

    If you want to make something, learn how to make it the right way. It’ll be better in the end, and who knows what might be wrong with this that you aren’t aware of?

    • CriticalResist8@lemmygrad.mlOP
      link
      fedilink
      arrow-up
      12
      arrow-down
      2
      ·
      21 days ago

      A developer doesn’t necessarily output 10/10 code. Even a good developer might average 9/10, leaving room for improvement.

      Does AI output 10/10 code? No, it might peak at 6, depending. But if you or I cannot reach 6, then the AIs code will still be better than whatever we could output. Not only that, it’s able to come up with ideas and let you try them out. For example I was envisioning the choices being presented in the middle of the screen like all VNs, but ultimately I like the way it coded them in the textbox instead.

      A developer might also not be aware of what’s wrong with their code. This is why they write tests, but a lot of testing, from how I code, comes from just testing it in setting as a user.

      Ultimately, why does anyone need to become a senior dev to do these things? I run python scripts, sometimes batch commands, make JS scripts with AI and they work great and let me progress with what actually matters, unlocking progress so I can move to the next task. The idea of the ‘right way’ is to spend months learning each language, library and frameworks just to make a 400 line script that interacts with a Web page.

      Will I eventually run into a problem that’ll break everything? Maybe! But I could also code that fatal bug in myself without realising it.

    • certified sinonist@lemmygrad.ml
      cake
      link
      fedilink
      English
      arrow-up
      3
      ·
      20 days ago

      I think there are lots of good arguments to raise against AI, even for personal hobby projects. I don’t think ‘you can learn to code yourself’ will ever be one of them.

    • KrasnaiaZvezda@lemmygrad.ml
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      20 days ago

      The same way that people don’t program on bits because of assembly, or on assembly because of C and such, or on C because of Python, why would people have to use Python (or whatever) if they can get help from AIs to do what they want?