Game Maker 3D Terrain Editor (GMTE)
#21
Posted 19 April 2010 - 04:51 PM
I also included the source code/gmk file.
See first post.
Maybe this thread could be moved to "3D Editable Examples" or something now.
#22
Posted 01 May 2010 - 06:40 PM
if(var_doHeightChange)
{
var mousePatchPosX, iRadius, icx, icy, changespeed;
iRadius = ceil(var_circlesize/TER_PATCHSIZE);
changespeed = var_changespeed * TER_CHANGESPEED * global.APPSPEED;
icx = round(global.x_mouse/TER_PATCHSIZE);
icy = round(global.y_mouse/TER_PATCHSIZE);
var beginx, beginy, endx, endy;
beginx = icx - iRadius; beginy = icy - iRadius;
endx = icx + iRadius; endy = icy + iRadius;
// Height editing with cubic falloff.
// f(r) = MAX_VALUE*((2 * r - 3) * r * r + 1)
// Source http://daz.med.upenn.edu/~rob/povray3/htdocs/pov30028.html
for (_x = beginx; _x < endx; _x += 1)
{
for (_y = beginy; _y < endy; _y += 1)
{
if (_x < 0 || _y < 0 || _x > obj_ground.var_terwidth || _y > obj_ground.var_terheight)
continue;
var dist, r, changeval;
dist = sqrt(sqr(_x - icx) + sqr(_y - icy));
r = max(min(1, dist/iRadius),0); // reldist, relative (0-1) radius
changeval = changespeed * ((2 * r - 3) * r * r + 1) * dir;
//if (reldist > 1 ||reldist < 0)show_error("reldist > 1 ||reldist < 0: reldist = "+string(reldist),false);
ds_grid_set(obj_ground.terrain_grid, _x, _y, ds_grid_get(obj_ground.terrain_grid,_x,_y) + changeval);
}
}
obj_ground.change_pos[0,0] = beginx - 1;
obj_ground.change_pos[0,1] = beginy - 1;
obj_ground.change_pos[1,0] = endx + 1;
obj_ground.change_pos[1,1] = endy + 1;
}to get smoother hills (with real cubic interpolation/falloff).
Edited by Master Xilo, 01 May 2010 - 06:41 PM.
#23
Posted 07 May 2010 - 08:07 AM
I have fallen in love with your editor after only having it for less than a week, and have already begun to add to it. So far I added saving terrains, loading terrains(limited), loading .obj models, and a nice effect to where if you lower the terrain past point 0, you get ditches/lakes/ocean filled with water. I am interested in using this to build levels for a game (slash have fun pretending to be God haha), but I'm having 2 roadblocks so far:
1. Creating new objects to be rendered isnt working, even using the d3d_3d_setting() script you provided and use for the terrain model. Any d3d drawing functions I use in the draw event of obj_ground work, but all other objects draw functions just appear on the screen as 2-dimensional objects. I was hoping, for better logistics with objects, to use d3d in other object's draw event. Is this just a tricky camera/view setup that I havent figured out or something more?
2. With my loading function, how would I refresh the terrain to update from terrain_grid? Currently, I must use a terrain brush on a light setting to bring everything slowly to the loaded grid z values. What I need help understanding is just what calls the model to update.
I am terribly sorry if these are noob questions, as I am vastly more experienced with Xtreme3D, and your math/coding is quite elegant. I will continue to tinker with this, but it would be nice to have direction from the maker, rather than continue to reverse engineer.
Thanks in advance
PS sorry if this is wordy or verbose.
#24
Posted 07 May 2010 - 06:15 PM
1. This should just work. Have a look at obj_ground or obj_controller, they both draw 3d stuff in their drawing methods just fine. Make sure your object has depth=0.
2.
The terrain updates at every "end step" event it's grid points from (change_pos[0,0]|change_pos[0,1]=0) to (change_pos[1,0]|change_pos[1,1]).
To update the whole terrain, do what obj_ground does in it's create event:
change_pos[0,0]=0; change_pos[0,1]=0; change_pos[1,0]=var_terwidth+1; change_pos[1,1]=var_terheight+1;
I'm actually currently working on making this even more efficient, especially the texture painting by using surfaces instead of create_sprite_from_screen.
I'm also trying to make the code even more understandable.
#25
Posted 16 June 2010 - 07:19 AM
#26
Posted 16 June 2010 - 09:37 AM
Hey masterxilo,
I have fallen in love with your editor after only having it for less than a week, and have already begun to add to it. So far I added saving terrains, loading terrains(limited), loading .obj models, and a nice effect to where if you lower the terrain past point 0, you get ditches/lakes/ocean filled with water. I am interested in using this to build levels for a game (slash have fun pretending to be God haha), but I'm having 2 roadblocks so far:
1. Creating new objects to be rendered isnt working, even using the d3d_3d_setting() script you provided and use for the terrain model. Any d3d drawing functions I use in the draw event of obj_ground work, but all other objects draw functions just appear on the screen as 2-dimensional objects. I was hoping, for better logistics with objects, to use d3d in other object's draw event. Is this just a tricky camera/view setup that I havent figured out or something more?
2. With my loading function, how would I refresh the terrain to update from terrain_grid? Currently, I must use a terrain brush on a light setting to bring everything slowly to the loaded grid z values. What I need help understanding is just what calls the model to update.
I am terribly sorry if these are noob questions, as I am vastly more experienced with Xtreme3D, and your math/coding is quite elegant. I will continue to tinker with this, but it would be nice to have direction from the maker, rather than continue to reverse engineer.
Thanks in advance
PS sorry if this is wordy or verbose.
I would love to have your version of the map maker with saving functions. Can you you upload it so I can download it?
#27
Posted 17 July 2010 - 02:58 PM
-MoK
#28
Posted 19 July 2010 - 05:09 PM
Edited by freko, 19 July 2010 - 05:30 PM.
#29
Posted 17 August 2010 - 10:13 AM
#30
Posted 17 August 2010 - 02:00 PM
could you put in a load and save map function?
i have tried it for 8 hours in a row to get it in but im new to game maker
i did get it in but it didnt save the edits i made in the map , only the blank map
i hope you can fix this so i can start making terain for my game.
greetings izaak
#31
Posted 17 August 2010 - 02:57 PM
#32
Posted 17 August 2010 - 03:36 PM
#33
Posted 17 August 2010 - 04:52 PM
this tool is by far the best i found on this website execpt for the saving part
could you put in a load and save map function?
i have tried it for 8 hours in a row to get it in but im new to game maker
i did get it in but it didnt save the edits i made in the map , only the blank map
i hope you can fix this so i can start making terain for my game.
greetings izaak
If your looking in for saving and loading, try this engine which is based on same master xilo's one & thank "irregular" for that part
#34
Posted 17 August 2010 - 05:13 PM
I uploaded a new version which features (despite the new direct download link achieved by uploading it to Dropbox' public folder):
- Unlimited zoom
- Faster texture painting
- (Optional) Fullscreen view
- Cleaner source code
Again, feel free to play around with the source gmk. For example, to change the terrain size and texture resolution, play around with the
TER_MODEL_PATCHCOUNT and TER_SIZE_IN_MODELS constants.
#35
Posted 17 August 2010 - 06:46 PM
The hurricane-eye site is down and I have to register at dropbox
#36
Posted 17 August 2010 - 07:16 PM
Edited by Master Xilo, 17 August 2010 - 07:27 PM.
#37
Posted 17 August 2010 - 08:30 PM
i need one that works like this one but wich dous save and load the map for game maker 8
im teaching myself by following tutorials how to script stuff in so eventualy il get it
if u do by any chanse find a way to get it to work in gm 8 with save and load game please let me know
because this version is a good one were u can pull up the mountains and stuff changing it
it makes me think back to when i played world of warcraft hehe
getting the map editor to work like i need it is the last thing on my to do list
then i can start making games with game maker
i never made a game be4 in game maker to be honest but i do know that my first game wil be 3d and kick ass , also i wil give credits to all tools and scripts makers.
Edited by Izaak, 17 August 2010 - 08:37 PM.
#38
Posted 17 August 2010 - 08:48 PM
http://www.hurricane-eye.webs.com/gmterraineditor.html
I don't.. I'm unable to access the site
edit:
Okay got it now after switching to a proxy IP.
@ Izaak
You just need to tweak down the background & sprite functions in the scripts and you are good to go.
But you'll need a lot of learning since you are new to game maker
Edited by freko, 18 August 2010 - 08:08 AM.
#39
Posted 18 August 2010 - 10:22 AM
http://www.hurricane-eye.webs.com/gmterraineditor.html
I don't.. I'm unable to access the site
edit:
Okay got it now after switching to a proxy IP.
@ Izaak
You just need to tweak down the background & sprite functions in the scripts and you are good to go.
But you'll need a lot of learning since you are new to game maker
im not gonna say that i cant do it but its gonna take a bit for me to get it working the way that i want but
im gonna try to do what youve just said ive looked up script errors in gm8 and iam trying to find a solution
thank you when its 100% working il let u know
#40
Posted 18 August 2010 - 02:27 PM
i dont know how you do it but its awsome.
i even found a way to add textures so i can get more grounds xD
but in this version you also did not add a save version or a load version.
i have tried over diffrent save and load engines , even with encrypts on it but i really cant do it.
i hope in youre next update you wil add this to youre tool because this tool is too sexah xD
thank you for reading my post i really hope you wil add xD
because this is the only tool naabs like me can understand hehe.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











