Creating static objects
This page will explain the recommended way of modeling static objects (including vegetation) for BeamNG.
The suggested workflow is to begin with a list of assets grouped by type (industrial_buildings, oak_trees etc), sketch them (for reference), model them in single documents based on the types, create small documents with individual objects, and finally export from those objects into the game.
List of assets
Creating a list of assets helps you to work through your project, gives you an understanding of the work involved and your current progress and can help motivate you. It is recommended that you group your assets into types as this makes it easier to create the list and read it. You don't have to be extremely specific, here is an example list.
- 5x apartment blocks (British style)
- 2x small petrol station
- 4x small country house
- 1x pub
Concept art is recommended, though not strictly essential. This is best done with rough sketches of what you want to achieve. There are two major benefits of creating concept art; firstly it helps to kill off bad ideas early and with minimal time wasted and secondly it speeds up the modeling process because you don't have to think too much about what you're modeling, just model it.
Things to consider
- Keep in mind where the player will likely view the object from (above, side, front, below) and model it accordingly; don't waste polygons detailing the inside of a building which cannot be entered
- Make sure you keep memory use as low as possible, use tiling textures and common materials where possible and try to keep texture sizes low
- Use lods where possible; the better you use LODs the better performance can be
- For buildings you can often delete the whole interior from the LODs since you won't be able to see it from outside anyway
- For vegetation you should keep in mind that transparent textures will cause a lot of slowdown when in large amounts
- When constructing trees you should build them from samples (a sample might be a branch or something) and then copy it again and again for your tree; this way you can vertex paint it once and not have to worry about it (just make sure you get it right)
- It's a good idea to model all objects of a similar type in a single document; this makes it easier to see how they compare to each other (size, shape, materials) and speeds up the modeling process
- Create a reference for object scale when modeling (such as a 2m high rectangle to represent a person); this will help you to understand how the object will look in the game.
Modeling static objects
When you have a list of objects and some concept sketches of them modeling should be fairly straight forward. You should begin by getting materials set up (especially important for modeling vegetation) as this will make it easier to understand how the final object will look. Next model one of your objects. You should model it in the highest detail you plan on using in the game, or at the maximum detail required for baking (if you are using a unique material for the object/s) first.
When you are happy with it copy it and place it above before simplifying it for a level of detail (LOD) mesh. You should generally make a lod use 50% or less polygons than the mesh before it (if your main mesh is 1000 polygons try to make your first lod 500 or less).
You'll want to make your LODs as close as you can to the main mesh in their overall appearance or they will "pop" in when you approach them in the game. Sometimes you can stretch parts of the model to fill gaps created by deleting smaller, higher complexity parts of the mesh. Things like cylinders can be simplified quite a lot in LODs without being noticeable; you might have a 12 sided cylinder for the main mesh but a 3 sided one may be sufficient for a LOD.
The number of LODs varies on an individual object basis. As a general rule you should at least halve the complexity every LOD where possible until the mesh is extremely simple (~10 > 50 polygons). You can then use an "empty" called "bb__autobillboard25" in your final export file to generate billboards for the object (2 polygons).
Most meshes will have a main mesh, one to two LOD meshes and a billboard.
The collision mesh is what your vehicle will collide with. This can be your main visible mesh or a LOD mesh but it is strongly recommended that you create a custom mesh to avoid wasting processing power. It should be as simple as possible, however, keep the following in mind when making your meshes:
- Objects with collision meshes smaller than 300mm wide will cause your vehicle to get stuck in a crash, it is recommended you ensure the narrowest part of your meshes are 350mm to 400mm wide at a minimum
- Crashing into sharp angles on objects can cause problems, to avoid this you can make objects like power poles at least 5 sided cylinders, 6 is recommended
- Ensure your normals face outwards or the object will eat cars
**Note for writers: Please explain how to set up a static object's collision in a 3D application (Blender, Maya, 3Ds, etc.) and how to set it up in Torque 3D**
Here's a tutorial for Sketchup users coutesy of jammin2222
If you don't understand any step In the video post on this thread : http://www.beamng.com/threads/7216-TUTORIAL-Sketchup-tutorial-for-LOD-and-Collision-meshes-(not-visible-mesh-collisions)?highlight=collision+mesh
Obviously If you know a better program like Blender or similar then this tutorial is not for you as sketchup is lacking features on the texture side of things. None the less you can make a fun map with it.
I hope somebody finds this helpful
https://www.youtube.com/watch?v=zPvc2YFsoC0&feature=player_embedded <-- This video link is unavailable. Needs to be replaced.
Edit: Extra Info jammin left out of the video
Video Tutorial for setting up collisions by NadeoX1: https://www.youtube.com/watch?v=nJgTI-bGtQk
When it comes to naming the collision mesh Colmesh-1 If there is more than one item showing below then name the others in this convention. Colmesh-2 Colmesh-3 ect. (See Picture)
•If you mess up and have no idea what you did wrong and want to start over:
Delete all instances of the model from the map in game (Not the .dae files and folders). Go to the folder for your models and delete the .cs file for the offending model. Delete all the cached.dts files relating to the model and save the map. Reload and try setting it up again.
•If your map crashes when you load it and your models looked/worked fine when you exited last:
Check the.cs files for any errors/typos. Sometimes if you do things in the wrong order or if you delete a detail level and add it back in, it can cause the steps in the .cs file to save in the wrong order. (I noticed if the imposter line in the .cs file was above the lower detail models it would crash for example. This happens when you have set up a model and gone back in and deleted/re added a LOD ) Correct the error if you spotted it or Just delete the .cs file and reload the map and set it up again.
•I need to re import part of my model again:
The high detail model is simple, just overwrite the original and job done. The lower detail models and collision meshes will most likely need to be set up from scratch again. If you just overwrite them then depending on what you changed it might work or you might find chunks of your model missing. You can try deleting the cached.dts file for the offending LOD (found in your folder with your models) and reloading the map, if that fails then just see my first point above.
Helpful plugins for sketchup that I have found so far are: CleanUp³ (removes unnecessary crap from your model and reduces the file size. Can have unexpected results if you don't understand the options, but undo will fix any cock ups) CLF Shape Bender (good for making long bendy inclines) Eneroth Upright Extruder (similar to shape bender but different. Both are good in different situations)
These are free from the extension warehouse and there are heaps more there for free. I have yet to play with the UV texture plugins I have seen on there. feel free to share any cool plugins you know about. Anyway enough waffle.
Vegetation should be created using a 3D modeling program and then placed into a terrain using the forest editor tool. To make the foliage move realistically in the wind you need to use vertex painting on the areas you want to sway. The colours are as follows:
- Red – Branch movement, large, slow, vertical movement to simulate a branch moving in the wind.
- Green – “Delay”, used to make the sway less artificial, the amount of green should ideally be random.
- Blue – Detail movement, small, fast, horizontal movements to simulate leaves shaking.
- White – Full movement
- Black – No movement
Keep in mind that each vegetation object can all be tweaked individually to adjust the power. Also, make sure things that shouldn't move are black or your tree trunks are going to look really strange.