Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How maps work?


kriogenic
 Share

Recommended Posts

Hey there,

I was just wondering how the maps in origins are rendered.

I would like to use a map I designed in my eclipse server in a totally different visual basic 6 app
I have just not worked out how to read and render the maps correctly i only need the images displayed i dont need to keep weather or not the tile is walkable.

If some one could help me out with some information that would be great.
Thanks,
Kriogenic
Link to comment
Share on other sites

actually, in a 2D Grid.

and every 2D grid is deployed with a tileset and a number for that tileset. If i remember correctly, it starts with 0… from left to right and from top down.
so
0, 1, 2, 3, 4, 5, 6, 7
8, 9....

What more informations do you need?
you'll find anything in the modTypes and for rendering in modDX7 or something.
Link to comment
Share on other sites

Well I was actually wondering how the map data itself was stored in the map01.ext so i could write my own function for reading it. however i have found a Public Sub LoadMap(ByVal MapNum As Long) in modDatabase

Edit: I beleive this is the code which makes this 2D array you were talking about. I am unsure how it is rendered from here to produce the map within a picturebox.

Sorry for all the questions and seeming stupid. Also thanks for the quick reply
Kriogenic
Link to comment
Share on other sites

Oh, well that's pretty simple

Eclipse Origin cache the date in User-Define Types(UDT)
You can see the data type in modTypes.
There are many layers of tiles, and each tile have 3 data. X, Y and TileSet.
Here's an example :
Map.Tile(1, 1).Layer(1).X = 2
Map.Tile(1, 1).Layer(1).Y = 2
Map.Tile(1, 1).Layer(1).TileSet = 2

What that mean is, the Map's tile at (1, 1)on layer 1 will have a tile from the tileset 2.bmp, coordinate (2, 2)
The tile set and the map is a 2D grid with each box the size of 32 pixel x 32 pixel.

EDIT : I didn't see the rendering. Yes, it does render the map using DirectDraw7\. It draw each tile on the map, using the data from MapRec.

Sincerely,
Rithy
Link to comment
Share on other sites

Ahhh yes I see,

I now have all the functions I believe needed to get the graphic to display. I've gotten loadmap to actually load the map files into a maprec and dx7 to initalize correctly am I missing something to actually get it from there rendered into the picbox?

Thanks. I've looked everywhere I guess just not hard enough.
Link to comment
Share on other sites

Alright well I went through the DX7 module and found a Render_Graphics sub which i then called and :( got no map display I am trying this

> If Not InitDirectDraw Then
>         MsgBox "Error Initializing DirectX7 - DirectDraw."
>     End If
>     LoadMap (1)
>     Call Render_Graphics

to try load map1.dat

however my picture box remains blank any idea what else is needed?
Link to comment
Share on other sites

I'm not very good with DirectX7 but I think I know enough to help you, I just finished my Auto-Tile System :D

Can you explain to me what your goal is? And are those the modules you added into the project?

Sincerely,
Rithy
Link to comment
Share on other sites

Those are the modules from Eclipse which I added into my project which gives me the correct globals and constants the other types i need and methods.

my goal is to JUST display the map graphics guess you could call it a map viewer? give it location of GFX and map.dat and it will display that map. The non walkable tile info can be discarded.

Thanks for the help
Link to comment
Share on other sites

Ahh, okay.

Here's what I would do, do all the Rendering in modDirectDraw.
Keep only the stuff you need like BltMapTile and BltMapFringe, etc.
Then, in render_graphic, only loop the BltMapTile and BltMapFringe for each of the tile.
Make a button in frmMain. When click, call Render_Graphic.

Sincerely,
Rithy

PS: I hope what I told you is correct cause I'm not very experience.
Link to comment
Share on other sites

We were trying to do this and we got everything, except Rendering the Map.

So, we load the maps, and we were able to read the data such as Map.Name, Map.MaxX, etc.
We loaded the TileSets and Initialized DirectDraw + Surfaces. Well I think we did.
But we couldn't BltMapTile to the picScreen. picScreen was just blank.

Can someone please explain to us how the engine render the map?

Sincerely,
Rithy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...