Site Overlay

Can’t Cut the Lawn Without a Mower


This past week, I have been extensively working on getting a set of lawn mower physics down. I spoke to my Linear Algebra Professor to get some ideas and he came up with a different approach than I did. His idea was that a zero turn lawn mower will always turn in perfect circles at an instant. Essentially, if the lawn mower remained constant speed, with the exception of straight, we know that it will follow a circle. As such, we can calculate how the lawn mower would move along the circle at that individual instance (tick). In the next instance (tick), we can recalculate the next circle. I am currently logging and experimenting using FVectors and FRotators functions to find out how they affect the the objects in the world. Currently, I have a dummy, that when the left joystick is pushed, will run in a circle. I however do not have a perfect zero turn for him as I have yet to implement the circle path approach. I have some concerns with that method as to feel and accuracy. How I have visualized the problem is a result of how the joystick functionality is implemented in UE4. The problem I see is that each joystick has its own function, which means that each joystick will have its own circle path calculation. I worry that running each of these separately will either create jitter or put the mower in an un-correct forward alignment. To note, I don’t expect perfection, but I would like a fairly close interpretation. As a matter of fact, most simulator games are more fun when they aren’t perfect. The minor nuances in the mechanics often make for memorable experiences.

Moving on, last blog I talked about procedural generation for objects in the world. As it stands, I am still considering this approach for placing trees, rocks, and other obstacles at random, but I don’t know that I will use it to place the in game tiles. I found a video of how to place walls, which of course wouldn’t be a random placement, but overall tile placement took a backseat when I started working with mower physics. If need be I can manually place tiles in the map. Manual placement will actually earn me just as much freedom as programmatic placement. As a matter of fact, manual placement is more visual for me which helps reduce the amount of times code needs to be tweaked. The trade off is that I won’t know exactly how many tiles I placed, and I may need to count them manually as well. If this is the route I take, I have a strategy to place one tile, which I will clone. I then will copy both tiles at once, and clone them. I plan to continue doing this until I create the desired size map and thus I can know how many tiles. based upon the number of “clones”. Lets be honest, I mean just copy and paste a grouping of tiles over and over again.

Meshes are another topic that I have put thought into, but of course, I haven’t really had time to make a lawn mower mesh. Keeping that in mind, I did find this really nice dune buggy in the Unreal Assets that they offer with their prebuilt offroad simulator. I might re-texture the dune buggy and drive that around.

I am hoping that I will have some new pictures up in the very near future. I at the least plan to add a picture of my working environment to the gallery. I am using my TV as a second monitor and it is driving my roommate nuts since the screen resolution doesn’t perfectly align. Thus some of the screen is cut off. At some point, I may also add a screenshot with a snippet of my code and/or the engine itself.