I am only 8 minutes in, but from a software engineers side: There is a wall always on the other side of where sand is, you can clearly see this when you fly up at around 6:30. (If sand on the left -> Wall on the right) and vice versa. Which would mean, you need to build an "If" gate/statement out of your logic gates, if it detects no wall on either side, it should travel to the other side and stick to that wall, vice versa as well obv. This would THEORETICALLY work, if there isnt a gap where the left and right side both have no walls for a short time
I prefer the solution of trying to stay in the middle of the track, If it detects both walls then go forward if it doesn't detect one side it'll turn towards it if it doesn't detect both, it will have a constant slight right turn, then it will also have a sensor at the front with the most minimal distance sensor for when it is face flat at an edge so it will reverse for maybe a half sec then turn right, then continue thr program, theoretically it should finish the course with how the course is made
i suppose you can do something like this when detect wall: . turn away . wait until no detect . turn towards the same wall but just a lil when no detect wall for a bit: . turn away from previous wall side i think this is possible with raw logic i just realized first "if" second step "wait a lil" has flaw so: have 2 depth of distance sensing i haven't watched the video
Basic logic would be comparing the distance from the right and left walls, and try to equalize them. There are way better logic’s but I think that’s pretty easy to implement, I don’t really know trail makers.
Or maybe the distance sensor doesn’t rlly output a number that can be used with the arithmetic blocks so I dunno. Seems like a waste that all the sensor block don’t output numbers now, so they can be used with arithmetic
@@tech-boy334 you mean traction wise? That is solvable with a variable speed or wind (for down force) that is relative to the difference between the walls. If the difference is bigger, go slower or more down force… again i don’t know how easy it is with in game logic. But you can even do like 0kmh when the difference is equal to the sum of distances, meaning you are touching a wall. And max speed when difference is 0 meaning you are furthest as you can be from both walls.
Or maybe do max speed from 0 to some fraction of the distance sum. To avoid this zigzag some what, this will mean faster corrections when the track is narrow. Or if possible do the steering angle relative to the difference, meaning smaller angle with smaller difference so if your turn isn’t sharp enough the distance grows and your turn angle grows as well to compensate.
With my testing, there is a slight difference in elevation between the track and off the track that an Altitude Sensor is sensitive enough to detect. You can use that to determine if you have gone off the track or not.
I feel like the thing that made your life unnecessarily harder was to set the front-facing sensors to a shorter distance than the side ones. The side sensors where usually the last ones to finish detecting the wall, which can put you at up to 90° from the direction of the wall. You kind of want the front-facing sensors to have a range of 50m (since that's the max), and an angle of 37° from the forwards direction. That should dampen out the swoops over time, because the car would make decisions based on a point that's 40m in front of the car and 30m to the left.
More power/speed means less time to react to changing conditions. I am certain if he slowed the vehicle down, he would have reduced the severity of the swoops.
@@ScottaHemi440 I made a thing that followed the course at decent speed, but my steering setup made it really twitchy above 200 kph. Unfortunately I couldn't figure out one turn where the right wall of the course does a hairpin turn away from the left side, which keeps going straight, as i was detecting both walls to stay in the middle and the sensors only reach 50 meters
try to keep minimum and maximum distance from the both walls . minimum distance make sure vehicle wont leave a wall (put minimum distance priority to one you want , and when one wall doesn't detecting put priority to detecting wall ) , maximum distance make sure vehicle dont crash into the wall . dont put constant turning but if there no wall detecting then put turning into a side you want , also try to create memory turning to last detected wall or put turning sensors in front and back of vehicle so if front not detect and back detect wall turn that side (this is for those sharp inside corners wall )
Yeah, turns out using basic logic AND less sensors is a bad idea. Obviously, you want the car to keep track of where the walls are and its relative position to them so that it 'knows' where to stay, even if it doesn't know what the walls are or why it needs to stay between them. The constant turning thing was just silly and wasted a lot of time.
all he would've needed was a 2nd sensor on top with around -5 range wanting it to pull to the wall, constantly jiggling it along. would've been a wiggle win having a + - value
Even though I am just an Computer Science student I can suggest something better than some of the software engineers here. Use 2 of the sensors, both on the side which you want to hug the wall. So for example, let's say you wanna hug to the left wall, you put 2 sensors on the left side on different detection range, one at 15m and one at 15.2m and now set it up in such a way if the 15m sensors senses something it will turn right and if 15.2 m sensor senses something it will turn left.In this way it will always stay at the distance of 15 to 15.2 m from the left wall whatsoever. to make it more smoother you can add more of the 2 sensors with same logic and same side but with more extreme steering angle and sensing at 14 and 16 m so that if the first set of sensors senses something it will turn it with less sharp angle but when the second set of sensors senses something it will turn it more sharply to correct the angle, how does it sound ? I saw some of the suggestions similar to me but I don't think so it will work by their way as they were saying to keep one sensor close to the wall and other far away but in that it would mess up so badly in between both the distance at some point that it won't be able to recover, for example facing the wall head on. If possible you can show my suggestion in your next video, I would really appreciate it. Thank You
When I saw the back sensor in the thumbnail, I figured he was using logic to say if the front sensor doesn't detect anything and the back sensor detects a wall turn left as it is probably a sharp left corner
I second this. Exactly the solution I came to very fast when thinking of it. I would take the side the course goes around to. So if it is clock wise right side. And then I would take the distance as 90% of the wide of the track. Like this it should always stay on the left side of the track when following the right side. So if right side there is some sand or anything, it might still stay on the course.
I just managed to score 4:21 after 2.3 hours of trying, in jet league though. I struggled to get it to work with less power cores. This was also the first time I ever used Trailmakers logic, so I'm proud of my time regardless of power cores used lol
Wow. I assume you followed one wall? I think I would angle my sensors forwards more than Scrapman did. Did you do that? Or did you use a large number of sensors for resolution (like Scrapman's 4 per side)? Or both?
@@Pystro I didn't follow a single wall, but avoided both sides. I only used 3 sensors per side, 2 at each front facing 45° outwards with 25 & 10 metre ranges, and one each rear side facing 40° at 50 metres range. No sensors facing directly forward
i have a demo derby ideas: so it is a evolving devolving vehicle so basically in the first round you have 100 blocks and 10 power core, as the rounds went on, the power core count is decreasing but the blocks amount is increasing
It was actually really interesting to see the solution you came to here, because I've made a robot IRL for a class, which needed to follow a line with just 1 sensor, and my solution was also to have a constant pull to one side, simply turning the back toward the other side when it detected a line.
Something that may have helped you is putting a senor on your throttle as well as your steering so it would reduce throttle slightly when turning. Actual race car drivers tend to slow down slight when entering a sharp turn, and the punching it to full throttle as they exit the turn. IDK if the sensors can modulate the throttle like that, but it's worth a try if you ever revisit self driving car again.
After a couple of years of watching Trailmakers videos from this channel and others, I'm finally starting to play the game myself. I haven't even touched the logic element of building yet, but the most effective way to keep the vehicle on the track seems to me to be to sense shading that isn't plain tarmac. But ScrapMan said something near the beginning of the video (I'm nearing the end of the video as I type this and I have ADHD) about not being able to reliably detect shading, and I don't remember if he was talking about the red-white striping of the edges or shading changes more generally.
SCRAPMANNNNN EVOLUTION DOGFIGHTERSS PLEASEEEEE. It could be separate evolutionary paths (each player sticks with the same plane they had from the start but changes it each round) so that there's more diversity and like reactionary evolution and stuff Eg if your opponent uses thrust vectoring, next round you could put on an emp instead of an extra smart cannon
"ohhhnooooookayy" 😂 Admirable try. I feel your pain. It would be so much easier if the game would offer color sensors, so you can track the course. For getting good automatic driving with only distance sensors, we would need actual distance sensors with analog output measuring the distance and return that, so we can feed the distance into some math logic. This way we could easily keep it in a safe zone near the middle . Even with such sensors it would not work, because the math logic doesn't work with two variable inputs, but only 1 variable and 1 constant (making them useless apart from some cases). So yeah ... coming up with well-working automation in Trailmakers is unfortunately still between extremely painful and impossible. Bringing up such issues in the Discord only get you slapped around. No idea why the devs torture us this way instead of improving their overall promising sandbox game.
I have never played this game, but have watched several of your videos. What about a hover car with navigationg thruster: thruster pushing it towards the control wall (left, in this case) and a slightly stronger 'away' thruster pushing it away when the sensors activate. Also, for steering, use a front/rear sensor cluster pair going to a servo/gyro to steer when one sensor cluster has a higher output than the other (three or more sensors in each cluster, each sensing a different distance -1, 2, 3, etc - with the output canceling out, so if the front cluster has all three activated, but the rear only has 1 or 2, the servo/gyro will turn to the right to move the rear closer. This will allow your navigation sensors to remain lined up with the wall properly. Then, if your navigation sensors sense the wall, it will trigger the 'away' thrusters to move you away from the wall
Id love to see other part of this, It wold be a great new series full of potentials and learning and fun ideas! Like I wonder what will happen if you mirrored the last version of the car (sensors on both sides with same settings). or if you went super fast speeds. its gonna be soo much fun!
I would suggest: 1. Activate the right sensors again 2. Add 2 more sensors at you center of mass, perpendicular to your forward movement that have max range and detect when you AREN'T sensing a wall. 3. These 2 sensors will pull the car in the direction furthest from a wall, effectively keeping a "Zero" of your position on the course. meanwhile, the turning sensors will correct you when you hit those apexes. Maybe use addition logic to make sure these are comparing each other as well. Also, if the sensors are detecting the ground when you tilt, it could be possible to have sensors at minimum range angled slightly to the ground that detect the slight bumps on the course. Once again, you might be able to use two of them to compare (One that wants to be close, and one that wants to be far) to make sure they aren't too sensitive, and ONLY detect the curb (Might still be hard tho)
I am at 31:27 and I wish you became with this, BUT, in case you don't i'll tell you what i think: You should always detect both walls, thsi means, the distance sensors have just enough distance to bearly detect the wall with a slight margin (this is the margin in wich you turn) so the logic ends up something like this: IF both sensors on --> forward (you are inside the course) IF left off --> turn right (this means left side have sand and the wall is far away so you have a right turn). IF right off --> same of the left but to the other side IF both off --> you are heading onto a wall and is a problem. A problem that you have already solve having a secondary pair of sensors with less distance that allows you to correct (also making the sharpness of the turn sharper).
I would put two sensors of the maximum length and then always turn to the side that has the bigger value. That way the car would stay in the middle of the path and on sharp turns, it would detect the far side of road and still would turn into the right direction.
I think that you could make it work much better if you make some simple changes: - Remove all but the two sensors facing directly left, aka keep the rear one and the front one, no hinges necessary. - Remove the trim feature so that it drives straight with no input. - Program the sensors so that A) The front sensor turns the vehicle left when it stops detecting the wall, B) The rear sensor turns the vehicle right when it stops detecting the wall, and C) The vehicle goes straight when both sensors detect the wall. I haven't tested this, but it should work... theoretically...
i've been working a lot on autonomous vehicles and other logic in trailmakers. i've made 4 different 2x2 100kph+ homing torpedos, the fourth one having the best computer. i've made 1 autonomous boat with old logic. i've made a self landing spaceship using sensors and logic. i'm now making a new autonomous boat with 360 degree sensors, and trying to give it as many functions as possible while keeping it flawless, to give it the best functionality. also i'm using the high seas map for testing to make sure it's waveproof.
A possible improvement could be adding rear steering on a sensor to activate when getting closer to the wall and allowing some strafe. That way you don't get the bigger angles facing towards or away from the wall. Probably only half or 1/4 of the front steer.
Hi For the next challenge you should not use any blocks apart from lodge blocks and moving blocks and cosmetic blocks to make a sub no standard block challenge i hope you like my idea scrap man
If the sensors can output a number, rather than just an on/off signal, then you can use a comparator to see the difference between the sensors on the left and the sensors on the right, and turn left/right to keep those numbers as close to each other as possible. this would keep you in the middle of the track, and should still be ok with finish line, despite the pit lane.
I've never played this game, but it seems such a system would be extremely dependent on the initial starting position. A slight change in the start position could cause the timing/angles to snowball to a failed run, even if a previous run worked. Also, how repeatable is the physics in this game? Assuming the start conditions are the same, how reliable are the other interaction at producing the same results? Will the friction always produce consistent steering and acceleration?
remember when you did a race on this course and you kept having collisions with the stiped lines because they were slightly off the ground, maybe you can detect them if you put the sensors as low as you can
May be you could use double sensor setup, so shorter one will turn you from the wall, and longer one will turn you towards the wall. So you will drive straight and keep certain distance from the wall, like 30-35m. And may be increase turn angle, but devide it with more sensors, so it possibly could keep you at exact distance from the wall
You should’ve used two front and back sensors, 2 sensors detect the wall and move towards it on a high sensing distance, 2 sensors move away on a lower sensing distance
When they added the math block they should've added raw number outputs to things like the distance sensor. Then we could just check which side is further and turn toward that side, so that the vehicle is always gravitating to the middle. This would be the solution to everything on this course. You could do front ones too, if you are getting perpendicular you could just steer to the side that's further distance to ensure you turn the correct way. These things alone should work for the entire course, including the pit entrance.
If you increased the sensor distance of the front most sensor it would decrease the swooping (also preventing it from seeing the other wall since it doesn't turn that sharp), you need to find a balance. The way you had the sensors for more "resolution" didn't help since they all saw the wall at the same time, otherwise it would've been perfect. But you did basically the same thing with that back sensor
I don't know how much is what I think might be the solution possible, but I was thinking making it detect both walls. If you embed into that somehow the accumulator, so the steering gets weaker the further you're from a wall, this could potentially make your car go kinda in the center of the track.
I was in a robotics class in high school where we had physical Lego robots we coded to do stuff like this, we used color sensors but the same principle applied, you'd put a line of black tape on the floor, and then code it to constantly turn left at say, 5 degrees, and then when the downwards facing sensor detects black, it turns right at the same angle, then it will drive forwards, wibbling back and forth, and can theoretically follow any unbroken black line, even if it turns/curves
A lot of suggestions for improvements in the comments, but I just wanna say, good job on doing it, ScrapMan! You might not have thought of everything that several hundred commenters thought of, but you managed it pretty well nonetheless!
Instead of always drifting left you should have had sensors that steer right if you come within range of the left wall and steer left if you move too far away from the left wall. I would stack the steer arms and run 4 sensors. Have the first steer arm trigger to turn right 5 degrees if it detects a wall at 5 yards, the second sensor trigger the second steering hinge to turn another 10 degrees right if it comes within 4 yards, then have a 3rd sensor the left 5 degrees if it is more than 6 yards away and a 4th sensor that has the second steering hinge turn an extra 10 degrees if it is farther than 7 yards. This hopefully lets it go straight if the car is between 5 and 6 yards away and have variable steering if it goes outside that. Also you could speed it up to what the tires could handle at the steering angles you use (with downforce) and just set it to always run that speed. If you do a two stage steering like the top you could have it slow down if it turns the 5 degrees and slow down more if it turns the 15 degrees. It would be cool if you could put the turning angle adjusted by and accumulator so the steering was variable. It would also be cool if you could adjust the range of the sensors based on the width of the track so you could stay in the middle instead of staying a certain distance from one wall. Maybe have it turn only if it was farther away from one wall than the other. Not sure if you can do that or not. I was never good at doing logic in Trailmakers.
Hi scrapman. Day 15 of asking you to make a gyro free stol plane (short takeoff and landing) or a bush plane and try to get the shortest takeoff and landing you can (in trailmakers)
They should add a mode you can toggle on sensors, whether you want them to send 0 or 1 based on a threshold comparison, or if you want it to directly output the value it s detecting, so you can do comparison and arithmetic operations with said value. Would be great.
Ok so what you should think about is a sensor at 30 meters and 35 meters. if 35 true but 30 false straight. If 30 true turn right. If both false turn left. Also put the sensor on a swivel to sweep forward when it's turning right. So as you turn off the wall, you will react faster to the wall falling away. Limiting how far away from the wall you will wander.
You would need to have it where you have a set of sensors that would try to curve you towards the other wall if it doesn't detect a wall on their side and maybe a set of sensors that middle out. I believe this should keep you more on the track. I will do some experiments with this on my own.
With the new logic stuff, I feel like it should be possible to make a proportional wall follower, and potentially even a PID algorithm thanks to accumulators? That's probably how I'd approach following the wall faster, rather than trying to avoid the sand altogether. I might also try following the right wall and use a combination of a timer + compass to avoid pitting... I don't know, it feels very possible, but I haven't played Trailmakers - only programmed robots to do this sort of thing.
I feel like you could combine your 3 sensor head with an accumulator that the sensors feed into and a constant decrement if the sensors don't detect anything so your turning isn't as jerky
If you use an accumulator i think you could make the turns smother and btw please make a pt2 for this project where you experiment with what the comments say
If you use an angle sensor that detects if the car has turned too much, it overrides the wheels forcing it to turn the other way. (just a small thought because it looks like the only problem was the car turning too much if It didn't detect a wall.
I built something that does this along with avoiding edges pretty recently, it’s on PS though. Using wheels was painful in terms of the wheel having to return to the base state after turning and making a larger turning radius than was required, speeding up the turning can prevent this but also makes some hiccups during said turning. I’m planning on making an autonomous vehicle that does what this video does but at a much higher speed but at the limits of the sensors and logic themselves. No this isn’t a fundraiser; it’s a self fulfilling challenge that I wish to impose on myself.
Only 7 minutes in but wanted to comment before I forgot. What if you made the car hug the wall but put the sensors in the front and back corners. Then you add in logic to where if the front and back sensors work together. So basically if you’re hugging a wall both of the sensors on that side will trigger, but when the wall pulls away, the front sensor will detect that there’s nothing there but the back one still is. I’m thinking at this point you make the car turn. Once both sensors stop detecting the wall the car will stop turning. And if you’re approaching a turn I think you could use the front one to start the turn until both detect the wall which it should just hug it there. No clue if this will work. But it’d be nice to your thoughts
This is my favorite video since the original teardown videos when I first subscribed and have watched everyday since then. ScrapMan is at his best when he is problem solving something he is not sure he going to be able to solve. Also, was he not the first person to complete the course? He was ranked number one with no one behind him.
It is actually possible to get an autonomous vehicle where the game thinks that you are sitting still, but also thinks that you're in the autonomous vehicle seat. I wonder which protocol would take over when crossing the finish line
I really would like to see a top 1% or top 10 challenge video for a glitchless 0 power core build. I'm not sure it's even possible so even if it's just trying to get as fast of a time as possible would also be really cool.
How about a 2 or 3v1 tower defense? Set up a goal, surrounded by explosives as the target, prevent the 1 from reaching it etc…. Using various weapons and the like, would be cool.
Have you seen the micromouse competitions? It’s an IRL thing where people build robots to fit into a maze with a set grid size. People program their robots to explore the maze then find the fastest route to the finish. Maybe you could set up something similar in scrap mechanic with a simple wall following robot.
2v2 dethrone, where 1 teammate builds an air vehicle to provide air support for the other person on the ground while the 2 ground vehicles duke it out for the crown
Although it's possible, I wonder how practical it would be to just use the logic to program the course. That is to say instead of 'turn right if wall left' have 'wait 30 seconds turn 30° left, wait 10 seconds turn 10° right' until it finishes the course.
I think all your sensors should have been set to 30, because currently, if the you are turned towards the wall, your sensors will all start detecting it at once, turning away from it super sharp, leading you to again be angled towards it when you turn back.
damn, now i wanna experiment on this my hypothesis is using a mixture of the steering servo to keep it centered on the track and the actual turning when it gets too close to the wall
Surprised by your approach, tbh. I expected for wall-tracker you'd do 2 sensors on the left side: one shorter range to turn right if detecting, one longer range turning left if NOT detecting
I would try using speed sensors pointing upward, that detect 0.01km/h vertical movements, from the invisible lip on the edge of the track. No idea if this could work but maybe ig.
Ya know, if the race designers *_really_* wanted to deter self-driving cars, they should've made all the drivers control the cars from outside the race.
Idea for multiplayer. You can do a EMP batle but you have extra thruster that arent hoocked up to anny controles, but if you get lucky you get extra boost when your hit.
I am only 8 minutes in, but from a software engineers side:
There is a wall always on the other side of where sand is, you can clearly see this when you fly up at around 6:30.
(If sand on the left -> Wall on the right) and vice versa. Which would mean, you need to build an "If" gate/statement out of your logic gates, if it detects no wall on either side, it should travel to the other side and stick to that wall, vice versa as well obv. This would THEORETICALLY work, if there isnt a gap where the left and right side both have no walls for a short time
I prefer the solution of trying to stay in the middle of the track, If it detects both walls then go forward if it doesn't detect one side it'll turn towards it if it doesn't detect both, it will have a constant slight right turn, then it will also have a sensor at the front with the most minimal distance sensor for when it is face flat at an edge so it will reverse for maybe a half sec then turn right, then continue thr program, theoretically it should finish the course with how the course is made
i suppose you can do something like this
when detect wall:
. turn away
. wait until no detect
. turn towards the same wall but just a lil
when no detect wall for a bit:
. turn away from previous wall side
i think this is possible with raw logic
i just realized first "if" second step "wait a lil" has flaw so: have 2 depth of distance sensing
i haven't watched the video
@@zajirayman1729 make a mini 4wd and it will finish the track with how the track is made
I hope he would try to do it
How would it deal with the
We need part 2, when you read the comments and upgrade the self-driving car to be more efficient
A self driving sled would also be cool with a gyro and some downforce
maybe it could go pretty fast
or when he realizes detecting the road is possible, just detect when the color is not black or try to detect the chance in height.
Faster and look better
@itayvolk there are color sensors in trailmakers?
@@itayvolkwait what block senses color?
The people have spoken
Swimming tanks it is
See you in 2026
let a new chapter begin
Next island tank
Driving tanks when? Imagine a Tank on a Truck
Please don’t start
Don’t goddamn start man
Basic logic would be comparing the distance from the right and left walls, and try to equalize them.
There are way better logic’s but I think that’s pretty easy to implement, I don’t really know trail makers.
Or maybe the distance sensor doesn’t rlly output a number that can be used with the arithmetic blocks so I dunno.
Seems like a waste that all the sensor block don’t output numbers now, so they can be used with arithmetic
Wouldn't work, since the middle between the walls would always be different due to the sand.
The car wouldn't stick to the track
Eggveants swiming tank
@@tech-boy334 you mean traction wise? That is solvable with a variable speed or wind (for down force) that is relative to the difference between the walls.
If the difference is bigger, go slower or more down force… again i don’t know how easy it is with in game logic. But you can even do like 0kmh when the difference is equal to the sum of distances, meaning you are touching a wall.
And max speed when difference is 0 meaning you are furthest as you can be from both walls.
Or maybe do max speed from 0 to some fraction of the distance sum.
To avoid this zigzag some what, this will mean faster corrections when the track is narrow.
Or if possible do the steering angle relative to the difference, meaning smaller angle with smaller difference so if your turn isn’t sharp enough the distance grows and your turn angle grows as well to compensate.
With my testing, there is a slight difference in elevation between the track and off the track that an Altitude Sensor is sensitive enough to detect. You can use that to determine if you have gone off the track or not.
Exactly my thought, I was going to go test this
he actually noticed it but it didn't register as that 11:15
@@josbud1112 looks like it was detecting the road, from my testing you can't detect that strip, even with .01 meter increments
Not the strip, but the grass and road do register differently.
I feel like the thing that made your life unnecessarily harder was to set the front-facing sensors to a shorter distance than the side ones. The side sensors where usually the last ones to finish detecting the wall, which can put you at up to 90° from the direction of the wall.
You kind of want the front-facing sensors to have a range of 50m (since that's the max), and an angle of 37° from the forwards direction. That should dampen out the swoops over time, because the car would make decisions based on a point that's 40m in front of the car and 30m to the left.
The fact that bro refused to add any more power is concerning me about his free time
More power/speed means less time to react to changing conditions. I am certain if he slowed the vehicle down, he would have reduced the severity of the swoops.
@@brandonstone3104but I have the need for speed underground
speed and self driving don't combine to well xD
I made some line follow robots in scrap mechanic they don't follow the line when they go to fast...
@@ScottaHemi440 Specially not with the very crude logic he used, with a more complex logic setup, you could probably increase the speed safely
@@ScottaHemi440 I made a thing that followed the course at decent speed, but my steering setup made it really twitchy above 200 kph. Unfortunately I couldn't figure out one turn where the right wall of the course does a hairpin turn away from the left side, which keeps going straight, as i was detecting both walls to stay in the middle and the sensors only reach 50 meters
For a simple logic wall follower you could have 2 sensors, one for too far and one for 2 close, too close turns out, too far turns in.
30:02 the none pizza with left distance sensor was perfect, thank you
try to keep minimum and maximum distance from the both walls . minimum distance make sure vehicle wont leave a wall (put minimum distance priority to one you want , and when one wall doesn't detecting put priority to detecting wall ) , maximum distance make sure vehicle dont crash into the wall . dont put constant turning but if there no wall detecting then put turning into a side you want , also try to create memory turning to last detected wall or put turning sensors in front and back of vehicle so if front not detect and back detect wall turn that side (this is for those sharp inside corners wall )
Yeah, turns out using basic logic AND less sensors is a bad idea. Obviously, you want the car to keep track of where the walls are and its relative position to them so that it 'knows' where to stay, even if it doesn't know what the walls are or why it needs to stay between them. The constant turning thing was just silly and wasted a lot of time.
all he would've needed was a 2nd sensor on top with around -5 range wanting it to pull to the wall, constantly jiggling it along. would've been a wiggle win having a + - value
Even though I am just an Computer Science student I can suggest something better than some of the software engineers here. Use 2 of the sensors, both on the side which you want to hug the wall. So for example, let's say you wanna hug to the left wall, you put 2 sensors on the left side on different detection range, one at 15m and one at 15.2m and now set it up in such a way if the 15m sensors senses something it will turn right and if 15.2 m sensor senses something it will turn left.In this way it will always stay at the distance of 15 to 15.2 m from the left wall whatsoever. to make it more smoother you can add more of the 2 sensors with same logic and same side but with more extreme steering angle and sensing at 14 and 16 m so that if the first set of sensors senses something it will turn it with less sharp angle but when the second set of sensors senses something it will turn it more sharply to correct the angle, how does it sound ? I saw some of the suggestions similar to me but I don't think so it will work by their way as they were saying to keep one sensor close to the wall and other far away but in that it would mess up so badly in between both the distance at some point that it won't be able to recover, for example facing the wall head on. If possible you can show my suggestion in your next video, I would really appreciate it. Thank You
Honestly that’s probably the best way to go about it. I am going to try to make that and put it to the test
Try this solution, plz
When I saw the back sensor in the thumbnail, I figured he was using logic to say if the front sensor doesn't detect anything and the back sensor detects a wall turn left as it is probably a sharp left corner
I second this. Exactly the solution I came to very fast when thinking of it. I would take the side the course goes around to. So if it is clock wise right side. And then I would take the distance as 90% of the wide of the track. Like this it should always stay on the left side of the track when following the right side. So if right side there is some sand or anything, it might still stay on the course.
My current best time for this is 4:30. You can go faster, but 50m max range makes it hard to steer in time.
I just managed to score 4:21 after 2.3 hours of trying, in jet league though. I struggled to get it to work with less power cores.
This was also the first time I ever used Trailmakers logic, so I'm proud of my time regardless of power cores used lol
Wow. I assume you followed one wall?
I think I would angle my sensors forwards more than Scrapman did. Did you do that? Or did you use a large number of sensors for resolution (like Scrapman's 4 per side)? Or both?
@@Pystro I didn't follow a single wall, but avoided both sides. I only used 3 sensors per side, 2 at each front facing 45° outwards with 25 & 10 metre ranges, and one each rear side facing 40° at 50 metres range. No sensors facing directly forward
I’ve been wanting to see this for so long
2:18 basti GHG Musik
Basicly the owner of the song
Ich habe nach diesem Kommentar Gesucht
Schön auch andere Deutsche hier zu sehen
i have a demo derby ideas: so it is a evolving devolving vehicle so basically in the first round you have 100 blocks and 10 power core, as the rounds went on, the power core count is decreasing but the blocks amount is increasing
and for the last stage its no power cores max complexity
I tried to do this about a month ago and it stumped me, I love it when Scrap solves problems we cant.
@7to7stopmotions81 sometimes all it takes is a different set of eyes
It was actually really interesting to see the solution you came to here, because I've made a robot IRL for a class, which needed to follow a line with just 1 sensor, and my solution was also to have a constant pull to one side, simply turning the back toward the other side when it detected a line.
BastiGHG introsong ab 2:00
Something that may have helped you is putting a senor on your throttle as well as your steering so it would reduce throttle slightly when turning. Actual race car drivers tend to slow down slight when entering a sharp turn, and the punching it to full throttle as they exit the turn. IDK if the sensors can modulate the throttle like that, but it's worth a try if you ever revisit self driving car again.
After a couple of years of watching Trailmakers videos from this channel and others, I'm finally starting to play the game myself. I haven't even touched the logic element of building yet, but the most effective way to keep the vehicle on the track seems to me to be to sense shading that isn't plain tarmac. But ScrapMan said something near the beginning of the video (I'm nearing the end of the video as I type this and I have ADHD) about not being able to reliably detect shading, and I don't remember if he was talking about the red-white striping of the edges or shading changes more generally.
SCRAPMANNNNN EVOLUTION DOGFIGHTERSS PLEASEEEEE. It could be separate evolutionary paths (each player sticks with the same plane they had from the start but changes it each round) so that there's more diversity and like reactionary evolution and stuff
Eg if your opponent uses thrust vectoring, next round you could put on an emp instead of an extra smart cannon
"ohhhnooooookayy" 😂 Admirable try. I feel your pain.
It would be so much easier if the game would offer color sensors, so you can track the course. For getting good automatic driving with only distance sensors, we would need actual distance sensors with analog output measuring the distance and return that, so we can feed the distance into some math logic. This way we could easily keep it in a safe zone near the middle . Even with such sensors it would not work, because the math logic doesn't work with two variable inputs, but only 1 variable and 1 constant (making them useless apart from some cases). So yeah ... coming up with well-working automation in Trailmakers is unfortunately still between extremely painful and impossible.
Bringing up such issues in the Discord only get you slapped around. No idea why the devs torture us this way instead of improving their overall promising sandbox game.
I have never played this game, but have watched several of your videos. What about a hover car with navigationg thruster: thruster pushing it towards the control wall (left, in this case) and a slightly stronger 'away' thruster pushing it away when the sensors activate. Also, for steering, use a front/rear sensor cluster pair going to a servo/gyro to steer when one sensor cluster has a higher output than the other (three or more sensors in each cluster, each sensing a different distance -1, 2, 3, etc - with the output canceling out, so if the front cluster has all three activated, but the rear only has 1 or 2, the servo/gyro will turn to the right to move the rear closer. This will allow your navigation sensors to remain lined up with the wall properly. Then, if your navigation sensors sense the wall, it will trigger the 'away' thrusters to move you away from the wall
Id love to see other part of this,
It wold be a great new series full of potentials and learning and fun ideas!
Like I wonder what will happen if you mirrored the last version of the car (sensors on both sides with same settings).
or if you went super fast speeds.
its gonna be soo much fun!
I would suggest:
1. Activate the right sensors again
2. Add 2 more sensors at you center of mass, perpendicular to your forward movement that have max range and detect when you AREN'T sensing a wall.
3. These 2 sensors will pull the car in the direction furthest from a wall, effectively keeping a "Zero" of your position on the course. meanwhile, the turning sensors will correct you when you hit those apexes. Maybe use addition logic to make sure these are comparing each other as well.
Also, if the sensors are detecting the ground when you tilt, it could be possible to have sensors at minimum range angled slightly to the ground that detect the slight bumps on the course. Once again, you might be able to use two of them to compare (One that wants to be close, and one that wants to be far) to make sure they aren't too sensitive, and ONLY detect the curb (Might still be hard tho)
Also use an AND Gate when both detect
I am at 31:27 and I wish you became with this, BUT, in case you don't i'll tell you what i think:
You should always detect both walls, thsi means, the distance sensors have just enough distance to bearly detect the wall with a slight margin (this is the margin in wich you turn) so the logic ends up something like this:
IF both sensors on --> forward (you are inside the course)
IF left off --> turn right (this means left side have sand and the wall is far away so you have a right turn).
IF right off --> same of the left but to the other side
IF both off --> you are heading onto a wall and is a problem. A problem that you have already solve having a secondary pair of sensors with less distance that allows you to correct (also making the sharpness of the turn sharper).
I would put two sensors of the maximum length and then always turn to the side that has the bigger value. That way the car would stay in the middle of the path and on sharp turns, it would detect the far side of road and still would turn into the right direction.
I think that you could make it work much better if you make some simple changes:
- Remove all but the two sensors facing directly left, aka keep the rear one and the front one, no hinges necessary.
- Remove the trim feature so that it drives straight with no input.
- Program the sensors so that A) The front sensor turns the vehicle left when it stops detecting the wall, B) The rear sensor turns the vehicle right when it stops detecting the wall, and C) The vehicle goes straight when both sensors detect the wall.
I haven't tested this, but it should work... theoretically...
i've been working a lot on autonomous vehicles and other logic in trailmakers.
i've made 4 different 2x2 100kph+ homing torpedos, the fourth one having the best computer. i've made 1 autonomous boat with old logic. i've made a self landing spaceship using sensors and logic. i'm now making a new autonomous boat with 360 degree sensors, and trying to give it as many functions as possible while keeping it flawless, to give it the best functionality. also i'm using the high seas map for testing to make sure it's waveproof.
pushing trailmakers logic to it's limits soon
A possible improvement could be adding rear steering on a sensor to activate when getting closer to the wall and allowing some strafe. That way you don't get the bigger angles facing towards or away from the wall. Probably only half or 1/4 of the front steer.
Hi For the next challenge you should not use any blocks apart from lodge blocks and moving blocks and cosmetic blocks to make a sub no standard block challenge i hope you like my idea scrap man
you should try to make a auto-aiming turret with lock on
Nice video
If the sensors can output a number, rather than just an on/off signal, then you can use a comparator to see the difference between the sensors on the left and the sensors on the right, and turn left/right to keep those numbers as close to each other as possible. this would keep you in the middle of the track, and should still be ok with finish line, despite the pit lane.
My thought was why not use a series of timer blocks and lodgic gate that way your not relying on the walls to turn the car
I've never played this game, but it seems such a system would be extremely dependent on the initial starting position. A slight change in the start position could cause the timing/angles to snowball to a failed run, even if a previous run worked. Also, how repeatable is the physics in this game? Assuming the start conditions are the same, how reliable are the other interaction at producing the same results? Will the friction always produce consistent steering and acceleration?
@@brandonstone3104yes it is pretty consistent but there are a few glitches that can happen
remember when you did a race on this course and you kept having collisions with the stiped lines because they were slightly off the ground, maybe you can detect them if you put the sensors as low as you can
I didn't expect this episode-
But I'm here for it!
Maybe try a dogfight where you have guns on zero-strength servos with exsposed tnt on your builds.
I love your videos i have been watching for 4 or 5 years now can you do a lives pls or try out new games pls
"It doesn't have to work great, it just has to 32:17 it's face against the wall to victory lol"
"everything is gonna turn out ok, right?" best unintentional pun ever
May be you could use double sensor setup, so shorter one will turn you from the wall, and longer one will turn you towards the wall. So you will drive straight and keep certain distance from the wall, like 30-35m. And may be increase turn angle, but devide it with more sensors, so it possibly could keep you at exact distance from the wall
You should’ve used two front and back sensors, 2 sensors detect the wall and move towards it on a high sensing distance, 2 sensors move away on a lower sensing distance
Nice! Looking forward to this one, self driving cars are fun
I think you should team up with Kan for this one, man! Dude's brain runs on logic gates, I'm pretty sure. Love your content btw, cheers from Brazil!
When they added the math block they should've added raw number outputs to things like the distance sensor. Then we could just check which side is further and turn toward that side, so that the vehicle is always gravitating to the middle. This would be the solution to everything on this course. You could do front ones too, if you are getting perpendicular you could just steer to the side that's further distance to ensure you turn the correct way. These things alone should work for the entire course, including the pit entrance.
This is so cool , I suggested this idea back when the update came out
If you increased the sensor distance of the front most sensor it would decrease the swooping (also preventing it from seeing the other wall since it doesn't turn that sharp), you need to find a balance. The way you had the sensors for more "resolution" didn't help since they all saw the wall at the same time, otherwise it would've been perfect. But you did basically the same thing with that back sensor
I don't know how much is what I think might be the solution possible, but I was thinking making it detect both walls. If you embed into that somehow the accumulator, so the steering gets weaker the further you're from a wall, this could potentially make your car go kinda in the center of the track.
I was in a robotics class in high school where we had physical Lego robots we coded to do stuff like this, we used color sensors but the same principle applied, you'd put a line of black tape on the floor, and then code it to constantly turn left at say, 5 degrees, and then when the downwards facing sensor detects black, it turns right at the same angle, then it will drive forwards, wibbling back and forth, and can theoretically follow any unbroken black line, even if it turns/curves
A lot of suggestions for improvements in the comments, but I just wanna say, good job on doing it, ScrapMan! You might not have thought of everything that several hundred commenters thought of, but you managed it pretty well nonetheless!
Bro this is awesome content!!
Hi scrapman!
Bro did my idea! Only took 1 day of asking! (Coincidence). I suggested the small oval to start with. Start easy
Oh or do it with timers! That would be crazy. But imagine programming in the whole course. Could break records maybe?
Instead of always drifting left you should have had sensors that steer right if you come within range of the left wall and steer left if you move too far away from the left wall. I would stack the steer arms and run 4 sensors. Have the first steer arm trigger to turn right 5 degrees if it detects a wall at 5 yards, the second sensor trigger the second steering hinge to turn another 10 degrees right if it comes within 4 yards, then have a 3rd sensor the left 5 degrees if it is more than 6 yards away and a 4th sensor that has the second steering hinge turn an extra 10 degrees if it is farther than 7 yards. This hopefully lets it go straight if the car is between 5 and 6 yards away and have variable steering if it goes outside that.
Also you could speed it up to what the tires could handle at the steering angles you use (with downforce) and just set it to always run that speed. If you do a two stage steering like the top you could have it slow down if it turns the 5 degrees and slow down more if it turns the 15 degrees.
It would be cool if you could put the turning angle adjusted by and accumulator so the steering was variable. It would also be cool if you could adjust the range of the sensors based on the width of the track so you could stay in the middle instead of staying a certain distance from one wall. Maybe have it turn only if it was farther away from one wall than the other. Not sure if you can do that or not. I was never good at doing logic in Trailmakers.
Now you’l need to complete a captcha to race
He should play space engineers I think he would like it a lot and it is like a mix of scrap mechanic and trail makers
It’s a good idea but it might be too complex for his audience
Would be interesting to see a mini series on this where you keep evolving and try to eventually hit
DOWN WITH THE TANK GUY!
Hi scrapman. Day 15 of asking you to make a gyro free stol plane (short takeoff and landing) or a bush plane and try to get the shortest takeoff and landing you can (in trailmakers)
0:11 no. didn't make a self driving vehicle in Trailmakers. only in scrap mechanic.
Yep
I have 0 research.
The start of the race are like other drivers on their way to work in the morning😊
They should add a mode you can toggle on sensors, whether you want them to send 0 or 1 based on a threshold comparison, or if you want it to directly output the value it s detecting, so you can do comparison and arithmetic operations with said value. Would be great.
Ok so what you should think about is a sensor at 30 meters and 35 meters. if 35 true but 30 false straight. If 30 true turn right. If both false turn left.
Also put the sensor on a swivel to sweep forward when it's turning right. So as you turn off the wall, you will react faster to the wall falling away. Limiting how far away from the wall you will wander.
You would need to have it where you have a set of sensors that would try to curve you towards the other wall if it doesn't detect a wall on their side and maybe a set of sensors that middle out. I believe this should keep you more on the track. I will do some experiments with this on my own.
I built a self driving car in Main Assembly once. It could do all the four races on the main map and worked pretty well, but it took me days.
Thank you for making this!
With the new logic stuff, I feel like it should be possible to make a proportional wall follower, and potentially even a PID algorithm thanks to accumulators? That's probably how I'd approach following the wall faster, rather than trying to avoid the sand altogether.
I might also try following the right wall and use a combination of a timer + compass to avoid pitting...
I don't know, it feels very possible, but I haven't played Trailmakers - only programmed robots to do this sort of thing.
I feel like you could combine your 3 sensor head with an accumulator that the sensors feed into and a constant decrement if the sensors don't detect anything so your turning isn't as jerky
I've been wondering if this was possible and you answered that question, kind of makes me want to try
Can definitely be improved you can use the slight bump in the side of the racecourse for the sensors if perfected can go faster and more smooth
If you use an accumulator i think you could make the turns smother and btw please make a pt2 for this project where you experiment with what the comments say
Yes! I was waiting for that since the episode with first space race challenge
If you use an angle sensor that detects if the car has turned too much, it overrides the wheels forcing it to turn the other way. (just a small thought because it looks like the only problem was the car turning too much if It didn't detect a wall.
I built something that does this along with avoiding edges pretty recently, it’s on PS though.
Using wheels was painful in terms of the wheel having to return to the base state after turning and making a larger turning radius than was required, speeding up the turning can prevent this but also makes some hiccups during said turning.
I’m planning on making an autonomous vehicle that does what this video does but at a much higher speed but at the limits of the sensors and logic themselves.
No this isn’t a fundraiser; it’s a self fulfilling challenge that I wish to impose on myself.
Only 7 minutes in but wanted to comment before I forgot. What if you made the car hug the wall but put the sensors in the front and back corners. Then you add in logic to where if the front and back sensors work together. So basically if you’re hugging a wall both of the sensors on that side will trigger, but when the wall pulls away, the front sensor will detect that there’s nothing there but the back one still is. I’m thinking at this point you make the car turn. Once both sensors stop detecting the wall the car will stop turning. And if you’re approaching a turn I think you could use the front one to start the turn until both detect the wall which it should just hug it there. No clue if this will work. But it’d be nice to your thoughts
This is my favorite video since the original teardown videos when I first subscribed and have watched everyday since then. ScrapMan is at his best when he is problem solving something he is not sure he going to be able to solve. Also, was he not the first person to complete the course? He was ranked number one with no one behind him.
Scrapman has automated backseat drivers anxiety
It is actually possible to get an autonomous vehicle where the game thinks that you are sitting still, but also thinks that you're in the autonomous vehicle seat. I wonder which protocol would take over when crossing the finish line
I really would like to see a top 1% or top 10 challenge video for a glitchless 0 power core build. I'm not sure it's even possible so even if it's just trying to get as fast of a time as possible would also be really cool.
Self-driving vehicles would be really cool to have their own leaderboard.
How about a 2 or 3v1 tower defense? Set up a goal, surrounded by explosives as the target, prevent the 1 from reaching it etc…. Using various weapons and the like, would be cool.
Have you seen the micromouse competitions? It’s an IRL thing where people build robots to fit into a maze with a set grid size.
People program their robots to explore the maze then find the fastest route to the finish.
Maybe you could set up something similar in scrap mechanic with a simple wall following robot.
What about a car that is programmed specifically to the course with timers? Obviously youd want to start with a simpler course like the oval circuit.
This is a very interesting concept
2v2 dethrone, where 1 teammate builds an air vehicle to provide air support for the other person on the ground while the 2 ground vehicles duke it out for the crown
Although it's possible, I wonder how practical it would be to just use the logic to program the course. That is to say instead of 'turn right if wall left' have 'wait 30 seconds turn 30° left, wait 10 seconds turn 10° right' until it finishes the course.
I think all your sensors should have been set to 30, because currently, if the you are turned towards the wall, your sensors will all start detecting it at once, turning away from it super sharp, leading you to again be angled towards it when you turn back.
Very impressive build. Please bring back moonbo for a surprise multi player monday.
Surely he could have a bunch of timers that turn perfectly at every turn in sequence
If left wall is between 25-30 drive straight. If left wall is less than 25 turn right.
If left wall is greater than 30 turn left.
damn, now i wanna experiment on this
my hypothesis is using a mixture of the steering servo to keep it centered on the track and the actual turning when it gets too close to the wall
Surprised by your approach, tbh. I expected for wall-tracker you'd do 2 sensors on the left side: one shorter range to turn right if detecting, one longer range turning left if NOT detecting
2:23
"Keep in mind that I'm not going for the fastest time I can, (silence) I'm going for a time."
-ScrapMan 11/9/2024
I would try using speed sensors pointing upward, that detect 0.01km/h vertical movements, from the invisible lip on the edge of the track. No idea if this could work but maybe ig.
I feel like they should make a robot league in the leader boards. Can only submit a time if you're not in the creation
Ya know, if the race designers *_really_* wanted to deter self-driving cars, they should've made all the drivers control the cars from outside the race.
can't you do the driverless race by having a detachable block attached to the seat, and just leaving the seat at the start?
that would be a remote controlled car, not a self driving car
@@Cookiekopter not any more than it already is
You need a seat for it to count at the end
Having the seat is helpful just so you can have the camera follow the car.
Idea for multiplayer. You can do a EMP batle but you have extra thruster that arent hoocked up to anny controles, but if you get lucky you get extra boost when your hit.
This is a good first try now go for the leader board!
Suggestion: A speed boat with a either buoyant tank above or tank being dragged around below.