@Kezarus sorry. I was tired and probably did not explain this well.
And finally, please, no need to be rude or angry. This forum is full of nice and helpful people. Let's leave it like that, shall we.
As I said I don't mean to be rude, sorry it came out that way. I took a nap maybe this will be a better post.
Here is some advice to anyone reading this. Sometimes, even with myself included, we give out wrong advice.
Sometimes it's because we don't know any better, and sometimes it's because we don't trust anyone.
Here are the 2 (hmm maybe 3?) problems with sprite_add
1: it's slow to run because it needs to create a new texture page. Note here. sprite_add is slow to run. Not drawing sprites with sprite_add.
This is why for me it caused a long load time, I was loading 351 sprites all at the start, that's why AAA games have load screens, because they are loading a booty ton full if sprites into memory.
2: if done wrong it causes memory leaks. This is why some people don't want you using sprite_add because too many people end up screwing it up and breaking everything and then others have to re-explain why they are creating memory leaks.
It's easier to just say "don't use sprite_add" then to explain an advanced concept like memory leaks and then to have them remember to use sprite_delete and then expect them to actually know when is right to delete them. Of course it takes a lot (and I truly mean a lot) of sprites to make a memory leak.
I mean you saw my project, 351 still wasn't enough to cause one and if you are loading 351 sprites into memory at the same time there might be other problems (ok maybe that's a lie I've had projects load more than that at once)
3: ? They say this is a problem but until I ever see the problem I will hold my ground. It's texture pages. People complain because sprite_add creates its own texture page this is what causes huge numbers of texture swaps. This is why this thread is here and what everyone says is the problem.
I've seen people obsess over so much about reducing texture swaps by just a few in order to "maximize performance"
If you are doing it for practice and to learn more about it then 100% do it. I've done it many times in order to practice and learn. But if you are spending days to reduce a couple texture swaps on an actual project then they are wasting time that they could be using making the actual project.
That's not to say you are doing this but I have seen people become like that and I feel it's a tad obsessive. If you use general common sense and have a basic solid understanding of when you are drawing things / doing things when you shouldn't be then you'll be fine.
If you are a beginner and trying out a big project with lots of sprites like this, then I'll just say don't. Do small projects to try out. But I don't think you're a begging Kezarus so I think you can do this just fine.
Alright let's answer some questions. Kinda.
About AAA, well, do you consider Forager a AAA? Have a look at this article from Game Maker blog itself:
https://www.yoyogames.com/blog/517/forager-optimization-in-gamemaker
AAA usually means a company with a fork ton of money, resources, and history. It has nothing to do with the complexity of the game really. But the fact is any indi studio without a fork ton of money and resources will never be able to create a WoW size game before we die.
So when I say make a AAA game take it with a grain of salt, but know that AAA games have to worry wayyyy more on performance than any of us for a handful of reasons.
As for the blog I've seen it before but only skimmed it.
It is important to optimize code. Yes. But knowing where to optimize code without wasting time and possible end up never finishing is another story.
No that was not a AAA game as it wasn't made by a AAA company. Though it does look like a really fun game.
I don't know when he used included files or if he did at all so I can't talk about his meathod for that.
But It's understandable to worry a little about batch calls and breaking a batch in game maker is worse. Though again don't stress over it unless you plan to be breaking the batch thousands of times.
Game Maker uses a batch rendering system that's why using 100 different shades is no good. This is the opposite with something like Unreal that using instance rendering so it's fine to have 1000 different shavers running at once.
I am against overengineering, but just wait for a problem to happen to discover that you have to redo all your code is not that smart, is it?
Hard to say I suppose. I rewrite code all the time so I've gotten in the habit of writing code in ways that makes it a lot easier to rewrite. That's why I advocate using functions anywhere and everywhere possible.
If I have a script that takes in an x and y and shoots out a number then later realize it's breaking everything I only have to rewrite that one script, ensuring that it still at least takes in that x and y and shoots out a number.
If you get better at writing code that can be easily changed or scale well in the future then if you break something or realize something is wrong or wanna add something later, well then you can start skipping most of the planning phase with insurance that it's ok if it's not 100% perfect.
I am just trying to discover what's the best course of action before start doing things. That's what is this forum for, I guess.
Yeah, that's understandable. Here is the thing, nobody wants to reinvent the wheel that's why you and others want a way to pack sprite_add calls into texture pages. And while that would be nice to have, I also don't think you have to worry about it as much as you think.
Game Maker has a really good 2D rendering system. Better than unreal's and probably Unity's. Optimization is good when it needs to be there. Obsessing over it is bad when you need to release that game.