The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
modify AI drivers and track - Printable Version +- Forums (https://www.vdrift.net/Forum) +-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4) +--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9) +--- Thread: modify AI drivers and track (/showthread.php?tid=740) |
modify AI drivers and track - mpo - 07-27-2007 Hi,i have two questions: 1) i have tried to inspect the code but i don't find where the AI of the computer drivers is implemented. 2) What i have to do if i want to modify a track? i have to use Blender? if yes, what i have to do to import in blender the model of the track? thanks. - rookie1 - 07-28-2007 1) It's in src/ai.cpp 2) What kind of modification do you want? Modify the track parameters, or actually modify the track objects? If it's the former, you can use track editor to do that. I don't think you can import the whole track into blender to modify the objects. - mpo - 07-31-2007 i want to modify the track object but i don't find the track editor, where is it? Just an other question,i need that the car controlled by the computer run on the contrary in the track, i have tried to modify the function UpdateSteer, now the car run on the contrary but don't follow the street. Probably i haven't understand really well as it comes calculated the next angle of steering, someone say something about it? thanks a lot. - rookie1 - 07-31-2007 At the car selection menu, there is an option 'Reverse Track'. If it's on, you will race in the reverse direction of the track. Is that what you want? - mpo - 07-31-2007 Not exacltly, i need that the other cars (the cars controlled by the computer) run in the opposite sense to mine. I'm using Vdrift for a project and this is one of the point that i have to do.. - joevenzon - 07-31-2007 Is this an assignment for a class or something? - kidrock - 07-31-2007 He said earlier a project where hes trying to make a virtual helmet correct? i think what he wants is to simulate a car passing you on your left as what would happen in traffic. ![]() ![]() - mpo - 07-31-2007 it's a school project, i have interfaced the game with an head mounted display and now i have to modify something to test the ability of the user, one of this thing is modify the ai of the other car, so the user have to avoid the other cars during the game. I have seen that i have to modify the function "updateSteer" in the file ai.cpp but with the modify that i have done the car turns on the contrary but don't follow the street.. - kidrock - 07-31-2007 I see what you are saying. thats a bit out of my ability. any ideas joe? (good luck with your project!) - FFuser - 07-31-2007 mpo Wrote:I have seen that i have to modify the function "updateSteer" in the file ai.cpp but with the modify that i have done the car turns on the contrary but don't follow the street.. Well, I can be wrong, I never programmed the ai. But I think it works as follows: It has a set of vectors that marks the street. from their it calculates the best route. So if you reverse the set of vectors the AI is going to follow the opposite direction. - rookie1 - 08-01-2007 If all you want is to test the functionality, why not just set the 'reverse track' option? AI will drive in the reverse direction. You, as the player, can drive in whatever direction you want. <edit>Come to think of it, there is actually no change required. Just let AI drive normally, and ask the player to drive in the reverse direction. Wouldn't this achieve the result you want?</edit> - mpo - 08-01-2007 Not exactly, with this solution the user have to change his direction when start the race, i have to modify the code to avoid it, in this way all will be automatic. - rookie1 - 08-02-2007 Ok. If that's the case, all you need is to reverse the player's starting orientation. If you want to do it programmatically, check out function TRACK::ReverseStartingPositions(). This function calculates the reverse starting position and orientation when 'Reverse Track' option is set. Note that this function calculates the reverse for all cars. In your case, you only need to reverse the 1st starting location and orientation in the list, which is what the player car uses. <edit>Sorry, the reversing of start orientation is done in TRACK::Reverse(). The relevant lines are, Code: //reverse start positions |