07-06-2017, 11:31 AM
(This post was last modified: 07-06-2017, 11:32 AM by Filler.
Edit Reason: wrong number used
)
Sometimes while doing stuff not related to game design, I have concepts and thoughts of ideas that would work in game design.
Anyways, I thought of a simple system for overworld enemies based off the simple sets of flags and variables in their behavior. This would allow me to set each enemy to have various different aspects that make their movement. The first five are really simple number-based variables:
And this is how they space their movements:
Anyways, I thought of a simple system for overworld enemies based off the simple sets of flags and variables in their behavior. This would allow me to set each enemy to have various different aspects that make their movement. The first five are really simple number-based variables:
- Movement speed (in units)
- Reaction time to move after seeing the player (in seconds)
- Movement speed after seeing the player (in units)
- Distance (in units) to notice the player
- Enemy level
- Movement speed is the amount of units a frame they move when doing their own stuff.
- The second is simply how many seconds it takes for them to move after the little "alert" sign appears above their head. 0.2 seconds would roughly be a common reaction time. While slower enemies might have a reaction time of 0.5 seconds. (Half a second)
- The third is how fast will they move in units once they've been set to be alert to the player.
- The fourth is a bit more complicated to explain. But each enemy has a simple formula that determines the distance away from the player's X and Y position they are. As technically, they always see the player, but they won't react until they're close to their radius of reaction. This gives off the illusion that they don't see the player, and is determined by a variable amount of units.
- Enemy level is simply their level. If the player's level is above the enemy's they might become scared, or run away, different variables will change how they react to this.
- Hides when scared (furthest, closest) (Position, actor)
- Runs when scared
- Doesn't react when alerted. (scared, chase)
- The first one is something actually pretty complicated. And relates to a list of "hiding position" that are just a list of X and Y positions stored on the map. Once the enemy reacts to the player, and is scared, the enemy will run off their reaction range, and it's behavior will sort up the list of hiding positions to either high-to-low, or low-to-high, and then choose the top result. Making them either run far away, or pretty close. The same thing could be applied to enemy actors to sorta use them as shields.
- Runs when scared simply means they'll move away from the player when in range then chase them.
- The second is just that they won't react to wanting to rush the player, or being scared. Meaning you can create enemies that are confident, and will fight an overleveled player, or they'll only fight if the player actually decides to attack them.
- Moves up/down
- Moves left/right
- Moves randomly
- Patrols route (based off a list of positions to follow)
- Doesn't move
And this is how they space their movements:
- On/off for a set amount of seconds (variable)
- On/off for a random amount of seconds (from 0 to maximum number of seconds variable)
- Never stops, always moves