irrlicht and Raknet

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
empirepro
Posts: 71
Joined: Thu Dec 27, 2007 5:41 am

irrlicht and Raknet

Post by empirepro »

I was wondering if any one had a tutorial for Irrlicht 1.4 and Raknet. I have seen some but it was either for a older version of Irrlicht or a older version of Raknet. If any one has a tutorial for current versions of both Irrlicht and Raknet I would be very thankful!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Irrlicht Tutorial: Link
Raknet Tutorial: Link
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.
empirepro
Posts: 71
Joined: Thu Dec 27, 2007 5:41 am

Post by empirepro »

Ok I guess I am confused. Isn't there something special that you have to do to get raknet to work with Irrlicht or do you just write your game code and write your network code and they work together?
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

Sudi, I think he means tutorial on how to use RakNet with Irrlicht.

Could you link the outdated tutorial here. Perhaps we can bring it up to date. I have used RakNet with irrlicht 1.4 and it works nicely.

edit: Making a network game takes a litte more than writing a game and then just adding the network part. You usually have to design your game with multiplayer already in mind.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

empirepro wrote:Isn't there something special that you have to do to get raknet to work with Irrlicht
No.
empirepro wrote:or do you just write your game code and write your network code and they work together?
Irrlicht == graphics engine.
^
V
Game code == entirely your responsibility.
^
V
Raknet == network engine.

Any tutorial would simply show a sample application that uses Irrlicht, and a sample application that uses Raknet. There's no interdependence or conflicts between the two.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
empirepro
Posts: 71
Joined: Thu Dec 27, 2007 5:41 am

Post by empirepro »

Here is the link to the tutorial:
http://www.daveandrews.org/articles/irr ... /step1.htm

Its for a older version of Raknet and alot of the include files that it uses don't even exist any more.

Also my "game" Idea does have networking involved right from the start. Pretty much what it is is a 3d chat application within a city environment. Each building will be a independent chatroom with its own activities to do. The mall will have shops where you can buy clothes for your avatars theres also a movie theater for those who want to go on a "Virtual date" and other features will be included which I am not ready to talk about yet. The main focus of the game is on community and creating a virtual, changing, 3d community.
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

Ok, I updated the tutorial you posted. You can download the example program from HERE and the source from HERE.

If you are using DevC++:

For compiling the source you have to rebuild RakNet or it won't work with Irrlicht. Just open the RakNet DevC++ project file and hit Compile. That should do it.
Also add the Source folder from RakNet to your project include folders.
Then add RakNet.a to your project linker. I also had to add libws2_32.a from my DevC++/lib folder for some reasons. And then it should compile. I hope :)

For other compilers it should work in a similar way. Minus the recompiling of course because DevC++ uses .a for linking library files.

If you are running the server example and couple clients on the same computer, make sure each client uses a different local port. Eg. 10001 for client one and 10002 for client 2 and so on.
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

Hello man, thank for the info. But... could you make a "portalbe" poryect for us (the newbies :oops: ) I'm traying to compile it with codeblocks, and don't know why isn't working well.

I had compiled the library, and linked both to the proyect. Now I start my server and I can connect with your client. But not info about client login in or out in the console.

Othen think that happend is my server need the dll in folder and yours no. So I think I'm configuring something wrong and I'd like to import your portable proyect into my C::B or if anyone know how to configure C::B for that.


Thanks in advance.

EDIT: I'm using the GCC compiler
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

For running the project I think you are doing something wrong:
For the server:
1) Enter the default port 10000

For the client:
1) Enter the server IP:
127.0.0.1 if you are testing it locally on your computer.
2) Enter the server port which is 10000
3) Enter the port which this client operates on: eg. 10001

For another client:
1)..2) Same as before
3) Enter another port for client .. 10002

Also in the client window you should see "client ok" or "failed". What does it show?

I'll see about the project file later.
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

I use your compiled client whit my compiled server (from your code) and that is waht i get:

-Server runing in dedalut port at localhost
-I run your compiled client and I could conect getting irrlicht up and the black painting zone.
-Got nothing in the server

So I think is a problem of project compilation, because I could conect. Its possible that it conect but never sent/ recive packets (nothing printed in console when get paket, added at your code a printf).

Any idea?
empirepro
Posts: 71
Joined: Thu Dec 27, 2007 5:41 am

Post by empirepro »

When I use the pre-compiled server and client it works just fine so there must be something your doing wrong but since I am new to networking I have no clue what it could be. This program is really quit interesting and useful for playing things like tic-tac-toe and stuff! Thank you Eigen for updating the tutorial for me!
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

@pelonzudo: does my server work or neither works? It could also be a firewall issue that's blocking outgoing/ingoing connections. For me, when running, a dialog pops up and asks for if I want to keep blocking or unblock this port. Or could you perhaps post your server code?

@empirepro: No problem :) I'm glad I could help.
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

I would try to explaint better.

Your compiled client and your compiled server ->OK full conectivity (so, no firewallor NAT problem)

My compiled server (from your server code) and your client ->It seems that I got the socket conection but stop here because didn't recive/send any raknet packet.

So the problem is in my compilantion that it's not working well (but not the code neither the linker). So I would know how are you compilating the project to find if my project setup it's wrong.

I'm using Codeblocks and Mingw 3.4 (as I could remember). Any suggestion?

Thanks for the help
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

Okay, I have found the cause but not yet a solution. For my example I wasn't using the latest version of RakNet which is 3.22 but instead 3.07. When using the latest version my client wont run at all and server runs but I can't connect to it. I'll investigate!
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

It was an RakNet issue. This fixes it!

edit: Also version 3.23 has been released which fixes it.
Post Reply