Images that give a blur effect?

KiaAzad

Member
Feb 27, 2019
277
207
I don't think such a thing is possible. Blur works by moving pixels around and no image can do that when shown over another image.
I assume you want this for renpy, I think I've seen some script for blur effect on it's forum, alternatively you can take a small screenshot and show it big, it gives you a kind of blury effect.
 
  • Like
Reactions: Black Ram oss

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,005
it can or can't work depending on what you are trying to do, will the glass (the thing bluring the images behind it) be moving? If it is moving, then you can't do this without making an animation (ie throw the image in blender and use an actually glass material and render the animation.

if the art can just be static, meaning the glass doesn't move, or if it does, but you can use multiple images to represent movement (ie a shower door close, then open, two different scenes/images) then if you want to make a blur effect you can use any photo editor, gimp or photoshop, and just duplicate the image, blur the duplicate, then cut out everything that doesn't need to be blur so that only the thing in the glass has the blur effect.

I have also found out recently that inkscape has a "rough transparency" effect, where it warps it like shower glass that looks pretty cool, but it has no shine.
 

BlueDick

Newbie
Apr 3, 2020
62
76
I don't think such a thing is possible. Blur works by moving pixels around and no image can do that when shown over another image.
I assume you want this for renpy, I think I've seen some script for blur effect on it's forum, alternatively you can take a small screenshot and show it big, it gives you a kind of blury effect.
Could you suggest me some codes?
 
  • Like
Reactions: Black Ram oss

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,376
15,289
Globally speaking, the default blur is done by diffusing the colors. You remember when you were young and had painting in school ? You were proud of what you drawn, until few water drops hit the paper and messed with the colors ; this is the default way to blur an image.

Therefore, you can simulate something like this with Ren'py, by mixing the image with altered copy of itself. Something like :
[wrote on the fly]
Code:
image myBlurredImage :
    contains:
       "myImage.jpg"
    contains:
       "myImage.jpg"
       xoffset -1 yoffset -1
       alpha 0.3
    contains:
       "myImage.jpg"
       xoffset 1 yoffset 1
       alpha 0.3
    contains:
       "myImage.jpg"
       xoffset -2 yoffset -2
       alpha 0.3
    contains:
       "myImage.jpg"
       xoffset 2 yoffset 2
       alpha 0.3
Just play with the value until you get the best result.
The ATL ( ) statement tell Ren'py that what's in its bloc is to add immediately. This by opposition to the default behavior of an ATL block, where new image replace the previous one. Which permit you to blend all the copy of the image together.
Copy that use are shifted by and , then defined as transparent with to not just hide what was under them.


Edit:
If you want something more universal, you can benefit from the text substitution in image, using a variable instead of a hardcoded name for the image :
Code:
default toBlur = None
image myBlurredImage :
    contains:
       "[toBlur]"
    contains:
       "[toBlur]"
       xoffset -1 yoffset -1
       alpha 0.3
[...]
label whatever:
    $ toBlur = "images/oneImage.jpg"
    show myBlurredImage
    "blablabla"
    "bliblibli"
    $ toBlur = "images/nextImage.jpg"
    "bloblo"
    hide myBlurredImage
The image will automatically change when the value of "toBlur" will be changed.
 
Last edited:

BlueDick

Newbie
Apr 3, 2020
62
76
Globally speaking, the default blur is done by diffusing the colors. You remember when you were young and had painting in school ? You were proud of what you drawn, until few water drops hit the paper and messed with the colors ; this is the default way to blur an image.

Therefore, you can simulate something like this with Ren'py, by mixing the image with altered copy of itself. Something like :
[wrote on the fly]
Code:
image myBlurredImage :
    contains:
       "myImage.jpg"
    contains:
       "myImage.jpg"
       xoffset -1 yoffset -1
       alpha 0.3
    contains:
       "myImage.jpg"
       xoffset 1 yoffset 1
       alpha 0.3
    contains:
       "myImage.jpg"
       xoffset -2 yoffset -2
       alpha 0.3
    contains:
       "myImage.jpg"
       xoffset 2 yoffset 2
       alpha 0.3
Just play with the value until you get the best result.
The ATL ( ) statement tell Ren'py that what's in its bloc is to add immediately. This by opposition to the default behavior of an ATL block, where new image replace the previous one. Which permit you to blend all the copy of the image together.
Copy that use are shifted by and , then defined as transparent with to not just hide what was under them.


Edit:
If you want something more universal, you can benefit from the text substitution in image, using a variable instead of a hardcoded name for the image :
Code:
default toBlur = None
image myBlurredImage :
    contains:
       "[toBlur]"
    contains:
       "[toBlur]"
       xoffset -1 yoffset -1
       alpha 0.3
[...]
label whatever:
    $ toBlur = "images/oneImage.jpg"
    show myBlurredImage
    "blablabla"
    "bliblibli"
    $ toBlur = "images/nextImage.jpg"
    "bloblo"
    hide myBlurredImage
The image will automatically change when the value of "toBlur" will be changed.
Thanks, but in the end I solved it like this:
Python:
    image 1 = Composite( (gui.width, gui.height),
        (0, 0), "/bed.png",
        (0, 0), "/M.png")
    image 1 blur = Composite( (gui.width, gui.height),
        (0, 0), im.Blur("/bed.png", 3),
        (0, 0), im.Blur("/M.png", 3))


But, since it seems wasted to "create" 2 identical images (but one with a blur effect).
i was wondering if you can use a better way. eg:
Python:
show image 1 with blur
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,223
Dumb question... but what are you trying to achieve?

I get your aiming to avoid having 2 versions of the same image (one clear, one blurred) - but to what end?

Someone waking up, first thing in the morning?
Someone looking from a distance through a telescope or binoculars and failing to get the focus sharp?
Someone looking at someone with their glasses on and glasses off?

Edit: Just noticed your original post talks about glass... So pretty sure my idea (which was mainly aimed at a frosted glass/water on glasses style effect) won't be appropriate.

I doubt it matters as finding a solution to the "blurred" image solution - but maybe someone could offer an alternative that you perhaps haven't considered?

(I'm thinking something like imagedissolve() ( ) that uses a static image with varying shades of a black and white image to transition between two images. If those two images were the same identical image, but with one shown with a very low alpha/high transparency against a white background to give a "looking through tracing paper" washout effect using the same source picture and RenPy's Composite() image maging... then use imagedissolve() with an B&W image given the look of soap bubbles to transition between the two versions of your image.... hell, I dunno, it'd probably look terrible... but I wonder it could be made to work for you).

On the more practical side... if you're worried about image sizes... just how many "blurred" images are you planning to have in your game? 1:1 would be a lot of blurs and I can see why you'd what to find a more economic solution. But if it's only 1 in 200 or more, then sod it... Just have two versions of the same image and eat the tiny amount of extra disk space. If you're really worried about space, then save the blurred version as a low quality .JPG file - the lack of image quality shouldn't matter to much for a blurred image, and will save reduce the file size significantly.
 
Last edited:

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,005
But, since it seems wasted to "create" 2 identical images (but one with a blur effect).
i was wondering if you can use a better way. eg:
Python:
show image 1 with blur
Now you sound like a true programmer, "could it be better?"
unfortunately a lot of the time in programming (at least in other languages or custom languages), programming can do a lot of unoptimized bs, but tries to lie to you and fake being pretty in that it at least uses clean commands and code, but sometimes under the hood it is just bs-ing the effect, kinda like how c++ bs object oriented programming, while a lot of the features can just be done in c with specialized structs and pointers.
 

BlueDick

Newbie
Apr 3, 2020
62
76
Dumb question... but what are you trying to achieve?

I get your aiming to avoid having 2 versions of the same image (one clear, one blurred) - but to what end?

Someone waking up, first thing in the morning?
Someone looking from a distance through a telescope or binoculars and failing to get the focus sharp?
Someone looking at someone with their glasses on and glasses off?

Edit: Just noticed your original post talks about glass... So pretty sure my idea (which was mainly aimed at a frosted glass/water on glasses style effect) won't be appropriate.

I doubt it matters as finding a solution to the "blurred" image solution - but maybe someone could offer an alternative that you perhaps haven't considered?

(I'm thinking something like imagedissolve() ( ) that uses a static image with varying shades of a black and white image to transition between two images. If those two images were the same identical image, but with one shown with a very low alpha/high transparency against a white background to give a "looking through tracing paper" washout effect using the same source picture and RenPy's Composite() image maging... then use imagedissolve() with an B&W image given the look of soap bubbles to transition between the two versions of your image.... hell, I dunno, it'd probably look terrible... but I wonder it could be made to work for you).

On the more practical side... if you're worried about image sizes... just how many "blurred" images are you planning to have in your game? 1:1 would be a lot of blurs and I can see why you'd what to find a more economic solution. But if it's only 1 in 200 or more, then sod it... Just have two versions of the same image and eat the tiny amount of extra disk space. If you're really worried about space, then save the blurred version as a low quality .JPG file - the lack of image quality shouldn't matter to much for a blurred image, and will save reduce the file size significantly.
I need it in a scene where I first look at an object in the distance, then look at the cell phone. therefore the rest becomes blurred.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,223
I need it in a scene where I first look at an object in the distance, then look at the cell phone. therefore the rest becomes blurred.
So it's just a single use?
A possible 2 (maybe 4) images in a game that will likely have hundreds of other pictures?

If that's the case... as I said earlier, I think you're looking for a highly technical solution (RenPy) to a very simple problem. Render your scene, fire up your graphics package of choice (Photoshop if you have it, if you want almost identical functionality for free)... Load your scene, hit the "Blur" button a dozen or so times, copy paste your hand/cellphone into the foreground and then use "Save as...".

Alternatively, if you're using something like Daz - Render your scene without the cellphone, add the cellphone to the scene, alter the "depth of field" and "F/Stop" settings for the camera so only the cellphone is in focus and render the new scene. This has the advantage of honoring any shadowing or reflections on the phone itself. If you don't already know how, search YouTube for "daz3d depth of field".

You're trying to treat the two pictures as being a single picture that can be stitched together with blur. But the reality is that they really are two separate images, so it's not really "wasted" disk space and they aren't "identical images", because one is blurred and has a cellphone in the foreground and the other doesn't. Or to rephrase my original point, it seems like you're spending a lot of time and effort trying to save 500KB to 2MB of disk space in a world where disk space is dirty cheap.

Don't get me wrong, as a programmer - I've gotten lost down that same sort of rabbit hole a lot of times in the past. Plus I barely know how to use Daz. But sometimes the simplest solution really is the best. Render it twice (with DOF and FSTOP) and don't worry about the ultimate file sizes.
 

BlueDick

Newbie
Apr 3, 2020
62
76
So it's just a single use?
A possible 2 (maybe 4) images in a game that will likely have hundreds of other pictures?

If that's the case... as I said earlier, I think you're looking for a highly technical solution (RenPy) to a very simple problem. Render your scene, fire up your graphics package of choice (Photoshop if you have it, if you want almost identical functionality for free)... Load your scene, hit the "Blur" button a dozen or so times, copy paste your hand/cellphone into the foreground and then use "Save as...".

Alternatively, if you're using something like Daz - Render your scene without the cellphone, add the cellphone to the scene, alter the "depth of field" and "F/Stop" settings for the camera so only the cellphone is in focus and render the new scene. This has the advantage of honoring any shadowing or reflections on the phone itself. If you don't already know how, search YouTube for "daz3d depth of field".

You're trying to treat the two pictures as being a single picture that can be stitched together with blur. But the reality is that they really are two separate images, so it's not really "wasted" disk space and they aren't "identical images", because one is blurred and has a cellphone in the foreground and the other doesn't. Or to rephrase my original point, it seems like you're spending a lot of time and effort trying to save 500KB to 2MB of disk space in a world where disk space is dirty cheap.

Don't get me wrong, as a programmer - I've gotten lost down that same sort of rabbit hole a lot of times in the past. Plus I barely know how to use Daz. But sometimes the simplest solution really is the best. Render it twice (with DOF and FSTOP) and don't worry about the ultimate file sizes.
it doesn't happen they are in one scene, but in many. in all cases the mobile phone is the same but the background is different.

my goal is also to add this effect when I click on the mobile phone icon. è my mobile appears to see the statistics of the game, making the background blurred.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,223
Fair enough. I can see what you're attempting.
You can open the cellphone at any point and want a system that works regardless which image is currently being displayed.

I'm still a relative newbie for RenPy, which is why I tend to pitch the "keep it simple" answers.

My only other thought is to forget the blur and instead try for a semi transparent overlay which covers the whole screen - similar to what happens with the text box in most games.
Have it be a format which supports transparency (.PNG probably) and have a semi random pattern converted to black and white and then reduce the alpha/transparency so you can see the image behind through it. Then add the cellphone on top.

I'm thinking something like this...

iphone-haze.png iphone-hand.png iphone-combined.png iphone-car.jpg iphone-whole.jpg

In my example, the 3rd image would be part of a full screen screen that overlays whatever happened to be on the screen at the time (in this case the 4th image) to show the user something that looks like the 5th.
You'd need to play around with transparency values and the graininess of the black and white haze to find something you personally are happy with - but I think this ticks most of the boxes you are aiming at (albeit, not an actual blur).
For example, I've used a quite blocky "haze" image, you might want to use a much finer grain to give a more "looking through tracing paper" appearance.

Edit: For example, this is a slightly more transparent haze layer (a bit less "in your face").
With the original transparency for comparison.

iphone-haze2.png iphone-car.jpg iphone-whole2.jpg iphone-whole.jpg

Edit2: To make the "haze" image a bit less bland, consider a dark blue tint to the haze image instead being varying shades of white. Again, all personal preference.
 
Last edited:

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,005
I think they are asking for something like this
test.jpg
where it looks like the background is out of focus
Python:
image 1 blur = Composite( (gui.width, gui.height),
(0, 0), im.Blur("/bed.png", 3),
(0, 0), im.Blur("/M.png", 3))
Now I don't use renpy so I don't know their API, but from the above example, I would guestimate 3 is referring to the blur radius. I don't know how renpy organizes its execution, but you could probably make 3 a variable, and instead of asking it to do,
Python:
show image 1 with blur
you could just define blur = some number, and noBlur = 0, and set the variable to blur or noBlur. But that assumes that image is recalculated each Time before being shown, but I don't know since I don't use the renpy API. Python is slow so they are probably using some trick in renpy to avoid unnecessary recalculations. If however, this does work, what you could also do is execute a parallel function that fades between the two values, that way the blur fades in rather that suddenly jumping from on to off, giving the impression as if the viewer is adjusting their field of view to focus on the phone. While this would be perfectly fine in C, C++, C#, Java, Javascript, normal python, gml, gdscript, mono,monogame framework, HTML (executing java or something) etc, because I don't know how the renpy system works I can't say how the image would actually be handled. I could google how renpy works, but it is 5 in the morning, I ain't doing jack :p
 
  • Like
  • Haha
Reactions: Cul and 79flavors

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,223
Ah ha. My newbie background didn't even know something like im.Blur() even existed. Good call.

So I see some possibilities here that I don't actually know the answer to. (I'm looking at you anne O'nymous )

Is it possible to access which image was last used as a scene?
If the OP is looking for a way to dynamically create a background image as a screen, overlaid with a picture of a cellphone (probably further overlaid with character stats, etc)... it strikes me that if im.Blur() could be applied to "the latest scene image" - without actually defining it each and every time - then things become really interesting.

Failing that, perhaps the screen could be passed the image name as a parameter and the im.Blur() applied to it in real time?

It looks tantalizingly possible... but is beyond my RenPy and/or Python knowledge.
But it "feels" possible...
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,376
15,289
(I'm looking at you anne O'nymous )
I'll try ta awake my brain, but no guaranty.


Is it possible to access which image was last used as a scene?
Not natively, but it's possible to tweak Ren'py in such way that you'll always know what was the last image displayed. When you look at the configuration variables, you found , which permit to replace , and which do the same for . But there's a pitfall, because renpy.scene isn't the strict equivalent for the scene statement ; it is limited to it without image, therefore to the cleaning of the screen. But in fact it's not a problem, because the scene statement is in fact a combination of renpy.scene and renpy.show.

You just define a function that will hook before renpy.show to keep track of the image :
Code:
init python:

    def keepShow( name, **kwargs ):
        store.lastImage = name
        renpy.show( name, **kwargs )

    config.show = keepShow

default lastImage = None
But be aware that name isn't the path to the image, but the name of the displayable.


Failing that, perhaps the screen could be passed the image name as a parameter and the im.Blur() applied to it in real time?
Yes, no, maybe. I see what you're saying. Something like :
Code:
    def keepShow( name, **kwargs ):
        if isBlured: BlurTheIamge( name )
        renpy.show( name, **kwargs )
But as I said, name is the name of a displayable, therefore you have to create a new displayable, or replace a generic one, all this by using a displayable as input.

I don't say that it's not possible, but my brain isn't in a good enough condition to say that it's possible, and even less how.


But it "feels" possible...
I agree on this.
 

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,005
Feel free to correct me if I am missing anything major anne O'nymous

The following is from the "Displaying Images" renpy , just above the "show" statement.
The image statement is run at init time, before the menus are shown or the start label runs. When not contained inside an init block, image statements are run as if they were placed inside an init block of priority 500.
Also, after browsing the Renpy Quickstart guide, this is what I can conclude.

Renpy is like a type of Interpreter Game Engine
Meaning: You are not really programming in python (everyone refers to the renpy files as python code), but it is more like using a very special API, and only said API to program with, and thus as a result game makers don't have direct access to manipulating data (such as making an image blur in real time, or access to displayables as the page and Anne O'nymous mentioned).

What is python?
Python is a type of interpretation programming language, also known as a run-time language.
Python works by having a special program called an interpreter, that looks at .py files, and line by line executes the code 'at run-time'.
This execution is not like normal 'compiled' code execution, which just executes code on your computer. Instead, the interpreter, programmed in another programming language (often C), is code that has to simulate code execution, and as a result, Python is much slower.
However, at least normal python has all the key features of a typical 'high-level, imperative' programming language, able to create and manipulate data at any time, and control the flow of the program state.

However, based on my quick review of the quick start guide and the "Displaying images" page, Renpy is like a game engine, where you have to code it in its own special language, but it is not a true programming language or a true python interpreter because it's missing some key features (such as not having direct access to data).

So this poses some issues, and I don't have any suggestions.

I would say, however, how things might have worked if you had low-level access or were programming in a true language. You could control if the image was displayed only when a refreshed was needed, or constantly refresh (60hz for the screen), you could have access to the displayable data (the image), and edit it on the fly and it will naturally show up on the screen without having to make any new calls or commands to let the program know to update with the new image anyway because this is already automated due to 'reference' type data manipulation, which python relies on heavily, however from what I hear this 'displayable' object that renpy uses seems to be a direct 'value' copy breaking the 'reference' link thus you have to manually tell the engine when you want the image to change and how (making new images and show command).

That's the trap with renpy and python overall, there is a lot of magic going on, and a lot of control taken out of your hands, and unless you learn to program in a core language such as C, you'll never know why things happen the way they do, or how to override what the program tries to force you to do. python and renpy seem to force you to make a games in a particular way, in a limiting way.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,376
15,289
However, based on my quick review of the quick start guide and the "Displaying images" page, Renpy is like a game engine, where you have to code it in its own special language, but it is not a true programming language or a true python interpreter because it's missing some key features (such as not having direct access to data).
But it still offer a full direct access to the Python interpreter. It's the main problem of Ren'py, too much of an hybrid...

Honestly I never were able to correctly describe Ren'py... Simply because it's kind of an abnormality in the world of game engines. It have this "cheap side" (relatively speaking) that you can found in GameMaker or Tyrano Builder by example, while having the behavior you expect from the professional game engines that are Unity or Unreal.
It have a language to build the game, like any other game engine, but unlike most of them, it's not an existing language, but a dedicated one created solely for it (and derived from Python).
It also have a whole API you can interface to, but for this you need to use the language that build the engine ; this part being the same that building a plug-in for Unity or Unreal.
And finally there's the less used feature, yet the most wonderful one, the possibility to extend its dedicated language by adding your own statement without the need to hack the core.

Talking about the last one, I let you imagine the whole world that it open. I remember having explained it once here, saying how easily (relatively speaking of course) you can build a scrolling kill'm'all game this way with Ren'py. Explained in terms never used for Ren'py, you just need to build the plug-in for it, then you'll use the new Ren'py statements to configure the game ; defining what the sprites will be, what will be their trajectory and so on.


So this poses some issues, and I don't have any suggestions.
They aren't issues, but they need knowledge that most of the indie devs don't have. You can address directly PyGame, and with it you can access directly every single pixel of the image you'll display. Therefore, you could build your own blur function if you wanted it. In fact, you even don't need to go this far, since Ren'py's API already offer you the possibility to apply a matrix to the image.
But how many among the devs who make adult games can effectively do it ? I'll even go further, how many effective devs here, whatever if they works on a game, or are just players like me, can effectively do it ? It's not because our job is to write lines of code, that we all remember how matrix works, or that we all know how to manipulate images. This in the exact same way than a chef able to cook an amazing meal while struggle if you ask him to make some pastry ; it's not what he usually do, if he learned the basis he forgot them long ago.
That's the limit of indie development. One can't know about everything, therefore one limit to what he's sure to achieve... more or less. And in the same time few have an income high enough to pay the guy that will know, solely to do it.


I would say, however, how things might have worked if you had low-level access or were programming in a true language.
Once again, technically you can. It would be difficult because either you limit to one platform or have to build the module for all of them, but nothing prevent you to build a Python module in whatever compiled language you want, then use Python to create a Ren'py statement that will let you use it directly in Ren'py language.
Like I said above, Ren'py is kind of an abnormality... It's the kind of behavior you expect from a professional game engine, yet you can do it with Ren'py.


python and renpy seem to force you to make a games in a particular way, in a limiting way.
Like you can imagine once you reach this part of my answer, I wouldn't say that ;) But still you aren't wrong at all. It's just that the limitation don't come from Ren'py itself, but from the dev.

Ren'py is an easy to use game engine which come with an easy to use BASIC-like language... and which offer you the same power than a professional game engine ; minus the computation power limitation obviously. Technically there's nothing preventing you to make a realtime 3D game with Ren'py. Python already have all the modules needed for realtime 3D, and there's even, somewhere deep in the abandoned game list, an attempt of realtime 3D VR game in pure Python that was smooth enough. Therefore, technically speaking any recent computer could play smoothly a game like The Twist powered by Ren'py.

But Ren'py imply two problems...

Firstly, it need a knowledge that 99,99% of the indie devs don't have, and that probably 99% of the devs who are members here don't have either. [I start a poll right here, who among us would be able to write a realtime 3D game if provided the rights 3D API that come with the language they'll use ? Is there even one ;) ]. You don't have to just provide the models, skeleton and path for the bones, you need to interface them to the API in a way or another.
It can be done in Ren'py, really. As said above, you can have a "load model FILE VARIABLE" statement, an "attach skeleton MODEL FILE" one, a "move MODEL BONE AXE VALUE" one, a "startAnim MODEL ANIM_NAME" one, and so on... It would make the game easy to write in Ren'py.
Well... this as long as you found someone that will write the code behind the statements, the code that will effectively load the model and declare it by using the right function of the right Python module...

And here come the second problem... Why someone who know how to do this would use Ren'py in the first place ? Why would he bother writing the interface between Ren'py and the Python 3D modules, when he can use Unity or Unreal and not have to write this interface ?
And this apply for more or less every unused part of Ren'py effective power. I said it, you can write a scrolling kill'm'all in Ren'py, but why doing it with Ren'py when a game engine like GameMaker, to not even talk about Unity/Unreal, is more suitable for this ? Why write a RPGMaker-like game with Ren'py, which is also possible, when you can directly use RPGMaker ?

Therefore, people using Ren'py limit themselves to Visual Novel, sometimes going a little further by adding Free Roaming features, and don't do really more. And the more there's game which don't go further, the more there's devs who limits themselves to this, thinking that it's all that the engine can do.

Sometimes, I dream of a game mixing Ren'py Visual Novel aspect, and RPGMaker walking part. You know, a game where the map isn't the usual "click here" you see in a Ren'py game, but a RPGMaker map. Then once you've reach the destination, you fall back to the usual Visual Novel presentation of Ren'py.
It's totally possible to do this, but first it need someone with the right knowledge to write the code that later every single new dev will use in hope that his game will become a hit ; like it happen every time that something new is added in Ren'py games :(


TL;DR: Ren'py is more powerful than it looks, but not "professional enough" (aka in a compiled language using a compiled language to write the game) for its power to be effectively used.
 
  • Like
Reactions: BlueDick

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,005
But it still offer a full direct access to the Python interpreter. It's the main problem of Ren'py, too much of an hybrid...

Honestly I never were able to correctly describe Ren'py... Simply because it's kind of an abnormality in the world of game engines. It have this "cheap side" (relatively speaking) that you can found in GameMaker or Tyrano Builder by example, while having the behavior you expect from the professional game engines that are Unity or Unreal.
It have a language to build the game, like any other game engine, but unlike most of them, it's not an existing language, but a dedicated one created solely for it (and derived from Python).
It also have a whole API you can interface to, but for this you need to use the language that build the engine ; this part being the same that building a plug-in for Unity or Unreal.
And finally there's the less used feature, yet the most wonderful one, the possibility to extend its dedicated language by adding your own statement without the need to hack the core.

Talking about the last one, I let you imagine the whole world that it open. I remember having explained it once here, saying how easily (relatively speaking of course) you can build a scrolling kill'm'all game this way with Ren'py. Explained in terms never used for Ren'py, you just need to build the plug-in for it, then you'll use the new Ren'py statements to configure the game ; defining what the sprites will be, what will be their trajectory and so on.




They aren't issues, but they need knowledge that most of the indie devs don't have. You can address directly PyGame, and with it you can access directly every single pixel of the image you'll display. Therefore, you could build your own blur function if you wanted it. In fact, you even don't need to go this far, since Ren'py's API already offer you the possibility to apply a matrix to the image.
But how many among the devs who make adult games can effectively do it ? I'll even go further, how many effective devs here, whatever if they works on a game, or are just players like me, can effectively do it ? It's not because our job is to write lines of code, that we all remember how matrix works, or that we all know how to manipulate images. This in the exact same way than a chef able to cook an amazing meal while struggle if you ask him to make some pastry ; it's not what he usually do, if he learned the basis he forgot them long ago.
That's the limit of indie development. One can't know about everything, therefore one limit to what he's sure to achieve... more or less. And in the same time few have an income high enough to pay the guy that will know, solely to do it.




Once again, technically you can. It would be difficult because either you limit to one platform or have to build the module for all of them, but nothing prevent you to build a Python module in whatever compiled language you want, then use Python to create a Ren'py statement that will let you use it directly in Ren'py language.
Like I said above, Ren'py is kind of an abnormality... It's the kind of behavior you expect from a professional game engine, yet you can do it with Ren'py.




Like you can imagine once you reach this part of my answer, I wouldn't say that ;) But still you aren't wrong at all. It's just that the limitation don't come from Ren'py itself, but from the dev.

Ren'py is an easy to use game engine which come with an easy to use BASIC-like language... and which offer you the same power than a professional game engine ; minus the computation power limitation obviously. Technically there's nothing preventing you to make a realtime 3D game with Ren'py. Python already have all the modules needed for realtime 3D, and there's even, somewhere deep in the abandoned game list, an attempt of realtime 3D VR game in pure Python that was smooth enough. Therefore, technically speaking any recent computer could play smoothly a game like The Twist powered by Ren'py.

But Ren'py imply two problems...

Firstly, it need a knowledge that 99,99% of the indie devs don't have, and that probably 99% of the devs who are members here don't have either. [I start a poll right here, who among us would be able to write a realtime 3D game if provided the rights 3D API that come with the language they'll use ? Is there even one ;) ]. You don't have to just provide the models, skeleton and path for the bones, you need to interface them to the API in a way or another.
It can be done in Ren'py, really. As said above, you can have a "load model FILE VARIABLE" statement, an "attach skeleton MODEL FILE" one, a "move MODEL BONE AXE VALUE" one, a "startAnim MODEL ANIM_NAME" one, and so on... It would make the game easy to write in Ren'py.
Well... this as long as you found someone that will write the code behind the statements, the code that will effectively load the model and declare it by using the right function of the right Python module...

And here come the second problem... Why someone who know how to do this would use Ren'py in the first place ? Why would he bother writing the interface between Ren'py and the Python 3D modules, when he can use Unity or Unreal and not have to write this interface ?
And this apply for more or less every unused part of Ren'py effective power. I said it, you can write a scrolling kill'm'all in Ren'py, but why doing it with Ren'py when a game engine like GameMaker, to not even talk about Unity/Unreal, is more suitable for this ? Why write a RPGMaker-like game with Ren'py, which is also possible, when you can directly use RPGMaker ?

Therefore, people using Ren'py limit themselves to Visual Novel, sometimes going a little further by adding Free Roaming features, and don't do really more. And the more there's game which don't go further, the more there's devs who limits themselves to this, thinking that it's all that the engine can do.

Sometimes, I dream of a game mixing Ren'py Visual Novel aspect, and RPGMaker walking part. You know, a game where the map isn't the usual "click here" you see in a Ren'py game, but a RPGMaker map. Then once you've reach the destination, you fall back to the usual Visual Novel presentation of Ren'py.
It's totally possible to do this, but first it need someone with the right knowledge to write the code that later every single new dev will use in hope that his game will become a hit ; like it happen every time that something new is added in Ren'py games :(


TL;DR: Ren'py is more powerful than it looks, but not "professional enough" (aka in a compiled language using a compiled language to write the game) for its power to be effectively used.
great stuff! I'll book mark this for later.

If it let's you get into the interpreter directly, that is great (as you can also execute other languages such as C through python to help with a bit of optimization)
If you can directly access data, like images to perform operations (ie bluring an image) that is great.
It sounds like you can take advantage of the draw commands.
Lastly, if you are able to directly access, manipulate, or control the main game loop, then these are the four requirements I need to make anything (or in some way control the order of execution and control between objects)

answering your poll. I don't need an API, I could code my own using openGL (I made my own engine for a html/javascript game). But I see your point, it is like the 80 20 rule or so. Focusing on using renpy to make VNs make sense, and while it could do other things with a little know how, why not use a more dedicated engine instead?

I guess I'm a bit more old school in that I like direct access to everything rather than using a game's API (it is kinda why I drifted away from unity and went to the monogame framework for a little while). it just bugs me that I really like programming but just about every programming question posted here is in python or renpy, neither of which I can really help with. That and since I started with lower languages and worked my up to higher languages, I can't even imagine what newer programmers are going through as they start with python and then have to work their way down to understand any other programming language concepts.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,376
15,289
answering your poll. I don't need an API, I could code my own using openGL (I made my own engine for a html/javascript game). But I see your point, it is like the 80 20 rule or so.
You're probably not the only one, I exaggerated a little on this part to not feel too old ;)
I assume that the younger is the coder, the higher are the chance for him to have seen at least the base of 3D at school. But for people like me, Doom was just released at this time, and we were far to imagine that 3D would take such place in our world.


That and since I started with lower languages and worked my up to higher languages, I can't even imagine what newer programmers are going through as they start with python and then have to work their way down to understand any other programming language concepts.
Well, technically it's possible since Python is the new Pascal. I don't have stats on this, but it's the main language used in universities/colleges, so I assume that at least 4 out of 5 peoples who followed this curriculum since the early 00's learned Python. But I agree with the difficulty. While it's good to teach all the "good practices" and the basis of algorithms, it have a structure so different to almost all other languages, that it's surely difficult to pass to lower level languages without a teacher to help you. In fact it's probably difficult to pass to any other language without some help. But the opposite is relatively easy, it's what you already know, minus most of the constraints.

This said, in the same time, it's this structure that make Ren'py such a successful game engine. It's BASIC with a structure, therefore a language that everyone can easily learn by himself ; and Ren'py language following the same structure than Python, but having a limited spectrum of use, globally one month of self teaching is enough to write a simple game with it. Which wouldn't be possible with more advanced languages, even script ones like Ruby or Perl by example ; you would need to learn the whole language before you can start.
But like you implied, there will still be something missing. Something that can be called, "the behind the scene magic". The Ren'py show statement will display an image, cool. But without a knowledge in "more advanced language" you'll never be able to tweak it in such way that you'll make it depend of something else. Not because you're dumb, but because for you it stay something magic.
Take what I wrote somewhere above on this thread, the small tweak that let you have a copy of the actually shown displayable. It's really something small, but how many among those who learned Ren'py by themselves know that with three lines you can hook your own code like I did ? It's not a secret, nor a knowledge limited to guru. Everyone that have learned a compiled language know this, because they do it often ; it's even not hooking in their case, just the regular use of another function. But for this to come naturally in your mind, you need to have used those "more advanced language".
And obviously, it apply even more for things less simple than this small trick. The most speaking example being probably the possibility to extend Ren'py language ; suddenly you don't use the magic, you create it...
 
  • Like
Reactions: BlueDick