Next-Generation Enhancement System for Ren'Py

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Next-Generation Enhancement System for Ren'Py

#1 Post by PyTom »

In the March game jam spirit, I did a little something over the past day and a half. It's not NaNoRenO, as it's not really a VN project, but it's kind of interesting so I'm posting it here. (And I gave my patrons a little preview earlier today.)

It's osmething I'm calling the next-generation enhancement system. It's a way to embed non-choice-based minigames inside Ren'Py. Would you like to add
arcade games to, say, Arcade Spirits? The next-generation enhancement system is the way to go.

The next-generation enhancement system involves a virtual machine that allows some of the most popular games ever created to run in Ren'Py. The virtual machine uses an 8-bit bytecode to express programs, while memory mapped registers provide access to functional units that can display tiled images, sprites, and synthesize audio.

Right now, the virtual machine gets input from either the keyboard or gamepad, as a series of "virtual switches" corresponding to left, right, up, down, action, etc. Visual output is displayed in a Ren'Py displayable, while while audio output is routed to the new per-sample mixing system.

The next-generation enhancement system is a work in progress, but I've compiled it for Windows, Linux, and Mac, and it's available for download at:

https://www.github.com/renpytom/nges

along with a sample Ren'Py project. It's been tested on Windows and Linux - I didn't get a chance to try it out on Mac. You'll need a recent nightly build of Ren'Py 8.1 to run it - some of the features it requires only became available in the last few days. If you'd like to see it in action before you try it out, I've put a youtube video up at:

https://www.youtube.com/watch?v=_XMdLtPV8VM

The next-generation enhancement system is something I'm doing on the side, but since it requires (so far, incredibly small) engine changes, I wanted to get a proof-of-concept working before Ren'Py 8.1.

Anyway, thanks for taking a look at this, and I hope you take it in the spirit it was intended to be taken in.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
plastiekk
Regular
Posts: 112
Joined: Wed Sep 29, 2021 4:08 am
Contact:

Re: Next-Generation Enhancement System for Ren'Py

#2 Post by plastiekk »

PyTom wrote: Sat Apr 01, 2023 12:00 am The next-generation enhancement system is the way to go.
Wow. What a fantastic idea! I just watched the video though. Only question I have: Are there any copyright issues (e.g. Nintendo) when using these arcade games (e.g. Mario) if you want to sell your VN?

Edit: Gosh, it's the first of April, very good I fell for it. :lol:
Why on earth did I put the bread in the fridge?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Next-Generation Enhancement System for Ren'Py

#3 Post by Ocelot »

What a great addition! I like the use of a virtual machine here: it provides an additional layer of security and keeps user data safe. Short, limited list of commands makes it easy for new developer to learn. Limiting amount of avaliable memory prevents malicious programs from performing an DoS attack by exhausting memory. I especially enjoy the system of built-in declarable machine extentions, which ensure that developers use only facets of the machine they want.
< < insert Rick Cook quote here > >

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Next-Generation Enhancement System for Ren'Py

#4 Post by m_from_space »

Since I watched the video and it told me to think about today's date and now reading Ocelot's little sarcastic comment (?), I get it.

I was wondering why people would like to include those kind of mini games into a visual novel on the other hand. But I actually asked myself how you get the result of the minigame into the Renpy script afterwards.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Next-Generation Enhancement System for Ren'Py

#5 Post by Ocelot »

m_from_space wrote: Sat Apr 01, 2023 6:59 am But I actually asked myself how you get the result of the minigame into the Renpy script afterwards.
The trick is to use a SDL-based emulator capable of running in headless mode (doing all calculations, but not doing any of the UI stuff) and modified to keep resulting image internally in format RenPy understands. Then you run it and get that image through ctypes.
< < insert Rick Cook quote here > >

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Next-Generation Enhancement System for Ren'Py

#6 Post by PyTom »

This is kind of a down payment on some tech I'm likely to improve in Ren'Py 8.2.

NGES does work, but it's really a proof of concept. I'd like to allow ctypes-using code to intercept the audio pipeline, both to generate sound and to modify existing sound. (Ren'Py itself will likely use this framework to implement some audio filtering based on ctypes.)

The new renpy.load_rgba function is going to be supported to make an image from a framebuffer. I'm probably also going to come up with some way of passing OpenGL functions to plugins (this is likely already possible with renpy.get_sdl_dll), and also a way of generating a texture that can be "filled in" by a plugin accessed through ctypes. I don't expect this to be used a ton, but I do think there are some things that could take advantage of this, and the changes to Ren'Py will be minimal and similar to what we're already doing for video on the web.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom


Post Reply

Who is online

Users browsing this forum: decocloud, Google [Bot], Li yuanlin