Hello everyone. I've come to a point where I have to think about npcs and their movements. What I need is to prevent npcs walking through trees and rocks in my scene. The first solution that comes to my mind is getting all trees'/rocks' coordinates, simulate some "cube" collision on this coordinates and handle this stuff on a server like MMOItems, so players/npcs will "see" it only when they are close to them. Or maybe just a List of such collision-cubes, not MMOItems, I am not sure what is better, or if this solution is absolutely awful.
So what do you guys think about it? Is this idea ok or you can give me some better solution?
Terrain objects as MMOItems?
Re: Terrain objects as MMOItems?
Hi,
there can be different ways of doing this.
One approach is to have the "map data" on the server side so that the NPC movement logic can detect collisions and non-walkable paths and avoid the problems you described.
Representing obstacles as MMOItems should be fine if you need those items to be sent to the clients. Otherwise you could simply represent obstacles using server side only data structures.
This approach well if your map is relatively simple. If you have complex terrains with 100s of small obstacles (e.g. trees, bushes, rocks...) it's probably going to be difficult to translate all that map data to server data and keep it in synch every time you edit the world.
Can you give us an idea of the complexity of your map?
Also how is it created? Unity?
Thanks
there can be different ways of doing this.
One approach is to have the "map data" on the server side so that the NPC movement logic can detect collisions and non-walkable paths and avoid the problems you described.
Representing obstacles as MMOItems should be fine if you need those items to be sent to the clients. Otherwise you could simply represent obstacles using server side only data structures.
This approach well if your map is relatively simple. If you have complex terrains with 100s of small obstacles (e.g. trees, bushes, rocks...) it's probably going to be difficult to translate all that map data to server data and keep it in synch every time you edit the world.
Can you give us an idea of the complexity of your map?
Also how is it created? Unity?
Thanks
Who is online
Users browsing this forum: Edithgal and 95 guests