View Single Post
Old 12-12-2005, 09:48 PM   #1 (permalink)
Rafkin
Registered User
 
Rafkin's Avatar
 
Join Date: Mar 2004
Posts: 20
Rafkin is on a distinguished road
Arrow Game project. I need some help.

Hi. I have been saying for sometime now that I wanted to create my own online game. I have worked out a few of the details of how the game will look, and act, and I finally want to get started on the project. Now, I know a few of you are already thinking "Good 3D games take lots of programmers and many years to develop." I am not going to try to delve into the 3D realm, and am instead sticking to a isometric game using bitmap sprites. It's much simpler and gives me the ability to offer what I want to offer the users.

What I have in mind is creating a client and a server that are both free to download. This will allow anyone who wants to host a server to be able to from thier own home computer, or from a server they may have that can handle it. In fact, while the client and the server programs are free, where I plan to generate income is from renting server space for those who want a map up on a more stable, more capable, and more permanent server that can handle many connections as opposed to on their dialup which can handle 4 or 5 players tops. The feature that this game would have, is the ability to not only create your own maps using floors, walls, and objects from the default selection, but also the ability to create your own floors, walls, and objects easily with an editor that is similar to MS Paint.

I think, the best place to start would be the image editor itself, followed by the map editor, and then the client and finally server. The thing that is making this a bit more complicated is that I want to create my own file formats, for the objects. Basically I want to create a file that contains multiple images for multiple objects, floors, or walls. Each image itself would be in bitmap form, with each byte being a number that coresponds to a pallet entry on a global 256 color pallet. I say global, because I want this one pallet to be used for all images. I may hard code the pallet into the program or more likely have it in a single image file that would be the first to load, so that even it is editable by those who know what they're doing.

First a little info on how the final game will work. Basically, I will have a isometric view turned 45 degree's to the side. So you'll be facing North-East instead of due North. In the game, with a click of a button or keypress, you can turn the camera angle to any of four views, all isometric. This would be North-East, North-West, South-West, and South-East. As such, the map will need to be drawn in the correct order depending on the camera viewpoint, and each object and floor will have one, two, or four viewpoints. For objects that look the same from all angles, only one is needed. Objects that look the same from North-East and South-West view, but different for the South-East and North-West view, two images would be needed. And objects that look different for all four views will need four.

Add to this that while floors need only one image per view, objects will need two, acting as two layers. The first layer will be drawn first, followed by any player who is occupying the same space, followed by the second layer. This allows one to draw objects that surround a player, such as a barrel, or a chair with an arm that covers part of the player. There may be occasions where a floor tile might want this same effect such as when a player is wading in waist deep water, so I may consider doing the same there.

I've already figgured out a bit of how I'd like the file format to be, though I'm sure it could use some improvement.
First I'll start off with file header:
01h - 9 bytes - Version "v01.xx.xx" - This will be version information.
0Ah - 3 bytes - File Size - This is to compare with actual file size to check for corruption
0Dh - 1 byte - Number of objects
0Eh - 1 byte - Type of objects (0=floor, 1=object, 2=wall, 3=player) - May add more as needed.

There will be only one type of object per file, named floor.* or wall.* but the byte is in there again to check if someone has changed the file name or done something else.

Then at byte 10h I'll start a table with a list of objects. Each object in this table will need to be same number of bytes, so I'll go with the first byte being object number, then several flags such as "walkable", "sittable", "gettable", and "tradable". I may come up with more later, so I'll padd these a bit to make room if I do. Then will come several bytes that simply tell the byte of the file for the start of each image. Sort of like Pointers. Objects that only need one image, will have all four pointing to the same byte. Objects that need four will have the four pointing to different locations within the file. There will also, for objects that are gettable (can be held in inventory), a fifth pointer to a 32x32 2D inventory image, which will show up in inventory when the object is held.

Then of course the images will have other information.. the Object will need a X and Y offset to show where the object is in relation to the position on the map. And each layer in an object will need X and Y offsets to show where they should be drawn in relation to the Object's X and Y coordinates. There is also, a need to figgure in the Players X and Y offsets in relation to this object, for if they are occupying the same space, we may need to move them. Such as on top of the table, or waist deep in the river, etc.

As you can see, I've got one heck of a project to work on, and I'd like to see if I can find some help, first in creating a window with an editor to create this file format, and how to load these images from this file format and have them share the same pallet, including a transparent color, and make them editable. Can anyone help me get this off the ground? I've looked for tutorials but most blitblt or other painting tutorials have me working with a class object that I gather is getting the pallet from the image it's loading. Where as this file format won't have the pallet included.

Any help or pointers would be good. Also, any suggestions on how I can improve what I've described so far?

P.S. if anyone is wondering how I will tell which object viewpoint to show when even the map viewpoint isn't certain.. If I number the map viewpoints from 0 to 3, and the object view points from 0 to 3.. then as they plop the object onto the map and turn it, I can take the current map viewpoint, the object viewpoint as it relates to the map, add those togeather, devide by 4, and the remainder will be the object image to use. Simple, huh?

Also, I know I've given too much info away in this single post.. there's more I havn't mentioned but I kinda don't want to make too much information on this game publically available untill I get it off the ground. If anyone wants to help with any of this, I am willing to share the information. Again, it's not the game itself that I plan to use to generate income, but rather hosting servers for those willing to rent.

Oh yea.. almost forgot. I'd like to do this in C or C++, and I now there's an option of using DirectDraw, which if i can find a way to feed it the proper images from the format I just laid out, I have no quams to figguring out how to use it. Otherwise, I'll need to figgure out how to get Blitblt to work.
Rafkin is offline   Reply With Quote