feature request: IrrSockets

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

feature request: IrrSockets

Post by JPulham »

this game engine has everything, even AI from the forum...except Sockets....all we need is a TCP/IP and a UDP Socket and its the best on the market :P
there are hundreds of open source projects and demos out there....untill u add it I'll make them my self, but if you make one before me....all the Irrlicht uses would be greatful...maybe you'red get torque users as well :roll:
pushpork
Guest

Post by Guest »

irrlicht is a graphics engine only with very basic collision stuff ;) please keep that in mind.

feel free to add something like that to irrlicht, though. would be cool to use as an extension.

ps: if you look for networking, try raknet
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

well maybe I will...

Post by JPulham »

for now I'll use a GPL one, but mark my word...YOU HAVEN'T SEEN THE LAST OF JPulham :shock: (or his sockets he wont shut up about :P ) on a serious key I'll work on it with my mate...I'm trying to get a project done which is pretty large AND do my GCSE's at the moment :cry:
pushpork
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Well, sockets can work between Windows and Linux very easily using POSIX style sockets( socket, bind, accept, listen, connect, etc. ) What specific functionality would you be looking into for IrrSockets???
Image
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Sockets

Post by JPulham »

Just sending streams of chars via a IStream or something. the indy project has a good set of sockets but it only works for Borland C++ builder :shock: ....which I dont use anymore for compatability issues. The stream should havea Read(void* buf,int size); method...I'll work on it... but see my last post
pushpork
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

the problem is, without a hell of a lot of work it will only be any good for turn based games.
Also, UDP would be better than TCP sockets, and then you might as well use Raknet and spend your time working on the hard stuff like (as Spintz mentioned in another post) dead reckoning, occlusion culling, LOD culling, etc etc rather than reinventing the wheel doing the easy stuff like opening connections and sending slow streams of characters back and forth.
It would be a shame to make a whole networking side project but it not be able to support anything but 2 player Tetris
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

i got it working

Post by JPulham »

I had an OnRead() Method and just read off the right stuff, i.e, first 4 bytes = 1 float ect, and the first 12 bytes are the X, Y and Z pos, along with speed milliseconds and other params
pushpork
terefang
Posts: 48
Joined: Tue Jun 21, 2005 9:56 am

Post by terefang »

why not wrap NSPR (Netscape Portable Runtime in C) since its already cross-platform (used in Mozilla/Firefox/Thunderbird/Evolution), reasonable stable since ages (remember Netscape Navigator 2 ?) and comes with a nice multiple licence model (NPL/MPL/GPL/LGPL).

if you need security too, just put NSS (Network Security Services aka. SSL) on top.
terefang
nVidia 7800GT/256, AMD64-X2 4k2, Latest Fedora/CentOS
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

hard to make generic sockets truly work

Post by buhatkj »

trouble is, you need to stream different kinds of data for different kinds of games. also there are other more ethereal issues to consider. how to you handle object creation/destruction over a network, how to uniquely identify an instance of some networked object, how to send data like animation states or spell/attack/whatever actions without a lot of lag, who calculates the hits? client or server (server we hope)
sure most of the time we just want to synchronize maybe the position and orientation of things; and maybe with a basic cross-platform UDP driver you could make an Irrlicht Animator to do that. but even then you still have to consider the creation/destruction problems, and so forth.

This is something ive thought about a lot, but I still haven't come up with a really good way to provide something more useful that just basic socket functionality and make it generic enough of flexible enough that you wouldnt have to almost totally rewrite it for a different sort of game.
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

almost...

Post by JPulham »

I found some stuff...you could have an async socket handle in the WndProc that calls the user function... i.e.

Code: Select all

#define IRR_SOCKET_MSG   WM_USER + 100
...
class socket
{
    public:
        virtual bool OnRead(void* buf, int type); //just a simple idea
        virtual bool OnWrite(void* buf, int type); //just a simple idea
};
...
//the WndProc
case IRR_SOCKET_MSG:
    switch (WSAGETSELECTEVENT(lParam)) 
    {
         case FD_READ:
                    OnRead(HIWORD(wParam),LOWORD(wParam));
	    break;
         case FD_WRITE:
                    OnWrite(HIWORD(wParam),LOWORD(wParam));
	    break;
         case FD_CONNECT:
	    break;
         case ...				
	    break;
      }
      break;
I dont know what the wParam would hold...it might be something else.
the user can then create a class...like IEventReceiver is used and define OnRead() ect.
pushpork
Dark Rain
Posts: 47
Joined: Thu Jul 07, 2005 1:31 am

Post by Dark Rain »

I'm sorry bitplane but TCP/IP is perfectly good for very large scale real time games. A lot of really large mmorpg use tcp/ip, my day job is doing maintenance on a mmorpg that's purely tcp/ip based.

We're not doing any magic optimixation with TCP/IP, writting the generic socket class for the client took a whole hour. We're just pushing bytes in a stream and receiving them.
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

although I read that TCP slows down the longer its used as it gets a backlog of packets to check...while UDP dosn't check...so dosn't get backlogged...I think TCP is good for things that has to happen...like joining games...then UDP for updates in-game...like position
pushpork
Post Reply