User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: All enemies are ONE big active object? Smart Plan?

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    All enemies are ONE big active object? Smart Plan?

    Hi everyone

    I want to know your opinions of which of the following game designs is better / easier on system resources (I want to use the IOS exporter) and more bug resistant. :-)

    In a Space Shooter Game...
    A) ...every enemy is an other Active Object. All collisions and all behaviors have to be coded for every Enemy separately...

    B) ... every enemy is the same Active Object but every enemy is represented by another Animation Sequence. So the basic behavior is programmed only once and everything can be defined by values.

    My Problem: I want to choose solution B) but this big enemy Object that represents 20 enemies will have 20 Animation Sequences with different sizes. Does MMF and especially the IOS exporter will have problems loading the whole Enemy Object every time an enemy appears even if it only uses one Animation Sequence? Will this be significant?

    What are your thoughts on that?
    Thanks and best regards

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Can't you define the enemies using the groups? You can have multiple enemy sprites that use the same script using the group.enemy as an example instead of pointing the code at the actual enemy.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I actually recommend B. It's what I always do these days. Qualifiers can't be named, and neither can't their alterable values. Meta objects makes everything much easier if you know how to use them. I tend to run out of alterable values pretty quickly though. They don't eat more resources, an instance doesn't need to load the graphics separately. Those resources are shared.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jan 2010
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would actually recommend A. Maybe it's just my preference, but I would think that controlling an active object with all those animations could get really confusing. Also, as the person above me says: You could run out of alterable values. One object can have A-Z in values, and would give you that many different things to do with an object. Sharing the values A-Z between different enemies with different characteristics would not give you many options to play around with for each enemy. Depends on what you are making the enemies do, of course. In theory though, I would expect that one large active object would be less demanding of the computer resource-wise. An interesting thought!

  5. #5
    Clicker Fusion 2.5

    Join Date
    Mar 2007
    Posts
    495
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I am going towards B at the moment in my project. I'm even doing it for bullets infact.
    If you keep your coding well commented and organised it will make life very simple for you, rather than having to handle 20 separate objects.
    This is especially true if the differences in behaviour between your 20 enemy types are limited.

    Alternatively, you could go for option C, which is say, 4 objects, each with 5 animations or so ... ;
    fighters, large attackers, capital ships and bosses.

    Presumably the fighters would behave fairly similarly to eachother so you could code their attacks to be conditional on the animations without too much bother and kind of 'split the difference' between A and B.
    See how it goes.

    Very little-to-no performance implications I would think.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Nifflas took the words right out of my mouth. Qualifiers *should* be perfect for this, but unfortunately they have too many annoying limitations. Using just one object saves a lot of duplicate code, keeps your code readable (because you can refer to alterable values/strings by name) - but still makes it easy to keep some code specific to certain object types.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One object can have A-Z in values, and would give you that many different things to do with an object.
    The whole point of meta objects is that you configure a shared mechanic to work differently on different objects. You'll get away with using 20 events instead of 200 and still have exactly the same result. It saves time, it's cleaner, more elegant, and much more resource friendly. Obviously, if you need a different base mechanic, you'll set up a different meta object for that anyway.

    Now, behaviours should be exactly for this, but again, they can't be named and nor can their values, so it's no option.

    Sharing the values A-Z between different enemies with different characteristics would not give you many options to play around with for each enemy.
    No, almost every non-MMF2 game works like this. The same code is used to control a whole lot of different characters, so that the can be configured with a set of values rather than having to be programmed individually. MMF2's limited number of alterable values causes some problems, but even only using those, in NightSky instances of a single object is enough for every physical object in the entire game, and instances of a single object is all that's needed for all the background animation in my new Knytt game (looks like this and this).

    Of course, setting it up takes some knowledge, and perhaps one shouldn't begin creating games like this. You can not discourage it on the basis of it being limited though, because making the same code handle as many different scenarios as possible is usually the best way to do things.

  8. #8
    Clicker Fusion 2.5

    Join Date
    Mar 2007
    Posts
    495
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If flexibility is short due to lack of values, then the enemies' behaviour are clearly too different to lend themselves to being integrated into eachother.
    In that case, they're better off as separate objects.
    As long as there's sufficient commonality between the enemies, I think you'll get a very positive result because you get fewer objects along the top of the event editor, fewer objects updating globally (because that doesn't always work the way it should), fewer behaviours, animations etc. scattered around in individual objects.

    And you get that all for the cost of an extra condition in your events to test what identifier value (or animation perhaps) is set on the enemy.
    And you don't have to repeat a whole load of identical events for each object either.

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your input. A lot of good points. I think I will go with option B (or C from crash86).

    1. Are you sure that the ios exporter can handle an enemy object with 20 or even 40 different sized animation Sequences? Does it load all the animation Sequences even if only one enemy apears or does it load only the Sequences that get executed? Would this even be relevant?
    2. how can I make a condition that the level ends, when a certain enemy type is destroyed? eg: -there are no Enemies with the animation sequence "Eveleye" left --> end the level (be aware that there may be still enemies in the form of meteorides)

    Thanks!

  10. #10
    Clicker Fusion 2.5

    Join Date
    Mar 2007
    Posts
    495
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Number of "enemy" = 0
    - Next Frame (frame object)

    You can add the value/animation of your enemy as an extra condition in the above event to stipulate what type of enemy (within that object) you want to have destroyed before you change the level.

    There ought to be no problem with iOS.
    It only bothers with the frame that's running. It has them all in memory but only thinks about the current animation.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Matching up enemies with their own active objects
    By alxmrg in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 9th July 2010, 12:27 AM
  2. Unable to sort enemies with background active tile
    By mobichan in forum File Archive
    Replies: 6
    Last Post: 13th April 2009, 04:09 PM
  3. Smart CPU
    By Godspeed8118 in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 21st December 2008, 05:06 AM
  4. Smart Tiles
    By Novabrain in forum Extension Developers Lobby
    Replies: 6
    Last Post: 25th September 2007, 06:43 PM
  5. Surface object plan
    By Anders in forum Extension Developers Lobby
    Replies: 24
    Last Post: 29th December 2006, 12:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •