CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

sleepingkirby

Active Member
Aug 8, 2017
829
1,312
Ok maybe I am a bit stupid but does a FIFO queue per timeslot do what you wish? Or a priority queue instead to account for more than a week? You can fix the max number of events per FIFO queue for internal optimization too.
Not really. You're kind of thinking of it backwards. You're trying to match the problem to the data structure instead of the data structure to the problem. No matter what happens, that game has to know what to run at a certain point. That might be timeslot, but that might also be location (entering the classroom, for example). But also consider that some events should take priority over others to prevent continuity errors or skip events altogether. So FIFO queues can work, but really, all you need is an array (they call that a list in python, right?). Most modern and/or interpreted languages should have the capability to push, pop, shift and unshift to an array. So you push an object to the array. The object can be like:
charname: "Laura",
priority: 5,
check: "Love>900"

And since it's an array, you can sort the array by priority at the time of pushing it into the array. So when the queue is read from, it can automatically find the first event to run which has the highest priority. There are other ways of doing this, but that is just an example off the top of my head.

And yes, when using a language, you should lean on the parts of the language that it has optimized. But remember, if you're using something just to use it, often times any benefits from the language optimization is lost. Basically, if I can give you any programming advice to you, it's that you (try to) make the solution to the problem, not change the problem to match your solution.

I've never done Renpy, but can you use python libraries in Renpy? If you can't then my suggestion is useless anyway. I agree that hand-coding your own binary tree clearly seems overkill.
Honestly, I'm not sure either, but I think you can. If you look in <game>/lib/ you'll see the actual python binary and the libraries it comes with. I imagine it wouldn't be too hard to include custom libraries in there.

You must truly be a dedicated fan :)
No, not really. This is my job (or rather, has been my job. Looking for a new job atm). I just happen to like my job. This is like asking your professional chef friend what he thought of your pasta sauce and he suddenly starts hand-making ravioli to pair with your sauce. For you, that's a big deal. For him, it's Tuesday.
 
Last edited:
  • Like
Reactions: RandomFapinator
Sep 21, 2019
199
154
Not really. You're kind of thinking of it backwards. You're trying to match the problem to the data structure instead of the data structure to the problem. No matter what happens, that game has to know what to run at a certain point. That might be timeslot, but that might also be location (entering the classroom, for example). But also consider that some events should take priority over others to prevent continuity errors or skip events altogether. So FIFO queues can work, but really, all you need is an array (they call that a list in python, right?). Most modern and/or interpreted languages should have the capability to push, pop, shift and unshift to an array. So you push an object to the array. The object can be like:
charname: "Laura",
priority: 5,
check: "Love>900"

And since it's an array, you can sort the array by priority at the time of pushing it into the array. So when the queue is read from, it can automatically find the first event to run which has the highest priority. There are other ways of doing this, but that is just an example off the top of my head.
Oh no lol, I thought of the problem quickly and it popped up in my head, not the other way around. Right, it could also be location based and not timed based. But... aren't FIFO queues of small pre-determined size already implemented/interpreted as arrays with extra index information in optimized libraries? Or this isn't the case in the Python binaries? Genuinely curious.
I would completely agree with your approach on low-level languages. But even then, you might miss out on potential compiler optimization or hardware intrinsics unless you plan to use them.

And yes, when using a language, you should lean on the parts of the language that it has optimized. But remember, if you're using something just to use it, often times any benefits from the language optimization is lost. Basically, if I can give you any programming advice to you, it's that you (try to) make the solution to the problem, not change the problem to match your solution.
We agree here: trying to make your own data structure in high-level languages (Python) usually results in slower performance than using native libraries unless we are dealing with large scale problems (which I assume is not the case here). I am just afraid that if you want to efficiently implement your own data structure and the operations within it, you would have to resort to things like and try to do better than <stdlib.h> in C and that may be overkill for a game of this size.

