[MOD 0.12.x] Pavement Drive Assist

Topics and discussion about specific mods
mawnicker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Apr 11, 2016 3:38 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by mawnicker »

This mod is awesome. They should just add it to vanilla. I have some requests:

I'd like to enter "autonomous driving mode" with a separate key. Like shift-W. Then I'd like it to exit back to normal mode any time I hit another movement key (W A S D). Perhaps shift-A and shift-D could be used to make turns in intersections.

Also, I use the color-coding mod. I make little "roads" in my otherwise paved factories with the black concrete. You could support this (and pretty much everything I can think of) by detecting the road's tile when the player hits shift-W. In vanilla you could make roads (in paved factories) with stone.
sillyfly
Smart Inserter
Smart Inserter
Posts: 1101
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by sillyfly »

mawnicker wrote:This mod is awesome. They should just add it to vanilla.
Thanks for the feedback, I'm glad you're enjoying it!
mawnicker wrote:I'd like to enter "autonomous driving mode" with a separate key. Like shift-W. Then I'd like it to exit back to normal mode any time I hit another movement key (W A S D). Perhaps shift-A and shift-D could be used to make turns in intersections.
As far as I'm aware mods can't register custom key handlers, so sadly this is impossible. One option would be to make an on-screen button for it, but I'm hesitant, because I don't like it when the UI is too cluttered. This also means the turning in junctions would have to be with on-screen buttons, which makes it much less convenient.
mawnicker wrote:Also, I use the color-coding mod. I make little "roads" in my otherwise paved factories with the black concrete. You could support this (and pretty much everything I can think of) by detecting the road's tile when the player hits shift-W.

I'll look into color-coding and add their tile types.
mawnicker wrote:In vanilla you could make roads (in paved factories) with stone.
I'm not sure what you mean by this... you mean the mod should prioritize bricks over concrete? I don't think it's very logical, as you drive faster on concrete.
mawnicker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Apr 11, 2016 3:38 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by mawnicker »

Throwing out the custom key handler is a bit of a problem. I'm looking for a way to detect the road-tile dynamically. It'd be nice if you didn't have to hand code it for different mods. I think you can call get_tile and pass in the players position. Without using Shift-W as a trigger you could just check this periodically and maintain a sliding window kind of a thing. If the player has mostly been on tiles of type X for the last T ticks then that's the road tile. For turns maybe you could just bias the "score" towards the cursor. I think there's a way to convert cursor position to map position.
sillyfly
Smart Inserter
Smart Inserter
Posts: 1101
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by sillyfly »

Updated to version 0.0.5, with a very minor config tweak, and more importantly tiles from color-coding mod.
Zaflis
Filter Inserter
Filter Inserter
Posts: 514
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by Zaflis »

Hey, it appears i published a mod that reminds yours alot viewtopic.php?f=92&t=25501
MIT licence is good, feel free to compare and check if there is something you would like to do differently if want to. It is just alot simpler it seems, not tracking on where it's driving at all for example.

edit: Oh snap, mind if i copy something along the lines of the for-loop structure for player variable? That seems essential for multiplayer.
sillyfly
Smart Inserter
Smart Inserter
Posts: 1101
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by sillyfly »

Sure, go ahead :D

Glad you could learn something form my messy code ;)
maurojunior2011
Inserter
Inserter
Posts: 32
Joined: Wed Mar 23, 2016 9:51 pm
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by maurojunior2011 »

Good evening. This "MOD" is amazing, and the use for a long time. Congratulations.

I realized the staff generally speaking, enable the MOD only on some cars or paths the user's choice.

I would also like, it would help a lot. mostly walk with the vehicle within the base.

A simple suggestion would be: If the car contains a particular item (Example:. Vehicle.get_output_inventory () get_item_count ("iron-plate")> 1), the MOD work in that vehicle that the player is.

It would be enough just to enter this condition in the code of the IF. You can also create a custom item, if you want, it would be the item to add to the car's trunk.
Anson
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sun May 22, 2016 4:41 pm
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by Anson »

I enjoyed this mod a lot when driving around in my 0.12 factory,
then i did a modless run for achievements in 0.13,
and now try to find a set of mods to play on 0.13,
but couldn't find an update of this mod :-(

IF this mod is updated for 0.13, i might have a suggestion concerning the selection of which types of pavement to prefer and which to avoid ...

most people probably will drive on the fastest pavement (concrete), but some people might have their entire factory covered with concrete to run as fast as possible everywhere and use stone roads for their cars (speed is less important when i simply hold "W" until i am at the destination :-) and there are lots of other variations for possible roads with all those colored concrete etc. I myself started building roads from stone which are lined by concrete and in that case stone should get a positive weight and concrete a negative weight for computing the path.
highway.PNG
highway.PNG (83.37 KiB) Viewed 5384 times
Thus it might be nice to be able to configure those weights somehow. a simple method would be to have it hardcoded in the mod, but there might be several other methods to adjust player's preferences. besides a GUI that takes up screen space and takes work to make it look nice, the tiles of choice might be put somewhere ingame. simple but a bit difficult to handle would be when a piece of stone/concrete is put in the trunk of a car and thus specifies on which type of tiles the car should drive.

on first sight a bit more complicated to implement, but maybe really easy compared to the other methods, would be to create a new item, a "traffic coordinator" or something like that which really is a simple constant combinator only. in that traffic controller (constant combinator), people could set all kinds of positive and negative weights for all kinds of pavement and none of them would have to be known to this mod. I am no mod programmer, but if all floor tiles have some general "floor" type, the mod could simply count all those floor tiles around the car (without knowing the mods that have generated them), multiply those numbers with the given weights (signals) and steer towards the bigger values.

maybe a bit too simple and a lot more difficult to implement, but "just an idea" :-)

and most important would be anyway, that there is any kind of update for 0.13.
Thanks in advance.
User avatar
GlassDeviant
Fast Inserter
Fast Inserter
Posts: 170
Joined: Wed Feb 11, 2015 1:51 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by GlassDeviant »

Unfortunately the times I need some kind of driver assist are usually the times I am laying roads or rails, making it a sort of catch 22 situation.

:D
- GD

Sorry if my posts are becoming difficult to read, my typing ability is rapidly deteriorating due to a nerve disorder. I try to clean them up before posting but don't always get every last typo.
User avatar
Arcitos
Inserter
Inserter
Posts: 38
Joined: Sat Dec 03, 2016 1:50 pm
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by Arcitos »

Sillyfly, i enjoyed your mod and even built some sort of highway network in my 0.12 games, which was really cool.

But now it seems that this mod is no longer maintained, as there is no update for 0.13 or 0.14.

Out of curiosity i started to work on a 0.14-Version of Pavement Drive Assist for personal use. I added some things i thought they might be useful, tweaked parts of the code and so far the new version is working perfectly for me. Now i want to ask you if i am allowed to post this new version on the mod page. Of course credit is yours and i would mark the parts in the code deriving from your first mod version. But i think the ingenious idea behind your mod should once again made accesible to the public. What do you think?
sillyfly
Smart Inserter
Smart Inserter
Posts: 1101
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: [MOD 0.12.x] Pavement Drive Assist

Post by sillyfly »

I have marked my code as using MIT license, so yes, you may alter it and post a derived version. Basically you are only required to give credit and include (I believe linking is enough) the original license.

See: https://tldrlegal.com/license/mit-license
Post Reply

Return to “Mods”