I'm working on a model of an event in a specific building. I have the floorplan. There's one issue: the building is large enough that if I make the walls take up a whole patch, making them easy to factor into pathfinding, the model is too large to run. So I have them narrower, and am treating them as turtles.
But people are still walking through walls. I want them to not walk through walls.
There's an intersection model in the library that means I can tell when someone has already walked into a wall, but that doesn't help with pathfinding. I can also draw lines where the walls are. But I'm not sure how to or even if it's possible to have lines register as locations.
Additionally, if I just use the whole patch that a wall occupies, that means there are no actual viable paths.
So: how can I make a turtle that is less than a tenth of a patch wide impermeable to other turtles using a pathfinding algorithm?
The workaround I tried ended up being the massively increased number of patches, which added granularity to the simulation, which was cool.
The fix ended up being taking my floorplan and turning it into a png of just the walls and then uploading that and making it so agents couldn't walk through patches that color.
Related
I am currently working on a 3d game in Unity, and I am working on the level design using ProBuilder. I basically created a huge cube which I "flipped normal", and a second one way smaller
which, as the other one, I flipped normal, but as soon as I crossed it while turning backward I could weirdly see through the small cube, which makes it feel unfinished. How could I fix this issue?
Normally in 3d games triangles can only be seen from one side. Usually this is not a problem because walls have some thickness. Since you clearly have paper thin walls made of only one layer of triangles this is exactly the result you should expect.
In short add the other side to your walls. The simples way is to duplicate the existing triangles and flipping them. Walls will still be paper thin of course. Later you should probably make them thicker.
I'd like to show congestion areas on a conveyor network by using the density map included into the Material Handling Library, but so far I haven't find a way to do so, as material agents movement cannot be tracked by the density map, but it only accepts transporters or pedestrians (both in free space movement mode).
So I thought I could create a "parallel" agent (for instance, a pedestrian) that could get attached to my material and move along with it. Then I could set the pedestrian visible property to "no" so that it does not show in the animation, or make it really small as an alternative approach.
The problem when doing the pickup/dropoff logic is that the pedestrian disappears from the scene when it gets picked up (although it's internally batched with the material) so the density map shows nothing.
Same thing happens if I try to seize/release a transporter, as they do not travel along the conveyor with the material agent.
Any idea on how to get this?
Thanks a lot in advance!
You won't be able to drag pedestrians, they actively move via PedMoveTo blocks. This is a creative idea but it will not work.
You will have to code your own heatmap using dynamically colored rectangles that you animate on top of conveyors. Doable, but might be more work than is really required for your purpose ;)
so I've been trying to see if I can make use of Wheel Colliders for the past several months now. As much as I've managed to figure out more and more things about how to set them up properly, there's some things I've been noticing that seem impossible to avoid:
Even if your friction sideways stiffness is lower, there's a chance that your car will continue to "spin" or "rotate" in the direction you were steering if you JUST hold down your input long enough to get the car beyond just rotating. I've noticed this will happen, whether for example the "SteerHelper" or "TractionControl" functions are doing their work or not. This will put a dent in ensuring smooth turn movement. Now, I don't know if maybe this is just due to realistic car physics (I mean, I can picture the car skidding in scenarios where they lost grip of the road for sure), but it just feels kinda glitchy. Sometimes, even when I'm not turning, the car will start to turn a little to the left or right and then gradually seem to "lean" that way in terms of applied torque to the rigidbody. I've seen many suggestions for trying to stop the rigidbody from doing this. Here is one way I'm trying to work against this:
rb.AddTorque(-rb.angularVelocity * 2);
However, it seems that the car will still "spin" more than intended. What would be ideal is to be able to MAYBE allow the car to turn a little extra after the left or right steer buttons were released (maybe more or less depending on the vehicle), and no more than that to ensure there is maximum control to give the engaged and maybe arcadey game play I've been going for for a long while.
It's been difficult to adapt an ideal friction curve value that would give the most ideal feel of a drift turn, especially a more arcadey one. I'm not trying to go for wide turns that slow you down, I'm trying to go for tight (yet controllable) turns that allow you to preserve most of your speed. I find that especially at higher values of stiffness, as I know many people have observed in other posts, that again, the car will turn back an extremely high amount sometimes (you drift left enough, a force is turning your vehicle way to the right). It's sad, because I've wanted to be able to say I've "mastered this beast" and used it for my purposes, but I don't know if that's really a good practical expectation for anyone. I even worked my own alternate friction curve values that would be used in the controller:
But I guess as some people say, you can't polish something that's broken? Moving to the third point...
I've read so many posts that show how to adjust a vehicle's center of mass, or to add more colliders in different spots to correct it, using scripting to add an offset to the center of mass, etc. So many tips that say, "lower the center of mass, you'll find it" and I give that a try. When the center of mass is too low, my car can get pretty shaky on the terrain (not that it hasn't in the past, but it's often been things I could correct, like the weird initialization of the attachedRigidBody of the wheel colliders themselves in the beginning, etc). High enough, and of course, (even when it's lower sometimes???) the car will just start spinning in the air on either multiple axes or specifically the forward z, when you drive off a ledge or bump into something with a high enough speed. It just seems inevitable.
I've been trying to give my benefits of a doubt. I like to think there's a correct way to use this thing, and that I'm just not familiar enough with Unity3D physics concepts. However, it just seems more and more that I'm investing too much time in a broken component - or, maybe I just never got the best grip of physics.
I was about ready to try just convex mesh colliders around my tires, and just abandon the idea of gripping physics altogether, but I'd love to hear suggestions to either address anything I've mentioned above, or just a more ideal package to move onto. I've glanced at packages like Vehicle Physics Pro, but I do want to be sure I'm getting something that makes sense.
Full disclosure: I'm in the middle of trying to make a game that feels incredibly similar to F-Zero, but with wheels.
Thanks in advance for any thoughts or suggestions you can provide.
(Maybe not an answer per se, but hopefully helpful.)
Note Unity also suggests to possibly give the car a constant downward force via script. It might be telling that such workarounds are officially given, one would think proper physics would, well, properly work without them.
There's some assets you might want to give a try generally:
One is the Unity Asset Store asset called Arcade Car Physics, and it's free. I've tried it and it works (but not sure if it works for your needs). It's using Unity's native Wheel Collider plus extra scripts.
Another is the Arcade Car Physics github project. It has nice plane stabilization and more, and works well. It's not using the native Wheel Collider.
Then there's this asset called Vehicle Physics. Instead of native Wheel Colliders, they've create a fully custom wheel system so that it would be more physically workable. The asset is not free, but they offer a free demo executable where you can drive around different vehicles, and that works quite well. (I haven't yet bought this asset myself.) As a downside, some reviews mention there's some complexity in setting this up (and I suppose future support for this custom Wheel Collider hinges on the company continuing to exist).
Good luck!
I've picked up on NetLogo a little while ago and was intrigued by the possibilites that this platform offers.
As a little hobby-project I wanted to make a simulation of our solar system in NetLogo 3D.
It turned out great but I have one big problem that I am not able to solve on my own.
In order to display a planets orbit around the sun I added some buttons with the function to ask each respective planet (turtle) to pen-down and draw a line. However if I keep this "feature" on within a matter of seconds the simulation becomes noticably slower and sluggish. After 30 seconds or so it gets so laggy that even the interface becomes hard to use.
Without pen-down the simulation can run indefinitely.
Can anyone here tell me how to fix this slow-down issue?
I've checked the RAM usage and it is well below the limit I have set in the config file.
Alternatively, is there a better solution to visualize orbits?
When I loaded the model library's 3D Flocking model and asked the turtles "pen-down" it became increasingly slow. The trails presumably increase the complexity of the 3D structure that needs to be rendered.
I advised a student a few years ago who made models of our solar system and exoplanet systems in 2D and 3D. See http://resources.modelling4all.org/libraries/orbits/documentation
Note that the models are in the Behaviour Composer and the NetLogo code can be obtained by clicking on the Download tab.
I have what I think should be a very simple problem. In 2D NetLogo, I can easily "unwrap" the world by checking the boxes in the Configuration Window. However in 3D, these check boxes are not accessible as they are in a light grey text. Does NetLogo 3D not allow unwrapping? or is there something I'm missing?
According to http://ccl.northwestern.edu/netlogo/docs/3d.html :
You'll also notice on the left side of the Model Settings that there are options for wrapping in all three directions, however, they are all checked and grayed out. Topologies are not yet supported in NetLogo 3D, so the world always wraps in all dimensions.
If NetLogo 3D development were still moving forward, this would certainly be one of the highest priority fixes. But NetLogo 3D currently isn't moving forward, and hasn't been for some years, for lack of funding and/or interested open source developers. Know anyone with money or time on their hands?