Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Hartland

  1. #11

    Hartland

    However can there be 32*32 numbers in boolean array, and in integer? I mean can it be something like this:

    {1,2,3...32}
    {34,35,36...64}
    ...
    {31*32,31*32+1,31*32+2...32*32}

    =O

    Also how does array work in general? And how do I check value of array? And what if I want to just change value of 5th line 3rd place number? How do I do that?

  2. #12

    Hartland

    Each integer holds 8 times as many on/offs as a boolean. You can have an array of them in the same way as you can have an array of booleans if you want many values - the difference being that you have to first figure out which element to grab from the integer array, then figure out the specific bit inside of that number. It's the usual speed/storage trade-off. Something like the following, off the top of my head.

    [pascal][background=#FFFFFF][comment=#0000FF][normal=#000000]
    [number=#C00000][reserved=#000000][string=#00C000]var
    MyArray: array[0..9] of Integer; // 320 bits

    function GetBit(WhichBit: Integer): Boolean;
    begin
    // get whatever bit - e.g. bit number 36, in array
    Result := MyArray[whichBit shr 5] and (1 shl (WhichBit and 31)) <> 0;
    end;

    procedure SetBit(WhichBit: Integer);
    begin
    MyArray[whichBit shr 5] := MyArray[whichBit shr 5] or (1 shl (WhichBit and 31));
    end;

    procedure ClearBit(WhichBit: Integer);
    begin
    MyArray[whichBit shr 5] := MyArray[whichBit shr 5] and not (1 shl (WhichBit and 31));
    end;[/pascal]

    Meh. Totally untested and I don't suppose you really want stuff like that though. Seriously, use TBits - a class exists for this purpose, so there's no reason to reinvent the wheel.

    [EDIT: looks like my code breaks the Pascal tags! BlueCat, you have work to do ]

    [BlueCat Edit :twisted: The perfect opportunity to test my new evil colouring tags, heehee. Edit them if ya don't like 'em]

    [EDIT 2: I guess it's time to fix the above code ]
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  3. #13

    Hartland

    Who says I don't like 'em? After all, you're talking to the person whose desktop wallpaper looks like this:


    While I'm at it,



    and



    We now return you to your regularly scheduled thread.
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  4. #14

    Hartland

    Alimonster: If you continue to post off-topic rubbish like this you are in danger of being made an administrator. You have been warned :mrevil:

  5. #15

    Re: Hartland

    Quote Originally Posted by Androk
    Hi, I just started working on Hartland, an MMORPG, I want it to have a Game it self, Level Editor, Messenger, and a few other things. Howevere I have no idea where to start. I am no begginer in programing, or maybe I am.
    Right now I was thinking about creating engine, basically by that I mean Player walks around, levels are actually drawn with help of level files, and tha's it. Howevere I ahve no idea where to start, or how. Help?
    I think I can help you out with lots of what you need. I have seen both the source code and the server files for a commercial Delphi MMORPG. (The Legend of Mir), it's a very addictive game and having seen the server files, it opened up a lot of ideas on how to get round problems that bothered me in the past. I started coding my own MMORPG about 2 weeks ago and have a Message Server, Login Server, Main Server, Client Shell, Image Compressor, Image Library Builder, and have just started the Map Editor. The biggest problem I am having is getting a TRichEdit working with fullscreen DirectX, infact it looks like I will have to bin it an write a new dx component. The messaging functionallity is complete though and it seems fairly stable. I am using Indy components for the TCP/IP.
    http://www.c5software.co.uk (site is being developed at the moment)

  6. #16

    Hartland

    Go Terranigma! Good work Ali

    Anyway, there are quite a few MMORPG's being made in Delphi.. Though not alot get finished (Bah! to programmers apathy).. I would like to see a few more MMORPG's be made.. Hopefully free .. But hey, i dont program in Delphi much more.. (C++ :roll: ).. But Delphi is pretty fun (when you dont have to use many components [im not a fan of drag'n'drop programming]).

    But i wish you all the best, and that the MMORPG's become a sucess (DIE GRAAL!).

Page 2 of 2 FirstFirst 12

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
  •