PDA

View Full Version : Hartland



Androk
20-11-2002, 11:38 PM
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?
:(

TheLion
21-11-2002, 08:25 AM
Hey Androk,
First of all I have no idea what an MMORPG is, but I think I can give you some basic information without nowing that! :)

I would start by making the basic map-engine, with that I mean, when you want to make a 2D game you may consider a tile engine, but sometimes one bitmap to fill the entire screen might do just what you need. In the last case you might use objects or sprites for walls or things like that, in the first case (tile-engine) you have to use something like an array to store the tile-information in. In my rectangular-engine (tile engine) I used records to store tile information in and created multidimensional dynamic arrays of the recordtype as map. For Example:

// The Record
Type TTile = Record
Index : Integer; // Image Index
Passable : Boolean; // Sprites collide if True or pass if False
End;

var Map : Array of Array of TTile; // The Map


Then you can write a drawing procedure that passes all of your tiles and draws them at their predifined position. If you use tiles that are 32x32 pixels than you could determine the position by using (pseudo):
For Y := 0 To MapSizeY do
For X := 0 To MapSizeX do
Begin
TileX := X * 32;
TileY := Y * 32;
End;

Of course before you can use a tile-engine in your game you'll have to have an editor, but that's pretty much the same work. To save the files you can simply store the multidimensional array into a file.

Only when all of that is done, then I would look into placing a character on the map and making it move and for that I would use objects and a simple sprite engine... So basically what you want to do is create two things a tile-engine and a sprite-engine.

Hope this helps :wink:

Alimonster
21-11-2002, 08:43 AM
MMORPG = Massively Multiplayer Online Role Playing Game.

Btw, you don't need the muls if you're doing a tile engine - instead, you can simply add a value each time. I.e., in pseudocode

screen_y := 0;

for (y)
begin
screen_x := 0;

for (x)
begin
draw tile(x,y) at screen_x, screen_y
inc(screen_x, 32);
end;
inc(screen_y, 32);
end;

That will be a bit quicker, plus you have the added advantage of easier scrolling - you can simply adjust the starting screen_x and screen_y values based on the offset and let clipping take care of the rest.

[EDIT: oops, slight mistake about setting screen_x to zero outside of loop]

[EDIT2: and btw, you'd store your tiles in a 2d array, probably, taking the form "map: array[0..map_height - 1, 0..map_Width - 1] of TTile". The pseudocode above really should be "draw tile(y,x)" but I didn't want to cloud the issue. If you don't take care of correct ordering for your array then things get very slow indeed.]

Traveler
21-11-2002, 10:24 AM
An MMORPG is quite an undertaking :shock:
I suggest you start writing things down first. Write down everything you think is needed for the game. What kind of engine (2D/3D), editors, script engines, graphics, IA (if needed (npc's?)). Don't take this too lightly though, look at other mmorpgs for reference.

Then for every item specified above, write more detailed what is has to do, what it's requires and how long you think it would take to realize and more important if you can realize it. For example, a tile-editor should be no problem, but how about pathfinding?

Once you have finished this 'blueprint' (and still think you can do all the things you wrote down) you can start thinking about programming.

Alimonster
21-11-2002, 10:49 AM
I agree about the size of this undertaking. I've never seen the attraction towards "massively multiplayer online xyz" to be honest. What's wrong with good ol' single-player fun, where the unreliability of network connections can be avoided? Damn these people with their online shenanigans!

You might want to have a chat with the bloke who's working on this online game (Age of the Ancients (http://www.aotaonline.com/)) to get a better idea of what to expect (btw, quite a few bits of the site give 404s, but the forums work - try to drag him over here if he's not already a member :twisted: ).

Androk
21-11-2002, 10:44 PM
Heh Thx, I was going to make walking engine first, but it makes more scence to make tiles first. I thought I can do it in 3 levels/layers:
1st level is walkable.
2cnd level is all the blocking stuff.
3rd is level are NPCs (This miuht change to water).

Links to Screenies:
http://forums.graal2001.com/forums/attachment.php?s=2150e2782a69ec40203a15be0ce4e5c0&postid=688828
http://forums.graal2001.com/forums/attachment.php?s=2150e2782a69ec40203a15be0ce4e5c0&postid=666585

I have more recent screenies, but until I get my site up and al, NO RECENT SCREENIES! I got about 3 times more tiles now x.X

{MSX}
21-11-2002, 11:14 PM
]http://forums.graal2001.com/forums/attachment.php?s=2150e2782a69ec40203a15be0ce4e5c0&postid=688828[/url]
http://forums.graal2001.com/forums/attachment.php?s=2150e2782a69ec40203a15be0ce4e5c0&postid=666585


The backgrounds look very nice!
But i think a mmorpg is really difficoult to program.. i've done something like a mud times ago, and it was very hard to do. A mmorpg is far more difficoult!
As i always say, the most important thing in programming a game is complete it! So it is better to have a simple completed game than a complex, uncompleted one.

Bye :P

Androk
22-11-2002, 02:11 AM
I have a question. What is easier on memory of computer 2-3 Boolean arrays, or 1 interger one?

TheLion
22-11-2002, 08:00 AM
*Deleted*

Alimonster
22-11-2002, 08:47 AM
I have a question. What is easier on memory of computer 2-3 Boolean arrays, or 1 interger one?
A boolean is one byte - which means you can get four of them into 32 bits. If you use an integer, you can get 32 values per int (32 bits) - 8 times more!

procedure Test;
type
TTest = array[0..3] of Boolean;
begin
ShowMessage(IntToStr(SizeOf(TTest))); // allows 4 values
ShowMessage(IntToStr(SizeOf(Integer))); // allows 32 values
end;

You can either do the packing-to-integers yourself ([url=http://www.alistairkeys.co.uk/bits.shtml]]) or you can have a look at the TBits component of the VCL.

Androk
22-11-2002, 01:05 PM
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?

Alimonster
22-11-2002, 01:46 PM
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.

[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;

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 8) ]

[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 :P]

Alimonster
22-11-2002, 02:36 PM
Who says I don't like 'em? After all, you're talking to the person whose desktop wallpaper looks like this:
http://www.alistairkeys.co.uk/images/smallplasma.png

While I'm at it,

http://www.alistairkeys.co.uk/images/2.gif

and

http://www.alistairkeys.co.uk/images/3.gif

We now return you to your regularly scheduled thread.

BlueCat
22-11-2002, 02:38 PM
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:

Gadget
16-01-2003, 09:48 PM
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.

Shadowfax
25-01-2003, 05:49 AM
Go Terranigma! Good work Ali :o

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 :wink: .. 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!).