I’m relatively new to Blender and the BGE, but have experience of other 3D modelling software and game engines.
I have a specific task that is quite simple, but before I get stuck into it, I’d like to ask your advice on whether the BGE is the right tool for the job.
For a theatrical production in which we use projected backdrops, I need to make some flying sequences. It’s supposed to look like the actors are on a magic carpet, so the animated backdrop behind them needs to show the terrain moving away from them. The terrain will mainly be a sandy desert with the odd rocky crag, oasis, camels, a town etc dotted over it.
I figured that the easiest way to produce this backdrop would be to make a simple flight sim, load up my large desert model and create a huge sky dome, and then record a flight over the desert as an AVI (or equivalent).
I already have a simple flight sim coded up in logic bricks, and it handles input from a PS3 controller.
Obviously, when flying, the viewpoint is higher, so the viewing distance is going to be further (unless I can make it hazy somehow). So my question is, can the BGE handle a really large terrain like that, and will a giant sky dome work?
Or if someone can point me at a tutorial about doing something like this I shall be eternally grateful.
how big 20km? 40km? ive done both. but be aware the bge will start to jitter when about 16000 away from the origin due to accuracy issues.
for your sky dome, it should be 18km radius, and set the shader to nodes, then plug your texture node right into the output, no material. this will prevent mist from affecting it.
then set your scene camera to 0.2 and 20,000 clipping. configure the mist to start at 14000 and be 4000 distance.
now create a python script on the the sky dome to copy the X and Y coordinates of the active camera. always(true pulse, first 3 dots on) -> python. create a game property “Z” and set it to boolean False.
the same script can be used for sun shadows. place the script on an empty with game property "Z " set True and parent the sun to it. move the sun up a ways and rotate the empty. configure shadows accordingly.
## Requires a game property "Z", type Boolean ##
import bge
owner = bge.logic.getCurrentController().owner
scene = bge.logic.getCurrentScene()
camera = scene.active_camera
owner.worldPosition[0] = camera.worldPosition[0]
owner.worldPosition[1] = camera.worldPosition[1]
if owner["Z"] == True:
owner.worldPosition[2] = camera.worldPosition[2]
im away from my computer for a bit, but if you want a blend, then i will make one.
I make maritime routes and have 45 made around the UK coastline which I might start putting back on line. These are 25 km to 45 kilometers. Also smaller size 16 made at 20,000 meters. However I would like to know myself what the the future will be for large routes before I work on them again, and will they still be suitable for download? Meaning will future simulations still be able to run if you have Blender installed or will it change to stand alone which would make it impossible for me to make them available for download due to the increase in size maybe tenfold? Things seem very vague at present regarding simulations in the Blender Game Engine in the future!
The number of faces influence render speed and detail.
The size of textures influence memory usage and detail.
The dimensions (mm, meter, km, light years) has impact on precision [a mm is not visible when the object is a km away from camera].
This means there is no need to create large dimensions. When you scale up your terrain it will look exactly the same as when you scale it down.
Be aware there is a camera frustum with a clipping start and clipping end (camera tab). Only what is inside the frustum will be rendered. You can change the distances of the camera to see the complete terrain. Increasing the clipping distance decreases the precision, which can results in render artifacts (pixels renders in the wrong order).
yes, in short.
long answer is you need to plan carefully when making any game and especially large scale games, my current project is model based terrain and uses 81 “tiles” all with LOD. I am still relatively new to BGE/UPBGE but I am not really getting any significant frame drops from my level(singular) and it is 20k X 20K,although the edges serve no purpose but eye candy…playable area is closer to 18kx18k. I do not use any splat map shaders on it but model out and texture each facet of it…grass areas, dirt etc…the one difference is that there are no vertical faces…those get closed off with cliff and stone models which also have lod’s I also make sue of occluder geometry in some corner cases…room interiors for example are simple cubes with occlusion so as to hide all interior content…be aware that occluders do not have any physics though…I highly recommend checking you tube for some tutorials on LOD, occlusion, and texture maps…using a texture atlas or reusing textures where you can and keeping the resolution down helps a lot…
another thing I’ve noticed that eats a lot of frames is alpha testing and sorting…I actually ended up modeling my tree leafy parts to not use any alpha maps…so far few have really noticed it and it helps drastically with your frame rate if you have a few thousand trees…you can get away with a lot is you plan it out well…I’ve also found that if you have areas with too many trees, rocks, grass etc…you can get rid of half of the trees and make the other half a bit larger to soak up the space…small objects do not need to be seen from far off so just come up with a way to cull them out at fr distances
Do not run a lot of functions if your player is not going to be nearby to notice
wash repeat…anything the camera does not see…generally does not need to exist…try to find ways to exploit that.
what monster said is correct about the camera clipping…my far clip is set around 3k with a max setting of 5k while in third person…if you are in first person it scales upward with the near at 2 meters and the far from 4k to 8k…in first person you can often get away with more…I realize that 2 meters is high, but it is only usable out doors…anyway no one has the perfect answer for every scenario, hopefully you will have enough info now to research it on your own or tinker until you find a solution for your given project.
I mentioned I made 45 maritime routes around the UK coastline 25 to 45 km and 16 at 20 km based on srtm2 data as I regard Blender having the possibilites and functions to make realistic large, true to life maritime routes! I won’t say say too much as posts tend to get shunted on these forum, however is it about ‘furthering the cause’ so to speak, for maritime routes as open source in Blender.
To keep on course the preceeding posts have given me food for thought as regards sizing up or down these maritime routes. Maritime routes are mainly coastal and river terrain and sea but do you make them small and scale up or large and scale down. Animation I currently set to 1 from default 25 . To enable me to continue to make the routes available for download, if Blender alters to make the routes seperate and not integrated, the 10 megs of routes now on line might need 100 megs each in the future so making the routes available for download as a rolling sequence, as they follow around the coast, would be impossible as regards bandwidth.
Also I use 3DEM to make the srtm2 data for the routes so I need to know will 3DEM still work in windows 10 as I am using windows 7. 3DEM is not supported and about dozen years old but it has been made available for download and is free.
There are a lot more questions but if if specific posts about simulations are swamped by a myriad posts about small games and artistic scenes, or shunted to different forums there no point in me posting further. Srtm2 terrain Script also has now altered, also ‘apparently’ changing to payware and 30 meter srtm2 from 90 meter. So I have changed to using greyscale and displace function from a height map using 3DEM! Still works well for coastal and river maritime…up to 45 km approx. Tested the Full isle of Man route down to quarter size by altering the scale boxes from 1 to 0.25 and camera from 30,000 meters down to 10,000…so maybe that is the way to go?
I think you have more practical experience on large terrain than I have. According to your posts I guess the above question can be answered with - yes :D.
barry, i have seen your work (which is pretty boss btw) and your camera setup (3rd pov at distance) allows for much larger enviroments.
the twitching at 16km is really obvious when your in first person, and your aircraft shakes around you like its going to fly apart. its very dizzying… lucky i have 3rd pov cameras too.
game play itsself is stable (walking around) even up to 64km.
I will have to review how to carry on with these maritime routes as been on the verge of abandoning them on a few occasions.
Maybe few seaplanes with floats then we could have both ships and planes in the one route. No need for the airports then. My boats used to fly off into space occasionally until I changed from ‘dynamic’ to 'rigid body’setting.
Remade the remade, using just greyscale for the Isle of Man, reduced to a quarter of 42 kilometers. Made the roaming camera for 8 kilometers. and the schooner reduced to similaR size, logic bricks reduces by a quarter. The rise and fall of water sheet for wave swell was ‘tricky’ to adjust in timeline. I will leave the rock texture for now and might upload it later today for download.
If I can get used to the system for the alterations using greyscale texture on one meter plane and subdivide 8 times makes 66,000 vertices I might change to the reduced size system for all future routes. Might have a better chance of continuing to work in the future updated to BGE. So instead of a model train routes it is model virtual model boat routes.
So any constructive help or hints might be useful, but not about textures as that’s for later.
Wow! What a fantastic response in answer to a newbie question. Many thanks to all of you- you have filled me with confidence (even if I don’t fully understand all of the replies!)
The viewing distance doesn’t have to be too high- maybe only a couple of km - I don’t mind if it fades into the mist - the most important thing is giving the illusion of flight. However, I need to make 3 different flights over the desert, each having different features to fly over to vary things a bit. The longest flight has to be about 3 minutes, so if my magic carpet flies at 20kph (who knows how fast they would fly!), then I guess I only need to fly for 1 km.
From the answers given, I’m guessing that would be no real problem for the BGE. Most of the terrain will be desert with the odd low-poly feature here and there, so I don’t think my scene will be too demanding.
Not sure how you are making the terrain but easy using greyscale colours black to white 0 to 255 of the aea than generate it with displace modifier. Last part of page srtm2 ver 2 to download area.
To open/see the file, I use 3DEM then select the area wanted. Problem is though although 3DEM is still available it is not supported, as about dozen years old. No idea if it will work with windows 10 but OK windows 7 (perhaps somebody could test it and post). Then make greyscale map and colour terrain map… with 3DEM. The rest then is Blender’s part. Terrain can made in half an hour more or less. Barry
You can use OpenStreet map for the co-ordinates longitude and latitude. I use square area.
I just press export then you can select an area showing lat and long.
im in the process of making a setup based off the SRTM 1 arc GeoTIFF data found at https://earthexplorer.usgs.gov/ of the grand canyon. it wont be all that pretty, but it should serve the purpose.
That is an excellent starting point for me. Thanks very much. I really appreciate it.
I only hope that someday I’ll be able to contribute as much to the community.
Thanks again.