No, not really. This is my job (or rather, has been my job. Looking for a new job atm). I just happen to like my job. This is like asking your professional chef friend what he thought of your pasta sauce and he suddenly starts hand-making ravioli to pair with your sauce. For you, that's a big deal. For him, it's Tuesday.
I am not a Python specialist, so I will assume you know better :) I hope you can help the dev (and that the dev accepts it?), that would be great for the community! Looking forward to what you can do!
 

sleepingkirby

Active Member
Aug 8, 2017
829
1,312
Oh no lol, I thought of the problem quickly and it popped up in my head, not the other way around. Right, it could also be location based and not timed based.
I'm not an expert in python either. I actually loathe the language. But you work with what you have, not what you wish to have or want.

But... aren't FIFO queues of small pre-determined size already implemented/interpreted as arrays with extra index information in optimized libraries? Or this isn't the case in the Python binaries? Genuinely curious.
I don't know 100% for sure, but if something's built on top of arrays, it's not going to be faster than an array. You can't get faster than the thing you're using. If it has extra index information, that's going to slow it down because it has to process, keep track, etc. that index information. Arrays in ASM, if my memory serves, is literally implemented and moved via memory (ram) jumps. In computing, the only things faster than ram jumps and reads are register reads.
I should also mention that predetermined size is a bad idea in this particular case. While good for reads and jumps, you don't want a case where you'll need to constantly resize the limited array as that will, usually, quickly overshadow and performance gains. And since we don't know the max size of all possible events (now and in the future), nor do we want to pre-set an absurdly large size for all eternity, it's better to stick with an expand-able array for now.

With that said, something compiled to a binary doesn't guarantee it's speed. It only, sometimes, guarantees that the interpreter doesn't have to re-translate/compile it down asm code again (sometimes because Java binaries still need to run through a java virtual machine). Optimized also don't guarantee a speed up. It's just written in a way to trim down read and/or run time and/or use different techniques to try to run the fastest version of an algorithm for the situation.

I'm writing the above just in case you have the common misconception that optimized code can run better than barebones code or a different data structure that is closer to solution of the problem. I once knew someone that though that the array optimization in javascript would make array searches as fast as or faster than a hash look up. I ran some tests to find that, while it is fast, direct hash look ups are faster. And that guy wasn't dumb nor a bad programmer, but these misconceptions do pop up in this tech industry.


I would completely agree with your approach on low-level languages. But even then, you might miss out on potential compiler optimization or hardware intrinsics unless you plan to use them.
You might, but you might not. And the compiler optimization might not be faster than what you've created from scratch. It's important to know what the optimization is and when to use it. Looking at the queue object you linked, it's not just providing a FIFO queue, but also:
The module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The class in this module implements all the required locking semantics.
All those multi-thread features (locking, guaranteeing consistency, preventing deadlocks, etc.) are more work in addition to adding the data to the queue. So, inherently, if the queue module is built on top of arrays and is providing all those as features, it will be slower than straight arrays. Conversely, if array speed is that much of a concern for the language, they should already have built in optimization for array functions. If they don't, well, that's on them (the makers and maintainers of python).



We agree here: trying to make your own data structure in high-level languages (Python) usually results in slower performance than using native libraries unless we are dealing with large scale problems (which I assume is not the case here). I am just afraid that if you want to efficiently implement your own data structure and the operations within it, you would have to resort to things like and try to do better than <stdlib.h> in C and that may be overkill for a game of this size.
Agreed. But I would like to warn you about putting libraries on pedestals. In the end, it all computing languages translate the code down to ASM. Just because a library is often used or is native, it doesn't guarantee it'll run better or faster. Again, conversely, if me implementing my own array is slower than a native library's array, the language has a problem. Something as basic as an array should already have it's own optimization. If it doesn't, that's not a language you want to stick with for very long.

I am not a Python specialist, so I will assume you know better :) I hope you can help the dev (and that the dev accepts it?), that would be great for the community! Looking forward to what you can do!
It'll depend on me too. As LeatherMax can attest to, I've been trying to get my own stuff done for a while now. Thought it would a few weeks at most. Life had other plans. There's a lot I would like to make/build/fix. Desmume on the linux side needs a memory scanner. I know this forum has a PHP dev position that's been open since forever. I still have other pet projects/ideas after the current 2 I'm working on.
 
