The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key 1 - Line: 866 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Forums
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. Big Grin Big Grin


- 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
        for (vector <QUATERNION>::iterator i = startquat.begin(); i != startquat.end(); i++)
        {
                //*i = i->ReturnConjugate();
                i->Rotate(3.141593, 0,1,0);
        }
</edit>