Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 14th Jan 2019 10:25
Hi everybody I've had AGK2 now for a year and written a couple of 2D games. I now wish to have a go at 3D . The problem is I have no idea how to create a 3D terrain . Could somebody please explain the procedure for doing this as I don't have a clue what's involved . Please help.
puzzler2018
User Banned
Posted: 14th Jan 2019 10:31 Edited at: 14th Jan 2019 10:31
Hi..

I have a thread called " my take on terrain"

But I don't have that link to hand at moment. But if you click my name and should see my threads

And I'm sure others will guide you too.

There is createobjectfromheightmap commands too.

I'll post the link a little later once I can get on here via the website instead of mobile
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 14th Jan 2019 11:21
AGK comes with a demo program in your projects folder. Its in the 3D/Terrain folder.

It shows an example of creating a 3D terrain from a simple 2D heightmap. This is worth looking at as a starting point
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 14th Jan 2019 11:33
Thanks for the input I'll go and take a look at the example . Thanks
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Jan 2019 19:32
Also there's a nice example in the phone app of a character controller moving round on terrain. Dunno if this is also included in the other versions..

PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 14th Jan 2019 21:55 Edited at: 14th Jan 2019 21:59
Quote: " Dunno if this is also included in the other versions.."


Not sure, but I think those demos may be different. I do know there is a 'church with moving light and animated 3D model' example that has terrain in it. edit: Nevermind, the 3D/Terrain example is a different one, but great one indeed.

Honestly, the terrain itself isn't the hard part, you can generate a terrain from an image using something like :

Those values may be a bit large for what you're looking for.

