imzahai

Active Member
Apr 19, 2019
929
1,267
Hmmm... That would be an interesting question no less. I'd say maybe? Naturally I'd say no, given I think it would be awesome if she were to be a mom, as it would bring so much joy and a sense of 'normalcy' for her. Maybe with regular contact with Zero it could happen.

Otherwise, unsure.
in the game you can give her the ability to touch others after a few levels.
 

sleepingkirby

Active Member
Aug 8, 2017
706
1,034
Is the way to handle this type of thing, never attempt to make a renpy game, stick to printing out hello world.
So, I found the segment, and yes, this is valid and correct. There's nothing wrong with this code. Is this the only way? Of course not. But that's not what I said. But according to programming 101, this is valid.
Code:
        if Girl.Event[1] == 1:
                #first time through. . .
                if Girl is RogueX:
                        $ Girl.FaceChange("bemused")
                        ch_r "Oh, hey there [Girl.Petname]. You seem to be fitting in well. . ."
                        if not Girl.Kissed:
                            ch_r "Look, since the other day when I first. . . touched you,"
                        else:
                            ch_r "Look, since the other day when I first. . . kissed you,"
                        ch_r "I've had this kind of. . . buzz. At first I thought it was just from finally being able to touch someone,"
                        $ Girl.Eyes = "sexy"
                        ch_r "But I think maybe. . . could I touch you again?"
                elif Girl is KittyX:
                        $ Girl.FaceChange("bemused",2)
                        ch_k "Oh. . . hey, [Girl.Petname]. I've been thinking. . ."
                        if not Girl.Kissed:
                            ch_k "Look, since a while back when I first. . . touched you,"
                        else:
                            ch_k "Look, since a while back when I first. . . kissed you,"
                        ch_k "I've kinda been thinking. . . feeling a little odd. . ."
                        $ Girl.Eyes = "side"
                        ch_k "Would you mind if I touched you again real quick?"
                elif Girl is EmmaX:
                        $ Girl.FaceChange("bemused")
                        ch_e "Oh, hello [Girl.Petname]. . ."
                        ch_e "You've been doing well in your studies, it seems. . ."
                        ch_e "Look, since the other day when we first. . . came into contact. . ."
                        $ Girl.FaceChange("sadside",1,Brows="angry")
                        ch_e "I've been. . . struggling with something."
                        ch_e "A feeling. . ."
                        $ Girl.Eyes = "sexy"
                        ch_e "I was thinking perhaps that. . . touching you again might help?"
I'll explain why:

First, this is a one off event. You'll never run into this dialogue again for a girl. This means that if you're making a function to handle this section, you're actually adding more computational work. Every function is a jump in ASM code. Every function has overhead. It's a very small one, but it still exists. Which means for one off statements, it's actually computationally faster to just stick a if-else and done with it since if-elses don't push things to the stack. This is the same reason why people will define certain functions as macros in C++. Because at compile time, instead of introducing jumps and having to context load/shift, the compiler will just copy and paste that block of code into the ASM.

Second, as I mentioned, something like this can be done via a switch, but a switch doesn't exist.

Third, each dialogue is unique. No repetition. Meaning calling the same function to then find the girl, then find the varying dialogue and reactions means you'd have to write the same block for each girl anyways due to the fact something like this and renpy's format. Renpy isn't like Unity or other game engines where you can just pipe a block of text from a dialogue tree into a dialogue box and expect auto formatting or parsing.


Are there better ways to do this? Maybe. It's arguable. One can define these into a separate file and jump to it then jump back. But, as I've mentioned with functions, there's a computational cost. There's also the human readability aspect to it too. Like, it's technically faster for the computer to run spaghetti code because there's less characters for the language parser to read through. But it's hell for the programmer to follow and maintain later on. Which is why programmers don't do spaghetti code. In a scripting/interpreted language like Python, this is even more prevalent as the script is the code. Readability is one of the main selling points. Separating every dialogue into it's own file can be more organized file-wise, but it can be argued that it'll be harder for a human to follow and maintain because you'll have to open 3~4 files just to follow one path of dialogue. Any advantage of file organization and neat looking code is directly in contrast to speed in developement because it's easy to go "Everyone's intro dialogue is in this 1 file and 1 block. I can compare and contrast or just add a new block." So, instead of spending a minute or two to find every block or run a:
find ./game -iname "*_dialogue.rpy" -exec filelist+=" "{} \; diff $filelist

you can just do:
vim ./game/script\ Addiction.rpy

Now, is this the perfect way to do this? No. Can it be optimized? Maybe. But there's also the school of thought for running optimization for a code that whose big O is only a constant (As in, not even n. Just a constant like 6.). The benefit vs. time taken to optimize is very small. A literal drop in the bucket compared to all the stuff.

The simplest way to do optimize this code and maintain both readability and speed (i.e. no logical jumps) would have been a switch statement. But, again, they don't exist in renpy.

