Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | independentCog | |
Old Version | Published before Godot 3 was released. |
From what I gathered from reading this:
https://forum.godotengine.org/4746/how-would-you-setup-structure-project-with-focus-scripting
is that its best to have a hierarchical approach and have the more complex code at root. I’m about to start working on script that I expect to be rather large, most likely at least 400 lines and I have multiple questions before I get started with it.
This script is going to be effecting and managing a lot of different things through a singular mechanic I’ve been working on.
Is there a certain line count that generally speaking scripts should be kept under before causing problems? (I understand that it depends on the complexity, which is why I’m saying generally speaking.)
Is putting something complex and possibly large into a global script a bad idea or on the contrary would it be beneficial to do so? The question above eluded to me that it might be a good idea. Especially for something that is going to globally effect multiple objects.
What platform is the most difficult to port too. My plan was the usual windows, ubuntu, android, ios? (My bets on ios but I’m somewhat biased against them)
Lastly I’d like some advice on my overall approach that I’ve come up through research and reading through as many of this sites articles as I can. Also as per advice from Zylann and multiple others here: Best practices question. - Archive - Godot Forum
My approach now that my defining mechanic is done is to version this as a base for other platforms instead of having to regress back to account for unique needs, than from there I was to have a loading scene and make each level a scene with everything besides static objects that don’t soak up much memory being instanced in categorically, player, enemies, collectibles, scripted objects ect. If a level ends up being too large to load from the loading scene instance it in from a point where it will be loaded before the player can get to it. Maybe using visual distraction and animations to delay the player appropriately. Each main level will have a boss and my plan was to make them mechanically unique and somewhat complicated so I was thinking on making those there own scene thats loaded before hand. This is going to be a 2d and as of yet I’m sure what the overhead is going to be like or if preloading at checkpoints is going to even be necessary. Advice on that specifically would be nice. Besides all that my approach is to do art and sounds last on a per level basis. Normally (unless being aggravating and trying to get best practice scripts out of people more experienced than myself to improve my own code and learn =P) I tough things out but at this point now that my games main mechanic is working with ugly blue blocks I’d rather start this as prepared as possible instead of slogging uphill blindly with mud in my boots. If you read all this, thank you in advance and apologies for the range and brevity of these questions.