All right.

I wonder if anyone here testet actor car movement without attaching them to a path or let them scan for a certain texture color or texture beneath them.
Some time ago I watched the behavior of the cars in Mafia 1 at a crossing. I noticed that the cars instantly started steering to the right or left when reaching a certain position at the crossings which means nothing else that they were now on a new tile (block) centered at the crossing. The borders of the crossing blocks could still be seen a little.

So I assume that the cars are moving through lost heaven constantly scanning the blocks beneath them and when finding a certain block with a name like left/right the car can decide to start turning to the new direction with a fixed or RND chosen algorithm from the car script.

I think the advantige of car movement like that also is that the actor cars can check you, the player car, and change their behaviour. Like letting you not pass or, if the actor car comes from behind, it can overtake or brake and more. Street tiles (blocks) can be used to control the direction of actor cars so they do not leave the street or crash into any other objects or kill pedestrians (by scanning the front space of the car)

Blocks could also be placed beneath a terrain.

Programming could look like this for actor cars front scanning. (Pseudocode)

If scan result = Pedestrian
then brake and play horn sound or abuse :-)
endif

If scan result = car
get speed from that car and slow down
or stop (if car in front speed is zero)
or overtake (if car is parking)
endif

If scan result = traffic light in red (stop)
stop car
endif

if scan result = traffic light in green (stop)
Start moving again
endif

and so on.

If i find some time I'll try to create a demo level just to learn if this works.

Maybe you find this helpful
Have a nice day

Neodumont

Last edited by NeoDumont; 04/30/20 14:39.