Jump to content


Photo

Game Maker 3D Terrain Editor (GMTE)


  • Please log in to reply
58 replies to this topic

#21 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 19 April 2010 - 04:51 PM

I had finally time to upload a slightly updated version to another host.
I also included the source code/gmk file.

See first post.

Maybe this thread could be moved to "3D Editable Examples" or something now.
  • 0

#22 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 01 May 2010 - 06:40 PM

Replace the "if(var_doHeightChange) {...}" part in the second script in the Begin Step event of obj_controller with
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.

  • 0

#23 Koratanu

Koratanu

    GMC Member

  • New Member
  • 27 posts

Posted 07 May 2010 - 08:07 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.
  • 0

#24 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 07 May 2010 - 06:15 PM

Hi, I'm glad you like my work!

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.
  • 0

#25 gadgetkk

gadgetkk

    GMC Member

  • GMC Member
  • 215 posts
  • Version:Unknown

Posted 16 June 2010 - 07:19 AM

So can you actually use this with GM for making maps and such?
  • 0

#26 rade134

rade134

    GMC Member

  • New Member
  • 211 posts

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?
  • 0

#27 MasterOfKings

MasterOfKings

    The True Master

  • GMC Member
  • 4888 posts
  • Version:GM8

Posted 17 July 2010 - 02:58 PM

I liked how it worked, but how can we use the terrain we make? All I can see is how to create a map, but not how to produce any file or script to draw it on a game...

-MoK
  • 0

#28 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 19 July 2010 - 05:09 PM

Sweet. Finally I get to learn from the source itself.

Edited by freko, 19 July 2010 - 05:30 PM.

  • 0

#29 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 17 August 2010 - 10:13 AM

I'll upload an improved version of this soon, featuring much faster texture painting using surfaces (working by using the surface fix extension).
  • 0

#30 Izaak

Izaak

    GMC Member

  • New Member
  • 11 posts

Posted 17 August 2010 - 02:00 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
  • 0

#31 3D2DGAMES

3D2DGAMES

    GMC Member

  • GMC Member
  • 638 posts

Posted 17 August 2010 - 02:57 PM

anyway to get the source to run in GM8? sprite_create_from_screen does not have the same arguments in GM8 as earlier versions.
  • 0

#32 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 17 August 2010 - 03:36 PM

I know of this issue. It'll be fixed in the coming update/new source. Stay tuned...
  • 0

#33 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

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
  • 0

#34 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 17 August 2010 - 05:13 PM

New update (1.2)

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.
  • 0

#35 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 17 August 2010 - 06:46 PM

Is that a proper link?
The hurricane-eye site is down and I have to register at dropbox
  • 0

#36 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 17 August 2010 - 07:16 PM

The link is still on the Hurricane-Eye website ( which is not down: http://www.hurricane...raineditor.html ). I didn't include a link in the above post since it's just still the same link on the website.

Edited by Master Xilo, 17 August 2010 - 07:27 PM.

  • 0

#37 Izaak

Izaak

    GMC Member

  • New Member
  • 11 posts

Posted 17 August 2010 - 08:30 PM

thank you guys for trying to help me but both of the files you linked dont match up with game maker 8
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 :D

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 :P

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.

  • 0

#38 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

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.

  • 0

#39 Izaak

Izaak

    GMC Member

  • New Member
  • 11 posts

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 :D thank you guys apreciate the help
  • 0

#40 Izaak

Izaak

    GMC Member

  • New Member
  • 11 posts

Posted 18 August 2010 - 02:27 PM

after 4 hours of work i finaly got the updated tool to work lol
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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users