21st April 2021
99 views

P3D Bots– Why so hard?

Made by Damen in Penguin3D

Daymen
Administrator
5,165 posts
37,117
Seen 23rd June 2024
21st April 2021, 05:06 PM

So you can appreciate just how big of a deal AI/NPC bots are in P3D and why its taking a while to finish this update, allow me to explain in simplest terms the challenge of making bots on p3d

When making bots on LeoRPG 1 and 2, its difficult enough to get them to find paths around obstacles, know when to stop, how to attack etc

but then add multiplayer, and you've got the challenge of syncing all of that logic over everyone's screen

One person's computer may find a path thats different to another person, but the bots always need to be at the same place for everyone for it to work

To do this, you have to let the server decide which path to take. That involves taking the best path from everyone's calculations and then re-sending that to everyone

But its not over yet. Everyones PC runs P3D at a different FPS. So bots for one person might finish a path quicker than another person.

So to ensure everything is synced, you need to actually simulate the path on the server, sending waypoint updates to everyone and then interpolating the NPC to each server-waypoint to keep everything synced up

Then of course you have to think about attacking with different weapons. That is never going to work unless you get the server to decide when to attack and how soon.

Then, NPCs need to have a separate animation controller because the one for real players won't work as its wired to your input controls (keyboard and mouse)

So you have to make a new animation controller which also needs to sync up with what the bot is doing at any given moment

But the good news is, I have managed it and it'll be coming out in the next couple of days with new items, new rooms and a seriously cool lore feature
16

+1 by Miromeski, Stoneclash, Zaron, Dice and 12 others

CEO of Lorefiix
Master
2,037 posts
4,757
Seen 2nd August 2024
21st April 2021, 05:29 PM

Damen wrote on 21st April 2021, 05:06 PM:
So you can appreciate just how big of a deal AI/NPC bots are in P3D and why its taking a while to finish this update, allow me to explain in simplest terms the challenge of making bots on p3d
When making bots on LeoRPG 1 and 2, its difficult enough to get them to find paths around obstacles, know when to stop, how to attack etc
but then add multiplayer, and you've got the challenge of syncing all of that logic over everyone's screen
One person's computer may find a path thats different to another person, but the bots always need to be at the same place for everyone for it to work
To do this, you have to let the server decide which path to take. That involves taking the best path from everyone's calculations and then re-sending that to everyone
But its not over yet. Everyones PC runs P3D at a different FPS. So bots for one person might finish a path quicker than another person.
So to ensure everything is synced, you need to actually simulate the path on the server, sending waypoint updates to everyone and then interpolating the NPC to each server-waypoint to keep everything synced up
Then of course you have to think about attacking with different weapons. That is never going to work unless you get the server to decide when to attack and how soon.
Then, NPCs need to have a separate animation controller because the one for real players won't work as its wired to your input controls (keyboard and mouse)
So you have to make a new animation controller which also needs to sync up with what the bot is doing at any given moment
But the good news is, I have managed it and it'll be coming out in the next couple of days with new items, new rooms and a seriously cool lore feature
A lot of game designers said the worst bit of game design is creating code for AI that's 'realistic' and not glitchy

So to save time, people just save code for AI, and paste it to another game. Saves a lot of time. So mr Damen of the spike 500th transformers pepsi max. Next time you make a game that requires npcs/ai. Just take the code from da other game to the current one. (You probably were gonna do that anyways)

Seems as if you have been blessed with the knowledge of code, and it scares me ngl
1

+1 by Damen

Quote:
Lol and fart

Daymen
Administrator
5,165 posts
37,117
Seen 23rd June 2024
22nd April 2021, 02:25 AM

harry15514 wrote on 21st April 2021, 05:29 PM:
Quote:
Damen wrote on 21st April 2021, 05:06 PM:
So you can appreciate just how big of a deal AI/NPC bots are in P3D and why its taking a while to finish this update, allow me to explain in simplest terms the challenge of making bots on p3d
When making bots on LeoRPG 1 and 2, its difficult enough to get them to find paths around obstacles, know when to stop, how to attack etc
but then add multiplayer, and you've got the challenge of syncing all of that logic over everyone's screen
One person's computer may find a path thats different to another person, but the bots always need to be at the same place for everyone for it to work
To do this, you have to let the server decide which path to take. That involves taking the best path from everyone's calculations and then re-sending that to everyone
But its not over yet. Everyones PC runs P3D at a different FPS. So bots for one person might finish a path quicker than another person.
So to ensure everything is synced, you need to actually simulate the path on the server, sending waypoint updates to everyone and then interpolating the NPC to each server-waypoint to keep everything synced up
Then of course you have to think about attacking with different weapons. That is never going to work unless you get the server to decide when to attack and how soon.
Then, NPCs need to have a separate animation controller because the one for real players won't work as its wired to your input controls (keyboard and mouse)
So you have to make a new animation controller which also needs to sync up with what the bot is doing at any given moment
But the good news is, I have managed it and it'll be coming out in the next couple of days with new items, new rooms and a seriously cool lore feature
A lot of game designers said the worst bit of game design is creating code for AI that's 'realistic' and not glitchy
So to save time, people just save code for AI, and paste it to another game. Saves a lot of time. So mr Damen of the spike 500th transformers pepsi max. Next time you make a game that requires npcs/ai. Just take the code from da other game to the current one. (You probably were gonna do that anyways)
Seems as if you have been blessed with the knowledge of code, and it scares me ngl

I would do that if the old code wasn't so bad- I was still learning.
1

Member
1,137 posts
3,006
Seen 14th August 2023
22nd April 2021, 07:05 AM

Yep I understood all of that
4

+1 by jay, Loki, Preston and visa

graphic designer
Moderator
3,098 posts
10,318
Seen 30th August 2023
22nd April 2021, 12:47 PM

excited for the update !!
0

Banned
2,542 posts
3,622
Seen 30th August 2023
25th April 2021, 05:47 PM

That seems very strenuous and difficult, but your hard work will not go unnoticed, I look forward to the new update!
1

+1 by Damen

Daymen
Administrator
5,165 posts
37,117
Seen 23rd June 2024
26th April 2021, 01:31 AM

weend2014 wrote on 25th April 2021, 05:47 PM:
That seems very strenuous and difficult, but your hard work will not go unnoticed, I look forward to the new update!

Thanks, its out now!
0

Login or join the forums to reply.