kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 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 appI 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 More sharing options...
Displaced Posted July 5, 2011 Share Posted July 5, 2011 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.so0, 1, 2, 3, 4, 5, 6, 78, 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 More sharing options...
kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 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 modDatabaseEdit: 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 replyKriogenic Link to comment Share on other sites More sharing options...
Displaced Posted July 5, 2011 Share Posted July 5, 2011 no it doesn't "render" the map, it just load it into the maprecthe maprec can be found in modTypes.Thats how the map looks like in the memory. Link to comment Share on other sites More sharing options...
Rithy58 Posted July 5, 2011 Share Posted July 5, 2011 Oh, well that's pretty simpleEclipse 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 = 2Map.Tile(1, 1).Layer(1).Y = 2Map.Tile(1, 1).Layer(1).TileSet = 2What 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 More sharing options...
kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 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 More sharing options...
kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 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_Graphicsto try load map1.dathowever my picture box remains blank any idea what else is needed? Link to comment Share on other sites More sharing options...
Rithy58 Posted July 5, 2011 Share Posted July 5, 2011 What's your picture box name? And you're missing a bunch of code so idk if they're correct.Sincerely,Rithy Link to comment Share on other sites More sharing options...
kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 form name - frmMainpicture box - picScreenI am usingmodConstantsmodDatabasemodDirectDraw7modEnumerationsmodGeneralmodGlobalsmodtypesthen I am using the above code in frmMains load function to try display map data Link to comment Share on other sites More sharing options...
Rithy58 Posted July 5, 2011 Share Posted July 5, 2011 I'm not very good with DirectX7 but I think I know enough to help you, I just finished my Auto-Tile System :DCan 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 More sharing options...
kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 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 More sharing options...
Rithy58 Posted July 5, 2011 Share Posted July 5, 2011 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,RithyPS: I hope what I told you is correct cause I'm not very experience. Link to comment Share on other sites More sharing options...
kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 Hey there,I've done as you said and called Render_Graphics and the picture box does not updateI am stuck on what to try next. I am unsure how the dx7 functions work Link to comment Share on other sites More sharing options...
Rithy58 Posted July 5, 2011 Share Posted July 5, 2011 Same here. I have to eat but when I'm back, I'm interested in helping you achieving this.Is there a way for us to work together? And can we talk over IM?My MSN, AIM, Yahoo, Skype :[email protected][email protected][email protected]Rithy58 (skype)Sincerely,Rithy Link to comment Share on other sites More sharing options...
kriogenic Posted July 5, 2011 Author Share Posted July 5, 2011 hey I just added you on MSN, ill be on in a couple of minutes just grabbing a bite to eat myself. Thanks for helping with this. I appreciate it. Link to comment Share on other sites More sharing options...
Rithy58 Posted July 5, 2011 Share Posted July 5, 2011 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 More sharing options...
kriogenic Posted July 6, 2011 Author Share Posted July 6, 2011 Yes, Thanks for updating the post I'm on prepaid internet and it ran out last night sorry for suddenly dissapearing. Link to comment Share on other sites More sharing options...
Rithy58 Posted July 6, 2011 Share Posted July 6, 2011 Okay I got it. The problem was, apparently render_graphics on Form_Load doesn't work.I had to make a button that On_Click render_graphics.Sincerely,Rithy Link to comment Share on other sites More sharing options...
blkcrow Posted July 6, 2011 Share Posted July 6, 2011 put me.show before render_graphics in the form_load or add render_graphics at Form_Activation Link to comment Share on other sites More sharing options...
Rithy58 Posted July 6, 2011 Share Posted July 6, 2011 We actually got everything working.Scrolling and static map, etc.Sincerley,Rithy Link to comment Share on other sites More sharing options...
kriogenic Posted July 6, 2011 Author Share Posted July 6, 2011 Yeah everything is working great now, Thanks again Rithy for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now