H-Mode7 - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Material Development (https://www.save-point.org/forum-8.html) +--- Forum: Scripts Database (https://www.save-point.org/forum-39.html) +---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html) +---- Thread: H-Mode7 (/thread-3151.html) |
H-Mode7 - MGC - 12-22-2010 RMXP : H-Mode7 Engine
Version: 1.4.4 Introduction This engine is an alternative to the NeoMode7 engine. While the purpose of the NeoM7 is to emulate the Mode7 feature of the NES, this new engine go further in the 3D feeling. The main cause of negative feedbacks regarding the NeoM7 is that the map seems too flat, like a paper sheet. The HM7 engine is a response to these critics. It handles heightmaps so that the rendered map is embossed. The relief is not very pronounced, so this engine is more suited for worldmaps-like maps, where graphical elements are small. The script might be hard to master, because it requires specific graphics and it is important to understand how the elements are drawn to create them properly. Therefore this script is not suited for RM beginners. Features
V1.2 :
V1.2.1 :
V1.2.2 :
V1.3 : LOOK AT THE BOTTOM OF THIS THREAD V1.3.1 :
V1.3.2 :
V1.4 :
V1.4.1 :
V1.4.2 :
V1.4.3 :
V1.4.4 :
Screenshots Download link HERE (Script + DLL - V1.4) and The DLL's source code How does it work ? This script modifies a Bitmap object that represents the screen. It's a 640*480/480*360/320*240 Bitmap object (depending on the chosen resolution), contained in a sprite that is displayed over the panorama but below all other sprites. For each pixel of this bitmap is calculated a corresponding map pixel to display, by a 3D projection of a textured polygon (the map). Then a vertical offset is determined depending on the slant, the ground heightmaps and the tiles heightmaps for the three layers. All the pixels between the original position and its offset are drawn : that makes the map "embossed". Heightmaps : A heightmap is a greyscale picture that contains heights data for each pixel. Black areas mean no height offset, whereas white areas mean a maximum height offset. The maximum height offset has a fixed value of 32 pixels, so a tile with an entirely white heightmap will be rendered as a cube. - ground heightmap You can associate a heightmap to a RMXP map (optionnal) that will be used to add an embossing effect independently to the 3-layers tiles. The heightmap is automatically stretched to the dimensions of the RMXP map, by using a linear interpolation. Ground heightmaps files, named "Heightmap_XXX" (XXX representing an identification number), shall be placed in the "Pictures" folder. - tiles heightmaps They are gathered into a set similar to the map tileset. A "heightmapset", named "[tileset name]_Hmap" and placed in the "Tilesets" folder, is mandatory for each tileset used in a HM7 map. - autotiles heightmaps It is the same system here. A heightmap that corresponds graphically to the autotile file, named "[autotile name]_Hmap", can be placed in the "Autotiles" folder (it's optionnal). Is there an easy way to create heightmaps ? Nope. For simple patterns you can use your favorite image manipulation program. For more complex objects, a solution is to use a 3D modeler, then apply a gradient texture and retrieve a top view picture. Vertical textures : By default, when drawing a screen pixel, all pixels between the "ground" (altitude 0) and the computed altitude are filled with the color of the target pixel. When the slope is too important (vertical walls, by example), it is inelegant : To solve this problem, you can use a texturemap per tile : it is a picture composed of five 32*32 px² areas : a colormap and four different vertical textures (one for each side). The colormap is a four-color area (red, green, blue, black) that coincide with the tile : for a screen pixel, when the source pixel of the map is determined, the correponding pixel on the colormap indicates which vertical texture shall be applied (Red => first texture, Green => second texture, Blue => third texture, Black => fourth texture). A transparent pixel in a texturemap means that the color of the source pixel of the map will be used. Texturesets must be placed in a "Tilesets/[tileset name]_Textures" folder, and must be named "Texture_[tile index]". The tile index represents its position in the tileset (the first index is 0). NEW (01/01/2011) : DerVVulman's help file for textures : Help file - autotiles textures There is only one colormap for all autotiles, named "Texture_Auto". It must be placed in a "Autotiles/Textures" folder (it is mandatory). Texturesets, containing only the four vertical textures, must also be placed in that folder. They must be named "Texture_[autotile name]". Misc : - The automatic lighting effect is not adjustable for the moment (but you can deactivate it). That means that shadows have always the same orientation and length. - As character sprites are always above the HM7 sprite, they are not used to display characters (otherwise characters could not be behind map elements). Characters are rendered directly in the HM7 bitmap, and thus there are limitations : transparency and blend type are ignored. - By default characters are drawn at the maximal altitude of their coordinates : ground + 3 layers. You can activate the bush flag in the tilesets tab of the database to have the altitude of the tile ignored when drawing characters. Instructions What is required : - the script (above main, as usual) - the file MGC_Hmode7.dll at the root of your project - specific autotiles, tilesets, textures and heightmaps To activate the H-Mode7, you must add [HM7] to the map name. The following tags are optionnal : [HMAPXXX] : XXX is the identifier of the ground heightmap that must be used for the map [#XX] : XX is the angle of slant (in degree) : 0 -> 80, 0 by default [%XXX] : XXX is the angle of rotation (in degree) : 0 -> 359, 0 by default [X] : enable horizontal map looping [Y] : enable vertical map looping [DA] : deactivate animated autotiles [AFXXX] : XXX is the animations period for animated autotiles : 1 -> 999, 20 frames by default [DL] : deactivate automatic lighting effects [RX] : X = 1 -> high resolution (default) X = 2 -> medium resolution (to increase performance) X = 3 -> low resolution (to drastically increase performance) [CX] : X = 0 -> no vertical offset (default) X = 1 -> vertical offset so that the camera do not cut the ground at the bottom of the screen. Should be used only when the horizon is visible. X = 2 -> vertical offset so that the camera do not cut the map at the bottom of the screen. Should be used only when the horizon is visible. X = 3 -> vertical offset so that the player is always in the center of the screen. [DF] : deactivate the filter (better quality, drastically decrease performance) [HF] : refresh the map every two frames (less fluent, increase performance) [E] (V.1.2.1) : edmhotta's request to have less cut elements at the bottom of the screen. May cause massive lag, especially when rotating. [DB] (V.1.2.1) : cut elements at the bottom of the screen are not filled with black (but they're still cut). You can also associate a keyword to a configuration at the beginning of the script. For example, with the following command : HM7::Maps_Settings["MyKeyword"] = ["#60", "X", "HMAP3"] if a map name contains "MyKeyword", then the HM7 will be activated, with a slant angle of 60 degrees, horizontal looping, and using the picture "Heightmap_003" as ground heightmap. Commands - To set a new angle of slant (0~80) : $scene.hm7_set_alpha(new angle) To slide progressively into a new angle of slant : $scene.hm7_to_alpha(new angle, speed) To increase/decrease the slant : $scene.hm7_increase_alpha(value) - To set a new angle of rotation (0~379) : $scene.hm7_set_theta(new angle) To slide progressively into a new angle of rotation : $scene.hm7_to_theta(angle, speed, dir) To increase/decrease the angle of rotation : $scene.hm7_increase_theta(value) - To set a new zoom level (in percentage - default = 100) : $scene.hm7_set_zoom(new value) To slide progressively into a new zoom level : $scene.hm7_to_zoom(value, speed) To increase/decrease the zoom level : $scene.hm7_increase_zoom(value) - To change the horizon light fading : $scene.hm7_set_fading(red, green, blue, flag) flag = 1 : the color determined by (red, green, blue) will be added to the horizon line flag = 0 : the color determined by (red, green, blue) will be substracted to the horizon line - To set the altitude of an event : add a comment in the commands list with : "Altitude X", where X is the height value ("Altitude 64" will draw the event 64 pixels above its original position) - To set the altitude of the player : use : $game_player.altitude = X - To have a fixed altitude for an event (not dependant on the maps heights) : add the comment "Floating" in the commands list - To have a fixed altitude for the player : use : $game_player.floating = true VERSION 1.3 :
Author's notes For the moment there is only a handful of tileset elements compatible with this script. It would be really great if anyone that creates such elements decides to share them. Open Source DLL! Now available, the source code for the DLL which handles the specially rendered graphics is now available. The request for the source code was made by finalholylight, and is now available in the link here, and just below the demo's own download link. The DLL's source code Thanks - DerVVulfman for his help file about textures RE: [RMXP] H-Mode7 - Kirito - 12-23-2010 Dude, I'd just like to say, YOU FUCKING ROCK! ( sorry for the bad language, but, it was necessary ) RE: [RMXP] H-Mode7 - PK8 - 12-23-2010 I've only checked out the demo so far and it is incredible! MGC, once again, you never cease to amaze me with your scripting ability. I am loving this! *goes to open the project and play around with the editor* RE: [RMXP] H-Mode7 - Agckuu Coceg - 12-23-2010 HOLY JEEZ!!! That's a beats up all of scripts then I see before!!! RE: [RMXP] H-Mode7 - MGC - 12-23-2010 Thank you all for your support ! With a few imagination, it's possible to obtain a T-RPG map (it's just a test) : RE: [RMXP] H-Mode7 - Kristovski - 12-23-2010 Tried out the demo. I came in my pants and then your script slapped me in the face and called me a pussy. The only problem I have with it is the fact it doesn't re-orient the direction controls when you rotate the map. RE: [RMXP] H-Mode7 - MGC - 12-23-2010 > Kristovski : I updated the demo with a special add-on for you. That should solve your problem. RE: [RMXP] H-Mode7 - Hsia_Nu - 12-23-2010 wow mgc what an achievment! I cant wait to try this out when I get home! congratulations! RE: [RMXP] H-Mode7 - DerVVulfman - 12-25-2010 *DerVVulfman faints* OMG. Do I have to update my system with this? Unbelievable! *DerVVulfman goes to scripting* Heightmaps only reach 32px in height? Could a later version support other heights so one could be able to craft nice wall enclosures? And seeing how you have MGC_ISO Engine in your 'working on' sig, I don't see that combining the two would be difficult now. That chase-view plugin... Nice... RE: [RMXP] H-Mode7 - MGC - 12-26-2010 Quote:Heightmaps only reach 32px in height? Could a later version support other heights so one could be able to craft nice wall enclosures? I think that's possible (but not beyond a height of 8 tiles). I just made some tests with all heights doubled, and there seemed to have no supplementary lag. The main problem is the configuration. Perhaps I'll have to create a small external tool to associate tiles with theirs heights and textures. Quote:And seeing how you have MGC_ISO Engine in your 'working on' sig, I don't see that combining the two would be difficult now. For the moment, it's still really difficult, because the ISO engine works with a 3D gameplay, wheareas the HM7 modifies only what is displayed on the screen. |