-
Stupid question
okay, well I've run into a big problem. I've set my map to run 400 objects. The problem is when I press X to shoot a bullet, and when it has already loaded 400 objects it will not create a bullet. Is there a way to get past this or load objects in -50 pixels of the screen?
thanks a ton:)
-
Re: Stupid question
[quote]load objects in -50 pixels of the screen?[quote]
This is the most powerful solution but takes a considerable amount of coding
Try setting the "number of objects" in the frame properties higher
-
Re: Stupid question
the problem with that is I'm making a considerably large game on one map. The game will have enough objects to probably even lag my computer (5gb ram)
-
Re: Stupid question
Why don't you destroy the bullets when hitting something or go outside the screen?
-
Re: Stupid question
I have my game running 613 objects on the screen and it runs fine, I also Have 5 1/2 gigs of ram, but it should not slow ur pc down.
-
Re: Stupid question
5Gb RAM? You folks running a 64-bit OS? A 32-bit OS can not address more than ~3Gb RAM.
-
Re: Stupid question
more ram takes longer to access and once you get past a point it is simply to buff pre loading, buying as much ram as possible isn't the answer.
(but that is still pretty cool)
-
Re: Stupid question
okay:P as I've said before it will have alot more than 500 (or even 1000) objects because the game runs on one map. The bullets do already destroy when colliding with a background.
is there any tutorials or could someone point me in the right direction on how to make the game load objects that are around the window (-100)
-
Re: Stupid question
Knytt probably have over 5000 active objects in the same frame, but that is never a problem. In each object's properties, I've set "Inactivate if too far from frame" to "Yes", to prevent MMF2 to handle it's movements or change animation frames. Except that, all you need to do is to make sure that no events controls the objects while they're out of the frame area (hint: Use groups that you activate or deactivate depending on whenever an object is within the frame area or not).
Oh, and disable "handle background collisions out of frame" in the frame properties. That saves you a whole lot of CPU.
Another more advanced technique that works nice with enemies, is to create 'generators'. Spread an ID over them, and whenever you get near one, an enemy (with the same ID) is created at that generator. Use the ID's to check if the generator have already created it's enemy. Once the enemy leaves the play area, remove it (which enables the generator to create a new one when you get near it).
Logically, the generator should be set to inactivate when out of frame area, and any number of generators can be used as they'll be using almost no resources at all.
-
Re: Stupid question
I'd like to see this program that uses 5 gig. of RAM. That is just mind blowing...
Any screen shots?
Nifflas, yeah it's all about the coding. That's where the real magic happens.
Even in the Big commercial games techniques and work arounds have to be used. The straight forward approach has never worked in game design...