sjg Posted January 30, 2017 Share Posted January 30, 2017 Thought I'd share this as someone might find the topic interesting or even useful. My project includes a random terrain/flora generator which creates the game area on the fly from a bunch of functions. However, I'm inexperienced with mathematics and don't know how to calculate the distance from say, the bottom of an entity to whatever brush is below it, so I did things the way they would happen in the real world: with gravity. I simply spawned a bunch of ents & props in the air, and let them land. Then, I added a hook to each entity so that when they hit the ground for the first time, it marks the time. After a certain period since marking, the collision hook is removed, the entity's mass is set to 0, it's rotated upright and to a random Y rotation, shadow mode to static and the collision type set to Collision::Scene. A brush is then created at the bottom of the model, is given an appropriate shape, and then its material is set to one with a 16x16 texture of alpha-transparency, giving the illusion that the scene prop has a solid body, but without calculating any gravity. Or something like that. It was a few days ago and I didn't document exactly WHY I had to use a brush with an invisible texture but it made sense at the time. I must have tried it with a pivot + shape and had no luck for whatever reason. Anyway here's a video of the terrain generation in action, over and over again. Usually I hide the loading and falling behind an opaque splash screen, but I also put together a simple fade in/out system. Much like the splash screen it's mostly there to distract the eye; the duration is easily changed but I haven't altered it recently so it's still pretty obvious. So, what MacGyver-y "hacky" tricks do you pull? I'm always fascinated by others' creativity when it comes to solving problems. Edit: Just realised I posted this in General Discussion and not Off-Topic. My mistake! 3 Quote Link to comment Share on other sites More sharing options...
Jazz Posted January 30, 2017 Share Posted January 30, 2017 In the title screen of my tournament game Rick Powers he's 'falling' and it looks like the wall behind him is endless but I actually just created a huge cylinder and am rotating it. 4 Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060 Link to comment Share on other sites More sharing options...
mdgunn Posted February 1, 2017 Share Posted February 1, 2017 This is actually an interesting topic and I bet people have quite a few things they could be mention but I've got nothing coming to mind right now! Sorry! 2 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 2, 2017 Share Posted February 2, 2017 In the title screen of my tournament game Rick Powers he's 'falling' and it looks like the wall behind him is endless but I actually just created a huge cylinder and am rotating it. That's how I used to make waterfalls. They were just planes with water textures that spawned and moved down. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.