Traffic cars

Traffic cars

Postby MirceaKitsune » 13 May 2013, 20:43

This is probably a large and very iffy idea, and 95% it won't get done. I'm going to suggest it either way still. Just append "if someone were to code it" to everything said here :) But yes... I'd love it if we had traffic cars roaming the roads during races. There are probably many questions and aspects, so here's a list of my exact thoughts on the matter:

First of all, why I believe this would make sense to have. StuntRally is an outdoor racing sim, often featuring large roads through natural environments. Nothing suggests the races are taking place in an organized environment or an area off-limits to cars that aren't racing. The reason I think they'd be a nice addition is that they'd make the world feel more alive and the player less alone, while also giving players something to dodge on the road. I admit that part of why I want this is also that illegal racing feel (like Need for Speed) :cool: Lastly, I plan on trying to create some city tracks... which is a more distant and different matter but this would make that a lot more possible too.

Now for how I personally imagine this being implemented: Traffic cars should use the same car models (and possibly physics / parameters) as player cars, only that they spawn on roads when a player is close enough and are controlled by an AI. This shouldn't require major changes in the editor, but roads should have options to specify the amount of traffic and the types of cars to spawn (as different environments can have different genres of cars). The track should decide if and where to use them, and there should also be a game option whether traffic should be enabled or not (maybe off by default).

General behavior: They always drive legally and under the speed limit. Speed limits as well as lanes can be automatically calculated based on the width of the road, or simply added as road options in the editor. For the first scenario, if the road is wide enough to fit two cars then two lanes are assumed, while if it's wide enough to fit four then it assumes four and so on. Rightmost lanes are for going forth while leftmost lanes for going the opposite way. Since traffic cars would drive slowly and there's no risk of spinning or going out of control, the AI for them should be extremely simple (much more than for racer bots which are a different subject). Currently roads can't be divided and circuits are looped, so there won't even be any decision making.

Crashes and obstacles: Players would obviously crash into traffic cars a lot. Best and simplest behavior would be for the AI of a traffic car to shut down when that car is touched. This way, even if a traffic car is flipped or thrown out of the road in the collision, we don't have to worry about it finding its way back to the road. But what if the player is simply standing on the road or a disabled traffic car is blocking the way? I guess traffic cars would have to detect if something is in front of them by X meters and stop + wait if it is (until the obstacle disappears). This should be possible with a simple trace.

I think those would be the basic concerns, and the only important aspects needed to make this possible. Only downside is that loops, overly coiled pipes and jumps would be impossible to navigate by such cars (pretty obvious). I know it's horribly unlikely someone will actually get around to doing this (I can't understand the code to help myself :( ) but there's always hope. If someone were to do it however, it's surely a possible task and IMHO fitting to the style of StuntRally. What do you think about the idea?
User avatar
MirceaKitsune
 
Posts: 15
Joined: 12 May 2013, 11:07

Re: Traffic cars

Postby CryHam » 17 May 2013, 08:52

Yeah well, there aren't any cars while driving on rally tracks. Our tracks don't also look like there were any cars or people there.
And yes, this is a very big gigantic thing to implement.
I did once think of implementing people too (is even more gigantic), and having a Carmageddon like gameplay, but that was already done in Carmageddon and you can't simply beat that awesome game (only tire simulation annoyed me after some time).
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Who is online

Users browsing this forum: No registered users and 1 guest