Code Planning.

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
User avatar
Dsiak
Newbie
Posts: 15
Joined: Fri Jul 06, 2018 10:26 pm
IRC Nick: [Actual Horse]
Contact:

Code Planning.

#1 Post by Dsiak »

Hello gamers, I hope y'all be having an EPIC reopening. Leave a like and subscribe if you want Corona to yeet itself before Christmas.

I'm going to start my second Ren'py game and this one will be a little bit more robust. The goal is to make a commercial publish and as such I can't afford to be sloppy with the code. Not even one bit. Unfortunately I'm not very agile with Python, I find it to way too relaxed and permissible.
So I came to ask what you guys do to keep your code in order, and also to ask what y'all think of these two basic ideas I have to organize the code:
Format One: All Separated
Each chapter will have five .rpy files:
  • Chapter One
    • chapter_one
    • transformations_one
    • images_one
    • scripts_one
    • screens_one
  • Chapter Two
    • same...
  • Recurring Assets, ATL, and Characters
    • transformations_common
    • images_common
    • scripts_common
    • screens_common
The idea here is to separate things as much as possible, so when I'm trying to figure out why the ATL is acting weird when I export in another resolution I can just go to transformation_chapter and figure it out there
  • Pros: Small files, when I have to adjust that one scene from chapter x I don't have to deal with 1000 surplus of lines
  • Cons:
    • Too many files can be just as bad to navigate as a gigantic file.
    • I bet my pp the recurring folder will just become a titanic file by the end of the project.
*dab*
Format Two: All together
All the project's images will be on single rpy file, all the transformations will be in a single rpy file, etc...
  • images
  • transformations
  • scripts
  • screens
  • Chapters
    • chapter_one
    • chapter_two
    • etc...
The idea here is to have everything filed by type and control F my way between the ones I need.
  • Pros: If I'm looking for a transform, I don't have to check 100 different files for it. It will be at transformers.rpy for sure
  • Cons:
    • over 1000 lines files
    • No way to quickly land of the item I want, even if I try to separate with comment blocks
Looking forward to see how y'all keep the mess that is coding in check.
neigh

User avatar
puppetbomb
Regular
Posts: 123
Joined: Fri May 19, 2017 4:04 pm
Tumblr: puppetbomb
itch: puppetbomb
Location: USA
Contact:

Re: Code Planning.

#2 Post by puppetbomb »

If you have multiple programmers, a large-scale project or have lots of features, your first option will help in isolating bugs so they don't affect the rest of the game.

If you're working alone, with a smaller-scale project or with only a couple of features, the second option would work better.

Honestly, going commercial shouldn't affect how you code as much as the features and scale of your game. When you add deadlines and special cases into the mix, spaghetti code is inevitable. Don't get too hung up on making the code perfect. If a little spaghetti code increases user satisfaction, go make the spaghetti.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]