VeTaL Posted May 11, 2010 Share Posted May 11, 2010 As Leadwerks doesn't allow dynamically terrain system, i decided to write own editor for that. It consists of DLL with functionality and EXE with form for view. Main idea is simple: global world (it can be very large) is separated to small terrain parts, lets call them "cells" (for now, they are 512*512 and there are only 4 cells). They can group into one "region" (for now, 4 cells with 512*512 size can be grouped into one terrain 1024*1024, that engine can load). How those cells are stored and their size is unnecessary information for all team, except maybe one programmer. So, artist just select needed region (now he may press "Generate" button), and DynTerWerks Editor generate region from 4 cells and loads new terrain in Leadwerks Editor. DynTerWerks editor now minimized and waiting, when artist would finish his work with LE Editor. When he finish editing this region, he just press Save button in Leadwerks Editor and close it, then DynTerWerks editor opens again, it split region into cells and save them, so artist can see them now in DTW Editor. DONE: DLL DLL is written on C++, so this functions can be called from the game without additional problems. v.1 - grouping RAW height-maps 512 to 1024, and 1024 to 2048. - splitting RAW height-maps 1024 to 512 and 2048 to 1024. v.2 - grouping PNG 512 to 1024. - splitting PNG 1024 to 512. /*********************************************************************************************************/ EDITOR Editor is written on C#, this would cause the faster development. v.1 - showing RAW files on the form. - generating new terrain. - loading terrain in Editor. v.2 - add dynamic cells loading: map cells must be stored in format "i@j.raw" for correct parsing. - add dynamic cells drawing (pictures are searched in folder). - add statusStrip with usefull info. - add menuStrip. - add Settings form. - add runtime cell generation. - move map files to directories. - icon changed. - save editor settings (pathes to directories with maps) to xml file. - if xml file with settings dont exist or some settings cant be read, new one is created and set all settings by defult. - user can change editor settings with Settings form. - add possibility of editing just one cell. /*********************************************************************************************************/ TODO: - add possibility to edit one region (4 cells). - fix terrain rotation problems. - add build-in viewer instead of editor (or with editor). - add DDS (or PNG) normal-map support. - add general map image zoom and movings. - add trigger in game, when new terrain may generates. - show this in game. - dynamic selection of regions with mouse in TerraDyne Editor. - add TinyXml and save project configs in XML files. - wait, till Josh would add multithread loading , so i would be able to load new region during gameplay, so player would see a large world without loads. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Flexman Posted May 11, 2010 Share Posted May 11, 2010 I'd be tempted to call it "Groundwerks" as you're starting from the ground up but you wanted a smart name. It's all very interesting. I like the idea of having cells paged in if it didn't cause too much stuttering. Microsoft FSX did loading and preparing terrain cells in another thread and every alternate frame to spread the load. This doesn't seem like an easy task but I'll be following what you do with it. There are other possible issues to resolve too, physics, world size and floating point error. Camera relative rendering would go a long way to fix juddering I think but I don't know enough about the LE internals to even guess at how you could make that work. Just Cause 2 uses 64 bit floats for all positional data to deal with that problem. There's a feature on it somewhere I'll try and locate. But kudos to your approach. I hope it can be made to work. Thumbs up here. 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...
VeTaL Posted May 11, 2010 Author Share Posted May 11, 2010 Thanks for answer. About number of memory - i think, some test needed to find perfect balance between loading time and terrain size. High-map of 512 terrain weights 512Kb, High-map of 1024 terrain is 2Mb and 2048 is 8Mb... other variable is size of cells: i can create one 2048 region from 4 * 1024, or 9 * 682 (as cells can be any parts, not only 512/1024/2048), or something like that... tests are needed anyway About physics there may not be a problem: i plan just to freeze the world, load new geometry (better, if in another thread, so i would be needed to change pointer from one to another), then move dynamic objects to new coordinates(as they don't save on geometry, this looking like annoying problem, but i hope that one control function may deal this problem) and unfreeze it. This can be longer than one frame, but... i dont know the better solution. About floating point error: every time the center of the would would be near player. As new map would create, center would move to the center of new landscape. Preparing terrain cells in each frame is a good idea, but i dont think that it would works good for Leadwerks. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Canardia Posted May 11, 2010 Share Posted May 11, 2010 TerADynE (=Terrain Advanced Dynamic Editor) 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...
VeTaL Posted May 11, 2010 Author Share Posted May 11, 2010 Wow, Lumooja, i like it Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
omid3098 Posted May 12, 2010 Share Posted May 12, 2010 this tool would be great for racing games or flight games.. however it's not our current project but truely it would very usefull. thanks Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
VeTaL Posted May 13, 2010 Author Share Posted May 13, 2010 And for RPG/FPS Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Raul Posted May 13, 2010 Share Posted May 13, 2010 I do not think that a racing game would need such a BIG terrain system Quote i5 2.7Ghz, GTS 450, 8GB Ram, Win7 x64; Win8 x64 rvlgames.com - my games RVL Games Facebook Page, YouTube Channel Blitzmax Link to comment Share on other sites More sharing options...
omid3098 Posted May 13, 2010 Share Posted May 13, 2010 I was thinking on something like "Fule"! Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
VeTaL Posted May 13, 2010 Author Share Posted May 13, 2010 This must be not a BIG terrain system, its can be just infinity (if random terrain generator would be added) Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Pancakes Posted May 14, 2010 Share Posted May 14, 2010 TeraDycTile! (Terrific Terrain Dynamic Tiles) Quote Core I5 2.67 / 16GB RAM / GTX 670 Zbrush/ Blender / Photoshop CS6 / Renoise / Genetica / Leadwerks 3 Link to comment Share on other sites More sharing options...
VeTaL Posted July 20, 2010 Author Share Posted July 20, 2010 Here i am again I returned to this project some days ago, but for these days i do a lot of interesting (or sometimes not) stuff, like changing icon, adding some functionality, adding xml files with settings and so on (first post is updated). Now user can add cells in runtime and different parts of project are in different folders (for example, all cells in one folder that called TDMaps, temporary maps are in folder that called TDTempMaps ) and even more: user can re-define names of that folders from setting window, so they would be stored in XML file. Even if that XML file would be lost or corrupted, editor would generate new file automatically, you would need just re-define your new folder names. Also, i added possibility to edit only one cell, edit the whole region (4 grouped cells, with is really the most ineresting feature of this editor) and now i'm planing to add a viewer, that would provide fast viewing of cell, without loading whole editor. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted July 20, 2010 Share Posted July 20, 2010 cool. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted October 22, 2010 Author Share Posted October 22, 2010 Okay, i almost finished with terrains, so now is question where i'm stuck in (and looking like i missed it out previous time): how to load model from another thread, independent from gameplay? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Rick Posted October 22, 2010 Share Posted October 22, 2010 That's been talked about many times and I think the outcome is always that it doesn't seem possible. I think this will prove to be a bigger hurdle than the terrain loading. Quote Link to comment Share on other sites More sharing options...
VeTaL Posted October 23, 2010 Author Share Posted October 23, 2010 I know that there were a lot of talks about it, but i thought that i would be able to manage with threading code from here http://leadwerks.com/werkspace/index.php?/topic/2287-public-domainish-c-code/ I tried with creation another opengl context in another thread, but still no large progress now. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
ArBuZ Posted October 23, 2010 Share Posted October 23, 2010 I'm not quiet sure, but on the old forum there was a guy Pushedx I think. I remember he was talking something about making work LE in parallel threads. Or I might be wrong. It was a long time ago. Here is some post I found, but not sure if its has any importance for you. Maybe there is more related posts, I dont know. (http://forum.leadwerks.com/viewtopic.php?f=3&t=3635&hilit=thread) Btw Pushedx was a cool community member. He knew so many things and helped people a lot. I wonder where did he go? Why did he left our community? Quote Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64 3ds max / photoshop CS3 / C++ http://www.arbuznikov.com Link to comment Share on other sites More sharing options...
VeTaL Posted October 23, 2010 Author Share Posted October 23, 2010 Great, ArBuZ, on the first sight this is right what i need... I'll look into it deeper. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted October 27, 2010 Author Share Posted October 27, 2010 This works fine, i'll add video soon. Quote Working on LeaFAQ 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.