C
ChaosX2
Guest
Hello,
I started mapping out the algorithm for how I want to go about initializing enemies in dungeons for my RPG. The enemies will roam the map like how the game Chrono Trigger is set up. I started off by thinking I'll use a nested switch case to set the enemy sprite based on the room and xStart position. But because I have been using data structures recently for other parts of my RPG, it got me thinking that maybe what I want to do can be done more efficiently.
I've used the nested switch-case to initialize NPC's sprites and scrolling text dialogue but because the game will end up having a lot of those (and enemies) that's what got me thinking that maybe I can use a ds_grid to initialize all this stuff. I'd like some feedback, clarification, and guidance on how to go about the things mentioned below in the most efficient manner; whether a data structure is the way to go or what.
~Different items for example can have their sprites all set within one sprite resource, separated by frames. But if I want the enemy to have a walk/run animation, would each enemy (and npc) in the game need it's own sprite resource? Is it possible to scroll between a set number of frames for one sprite resource for NPC's? Ex: Frame 0 - 3 is npc1 walk animation. Frame 4 - 8 is npc2 walk animation.
~With the nested switch-case statement I've used thus far, I've always placed the npc object in the room myself and remember the x position to use within the switch-case. Would I be able to spawn NPC's (and enemies) without having to place the object in the room first?
Thanks for taking the time to read this and hope I've been clear in expressing this.
I started mapping out the algorithm for how I want to go about initializing enemies in dungeons for my RPG. The enemies will roam the map like how the game Chrono Trigger is set up. I started off by thinking I'll use a nested switch case to set the enemy sprite based on the room and xStart position. But because I have been using data structures recently for other parts of my RPG, it got me thinking that maybe what I want to do can be done more efficiently.
I've used the nested switch-case to initialize NPC's sprites and scrolling text dialogue but because the game will end up having a lot of those (and enemies) that's what got me thinking that maybe I can use a ds_grid to initialize all this stuff. I'd like some feedback, clarification, and guidance on how to go about the things mentioned below in the most efficient manner; whether a data structure is the way to go or what.
~Different items for example can have their sprites all set within one sprite resource, separated by frames. But if I want the enemy to have a walk/run animation, would each enemy (and npc) in the game need it's own sprite resource? Is it possible to scroll between a set number of frames for one sprite resource for NPC's? Ex: Frame 0 - 3 is npc1 walk animation. Frame 4 - 8 is npc2 walk animation.
~With the nested switch-case statement I've used thus far, I've always placed the npc object in the room myself and remember the x position to use within the switch-case. Would I be able to spawn NPC's (and enemies) without having to place the object in the room first?
Thanks for taking the time to read this and hope I've been clear in expressing this.