Results 1 to 10 of 17

Thread: Online torpedo game

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Online torpedo game

    Hi. Me and my friend are just about to start a Torpedo game. And we have some ideas like the field will be handled as a 10x10 matrix and we can do most of the coding it's not too tough. What we don't know however is how will we be able to make this work online. How should we make the packages work but not too slow. And first of all how do we make the program send the packages. I don't know if there exists a topic about something similar like this if there is I am absolutely okay with just a link to that topic altough I haven't found anything like that. Thanks in forward.

  2. #2
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    I would suggest you have a read through some of the threads here.

    They should help you get an idea of what's involved. After that, you'll need to get a handle on what information you need to exchange between clients and then come up with some suitable structures/communications protocol.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  3. #3
    oh then it won't be as easy as we thought well anyways thanks. If I can get SDL work in this life maybe the game will be fine

  4. #4
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    Depending on how much data you need to transfer (and importantly, what data - synchronisation etc.), it can be quite easy.

    I don't know what compiler you're using, but lets say you're using Delphi, you can create a class descended from TPersistent. The data you want to transfer can be stored in that class as published properties... then you can make use of the streaming mechanisms in Delphi and say the Indy components and simply stream the class over the socket connection.

    I've never written a game that uses this kind of socket connection so I can't comment further, but I have used this technique to squirt 12MB objects over a TCP/IP connection without too many hitches. But, it doesn't have any real error detection etc. So you may be better off defining a communications protocol (I've always used HDLC as a base for such protocols) which can handle failed transmissions and other errors such as corruption etc.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  5. #5
    I didn't get most of this since my skills in network programming... well let's just say you can't divide with it. Anyways this will be useful when I finally understand it so thanks. It's not your fault I assure you I'm just way too noob in this. I'm using free pascal. And I have never used ANY other includes and barely even use units except for crt. Altough I'm trying to get JEDI-SDL work I'm too noob to even do that. There's another topic of mine about that... So all this, a program with multiple components like not just a simple executable and maybe 1 or 2 binary and text files is totally new to me. I thought it would be so much more simple. They said Game Maker is good for start well game maker is nothing compared to this. It's like telling a 5 year-old to make the plans of a whole house after he've been playing with wood-cubes for a couple of hours. There I just pushed a button and there was my object I didn't need any constructor thing I don't even know what the hell is that but I see it everywhere in the examples. It's hard to learn from the examples when the theory of the coding is explained but I barely know the functions and procedures used because they're either Object Pascal or in units I've never used before. Altough if I could finally create an object and make it "work" somehow I would see, yes it is kind of similar to game maker but other than that, not at all. I don't even know how these work in pascal. I mean objects. Are their procedures executed as they exist? Or should I call them? Oh don't worry you don't have to answer these stupid questions I'll search for them but I'm just scared When I finally think I know a little about this langauge I find out how little exactly that is.

  6. #6
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    If you want to program in Object Pascal, just program in Object Pascal, it's not so scarry once you get into it more. As neat as Game Maker is, it won't really teach you how to use the tools or learn the language. Game 'design' concepts sure, but you need programming experience to really break ground in learning it. It'll come, just don't get too discouraged if it's not coming right away. We all went through this and we want to help so you are good to go as long as you keep trying and make the effort. Trust me, it's worth it.

    Along with this fine pep talk, I'm going to give a caution. I'd stay away from networking or online anything for now. Keep your game local. Networking is an aspect of game programming that can even make commercial game developers for EA Game cry. Save this for something that you will learn a bit later. Instead try your hand at simple rule-based AI for computer players or adding joystick/gamepad support so that you and a buddy can play and test it on one machine. You can do some cool stuff with both those areas without splitting your head open on networking so early.

    Games with simple yet an addictive quality will do you the most good. Your torpedo game seems like such a game. Keep the things you have to program to a minimum so as not to overload your project or you'll lose interests fast.

    Also check out my tutoruials on making an Artillery game I use Lazarus and JEDI-SDL and I provide the source code you can download and compile yourself. It might help you figure out your setup for making games too.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •