|
Post by ariablutron98 on May 28, 2017 21:47:27 GMT
anyone know how to make an endless road in 3d rad for a game? chears!
|
|
|
Post by indiedev on May 29, 2017 8:36:43 GMT
short answer: you likely can't.
those games use procedural geneneration. in rad, with an advanced script, and randomized imposters you can do infinite terrain [no collision] and not really procedural as only scale/orientation is random on a pre-made terrain mesh so looks repetitive.
and even if you know how to make a procedural model generating script that works with rad, streaming collision rigids need to be dynamic and i think rad does not support dynamic meshes as they get converted to box/sphere groups, engines like unity can use dynamic rigid meshes.
|
|
|
Post by Famer on May 30, 2017 5:02:07 GMT
I always wonder why "iObjectImpostersCreate(OBJ_X,int)" won't generate rigid bodies...
|
|
|
Post by TinSoldier on May 30, 2017 7:31:56 GMT
I always wonder why "iObjectImpostersCreate(OBJ_X,int)" won't generate rigid bodies... Actually Famer rigidbody imposters can be made, ariablutron98 Actually, i think a infinite road is possible, just as an infinite terrain or water plane can be made.(there is a 3drad infinite water demo project ). Something i've never tested is, what happens if a car object project is left running with a car that drives on an infinite terrain, say heading exactly north for a few days 24/7... would 3drad crash if a certain world position were crossed ?? This test project could be created really easily, just to see if 3drad has world size limits.... unless somebody has already tested this ?? . ( i'm going to guess there is a limit, but what size is it.. thats the question) It mite be just easier to manually enter in world location values for any 3d object till 3drad pukes or disallows that size number . A solution to prevent this issue would be using a wrap-around world, basically creating a earth ball type world, but using flat terrain pieces. Script can be used to move static rigidbodies with collisions, this also applies to imposters. (imposters are not free objects, they still take up memory and use CPU, their only advantage is loading time can be saved by creating them as needed in the project and not loading them at project startup, so your project can be smaller too, and loads faster). To do this you would need to use scripting heavily to move pieces around in a array(s) and those pieces would need to be tillable rigidbodies ( just like 3drads included road objects, they are designed to align end to end with each other) your terrain and or rigidbody pieces would need this as well. It definitely can be done, but you're gonna need a lot of scripting and planning and testing and designing.
|
|
|
Post by Famer on May 30, 2017 11:38:17 GMT
Maybe the size limit is set by the processor and the RAM....
|
|
|
Post by NicusorN5 on May 30, 2017 12:04:49 GMT
I always wonder why "iObjectImpostersCreate(OBJ_X,int)" won't generate rigid bodies... Actually Famer rigidbody imposters can be made, st project could be created really easily, just to see if 3drad has world size limits.... unless somebody has already tested this ?? . What this says for you ? : Vector3(float,float,float) Float has the maximum value of 3.40282347E+38 So 3D Rad world's limits are the field [-3.40282347E+38 ; 3.40282347E+38] for every coordinate. Maybe the size limit is set by the processor and the RAM.... And by the video cars too. (If the game is full of shaders).
|
|
|
Post by TinSoldier on May 30, 2017 17:37:01 GMT
Darn it, i clicked the spoiler Actually, after i wrote that i realized i had seen mention of 3drads value size limits before, but thought it would a fun little distraction to setup a car on an infinite road just to see how long it takes rad to puke .
|
|
|
Post by NicusorN5 on May 30, 2017 18:56:36 GMT
I think that the car's coordinates will overflow resulting in it's teleportation. (Not sure)
|
|
|
Post by indiedev on May 31, 2017 5:16:18 GMT
tin, what you may not realize is:
1. mike hense already made an infinite terrain addon, but in his words - ' although we have an infinite terrain and ocean... all of these are flat, repeating, featureless solutions..' and 'beyond a certain point the physics engine starts to fall apart on us and all our meshes start jittering wildly...' which even for some other engines seems to be about 10km.
2. moving static rigids as you suggest causes a big overload. why? -because, as i read on physx docs just this week, if you move, remove or create 1 static, it and EVERY other static in the scene has to be reloaded [including the one you are now driving on -oops!] which would likely cause the game to freeze just like when iobjectrefresh is used, so statics are meant to stay exactly what it's name implies - static. that's why i suspect mikes addon used flat dynamic rigids for the ground, and for mountains used just non collidable skinmeshes or basic sphere/box dynamic terrain rigids which would not be able to be driven over.
1 + 2 = you can make a flat [plane based] maybe with some simple box or sphere based roadside cliffs/walls [not very ideal for a road], non procedural, repeating terrain up to around 10km, so if the model was 1km2 you'd just be driving the same flat terrain 10 times, maybe rotated each time to seem slightly different - not exactly an endless rd.
|
|
|
Post by Famer on May 31, 2017 10:41:12 GMT
indiedev , that could be of use....(1+2)
|
|
|
Post by TinSoldier on Jun 1, 2017 0:19:08 GMT
Infinate_road_pieces.3dr (226.91 KB) Here you go boys and girls.. Before you get excited, there are issues with 3drad and this project. When the PCar gets to 10K+ meters on the Z access a strange bug sets in that cause's the HCK pieces collisions to stop working and the PCar also becomes stuck in mid air ( it doesn't fall due to gravity anymore ) but the wheels continue to rotate anyway. Other then this little thing, it works perfectly . I'll let you guys play with / look it over, and see if you can find the problem here.., i have no use for an infinite roadway.
|
|
|
Post by indiedev on Jun 1, 2017 4:28:45 GMT
did you try enabling steering? the wheels fall off!
edit: i added a 2nd car and if it keeps up with the 1st it can steer ok, so this could be a 'semi endless rd chaser - keep up or fall off!' similar to some cheap mobile games.
it does work with statics too, i guess only having 2 is not a big overload since they are imposters and not actually being fully recalculated as such, but the ones i tested were also flat except for the buildings which where non box and collided ok, so maybe it would work on static hilly terrain too?
|
|
|
Post by TinSoldier on Jun 1, 2017 7:17:48 GMT
Infinate_road_pieces.3dr (227.19 KB) I see nobody figured out the issue, So heres the fixed project. PS just so you know ... The 10k distance issue was caused by the gravity distance (10k default) running out, this caused the car to float somewhat up and that caused it to miss hitting the EvenOnLocation() box's (required to relocate the road pieces). So the project wasn't crashing or puking, it just wasn't working as required. The fix was a simple process of linking the gravity object to the script, then relocating it to the cars location each engine cycle... all fixed and woks as expected now. NOW you can get excited, you have your infinite ( so to speak ) roadway. I'm going to leave the project running overnight just to see if the other value limit can be reached in 7 or so hours. I'll update tomorrow.
|
|
|
Post by Rafay Jutt on Jun 1, 2017 7:37:59 GMT
TinSoldier The wheels starts going crazy as i try to Turn left or right -_-
|
|
|
Post by Famer on Jun 1, 2017 8:00:54 GMT
I've encountered that G-Force problem 6 months ago or so. I tried setting it to the highest value: *Sets to a very high value* *Waits, Waits, Waits...* *Me likey, I lost patience* *Pulls the plug *
|
|
|
Post by indiedev on Jun 1, 2017 10:14:09 GMT
in order for this project to be useful [less repeating] it needs to work with hilly terrain, that way you can have 4 tracks at different heights on each edge and rotate it, if so, even an octagon with 8 tracks would work, with a skinmesh mask to fill the gaps, but let's face it - you'd be better off just making a looped track with 8 terrain tiles instead.
just an idea, i won't be testing this more as i also have no use for it, but if the OP wanted a simple repeating rd then problem solved, but it's a long way off from procedural generation which is likely beyond rad. ----------
edit: in the last version the 'fixed' gravity is now not working properly for the 2nd [player] car as it's set to only 10m.
|
|
|
Post by TinSoldier on Jun 1, 2017 16:19:07 GMT
I thought it would obvious, to add a second pcar just add a second gravity object and repeat the process for locating it to the second cars location like the first one is doing in the script. my pcar got 735,487 mt before all passengers were beheaded in a horrific crash, RIP Andro 3drad didnt crash , all 4 car wheels were still spinning this morning I don't see any issues with this working on a hilly terrain, but an updated script would be needed.
|
|
|
Post by TinSoldier on Jun 2, 2017 0:36:57 GMT
TinSoldier The wheels starts going crazy as i try to Turn left or right -_- Yeah the problem is the script is setup ONLY to keep the pcar running at full throttle and in a straight line. you could edit the script and set the pcar to normal manual key input control.. This was only a test of the infinite road idea, not a fully functional project.
|
|
|
Post by indiedev on Jun 2, 2017 4:32:24 GMT
for manual control delete the 1st 2 paragraphs starting at OUT_1 = 1.0f; or do what i did -add a 2nd car and increase gforce range to 1km
|
|
|
Post by TinSoldier on Jun 2, 2017 5:21:44 GMT
Soooo it was kinda fun playing with this projec,t so i made a new update, but i'm not telling what that is, you'll have to try it and report back with your results, then i'll share mine Infinate_road_pieces_V2.3dr (240.34 KB)
|
|