Infinite map in Unity 3D - unity3d

I'm working on my first project on Unity 3D, I'm making an endless racing 3D. I took a highway asset from the Unity Store. The road isn't straight, it has many curves and is very long. I would ask you: how do I make the road endless?

You can create a few patterns, and all of this patterns can start and end with straight road, so you can design however u want between this two straight road :)
after you create 5-10 patterns like this after that you can instantiate this patterns behind and behind so i think this will work four you :)

Related

Can i flag SPECIFIC areas of a Tilemap in Unity?

I am making a 2D top down racing game in Unity
I have made 18 tracks, all with tilemaps and colliders attached to those tilemaps.
I am trying to introduce a new system, let me explain.
I have 4 different FULL tiles: Road, Trackside Grass, Grass, Water.
I also have many tiles that are e.g. half road half trackside grass to make certain areas smooth
I can't separate tilemaps because of the half/half tiles.
How can i try to flag certain areas? Or am i gonna have to spend months redesigning all the systems?
I don't want to redesign the system. I tried the tilemap separation on 1 of the tracks and the problem with half/half tiles happened. Please try to help me, i would be very gratefull
i hope someone helps me its been a while

Unity, how to make NavMesh Agents climb obstacles from any point around it?

So I'm working on a game where I want my AI to be able to smoothly climb obstacles from any point around the obstacle but I'm having a hard time trying to figure out how to do this. I know I can use off mesh links to have enemies go on to obstacles but the problem is that they all funnel from a single point and it looks very unnatural. Now I could make a bunch of off mesh links for each obstacle, but I have a lot of obstacles I want to be climbable and that's not very efficient.
Is there a good way to go about this that I can make all of my AI climb at any point around an obstacle? I'm currently using A* Pathfinding but this is kind of a must for my game so any ideas regardless of if A* can do it are welcome.

SCNPhysicsVehicle SCNPhysicsVehicleWheel Road Issue

I am testing on a little car game using Apple's SceneKit, to simulate the car behavior I'm using SCNPhysicsVehicle class.
For the first development steps I drove the car on a big area. This worked fine. I've set up all the car variables so that it felt like expected.
In the next step I wanted to build the road. Naturally the road should consist of parts so I can create different racing tracks.
Here is where the trouble begins.
I just made a straight road consisting of 50 blocks. The blocks line up a 100% perfect.
Anyway the car bumps and "jumps" in every place where two road blocks meet.
For better understanding I made a Video showing the wired behavior.
Did anyone ran in the same issue? What I'm doing wrong?
Any thoughts or suggestions would be appreciated.

Large scene scene in Unity, far bigger than one Terrain?

Imagine a large free-roam game in Unity,
The yellow size indicates about the largest you can make a typical Terrain in Unity.
Art dept. will completely build, meter by meter, the entire scene.
Please note, this has absolutely no connection to repeating scenery (as in runners) or procedural scenery (as in say some race games).
Really, what is the correct and good way to do this in Unity?
use say 50 or so terrains, each perhaps 100m x 100m ?
can you even have or use that many terrains?
or what?
For anyone googling here.
The correct solution is indeed
Terrain stitching
that's it.
In practice you must use one of the tools available to do this (eg, TerrainFormer) or, your team will write from scratch a terrain stitcher.
Yes, you just use "many terrains".
The best approach to the exact problem posed,
is in fact to just:
"use lots of Terrains".
It seems to be perfectly viable in Unity to have many (dozens) of Terrain units, basically "sitting next to each other".
In practice, you'll need TerrainFormer
https://assetstore.unity.com/packages/tools/terrain/terrain-former-20052
or one of the similar tools.
(Or, I suppose, from scratch write your own tool to stitch terrains, and allow you manipulate them all at once, join the edge-heights perfectly, etc etc.)
It's not realistically possible to just perfectly sit many Terrains together (by hand), matching all the edges, etc etc. So you're going to need a "stitcher" package for putting many Terrain squares together.
So, this huge area ..
has about 12 Terrain.
So that's the answer, you can indeed have "many, many" Terrain in a Unity project, you do indeed essentially just "sit them next to each other". In practice it's not achievable unless you use one of the editor tools such as TerrainFormer.
The proper way to do this would have been with procedural mesh generation with MeshFilter and Mesh API but you mentioned that this not at all random or generative so that one is eliminated.
It's just simply a very long, thin, hand-made environment
The best way in this case would be a Modular Level Design. You need to create Modular Assets. With this you can have a long road in pieces which can be tileable. A good modeling artist should be able to create and texture modular assets with 3D modeling packages like Blender, Maya or 3ds Max.
All the programmer has to do is make each asset a prefab then use the Instantiate function to instantiate them to create any distance of environment. You can also create a static environment in the scene from the Editor. Almost anything can be made into a modular Asset especially buildings and roads.
After assembling them in Unity, you can do static batch on all the instantiated modular parts with Unity's StaticBatchingUtility.Combine to improve performance of the game since they are not being moved.
Below is an example of a modular road asset that can be used to create almost any amount of road:
You already answered your question
in this case would it be better to not bother with Unity's otherwise excellent Terrain, and the modellers would just outright build the long course/scenery? (Obviously you'd have to chunk it so it all occludes fine)
I think it's the way to go. If the performance is an issue, try putting each chunk in different scenes and then have a master scene to load them async and additively. And of course you want to unload each scene as it becomes invisible in the camera.
I personally go with your own solution which is letting the Unity Occlusion Culling system to take care of the hiding and showing chunks. I only go with the separate scenes approach if I'm not getting enough performance this way.
I recently had the same problem. We build a tilebased infinite runner with road crossings. The camera was positioned behind and over the car looking down on the street and the player car. So the setup is quite comparable.
We used Curvy from the Asset store to create paths for moving the player and also for creating the geometry of the streets and the surroundings among the streets.
https://assetstore.unity.com/packages/tools/level-design/curvy-splines-7038
It is also easy to spawn tiles with curvy paths and combine them at runtime. So you can separate long distances into smaller segments and spawn them randomly.
We also used QuickBrush from ProCore to quickly paint environment detail to the geometry like trees, bushes or stones. I think procore tools are now implemented in the new Unity 2018 version.
Worked quite well.