So, yes, this is valid. There's nothing inherently wrong with this code. There are other code in this game (and many other renpy games) that are WAAAY worse. But the foundation of coding is the if-else statement. To say a literal use of them is a bad thing is to deny that, in ASM, there are no object inheritence. There are no class interfaces. The most basic logic gate after the NOT gate is probably the XOR gate. And if-else is the C++ and higher level analog of that.
 
Last edited:

Semondemon

Engaged Member
Mar 9, 2018
3,114
9,340
Honestly this last couple of days has been hilarious. Even if I'm not on topic people whining is hilarious; I'm so indifferent to Oni now (I get the game for free still for some reason).
This update sucks same as the last one 'cos cannot fug de sea-lock; Cannot fug da crazy cat lady :( I get two fer one & I don't complaining tho.
 

Dr. Coom

Active Member
May 12, 2023
552
862
but i thought oni wouldn't change for anyone? aren't you wasting your time asking him to do anything, by your own words?
Encouraging someone to do the same thing that they're going to do is a far better idea than calling him a fuckup
 
  • Haha
Reactions: SerHawkes

SpikyHair

Member
Nov 13, 2019
363
659
So, I found the segment, and yes, this is valid and correct. There's nothing wrong with this code.
I'm also extremely curious why they think that if-else approach is somehow bad.

Usually when such objections are raised you end up looking at an "alternative" that's a clusterchuckle of self-references and recursions, because competent procedural programming is so last century /s
 
Mar 14, 2018
105
291
Honestly this last couple of days has been hilarious. Even if I'm not on topic people whining is hilarious; I'm so indifferent to Oni now (I get the game for free still for some reason).
This update sucks same as the last one 'cos cannot fug de sea-lock; Cannot fug da crazy cat lady :( I get two fer one & I don't complaining tho.
sea-lock and crazy cat lady? Now you're just testing my limits :ROFLMAO:
I fucking love this thread
Battling coders, people cursing each other, some shaming and some defending their kinks, lots of whiny brats.
It's like being back to simpler times when birdie and fuckface were no-man's-land.
 
Last edited:

sleepingkirby

Active Member
Aug 8, 2017
706
1,034
I'm also extremely curious why they think that if-else approach is somehow bad.

Usually when such objections are raised you end up looking at an "alternative" that's a clusterchuckle of self-references and recursions, because procedural programming is so last century /s
There are some valid reasons/criticism. Like daisy-chaining them to the point where the code is hard to follow (though, sometimes that is unavoidable). Or writing if conditions within if conditions where the 2 conditions don't need to be separated. Or when a bunch of the conditions end in the same result.

But a lot of the knee-jerk responses to if-else statements being "overly used", in my experience, is just as you said. Like, we like to think (and I certainly did) that programming is a field base off of logic and reasoning. But there's A LOT of politics to be found in it. People insisting their new way of doing things is the better way because reasons or they want clout or they want to sell you something. Like, this is why they tried to embed blockchain and crypto into "web 3.0". (which, again, is a marketing term. There's no technology that enhances/changes the fundamental way we're view HTML and run HTTP defined "web 3.0") This is why I picked up on that post so quickly. A lot of people like to pretend they know coding on the internet for some reason but don't (Like, look at Elon Musk). And they tend to make statements like that that makes them stick out like a sour thumb.


My last point/tangent so I don't keep going off topic. I once watched a video on someone trying to push that object oriented programming is bad and how we should all stick to naming/bundling all functions like:
class1_run();
class2_run();
And so many comments were like, "This is GENIUS!" And I had to go like, "Uhhh, no. We've tried this. People use to do this prior to OOP. It was bad. It was really bad. This is why we invented OOP."
 

Dr. Coom

Active Member
May 12, 2023
552
862
"Of course, Steve. You really should smoke all that meth and go rob a bank. What could go wrong? You're not a fuckup in any way, shape or form"
He's still making a lot of money. He's not doing it by robbing a bank. And as far as I know, he's not on meth. I'm going to keep encouraging him.
 

Dittymyman

Member
Feb 23, 2019
128
705
Honestly this last couple of days has been hilarious. Even if I'm not on topic people whining is hilarious; I'm so indifferent to Oni now (I get the game for free still for some reason).
This update sucks same as the last one 'cos cannot fug de sea-lock; Cannot fug da crazy cat lady :( I get two fer one & I don't complaining tho.
Games been in development for like nine years...I'm too old to give a shit anymore
 

Dittymyman

Member
Feb 23, 2019
128
705
And so many comments were like, "This is GENIUS!" And I had to go like, "Uhhh, no. We've tried this. People use to do this prior to OOP. It was bad. It was really bad. This is why we invented OOP."
I'm not trying to disqualify anything you said or join in on this argument. OOP was popularized by c++ which lead to Java, probably the most used language out there. So we did not invent OOP because what came before was bad; it happend because Bjarne liked OOP.
 
  • Thinking Face
Reactions: Dr. Coom
4.40 star(s) 154 Votes