I v e started to make some terrain.
I am trying to make 16x16 tiles, that needs to be unmovable "objects"(or something which i can control different terrain overlaps with in editor).
The problem is when i duplicated the grass tile only, and raised the number of objects from 500 to 2500, the game started lagging(mostly while scrolling). I turned off, save background and all stuff like fine detection.
And it doesn't really help.
Bigger objects lags less, but i need 16x16.(at least in transition, and special areas)The most lag is when i scroll the screen, while playing it doesn't lag so much. But i fear it will if i fill up the whole map.(Due to some small indication lag)
And i would prefer 16x16 objects, cause of the later planned editor i want to make.
(maybe i could replace 4 consecutive 16x16 tiles with 32x32 tiles. or even smaller, if its possible, and bigger in event editor)
Is there a way to read those objects somehow else, or to load them in memory somehow to be faster. I just want no lag.whatsoever.(and possibly as smallest tiles as possible)
I know I will face this problem myself when project Parilis will go to the point of where I design huge 2D maps, but do try to work out a method to use only backdrop objects, and when you're saying that you want to read these objects from a memory, you are definitely on the right track.
Simply get the Array Object Extension which should be included in your MMF2, and use it by saving values to X and Y positions. I'm not gonna explain everything to you here, but I think you will get the picture. However I do happen to have a tutorial about this that I've made myself that explains this perfectly well. Even though it's not exactly what you're looking for, it will definitely teach you a thing or two about it. (Hint: Construct your movement engine so that it checks the X and Y position of itself in the Array Object, and if there's a value that means there's an obstacle on that point, move back one step by using some kind of ini file perhaps? At least that's how I did it. You may find a more efficient way, but I find my way to be nice).
Good luck if you're going the way I prefer, because I did well doing it this way. After that you can just turn all objects into background objects. If you need help with something specific, dont be afraid to register on www.martin2k.co.uk/forums and post, and I'll be there to give you a hand.
I am using active, i need to use active.(for terrain modifiers to shooting and movement, evasion and stuff)
I have a good pc, not the best around here, but no problem with most of newer games.
And for the above.
I check movement obstacles after the unit moved, so the unit returns back if hit something solid. It s pretty easy evented, and i m ok with it.
I found out if I replace smaller filled areas with one big object it doesn't lag that much. So i will try and put smaller objects only where i need them.
MMF2 doesn't process backdrops of quick backdrops into any of it's loops or conditions, in other words... they're just flat images that do nothing but sit there and look pretty. This is why you can't interact with them or command them specifically, they're just known as "backdrop" in the event editor.
For this exact reason, backdrops can take a game from 20fps up to and beyond your current fps cap, most likely 60 to 80.
Only use Active Objects if you need to interact with them in a very specific manner... even then; you should try to find a way to slither around them if you can.
For example, if you want to 'create' backdrops, obviously you wont be able to do this directly, but create an active object, then paste that object into the back as a no-collision or a collision, which ever you want. Then delete the active object, you shouldn't have any problems, and personally, I haven't had any issues with them disappearing whenever you scroll away from them. Hope this helps.
PS: Unless you're doing things like enemies or bullets, always make sure that you have load on call and inactive when far from the screen, this will exclude the objects from being processed until you get near them, improving the game's performance.
PSS: Use layers if you want to have objects appear over the player, backdrops will appear over active objects if they're in a higher layer.
I'm sure there is a way to define terrain types without excessive use of active objects. Say for instance pre defining what terrain is where and having the data stored somehow (in an array?) then making the level out of 16x16 tiles and quickly pasting them as backgrounds.
So the game knows whats what.
Yea i got the picture, i am sure this all will be helpfull while making terrain. But i realized i should start from the map editor first then. If this is the case...