Hi
Im trying to develope an online game, so i have a server, and a client.
In the server side, I dont have the models, no graphic engine of course.
But the mobs are controlled by the server, and have to filter the wallhacks too. So somehow i have to check that there is a collision between the players/mobs and the walls.
Any ideas how should i achieve this?
I have mutliple terrains, in the terrains i have static objects.
And for the map, i put simply these terrains with objects together.
So my idea was that i make a picture (raw bmp maybe?), with grayscale colors. and following the mobs position in that picture. if the difference in the colors bigger than x, then its much more higher than the current pos, so cant go there. It would be kinda like the heightmap of the terrains.
And i wouldnt check for the terrain, there won't be big cliffs and so on. (or maybe, but the terrain isnt problem if the others are done )
but i dunno if that would work, and dont wanna delete it after i completed coz it didnt work xD
or is there an easier/faster method?
thanks
Collision detection WITHOUT models
Why do you have no models on the server? You don't need to draw them - but having them allows you to run just the same collision code which you have on the clients. Or you might even only run the collisions on the server. Models don't cost much memory - you don't need to load textures (you can just remove them). If you want to simplify them that is certainly also ok, thought I wouldn't recommend it unless you really have to.
And then just run the server with a null-device - you get all the collision handling that way without any need for output.
And then just run the server with a null-device - you get all the collision handling that way without any need for output.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien:
You know, irrlicht collision detection isnt the fastest.... xD
i dont need complex collision, checking Y coordinates and so on. im just working with XZ coordinates.
loki:
bounding box collision isnt good either. for example:
its a wall at the top-right corner of my terrain(actually i have this model, so its not just example )
with a bounding box check it will look like this:
server would say that the player cant enter to that, would kick the player for hack. but you CAN enter to that
and the other one, for example a big circle
ok, this one kinda looks crap, but oh well xD
so player at the X. as for a bounding box, he couldn't enter.
(i kinda have feeling that my mapper WILL make that kinda map xD)
and i dont wanna use irrlicht in server side. for just loading it uses a couple of memory, cpu usage and so on, whats not too good for a server right?
(sorry for the crap ASCIIs, but didnt want to paint now xD)
You know, irrlicht collision detection isnt the fastest.... xD
i dont need complex collision, checking Y coordinates and so on. im just working with XZ coordinates.
loki:
bounding box collision isnt good either. for example:
Code: Select all
-----------------
|
|
|
|
|
|
with a bounding box check it will look like this:
Code: Select all
-----------------
| |
| |
| |
| |
| |
-----------------
and the other one, for example a big circle
Code: Select all
------------------------------------
| __.......__ |
| _.-'' '-.. |
| ,-' '-. |
| ,' '. |
| ,' '\ |
| / ` |
| / `. |
| / \ |
|| | |
|| | |
|| ||
|| ||
|| .'|
|| | |
|| .' |
| \ / |
| \ ,' |
| ` / |
| '. ,' |
| '-. _,' X |
| '-._ _,-' |
| '`--......---' |
-----------------------------------
so player at the X. as for a bounding box, he couldn't enter.
(i kinda have feeling that my mapper WILL make that kinda map xD)
and i dont wanna use irrlicht in server side. for just loading it uses a couple of memory, cpu usage and so on, whats not too good for a server right?
(sorry for the crap ASCIIs, but didnt want to paint now xD)
It really depends on your game. If you have for example a shooter then it will just be the easiest to use the same engine on client & server. Doesn't matter too much if you use the collision detection of the engine or an own. I use for example an own collision detection myself, but still using a few of Irrlicht's functions for that. If collision speed ever gets a problem then I will think about partitioning the level some more. Which usually means either adding an octree or a grid. Irrlicht even has octree support (I used that in h-craft) and coding a grid isn't that complicated (is better suited for collisions for most games as levels are usually rather flat).
Don't know why a few MB(?) are a problem for your server. Often the server is the best computer and has no trouble handling everything a client can handle - and he doesn't even need to render or play sound. Do you want to run that many instances on one computer? I don't know your game, but I couldn't really think of a game where you would need that right now.
And using different collisions on client & server sounds like a bad idea. I just can only think of problems which that would cause and don't really see much advantages to it. Either trust clients enough to use their collision detection or use identical collisions on client & server. If you need only simple collision detection then just do that on both sides. How would you want to handle otherwise if you get different results?
Don't know why a few MB(?) are a problem for your server. Often the server is the best computer and has no trouble handling everything a client can handle - and he doesn't even need to render or play sound. Do you want to run that many instances on one computer? I don't know your game, but I couldn't really think of a game where you would need that right now.
And using different collisions on client & server sounds like a bad idea. I just can only think of problems which that would cause and don't really see much advantages to it. Either trust clients enough to use their collision detection or use identical collisions on client & server. If you need only simple collision detection then just do that on both sides. How would you want to handle otherwise if you get different results?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
yeah in client side, im using octree, but thats slow too.
and i dont wanna do a complex collision detection, just one for bots that can tell, where it cant go.
like there is a big wall in front of it, then dont go through and so on xD
the detailed collision is just on clients side.
like in WOW, the bots can climb up everything when chasing the player.
thats ok for me too, but when just patrolling (random walk), dont go through, and do not notice players behind walls.
so just i want a function what checks that is there an obstacle between A pont and B point.
I simply dont want to use 3D engine collision for just that one, if there is other way...
and i dont wanna do a complex collision detection, just one for bots that can tell, where it cant go.
like there is a big wall in front of it, then dont go through and so on xD
the detailed collision is just on clients side.
like in WOW, the bots can climb up everything when chasing the player.
thats ok for me too, but when just patrolling (random walk), dont go through, and do not notice players behind walls.
so just i want a function what checks that is there an obstacle between A pont and B point.
I simply dont want to use 3D engine collision for just that one, if there is other way...
*sigh* I won't stop you - it's your time. Just another note - in most games you will need full collision on server because the server is usually the deciding instance, so are you really sure you won't need that additionally anyway?B@z wrote:I simply dont want to use 3D engine collision for just that one, if there is other way...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
yeah i want to try in this way first, coz my full game design is based on this.
so if i change it, i have to change a lotlot things what i want to avoid.
and if this wont work, then i will change.
but in theory, this should work (IMPO), and enough for me. so why not give a try?
thanks anyway.
so, any ideas how should i achieve that?
so if i change it, i have to change a lotlot things what i want to avoid.
and if this wont work, then i will change.
but in theory, this should work (IMPO), and enough for me. so why not give a try?
thanks anyway.
so, any ideas how should i achieve that?