Last edited:
Sep 21, 2019
199
154
I don't know 100% for sure, but if something's built on top of arrays, it's not going to be faster than an array. You can't get faster than the thing you're using. If it has extra index information, that's going to slow it down because it has to process, keep track, etc. that index information. Arrays in ASM, if my memory serves, is literally implemented and moved via memory (ram) jumps. In computing, the only things faster than ram jumps and reads are register reads.
I should also mention that predetermined size is a bad idea in this particular case. While good for reads and jumps, you don't want a case where you'll need to constantly resize the limited array as that will, usually, quickly overshadow and performance gains. And since we don't know the max size of all possible events (now and in the future), nor do we want to pre-set an absurdly large size for all eternity, it's better to stick with an expand-able array for now.

With that said, something compiled to a binary doesn't guarantee it's speed. It only, sometimes, guarantees that the interpreter doesn't have to re-translate/compile it down asm code again (sometimes because Java binaries still need to run through a java machine). Optimized also don't guarantee a speed up. It's just written in a way to trim down read and/or run time and/or use different techniques to try to run the fastest version of an algorithm for the situation.

I'm writing the above just in case you have the common misconception that optimized code can run better than barebones code or a different data structure that is closer to solution of the problem. I once knew someone that though that the array optimization in javascript would make array searches as fast as or faster than a hash look up. I ran some tests to find that, while it is fast, direct hash look ups are faster. And that guy wasn't dumb nor a bad programmer, but these misconceptions do pop up in this tech industry.
Completely agree with this. Thought the dev would know a max number in advance (number of girls and event per girls are limited after all... right?), but maybe that's not even a good solution?

All those multi-thread features (locking, guaranteeing consistency, preventing deadlocks, etc.) are more work in addition to adding the data to the queue. So, inherently, if the queue module is built on top of arrays and is providing all those as features, it will be slower than straight arrays. Conversely, if array speed is that much of a concern for the language, they should already have built in optimization for array functions. If they don't, well, that's on them (the makers and maintainers of python).
Completely agree on this. If it's not implemented as a low-level structure it may be clearly slower.

Agreed. But I would like to warn you about putting libraries on pedestals. In the end, it all computing languages translate the code down to ASM. Just because a library is often used or is native, it doesn't guarantee it'll run better or faster. Again, conversely, if me implementing my own array is slower than a native library's array, the language has a problem. Something as basic as an array should already have it's own optimization. If it doesn't, that's not a language you want to stick with for very long.
Hard agree. Sadly, some people stick with antiquities because they don't want to break legacy code :(
I am just slighly worried because even an integer in python has its own internal data structure: it's not like an int in C. Then is the code written with Renpy even compiled? If it's just interpreted... ouch.

It'll depend on me too. As LeatherMax can attest to, I've been trying to get my own stuff done for a while now. Thought it would a few weeks at most. Life had other plans. There's a lot I would like to make/build/fix. Desmume on the linux side needs a memory scanner. I know this forum has a PHP dev position that's been open since forever. I still have other pet projects/ideas after the current 2 I'm working on.
I see. Good luck to you, this has been informative thank you, real life is more important than a porn game (or is it????).
 
  • Like
Reactions: sleepingkirby

sleepingkirby

Active Member
Aug 8, 2017
829
1,312
Completely agree with this. Thought the dev would know a max number in advance (number of girls and event per girls are limited after all... right?)
You'd be surprised. Game development is not like programming. You don't always get to know the domain of your input. And even if you do, that might change as the game changes.


Hard agree. Sadly, some people stick with antiquities because they don't want to break legacy code :(
I am just slighly worried because even an integer in python has its own internal data structure: it's not like an int in C. Then is the code written with Renpy even compiled? If it's just interpreted... ouch.
Yes...maybe. Some game will only ship with .rpyc code. Rpyc, as you can probably guess, is "compiled" bytecode. Depending on how you look at it, . But, technically, it's "compiled". Rogue-like ships with both. If I recall correctly, renpy, if the .rpy file exists, will defer to the .rpy file first before the .rpyc file.