The hard part is deciding how you want to do collision detection, use the physics engine or use your own collision detection stuff (there's a specific command to get the terrainheightmap height called GetObjectHeightMapHeight(objid,x,z) , but you could also trace it yourself etc. ). I personally found it tricky to maintain good performance, but am still learning that part of AGK2.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 15th Jan 2019 11:29
Right got to start somewhere . Could somebody please explain what is and how to make a 2D height map. Could I make one with mtpaint which is what I used to do my 2D stuff.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 15th Jan 2019 11:57
Well it seems I need a height map generator anybody know where I can find one for free .
puzzler2018
User Banned
Posted: 15th Jan 2019 12:29 Edited at: 15th Jan 2019 12:31
I'm not really sure of any. I'll have a look later for you

I'll create some code to create a gray scale map for you too if that helps. But at work at moment
puzzler2018
User Banned
Posted: 15th Jan 2019 12:39
here is my terrain from that thread, to help get you started - it has 2D perlin noise mapping too for you - Bonus!!!



Happy AppGameKit Coding...
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 15th Jan 2019 14:00 Edited at: 15th Jan 2019 14:02
Quote: "Right got to start somewhere . Could somebody please explain what is and how to make a 2D height map. Could I make one with mtpaint which is what I used to do my 2D stuff."


ANY image can be used as a heightmap so you could use any image editing software ....mtpaint, photoshop, paint shop pro, MS Paint......, whatever you like really. Just save it as a png or jpg.

Black pixels will be the lowest land, grey will be middle height and white will be the highest points on the landscape created. Actually, only the red channel is used so a red image (with varying brightneses of red) is all you really need.

Try any 256x256 pixel image in the CreateObjectFromHeightmap() function and you will get some terrain. Its really very easy.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 15th Jan 2019 14:53
I found an app called world machine I am thinking this looks useful but not cheap for the commercial version. 119 dollars for indie developer . Got the free basic version to have a look at . I'm beginning to get how it's done now. sort of .
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 15th Jan 2019 17:03
I probably would invest in a good digital painting application instead to be honest (something like Asesprite or something similarly decent, doesn't have to be pixel art focused). Not saying World Machine is bad, but one should ask themselves the question whether the 'world machine' result would match whatever game you intend to make. In other words, if the terrain has super realistic textures, then so does everything else in how it has to match that. I'd say more 'stylized' terrains or stuff you've drawn yourself would work better most of the time.

Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 15th Jan 2019 19:23 Edited at: 15th Jan 2019 19:26
I second what Bengismo said.

This video is from a heightmap I created in GIMP, and saved at 2048X2048. I don't think that size is useable on mobile, though, so you won't get the level of detail.



You can also create land using Blender. Create a plane get to about a million vertices(less if you don't care about jagged edges), and start sculpting. You can save that as a 3d object or create a height map in blender.

Another option is using Cities Skyline editor. You can create terrain, and save it has a height map. I found this to be rather bland, but it is very quick.

Supposedly, you can get height maps from https://terrain.party/ I haven't had much luck, though.

edit: wanted to add you can also use unity and export the raw height map and use CreateObjectFromRawHeightMap
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Jan 2019 08:28 Edited at: 16th Jan 2019 08:53
Quote: "I need a height map generator anybody know where I can find one for free . "

This one is quite easy to use
https://directory.fsf.org/wiki/Height_Map_Generator
or you could do it with AppGameKit requires an image called "height.png" any image to start with that is PNG 8-bit greyscale or RGB,
if it is RGB then only the red channel is read. 16-bit greyscale support may be added in future. (taken from the agk help file on height maps)
and from memory I think the images have to be a power of 2 ie 256*256 ,512*512,1024*1024

the saved image can generally be found at c:\users\your name\AppData\local\AGKApps\name of this program
the above code draws an image suitable for a heightmap but allows you to see the changes as it does it
but personally the first option is better once you have an understanding how height maps work and is far quicker
to create them. Also many height map generators including free ones allow you to import proper height data
such as I could get the actual height data of Australia and place it into the height map generator to create a true
to scale height map of Australia (hahaha I live there) which really would only make a png image that I could then
import into AGK
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Jan 2019 09:00
and if you want to see pics of what can be done with real terrain data please
visit this old DBPro link and check out the pics of a game I worked on back then
https://forum.thegamecreators.com/thread/98449 The same can
be done with AppGameKit and height maps just haven't used real terrain data with AGK
yet
fubar
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 16th Jan 2019 15:06 Edited at: 16th Jan 2019 16:58
Personally I like these:
EarthSculptor

Above one I used in for Blitz3d to create a pretty large terrain with mountains and valleys, then saved the grayscale heightmap of 4096x4096 and accompanying large texture and added to that a detail texture with relief for looking better at close up near camera views.

Screenshots of what I used in Blitz3d, but in AppGameKit shouldn't be much different. Just to show that by simple means you can create some nice, albeit crude, terrain.
Note: the free demo version has a terrain heightmap image size limit of 256, which I circumvented somehow by stitching multiple heightmaps together and then scaled up to 4096 in a paint program( I think I used paint.net for that), This of course has some disadvantage as not seeing the map on screen as-is. So the pro version is recommended

(*the first one looks bit blurry for had to blow it up from a screenshot I saved low res)








TerreSculptor.
This one actually appears to have a free(standard version) which looks promising.
[EDIT: this is more a terrain generator than editor afaics, so not what I'd prefer for has too little control. No manual tools for elevation and such, just a bunch of procedural generators and filters to create a nice looking random terrain]
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Jan 2019 20:29 Edited at: 16th Jan 2019 20:53
Quote: "Well it seems I need a height map generator anybody know where I can find one for free ."


A heightmap could be made with any painting programm as being mentioned . We could do something as rudimentary as this ..




We can add some more brushes .

I'm not a grumpy grandpa

Attachments

Login to view attachments
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 18th Jan 2019 14:10 Edited at: 18th Jan 2019 14:11
@chafari
Could be my PC and didn't update to very latest AppGameKit version yet, but it appears to create the heightmap png, then doesn't display the heightmap itself, instead it just exits.
While from the code I got the impression it was your intention to do so.

BTW: Overal I'm fairly impressed by your coding skills, but a bit surprised by your usage of Goto, Gosub & Return, which you are free to use of course, but are considered legacy BASIC and may lead to the infamous spaghetti code. Therefor a bit out of fashion these days(not that that matters much ). Dunno if you're familiar with(perhaps you are and have your reasons), but most people favor "Function functionName ( optionalParameters) .. Endfunction optionalreturnvariable", which has the benefit of being easily portable into other parts of your code.

Other than that pretty good stuff you keep throwing out of your sleeves like nothing.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 18th Jan 2019 16:47
Quote: "Could be my PC and didn't update to very latest AppGameKit version yet, but it appears to create the heightmap png, then doesn't display the heightmap itself, instead it just exits."


What I try here is just create an image to be use as a heightmap . I save the image as heightmap.png .

Quote: " a bit surprised by your usage of Goto, Gosub & Return"


You have seen in some of my codes the goto command, but I normally never use it unless I know that I will never go back . In this little example I just put goto because I know that the user only will be able to see the final result .

I have in my old codes all kinda function that can be use in any code with just a little change . My coding skills are not to much in Agk ....I'm just translating some of my old codes from Dbpro and Freebasic . I've been a bit busy this week and have not coded at all but I'm coming soon
I'm not a grumpy grandpa
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 18th Jan 2019 18:14 Edited at: 19th Jan 2019 11:15
Can't wait to see your next marvels, for your have shown some really nifty stuff at quite a good pace.(I certainly can't do it at that rate).
Keep it up.
puzzler2018
User Banned
Posted: 19th Jan 2019 16:47
My take



Not as glamorous as everyone elses though
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th Jan 2019 11:16 Edited at: 20th Jan 2019 11:19
Thanks guys for your comments.

Quote: "
Not as glamorous as everyone elses though
"


That remember me Toscana spas lol

I'm not a grumpy grandpa

Attachments

Login to view attachments
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 21st Jan 2019 18:22
Hello,
you can take a look to the L3DT-Editor. There you can create a nice looking map in an easy way. The L3dt has a lot of export formats. Look at http://www.bundysoft.com/docs/doku.php?id=l3dt:formats:support and https://www.youtube.com/results?search_query=l3dt.

Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 24th Jan 2019 13:36
Thanks guys for all the help. I have just produced my first working piece of terrain using create object from height map . Now the ball is really rolling thanks you very much.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 24th Jan 2019 21:01 Edited at: 24th Jan 2019 21:05
Hope was of any help.
Even though I personally fancy the interface of EarthSculptor, apparently L3DT is planning to go Freeware and author will supply a key for the Pro version for 6 months.

Login to post a reply

Server time is: 2024-03-28 20:49:42
Your offset time is: 2024-03-28 20:49:42