scnBox with scnTube through the middle

I have been digging around trying to find a way to show a game board of sorts.
It is basically a square board with a round hole in the middle, I am able to render the scnBox and the scnTube, but I would like the area where the scnTube sits in the box for the box to be transparent and see through the game board, but can't seem to find anywhere that has an example. Any help would be much appreciated. I am hoping that I am just missing something very simple, but this is my first time using scene kit.
Thank you.
Before Unreal Engine 4, (UDK and prior) Epic's modelling space was subtraction - a filled block was your game world and its extents. From inside this block you took chunks out to create space for players to run around in, and shoot each other. All's fair in love and war.
I'm telling you this because it's a good example of how contrived 3D modelling is compared to real world scenarios, and should (hopefully) put you at sufficient unease to digest what follows.
This approach of carving out of a finite block is still in Unreal Engine 4 and popular with older users, but it now defaults to an open, infinite world into which things are added. Most new users gravitate towards building into an infinite space of nothingness rather than carving space out of a solid, finite block.
Everything about 3D modelling is virtual, and virtually impossible to relate to the real world. Instead of thinking in terms of how things could be done if objects were real and literal, you need to think in terms of the limitations (and there are many) of geometry definitions as used in most 3D modelling and game engines.
The programming equivalent of this mental gymnastics is going from the concept of classes and objects to their realities within languages and frameworks. On the one hand the ideas and their ideals are wonderful, and on the other the realities are a bleak reminder that programming languages haven't really progressed very far, at all.
3D modelling is exactly like this. It's not much further along than it was decades ago, and is still using archaic ways to solve many of its original problems.
Cutting a nice, clean, efficient round hole in a cube is one such original problem.
A very simple shape is being intersected and cut by a shape with the potential for infinite complexity. What should happen? Should the simple become complex or the complex become simple? How to make the most graceful transition between the two?
That's the problem you're facing: a cube is a simple geometric shape, easily defined by minimal line segments. A cylinder introduces infinite possibilities for line segmentation around its circumference.
So somewhere along the lines of development, the architects of 3D modelling had to come up with a way to make these contrasting line complexities play well together for lightweight presentation on limited hardware. Their solution, in most cases, is a hybrid and a disaster of user operability, but masterful in its geometric efficiency: Polygon modelling, UVW unwrapping and subdivision!
All of which means that if you want to achieve this in the best way possible, with today's tools, for the purposes of Scene Kit, I suggest polygon modelling this board in Maya for 4 reasons.
It's got a 30 day free trial.
It works on a Mac
It's polygon modelling tools are second only to 3ds Max
It's easier to learn (for a complete newcomer) than MODO, and miles easier to learn than Blender.
MODO is interesting if you're already skilled in Polygon modelling, but it's so utterly discombobulating if you don't have that prior experience that I'd recommend using just about anything else first. Except Blender. Blender is free, but don't be tempted. It will cost you more in learning time than buying a copy of every other professional 3D app.
In MODO's favour, and the reason I mention it, it does export nicely for Scene Kit. I know that for a fact, but am not yet sure how well Maya exports for Scene Kit.
Which is the next problem you're going to come up against. All COLLADA files are not born equal.
New Maya does have Unity and Unreal export presets, so I presume it's possible to calibrate its COLLADA exports to match the demands of Scene Kit perfectly, just haven't yet needed to do it. This will (very likely) involve trial and error to get the settings right. It would be nice if Apple would tell us exactly how to configure export from all major 3D apps for Scene Kit, but instead they're giving us the half baked Model I/O, so we can double the effort of importing artwork.
All context aside (which has largely been to demonstrate that 3D is no simpler nor more refined than using an IDE and frameworks like Xcode and Cocoa), here's the meat and potatoes:
A video on one aspect of what's best to make holes, and starts out as you are, with a cube and a cylinder:
https://www.youtube.com/watch?v=zaEv5rio8bk
But it does presume a certain amount of Maya familiarity, some of which you can gain from this rather slow and ponderous examination of two other ways to make holes in cubes:
https://www.youtube.com/watch?v=lvMfoH5Ikrc
Yes, if you're counting, that's 3 ways to make holes. Actually four, because the first video starts with the boolean operation you might have been expecting to be how this could/should be done. In some parallel future we'll have well working boolean geometry operations. We're not there, yet.
Hopefully that same parallel future will offer us a programming language, frameworks and terminology that's not confusing and maintains metaphors long enough to make teaching easy and usage elegant and simple.
I dont know about that long answer but this can be achieved with Boolean Subtraction. You create a cube and a cylinder. You subtract the cylinder from the cube. In 3ds Max this is under compound objects-modifiers-boolean subtraction. I guess Maya has a similair function somwhere in the menus.