Posted April 18, 2024 by Pizberry
#Construct 3 #2d #bots #game dev #develop #news #c3 #programming #tutorial c3 #tutorial #tutorial bots #tutorial botc c3 #tutorial construct #AI #Construct AI #Construct #construct #developers #mechanics
Hello world! I recently released my first game on itch and gamejolt! Of course, I expected a different result from the stats. But with renewed vigour I'm going to make my first horror, or rather analogue horror. But I'm not about, you're on the Football Championship game article. Which means I have to tell you, "How to make NOT DUMB, but a little bit SMART bots". Here we are going to look at the behaviour of FOOTBALL players. If you need something else you can ask me for help here. I will answer you: how to teach the bot your way. P.S I am not from Britain or USA, so some items have names in my language, I will translate. P.S.S TUTORIAL HOW TO DO ALSO IN MY GAME!!! IF YOU WANT IT DIFFERENTLY, WRITE HERE
We tell the game: if the distance between the object and the bot is less than *** pixels (in our case 100) and the player has not reached the target and the bot has not picked up the ball, then interact with it (pick up the ball).
In your case, action=damage, steal, notice, or some other interaction. In football=take the ball.
What does this command do? It says: if the bot sees the object at point 0 (in short, the ball), and the bot has not reached the goal (take the ball), then find a path to the object
As a matter of fact, there is nothing like that. Also you can see X<2949. Let me tell you straight away, this is not a necessary condition if you don't care where the object is. Don't forget to put exactly every * second. This way the bot will find its way to the ball without stopping.
If you want to see the bot as a human: make it have a "tiredness" effect. For example, the bot has stolen money and is running away, and you are catching up with it. Then it comes to your rescue:
For the bot, we are adding a new behaviour "Timer". It will be cyclic. Let me tell you how the command works. The bot is "tired of running" (timer) after the object (variables show us this), its maximum speed decreases from 800 to 500 pixels and the timer stops. When it has rested (2.5 seconds), the timer resumes and the max speed returns to its position.
You can add a stop instead of speed so that a bot with the "Sight" behaviour doesn't see the player. You can also put a regular timer instead of a cyclic timer, but don't forget to add the "enable timer" command. But it is not a problem to insert the command "turn on timer" - you have to think of it.
Oh, yeah, this is gonna be a real B*SM S*X!!! I'VE BEEN STRUGGLING WITH THIS FOR THREE DAYS. Anyway, there are teams like this:
You can see by the name what is responsible for what. But there are some problems. These commands are useless for BOTS, for character (player) selection they are perfect.
All of the commands I have listed currently work for ONE bot. If you have more than one bot, the game and bots will crash. To avoid this, all you need to do is add the COMMAND shown on the screenshot, and move all the commands listed above to that COMMAND. Kind of like sub-commands of a global team.
The last two commands are needed in one case: if you care about which bots to use. If you don't care. You use the first one, without 2 and 3. The first command is mandatory!
That's it, I've written an article that should help newbies. All of this I have learnt on my own. Tutorials helped me a little bit. If you have any questions, write here or in the comments. I will answer them all. You can also suggest additions to this article.
Also, I'm making a horror game that will interact with the computer, camera, microphone and so on. If you're interested in following me, you can subscribe to me on itch or on gamejolt. Bye!!!