Clackdor Posted January 28, 2012 Share Posted January 28, 2012 What method would be correct for implementing a mini-map? I figure it would be a second camera, positioned high above the character facing down. How do you add that to the framework? Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted January 29, 2012 Share Posted January 29, 2012 I would not recommend that at all. It means that you would be doing extra rendering which isn't necessary. So basically you need to get a 2D image map or alternatively you can go to your scene, go really high and take a screenshot facing down. Now the trick is to only display a section of that map that your character is in. I'm not entirely sure how to do that with just 2D, However, you could make a 3D plane glue it to the camera and set your map as the texture. You would have to move the UV's with code as your player moves. This, however, could be troublesome as Editing UV's on the fly is probably the slowest thing a graphics card can do. That being said if the plane only has 4 vertices maybe it won't be such a problem. I'd prefer it if you could just show a part of a 2D image but I have no idea how to do this. Maybe someone could enlighten me Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Canardia Posted January 29, 2012 Share Posted January 29, 2012 You can render the minimap every 1 second or even every 5 seconds, so it doesn't take any FPS. And when it's only like a 128x128 buffer, it renders very fast anyway. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted January 29, 2012 Share Posted January 29, 2012 Yeh I guess that would work. However, it depends how you want your mini map to look. I personally like it to not look like the game itself and more like a map. However, that's just my preference. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Clackdor Posted January 29, 2012 Author Share Posted January 29, 2012 So, a couple of options. A camera high above the world or a 2D texture that you only show a part. It looks like I would need to render whichever to a buffer. How, is that done then displayed as part of the GUI? Quote Link to comment Share on other sites More sharing options...
Canardia Posted January 29, 2012 Share Posted January 29, 2012 The easiest and most powerful way is to make a 3D mesh on which you paint the texture. Then you can also rotate and tilt it like in Crysis HUD. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 29, 2012 Share Posted January 29, 2012 The easiest way would be DrawImage. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Flexman Posted January 29, 2012 Share Posted January 29, 2012 What level of detail is needed on it? Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted January 29, 2012 Share Posted January 29, 2012 The easiest way would be DrawImage. Yes this would be my preference. But how do you only draw part of an image? fill me in if you know Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Canardia Posted January 29, 2012 Share Posted January 29, 2012 You don't need the full image, as it would only take more FPS to render. Just render a 128x128 bitmap, but with DrawImage you can't make it round etc..., so still easier to PaintTexture it on a 3D mesh. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 29, 2012 Share Posted January 29, 2012 Yes this would be my preference. But how do you only draw part of an image? fill me in if you know It was with reference to an overhead cam and a render to texture. @Mika ... really? where was the stipulation it had to be round? ... oh thats right .. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Clackdor Posted January 29, 2012 Author Share Posted January 29, 2012 So a 3D mesh, that is parented to the camera so it appear to be on the 2D plane with the rest of the graphics? Then use DrawImage to put any icons or such on there. I can see how you would get item positions and translate them to coordinates on the mesh, but I'm not sure how to render a portion of an image onto the 3D mesh we've created, especially making it move with the character. Quote Link to comment Share on other sites More sharing options...
Clackdor Posted January 30, 2012 Author Share Posted January 30, 2012 There is at least one library available for editing pictures in C++ http://www.imagemagick.org/Magick++/tutorial/Magick++_tutorial.pdf Unfortunately, it seems like the method they use would not be adequate for what would be required as the functions would copy a file, then load to memory, then crop and rotate. Thats a lot to do in a loop. Basically, just need a way to display only a portion of the dds file, whetehr it is painted to a plane or shown with DrawImage(); Quote Link to comment Share on other sites More sharing options...
Rick Posted January 30, 2012 Share Posted January 30, 2012 I've always been surprised LE doesn't have a Blit type function. http://en.wikipedia.org/wiki/Bit_blit Quote Link to comment Share on other sites More sharing options...
Clackdor Posted January 30, 2012 Author Share Posted January 30, 2012 What about writing a shader that navigates around the texture? I'd have to learn how to write a shader.... Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 31, 2012 Share Posted January 31, 2012 What about writing a shader that navigates around the texture? I'd have to learn how to write a shader.... I don't know anything about coding shaders, so I cant advise there or even speculate at any impacts that approach may have, you could always use OpenGL to "scroll" about a loaded image, write your own "DrawImage2" function that would adjust the image origin to a new position then scale the image up and output to the screen. Of course then you'd have to put contraints on that "movement" to prevent going off the "map" and stop unwanted tiling. In Furious Frank I did not bother with a map just an Enemy radar which relied on DrawImage, 3D maths, a spherical coordinate system and some trigonometry. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
DaDonik Posted January 31, 2012 Share Posted January 31, 2012 Assuming you have a big texture which shows your map from above you could go ahead and paint that texture onto a plane. You can move the texture around on the plane without any shader knowledge. All you have to do is to change the UV coordinates of your plane's verticies via code. SetVertexTexCoords() is what you need for that. Changing the texture coordinates like this has a pretty big performance impact, so it should not be used all over the place, but i think for a minimap this is a good solution. You can rotate the plane to adjust the map to the players view direction. To get rid of the uglyness of a plane you can draw a nice round UI element over it, so that no one sees the edges and corners of the plane =) Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 31, 2012 Share Posted January 31, 2012 ok, I had a few mins so I based the scroll function off my OpenGL DrawAndRotateImage() function ... seems to work ok. A Simple Demo: Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Clackdor Posted January 31, 2012 Author Share Posted January 31, 2012 Thanks Marley. What OpenGL library do you recommend? Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 31, 2012 Share Posted January 31, 2012 BlitzMax has direct OpenGL support so you can use BlitzMax for direct OpenGL programming. If you want to go that route and I believe you are using c++ then, Masterxilo did a tutorial on the basics which might still be available. What I would recommend as you are just starting out is to use the overhead camera approach with a render to texture routine, this will eliminate a whole host of issues that need to be overcome when using a more complex approach, from tracking to actually making the map image. EDIT: Yes, Masterxilo's Tutorial is still available: http://www.leadwerks...for-drawing-r19 Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted February 1, 2012 Share Posted February 1, 2012 Cool. I was planning on getting to this some time myself. I think I'll try both methods and see which one works best XD, i.e. UV edits and the openGL drawing stuff. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Clackdor Posted February 1, 2012 Author Share Posted February 1, 2012 I want to try the overhead camera thing. How would I create a buffer and assign the second camera to it, while also maintaining my main camera? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.