hello
I'm trying to make an RPG game and I want the enemy's to charge the player once they see him. Also when idle they kind of just move around a bit like a Pokémon game NPC does. is there any videos or manuals to making AI enemy's?
please help
thanks
Is this a 3D or 2D game?
2d top down game
can anyone help? i assume its got somhing to do with line of sight and pathfinder. i just cant figure it out.
Develop games in your browser. Powerful, performant & highly capable.
You'll want to read the manual entries for the Line of Sight, Pathfinding and maybe MoveTo behaviors. Then from the start panel click on the example browser link. In the example browser search for those behaviors to get a bunch of example projects you can download and look at. I suggest finding one that is closest to what you want and using that as your base.
construct.net/en/make-games/manuals/construct-3/behavior-reference/line-of-sight
construct.net/en/make-games/manuals/construct-3/behavior-reference/pathfinding
construct.net/en/make-games/manuals/construct-3/behavior-reference/move
thanks you, I still cant figure it out yet. i don't know any code and was hoping to just drag and drop it into place (old school zelda style enemies) but i think its a lot harder than i realised.
Construct was built for people who don't know how to code. In the layout right click on your enemy, select 'Add' and then 'Behavior". Add the Line of Sight and Move To behaviors. Then, in your event sheets check if the enemy has Line of Sight to the player, and if true move the enemy to the player object.
i think that might work! thank you so much! do you happen to know how to get an enemy to do a small 2square patrol in 4 directions
Use states for your enemies.
Change the state when something happens. For example: if the enemy has line of sight, set the state to chasing; otherwise, set it to idle. Then you can create logic for each state.
Yeah, my solution was just to get the OP started and getting in the event block mindset. State Machine patters like above are the go-to for enemy ai (and many other elements of video games). Also, remember that line of sight has a distance parameter so you can control how close the player gets before the enemy "sees" them.
You can check out Construct’s pathfinding and line-of-sight tutorials. They’re great for making simple enemy AI that chase or wander naturally.