Server
Re: Server
Really depends on what your server has to do. There is no magic answer for this. The server does not even need irrlicht probably since it does not have to display anything.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Re: Server
Irrlicht does just 3D, it does not mess with networking (or physics). To implement a game server, either use a proper framework/library along with Irrlicht or write your own
Re: Server
Yeah, for network you either use sockets or some higher-level network library like RakNet.
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
Re: Server
I am aware of the fact that I would need a proper networking library.
e.g. When I implement a pathfinding AI for enemies. Doesn't the server need to know all the objects in the game, to calculate a path? Wouldn't this mean that I am forced to partially implement irrlicht into the server?
I considered using even a complete different programming language for the server. But I thought it wasn't such a good idea. Even if I let the client handle all the collision and valid movement checks, don't I still need irrlicht, even without rendering?Sudi wrote:Really depends on what your server has to do. There is no magic answer for this. The server does not even need irrlicht probably since it does not have to display anything.
e.g. When I implement a pathfinding AI for enemies. Doesn't the server need to know all the objects in the game, to calculate a path? Wouldn't this mean that I am forced to partially implement irrlicht into the server?
Re: Server
Well you will have to implement the gamelogic that has to run on the server. But generally it is a bad idea to use irrlicht objects(SceneNodes) as game objects. You can think of it as the rendering component of your gameobjects. But yes if you have collision detection and things like that you will need a physics engine(irrlicht is not a physics engine) running on the server. So a math lib is probably needed. A different language is totally fine for all those things but you probably wanna use c++ as well when it comes to physics.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Re: Server
I like to have server/client as similar as possible. Often it's not trivial to figure out which parts of the code should run where. And it becomes easier to move code when server&client run more or less a similar world. So Irrlicht on the server can be fine. For testing you might even render stuff on the server.
For example depending on the game collision might happen on server & client. You have server collisions to ensure you have an instance making the decisions (Han shot first), but you have client collisions to show effects even before the server has decided who get's the points. Generally the server should have as much objects & information to be able to make all decisions that matter.
But it all depends on the game. If you are new to network programming it might help doing first a game which isn't about realtime and fast actions (like shooters). Turn-based games or games at least allowing some lag without affecting the gameplay might be easier (not easy... network never is).
For example depending on the game collision might happen on server & client. You have server collisions to ensure you have an instance making the decisions (Han shot first), but you have client collisions to show effects even before the server has decided who get's the points. Generally the server should have as much objects & information to be able to make all decisions that matter.
But it all depends on the game. If you are new to network programming it might help doing first a game which isn't about realtime and fast actions (like shooters). Turn-based games or games at least allowing some lag without affecting the gameplay might be easier (not easy... network never is).
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
Re: Server
How should I do calculations with in game objects, without irrlicht? Do you suggest that it's better to write own code for this?Sudi wrote:Well you will have to implement the gamelogic that has to run on the server. But generally it is a bad idea to use irrlicht objects(SceneNodes) as game objects. You can think of it as the rendering component of your gameobjects. But yes if you have collision detection and things like that you will need a physics engine(irrlicht is not a physics engine) running on the server. So a math lib is probably needed. A different language is totally fine for all those things but you probably wanna use c++ as well when it comes to physics.
But beside debugging, how should I disable the rendering part? something like this maybe?CuteAlien wrote:I like to have server/client as similar as possible. Often it's not trivial to figure out which parts of the code should run where. And it becomes easier to move code when server&client run more or less a similar world. So Irrlicht on the server can be fine. For testing you might even render stuff on the server.
For example depending on the game collision might happen on server & client. You have server collisions to ensure you have an instance making the decisions (Han shot first), but you have client collisions to show effects even before the server has decided who get's the points. Generally the server should have as much objects & information to be able to make all decisions that matter.
But it all depends on the game. If you are new to network programming it might help doing first a game which isn't about realtime and fast actions (like shooters). Turn-based games or games at least allowing some lag without affecting the gameplay might be easier (not easy... network never is).
Code: Select all
IrrlichtDevice *nulldevice = createDevice(video::EDT_NULL);
Re: Server
That should mostly work. Or simply not doing the drawAll calls. It depends on the game what kind of stuff you need on the server. If you do a Poker game you probably don't need any Irrlicht on the server. If you do a Shooter then having a 3D engine on the server is maybe useful. But could also be you only need to run physics on the server (thought even then Irrlicht might be useful to load some mesh-formats).diho wrote:But beside debugging, how should I disable the rendering part? something like this maybe?Will this stop every calculation for rendering purposes?Code: Select all
IrrlichtDevice *nulldevice = createDevice(video::EDT_NULL);
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
Re: Server
Own code for what? You know that irrlicht is only a 3d engine+some input. But CuteAlien is right about using irrlicht to load 3d models. It really depends on what you wanna do. Maybe be a bit more specific about what you wanna do? Then we might be able to give you a better answer.diho wrote: How should I do calculations with in game objects, without irrlicht? Do you suggest that it's better to write own code for this?
Yes that works.diho wrote: But beside debugging, how should I disable the rendering part? something like this maybe?Will this stop every calculation for rendering purposes?Code: Select all
IrrlichtDevice *nulldevice = createDevice(video::EDT_NULL);
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Re: Server
The idea is to make a little fps game. The server needs to update player positions to all clients, post-check bullet hits, control AI pathfinding etc. I am planning to use raknet. But as I said, don't I need to use irrlicht to load in the terrain and ingame objects, for at least the pathfinding algorithm if not more?Sudi wrote: Own code for what? You know that irrlicht is only a 3d engine+some input. But CuteAlien is right about using irrlicht to load 3d models. It really depends on what you wanna do. Maybe be a bit more specific about what you wanna do? Then we might be able to give you a better answer.
Re: Server
Usually your physics representation is different from the graphics. You wouldn't use a hugely detailed 3d model with every triangle being a physics triangle, you'd use a box/sphere/ellipse/whatever. Then your server only needs to know the physics world, not the graphics world.
Re: Server
I don't see how a simplified representation of a terrainnode can work for pathfinding. Could you give a textual example of how you would tackle this? Besides, a physics lib or any lib for that matter has a different way it processes heightmaps to become a terrain mesh or model of some sort. It will be different than the one the client uses (using irrlicht), or do I see this the wrong way?hendu wrote:Usually your physics representation is different from the graphics. You wouldn't use a hugely detailed 3d model with every triangle being a physics triangle, you'd use a box/sphere/ellipse/whatever. Then your server only needs to know the physics world, not the graphics world.
Re: Server
Not sure if there is such a thing as a little FPS-game with Network, it's pretty hard stuff. You might consider starting with an existing open source game which already has those features. Sauerbraten engine for example (I never used that, but it's about that and has the same zlib license as Irrlicht). Or just write mods for an existing shooter. Not saying you can't do all that from scratch, but you should be a pretty experienced programmer for that already and have a lot of time (I already worked on 2 similar projects, first time we needed more than a year with several people, second time I had to give up after working on it for over a year). Generally a good idea to do some simpler games first to get some experience.
Anyway - even if you want to do from scratch - take a look at sources from a game like Sauerbraten (might be called Cube2 now) to get some idea how that stuff can work.
Anyway - even if you want to do from scratch - take a look at sources from a game like Sauerbraten (might be called Cube2 now) to get some idea how that stuff can work.
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
Re: Server
Yeah there is no small fps game. Besides in a case of a fps you can also declare one of the clients as the "server". Then you do not have to run an extra instance.diho wrote: The idea is to make a little fps game. The server needs to update player positions to all clients, post-check bullet hits, control AI pathfinding etc. I am planning to use raknet. But as I said, don't I need to use irrlicht to load in the terrain and ingame objects, for at least the pathfinding algorithm if not more?
PS: This little deathmatch game like thing took 5 months. Youtube
PPS: Besides the fact the video does not show real multiplayer...it works...believe me
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.