Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am making a small game for a course in my school and was planning on using QT to build it. I have worked with pygame[last year] and turbo c++[about 5 years agao] to make games, small easy stuff. This time I am planning to make a game that supports multiplayer over lan, the game idea is simple however, information about the game is here

http://bit.ly/mOKzuY

I was hoping to know from you all, if it is a good choice to use QT for this! I am totally new to QT, but a decent c++ programmer. Also what problems would I encounter when it is a LAN game, for a start I just want it to support 2 players on the local network.

Thanks

share|improve this question
    
what is your target platform? is it going to be a windows based game or linux/mac based game? –  Ali.S Sep 18 '11 at 14:27

2 Answers 2

Using QT is not a bad choice, more important is the networking. As you are developing for LAN you should be alright with TCP networking. In fact I'd even go so far as to recommend it to a first timer. Just be aware when you are working with TCP it will guarantee delivery, guarantee packets arrive in order, and provide a stateful connection for you. The problem with TCP is it doesn't work well over the Internet, the things it guarantees come at a price that increases with bad connections, which over the Internet it becomes too costly for some applications. Either way I would recommend the use of RakNet because it's open source you can learn a lot of useful tips for networking in general. Google for website URL. Good luck!

share|improve this answer
    
thanks for the insight, now that i need to implement it only over lan, TCP should not be a hindrance right ? Also based on the game i want to develop I guess the data exchange is going to be light, so it should work fine. Thanks again, i'll wait for few more replies before choosing an answer. –  Aadi Droid Sep 18 '11 at 12:43
4  
I greatly disagree with your assertion that TCP "doesn't work well over the internet". TCP is the basis for MOST of the communication over the internet (i.e. HTTP, FTP, email clients, many client-server applications, etc.). Compared to UDP, yes, TCP has a bit more overhead because it's a reliable protocol, but to say that it doesn't work well over the internet is just a gross overstatement IMO. And what do you mean by "bad connections"? UDP is connectionless and you have to deal with the issues of packets coming in out of order or not at all. The chances of a packet getting lost increases... –  Richard Marskell - Drackir Sep 18 '11 at 13:33
4  
...while transferring over the internet (because it has so many more obstacles to get through) so I would say that out of the two, without anything other than the protocol, UDP "doesn't work well over the internet". Of course, you can build your own message protocol over UDP to add some reliability, or perhaps you have packets that can be lost and that's fine, but don't dismiss TCP out of hand because it adds some overhead. –  Richard Marskell - Drackir Sep 18 '11 at 13:40
    
TCP is useless for realtime games, no professional game uses TCP because the lag for lost packages is unacceptable. It is great for many things, but realtime system is not one of them. Read this for example: gafferongames.com/networking-for-game-programmers/udp-vs-tcp –  Psykocyber Sep 18 '11 at 13:56
1  
@Psykocyber I have read that. But I think it needs to be taken with a grain of salt. TCP works fine for many applications and even many games. It really depends on your game and the type of data you're sending. I'm just saying don't dismiss TCP just because someone wrote an article saying that UDP is always better. Like most things, it depends on your requirements. –  Richard Marskell - Drackir Sep 18 '11 at 14:25

As it is over a LAN there shouldn'nt even be a discussion about UDP/TCP, go with TCP as it is much more easier to use.

Qt for a game or not?

That is a completely different history, go with it if you feel like it, it is a nice framework.

What you should check out is IP broadcasting (or scanning as routers usually just dismiss IP broadcasts) or if you can, Ethernet broadcast so you can find the other computers on the network fast and easily (you will want to know where the PC that hosts the game is).

Also read up on dead reckoning if you don't know that one or go with the 'ol 'lock step' method (simpler but that will be hell to use over the internet :-) to synchronize gamestates.

Anyway, do use the technology you feel most at ease with, that usually does the trick.

[edit] BTW: a must have for network programming is Beej's Guide to Network Programming simple, fun and precise.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.