More efficient code

After reviewing some game files my question is if you have entities for instance character and so forth and some share the same assets example: explosions, effects, bullets, etc. Does more efficient code have anything to do with how many folders you use? In other words if I put all assets in a character's folder instead of in a miscellaneous where assets are shared can it affect performance or does it not have anything to do with efficiency?
Or, does efficient code writing have more to do with how scripting is properly utilized? This is the first text based C engine I have used, Most of the game mods I have had exposure to have been with engine more like visual C++, using windows and editing tools rather than text based but I do like this engine, is quite impressive games I have seen. To note, I am new to the forum. Hello to all members. I hope my question is relevant. :)
 
I'm not sure that file placement has much of a detrimental effect on engine efficiency but some basic stuff is hard coded location wise, of course trying to find a file buried in 100's of folders is going to make things less efficient overall,

however file (sprite size) does have an effect and should be optimised for example having 2 50000x50000 pixel images with a transparent effect is less efficient than a 50x50 pixel image placed 500 times which also gives you more room for creativity and design even though the math is not equal, which is why coding and scripting does have an effect on efficiency , see here

 
Does more efficient code have anything to do with how many folders you use?
No.
But recently I've changed how I store my assets: instead of the common "bgs" for background images and "levels" for the background codes, and I saving booths on the same folder, making a folder for each stage or chapter. This makes easier to find the files later.

And after inspecting @Kratus SORX game, I realized he put any entity that is tied to a specific stage on the same folder and this speeds up the process of finding what you want to edit a lot.

Edit: ah, I do like to have specific folders for enemies and bosses.
Data/chars/enemies/robots
Data/chars/enemies/monsters
Data/chars/bosses

and I don't like to throw a lot of stuff under the "misc" folder without a proper subfolder.
 
Ok thanks. Just out of curiosity would load be an example of a global variant then, since it's always stored in memory and would know be a local variant?

Not in the sense we're talking about. Globalvars are variables that you define when writing scripts. Load is loading up model assets. It's a native functionality and fundamenal to the engine. You couldn't run a game without it.

DC
 
Back
Top Bottom