Dealing with NPC event iteration

  • scared of performance issues later on, i busted my ass trying to put together a single series/sheet of events for different types of NPC's in my game instead of having different sheet and series for different NPC profiles, such as neutral NPC's, aggressive NPC's, policeman NPC's etc.

    bit.ly/2CWHuAW

    as you see it's for just the collision mask of NPC's, and not the visuals for the actual game,

    but now i have an issue of assigning different visuals/animations ON those collision masks

    my questions to the experts is:

    1- do i even need to bother having a singular series of events like this for all NPC types for performance? Can i just split them and go the easy way?

    2- if not, how can i assign different sets of visuals and animations on a singular collision mask?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm no expert, btw. However, I don't think that unifying the events for generic NPC behaviour improves performance; I think it's better for organisation and debugging purposes (so you fix bugs in only one area instead of each NPC's event area).

    It looks like you didn't use Families, which may be more difficult to pick if you intend to have different Sprite objects to represent different NPCs. But this depends on how you intend to organise your NPC graphics.

    If you intend to have different Sprite objects for different NPCs, then you would want to create a Family and put those NPC Sprites in there, and use the Family to replace `actor_NPCMask`.

    Or, if you intend to use the Animation Folders of `actor_NPCMask`to define separate NPCs (for example, you have an Animation Folders such as 'NPC1_walk', 'NPC2_walk', 'NPC1_idle', 'NPC2_idle', etc), then you don't have to change anything in your event sheet. But of course, you have to maintain `actor_NPCMask` as your main Sprite object that contains all of the graphics of your NPCs that will use this event sheet. There's also the added complication of keeping track of which animation a particular `actor_NPCMask` instance is going to use; you'll probably need to create an instance variable determining the name/identity of a particular `actor_NPCMask` instance and then match the instance variable with the Animation name.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)