Hi,
I searched a lot on the forum but strangely didnt find anything related to the following problem:
I have client using irrLicht for graphic.
I have server to which clients connect.
Clients are basicaly players playing in the multiplayer world, that means they are getting coordiantes of all other object in the game from the server. And everything is fine while it is only about human players.
But if i want to add computer controlled players (monsters), my question is, how can server do the collision or pathfinding when it doesn't even know what is irrLicht?
It means i must run irrLicht on the server also?
2nd question:
Ok, i will run irrLicht on the server also, then if there are lets say 7 levels (zones) in the game, that means that server will need to load and run all 7 maps simultaniously?
3rd question (MAIN QUESTION)
Ok, i have server runing irrLicht with 7 maps runing simultaniously. Now about monster AI and 3D issue. Lets say i have built a waypoint graph for my levels so that monsters know where and how to move around.
We talk about server:
monster #13 see player #3 and want to follow him. They are not on the same height level. Is there any support (or possibility to implement) in irrLicht so that i can just tell the monster to move to 2d point of the player, and then irrLicht will calculate height coordinate based on the collision between monster and level.
Like: monster->moveTo(horizontalPlanePoint)
and height component will be calculated depending on the level configuration?
Ask me if i need to explain more.
Thanks for the anwers!
Monsters collsion and pathfinding
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: Monsters collsion and pathfinding
If you want to use Irrlicht's collision detection, then yes, of course you will. You can use the video::EDT_NULL device if you're not going to be doing any actual rendering.WishFish wrote:But if i want to add computer controlled players (monsters), my question is, how can server do the collision or pathfinding when it doesn't even know what is irrLicht?
It means i must run irrLicht on the server also?
Alternatively, you may be able to get away with using a much more abstract scheme, or a 3rd party physics engine, depending on how much accuracy you want.
At this point, it might be a good idea for you to start thinking of your level topography and actors in abstract terms rather than as Irrlicht objects.
That looks like another rhetorical question to me. Are you just thinking out loud?WishFish wrote:Ok, i will run irrLicht on the server also, then if there are lets say 7 levels (zones) in the game, that means that server will need to load and run all 7 maps simultaniously?
Answer: it depends. If you are using appropriate level topography (e.g. ramps) and collision animators, then it might all work out peachy. What Irrlicht won't do is have scene nodes climb ladders or jump. Also, the "moveTo()" functionality would be an iterative setPosition() - the logic of that is up to you.WishFish wrote: Is there any support (or possibility to implement) in irrLicht so that i can just tell the monster to move to 2d point of the player, and then irrLicht will calculate height coordinate based on the collision between monster and level.
Like: monster->moveTo(horizontalPlanePoint)
and height component will be calculated depending on the level configuration?
The best person to ask would be JP. Have a look at irrAI and see if that helps you.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Re: Monsters collsion and pathfinding
I can see that IrrlichtDevice has pointer to only one sceneManager, that means i will have to use more NULL devices, will that work?rogerborg wrote: If you want to use Irrlicht's collision detection, then yes, of course you will. You can use the video::EDT_NULL device if you're not going to be doing any actual rendering.
Is it possible to disable textures loading to save resources?
rogerborg wrote:That looks like another rhetorical question to me. Are you just thinking out loud?WishFish wrote:Ok, i will run irrLicht on the server also, then if there are lets say 7 levels (zones) in the game, that means that server will need to load and run all 7 maps simultaniously?
Not following you completly here.rogerborg wrote: Answer: it depends. If you are using appropriate level topography (e.g. ramps) and collision animators, then it might all work out peachy. What Irrlicht won't do is have scene nodes climb ladders or jump. Also, the "moveTo()" functionality would be an iterative setPosition() - the logic of that is up to you.
If i attach collision animator to node and call its setPosition(x, y, z), the irrLicht will automaticaly adjust its vertical postition?
EDIT:
Camera node with collision animator works that way. User press "forward" key and camera will move in that direction updateing vertical position automaticaly. Is it possible to use the same functionality for other nodes?
Last edited by WishFish on Thu Feb 21, 2008 12:59 pm, edited 1 time in total.
Re: Monsters collsion and pathfinding
A device can have as many scene managers as you want i think, you can create new ones and hold on to the pointers of them and then draw/update them as you like.WishFish wrote: I can see that IrrlichtDevice has pointer to only one sceneManager, that means i will have to use more NULL devices, will that work?
Is it possible to disable textures loading to save resources?
Not following you completly here.
If i attach collision animator to node and call its setPosition(x, y, z), the irrLicht will automaticaly adjust its vertical postition?
EDIT:
Camera node with collision animator works that way. User press "forward" key and camera will move in that direction updateing vertical position automaticaly. Is it possible to use the same functionality for other nodes?
Calling setPosition for a node with a collision animator should update the vertical position according to the level, yeah, applying gravity if it's above or pushing the node up if it's in the geometry.
Re: Monsters collsion and pathfinding
Fascinating!JP wrote:A device can have as many scene managers as you want i think, you can create new ones and hold on to the pointers of them and then draw/update them as you like.WishFish wrote: I can see that IrrlichtDevice has pointer to only one sceneManager, that means i will have to use more NULL devices, will that work?
Is it possible to disable textures loading to save resources?
Not following you completly here.
If i attach collision animator to node and call its setPosition(x, y, z), the irrLicht will automaticaly adjust its vertical postition?
EDIT:
Camera node with collision animator works that way. User press "forward" key and camera will move in that direction updateing vertical position automaticaly. Is it possible to use the same functionality for other nodes?
Calling setPosition for a node with a collision animator should update the vertical position according to the level, yeah, applying gravity if it's above or pushing the node up if it's in the geometry.
Thnx!
HI,
I suppose you will use client/server , am i rigth ? if yes , running graphics in server is a bad idea. You should choose a client point to control and run ai monsters and send informations to server , like position, state , rotation etc...
In my game i have 2 flags : humanPlayerFlag, and remoteFlag , so if a monster is controlled in a client point the flags would be:
humanPlayerFlag = false;
remoteFlag = false;
sorry , my engilsh is realy bad!!
I suppose you will use client/server , am i rigth ? if yes , running graphics in server is a bad idea. You should choose a client point to control and run ai monsters and send informations to server , like position, state , rotation etc...
In my game i have 2 flags : humanPlayerFlag, and remoteFlag , so if a monster is controlled in a client point the flags would be:
humanPlayerFlag = false;
remoteFlag = false;
sorry , my engilsh is realy bad!!
Np, i understood you perfectly!Daniel FF wrote:HI,
I suppose you will use client/server , am i rigth ? if yes , running graphics in server is a bad idea. You should choose a client point to control and run ai monsters and send informations to server , like position, state , rotation etc...
In my game i have 2 flags : humanPlayerFlag, and remoteFlag , so if a monster is controlled in a client point the flags would be:
humanPlayerFlag = false;
remoteFlag = false;
sorry , my engilsh is realy bad!!
But i see one big downside of that approach.
What happens if that player on that client hit the reset button on his PC?
Monsters controlled by him become stuned?
Or server search another node to give him that moster?
Seems like a too much effort to me.
