Comments (8)
One thing you will want to make sure you are doing: Make sure you've cropped all your images for your buttons as close to the image as possible. Ren'py has to calculate the transparency for buttons when using focus_mask True
to verify what is and isn't clickable in real time, so if the button is full screen (with the majority of it transparent) it can really tank performance (especially when you have dozens of them on a screen).
from renpy.
That's good to know, but I already do this. According to Pink Productions, the creator of the overworld system I'm using(Pink Engine) is a big contributing factor. Apparently Renpy needs to re-render the entire scene when buttons are interacted with, so this means it needs to re-render the the entire map when I interact with a button. So unless Renpy gets a more efficient renderer, I'm kinda screwed.
from renpy.
What version of Ren'Py are you on? There was some work done on this recently, so if you're out of date, you might be able to get some easy fixes.
from renpy.
Renpy 8.2.1. On a similar note, does renpy.pause() need to re-render the entire scene as well? I've noticed some major performance drops with Pink Engine's NPC movement during events. To my knowledge these essentially spam renpy.pause(0.1) until a condition is met(finishing their movement). My battle system has a similar problem. I have a while loop with a renpy pause that keeps a screen open until a selection is made. This can tank performance in a similar matter. To be fair, these are both doing things not intended for Renpy at all.
from renpy.
Renpy 8.2.1. On a similar note, does renpy.pause() need to re-render the entire scene as well? I've noticed some major performance drops with Pink Engine's NPC movement during events. To my knowledge these essentially spam renpy.pause(0.1) until a condition is met(finishing their movement). My battle system has a similar problem. I have a while loop with a renpy pause that keeps a screen open until a selection is made. This can tank performance in a similar matter. To be fair, these are both doing things not intended for Renpy at all.
Seems like just having a longer pause of 1 second instead of 0.1 fixes any major drops with pausing, which makes complete sense.
from renpy.
I noticed bars are very expensive as well. Each of my buttons has 3 bars overlayed on top(One for HP, SP and XP). I thought it might be because they use an animated value, but that seems to make no difference. Each bar costs about 3fps. If I have a full party, I lose about 50-60fps on that menu.
from renpy.
I have noticed that displayables containing a tooltip property cause massive lag spikes on hover events. This is because they restart the interaction of every single displayable utilizing the tooltip property. We're talking about a drop from stable 144 FPS to ~60-70 FPS.
There's no telling if the issue is the same on your end, but here's the solution that worked for me:
init early hide:
def set_focused(widget, arg, screen):
global _tooltip
renpy.display.focus.argument = arg
renpy.display.focus.screen_of_focused = screen
if screen is not None:
renpy.display.focus.screen_of_focused_names = { screen.screen_name[0], screen.tag }
else:
renpy.display.focus.screen_of_focused_names = set()
renpy.game.context().scene_lists.focused = widget
renpy.display.tts.displayable(widget)
# Figure out the tooltip.
_tooltip = widget._get_tooltip() if widget else None
# Monkey-patch focus in the Engine
renpy.display.focus.set_focused = set_focused
default _tooltip = None
screen tooltip():
window:
id "tooltip"
text "[_tooltip!i]" align (0.5, 0.5)
Keep in mind that this code may have side effects. The set_focused method is part of the Ren'Py engine, and modifying it could potentially break other parts of the engine. That said, I've been using this piece of code in my project for about a year and have noticed no negative side effects, and the performance bump is significant.
from renpy.
I don't think there's an obvious way to solve this.
@loafylemon 's code disables updating the tooltip when it changes, at which point you might as well just not use it. Fundamentally, either you use tooltips are you don't,and if you use them, there's an associated performance hit from restarting the interactions when the tooltip changes.
from renpy.
Related Issues (20)
- Triple-quoted strings are incorrectly indented in _ren.py files HOT 5
- Roll forward? HOT 1
- A feature to prevent screen resolution letterboxing HOT 2
- Live2D - Dynamic zoom or position is impossible HOT 13
- Surfacing depreciated syntax to developers HOT 3
- Execute Python when dialogue strings are said HOT 2
- Add functionality for toggling Shaders on and off HOT 7
- `renpy.log` ignores linebreaks
- How with_none is used in renpy.input is not documented HOT 3
- add the ability to create const expressions at runtime HOT 1
- Rolling back automatically HOT 4
- Some `exec.py` scripts don't work if executed while the game is starting HOT 3
- Explicitly create mixers / set default volumes
- How to alter the dialogue in a game if there is no tl file? HOT 3
- [Feature Request]: adjust error message text size to display resolution HOT 1
- Text to speech, renpy.alt(force=True") not working?
- Unable to lint games in macOS HOT 6
- config.gl_test_image seems to not work HOT 4
- `config.quit_callbacks` is called on restart HOT 2
- Reorganize config.rst
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from renpy.