I see. Good luck to you, this has been informative thank you, real life is more important than a porn game (or is it????).
Thank you. It's been nice discussing this stuff.
 
  • Heart
Reactions: RandomFapinator

botka4aet

Newbie
Jan 13, 2022
62
54
The Link doesn't work
You know site
Now you just need correct link
Find by yourself
You'd be surprised. Game development is not like programming. You don't always get to know the domain of your input. And even if you do, that might change as the game changes.
But it is
If you don't know exact number - you don't limit it
You invite all your friends but don't know - who will come
You don't bring only 4 chairs - you bring as many as can
 
  • Angry
Reactions: geamoiri

sleepingkirby

Active Member
Aug 8, 2017
829
1,312
But it is
If you don't know exact number - you don't limit it
You invite all your friends but don't know - who will come
You don't bring only 4 chairs - you bring as many as can
That was my point.

I should also mention that predetermined size is a bad idea in this particular case. While good for reads and jumps, you don't want a case where you'll need to constantly resize the limited array as that will, usually, quickly overshadow and performance gains. And since we don't know the max size of all possible events (now and in the future), nor do we want to pre-set an absurdly large size for all eternity, it's better to stick with an expand-able array for now.
 

mbRjpZLD

Member
Apr 28, 2017
159
286
python and renpy is fast enough on any modern system.
If a Renpy game is slow it is due to shitty programming.
 

sleepingkirby

Active Member
Aug 8, 2017
829
1,312
python and renpy is fast enough on any modern system.
If a Renpy game is slow it is due to shitty programming.
*sigh* I wish. Don't you think it's weird that an engine that just moves images flat 2D images around, something humanity has been doing since the late 1990's (namely, Japanese hentai dating sim games. Think Jast USA, Season of Sakura/Nocturnal Illusion.), during the windows 97~windows 2000 days *needs* a *modern* system to run fast enough?

Python is a slow language. It's anywhere from 20~50x slower than C++. From 10~15x slower than node.js. Even around 3x slower than PHP7.

I've seen many renpy games that try to be just a little ambitious start choking even on modern systems. Like The Null Hypothesis. Just a spinning background, a GUI and 1 character on screen can kick up the GPU fan. I can write a javascript and css webpage that can render/animate the same image with less cpu/gpu power. Don't you think that's odd?
 
Last edited:

Semondemon

Engaged Member
Mar 9, 2018
3,191
9,536
saves not working in 1.53c. Any workarounds?
If joiplay uninstall (lol). if main game you cant use android saves back and forth only pc to android i noticed (so move your pc saves onto the android device it will work in moat cases). If neither are yer issue then just start over dude.
 

RiloLaki

Member
May 16, 2022
323
1,351
I don't really care for Python either. If I were making a VN with any kind of extra flair I'd probably go with Unity or Godot + Ink.
Or develop your own "engine" (using C++ or something) so if you decide to commercialize you don't have to worry about licensing, or the makers of the backend ""not appreciating"" your content, or the inherent issues that can crop-up by using open source/freeware...

Gah, been forever since I even looked at programming. And my brain is too old and too riddled with depression to want to bother with it ever again. So here's more subject related artwork!

Before anyone says "no stripe"...just imagine that the stripe is a little lower...
1725477921561.png

Itty Bitty Kitty Ti-uhhh...
1725478035524.png

So...this is Wang Chung, right? Because everybody's Wang Chunging tonight...
1725478082471.png
 

sleepingkirby

Active Member
Aug 8, 2017
829
1,312
Or develop your own "engine" (using C++ or something) so if you decide to commercialize you don't have to worry about licensing, or the makers of the backend ""not appreciating"" your content, or the inherent issues that can crop-up by using open source/freeware...
I've been interested in godot because you can use C++ with it. It's also under the MIT (expat) license so commercialization isn't a problem. If I recall, it's what Dittymyman was using to remake this game before life also slapped him in the face (As in, life recently slapped me in the face for my dev plans).
 
  • Like
Reactions: RiloLaki
4.40 star(s) 154 Votes