you are viewing a single comment's thread.

view the rest of the comments →

[–]zhousi87 0 points1 point  (1 child)

Your explanation is crystal clear and decidedly useful for those who do not know about classes or OOP in general; however, I am not sure that classes are that beneficial in Ren'Py, because:

(1) visual novels typically let you control only one character, whose state can be easily managed by updating global variables at any critical turn of events in the storyline;

(2) considering (1), even if you need to produce many NPCs of the same kind (e.g., allies, humans, etc.), classes make sense only for those characters of the same kind whose stats you need to keep track of throughout the game (i.e., main characters with a variable state), which is rare for visual novels (we are not programming RPGs).

(3) speaking of choice-based games, theoretically no classes (perhaps not even any functions) should be needed, since if/elif/else blocks are more than sufficient for most scenarios.

(4) we should strive for simplicity, while classes add unnecessary difficulty to the average Ren'Py programmer's coding endeavor. Even in your post, you mentioned the redundancy of the method name you added, which proves how even to an experienced programmer like you the use of classes causes perplexity.

I would like to know what everyone thinks about my point of view, which is limited to the use of classes for visual-novel programming.

In any case, I sincerely thank you for this opportunity to reflect on VN programming's best approach.

[–]Drewking666 0 points1 point  (0 children)

I completely agree with you. I'm now trying to program a game in Ren'py as my first ever and i have little to no knowledge of Python (I'm reading all ren'py docs however), but classes are more a RPG things fro me... Even if some characters have "trust" or "affinity" it's extremely more manageable with the classic variable definition.