bradenhurl / DeepGTAV-PreSIL

GNU General Public License v3.0
78 stars 16 forks source link

Freeze - Long loading when Start #2

Open Hokyjack opened 5 years ago

Hokyjack commented 5 years ago

Hello, when I'm in the game, and send Start command to the server to begin collecting data, the game freezes for about 45 seconds, and than it teleports the player to the spawned and begin. Is this long delay normal? Is it possible to speed it up?

Also the capturing one frame (depth+stencil+annotations) takes around 6 seconds. Is this a normal behaviour? Are there any possibilities to speed it up? I know reducing the game resolution helps a bit, but I guess it is not possible to collect the data close to the real-time? Maybe using RAM cache for storing buffers and than save to HDD using another cpu thread?

Thanks, Jan

bradenhurl commented 5 years ago

Hi Jan,

Yes, this delay is normal. I had the application on an SSD which helps. If you find a way to reduce startup time please share.

6 seconds is also normal behaviour. There are definitely possibilities to speed it up. I am busy with another project for the next couple months but some good options to start are:

Best regards, Braden

Hokyjack commented 5 years ago

thanks for the fast reply, Braden!

yes, I use M.2 SSD which definitely at least speeds up loading the game, I'll try to look what is causing this initial freeze when starting the data collecting process, because with original DeepGTAV, there is some initial teleporting and setting up, but it is definitely faster and it doesn't freeze the game.

I'll also try to profile the functions to see which take most time, since I don't always need all the data (e.g. LiDAR, or some of the annotations).

I'm also planning to add support for multiple cameras mounted on car, with individually set FOV for each of them. Do you know wheter is it more efficient to move/change params the main (only one) camera at each gameframe and grab the data from this one, or define more cameras and just switch between them?

Thanks , good luck with your other project!

bradenhurl commented 5 years ago

That would be a great contribution if you could solve the issue!

I haven't experimented with efficiency too much as I had a spare machine to let the game run on. You can start with the function generateSecondaryPerspective to see how I generated multiple camera views. I will be releasing another paper describing this shortly. There are a couple problems with switching cameras you should watch for:

  1. The cameras don't seem to switch properly when the game is paused, you can see how I set the game speed to 0 to compensate for this however it still causes synchronization issues, especially when using large amounts of camera position switches.
  2. I had cases where the proper image wasn't acquired unless I flushed the buffer multiple times when paused then waited. You can try playing around with this if you wish but the problem is fairly inconsistent and can be difficult to spot.
Hokyjack commented 5 years ago

Thanks for the suggestions and tips. I'll stay in touch, and share the outcome once I have some changes or new features.

Good job on creating this repo!

lpplbiubiubiub commented 4 years ago

Parsing the "path.xml" is time-consuming, and it could be removed.

Hokyjack commented 4 years ago

Parsing the "path.xml" is time-consuming, and it could be removed.

can you point out where does it happen? I only found referencing the paths.xml here: https://github.com/bradenhurl/DeepGTAV-PreSIL/blob/635808cae200a001cabe4e519b001b179788a3fd/Scenario.cpp#L148

but it seems it only uses that file, when the "rewarder" is specified, otherwise it just ignores the file, or not?

lpplbiubiubiub commented 4 years ago

Parsing the "path.xml" is time-consuming, and it could be removed.

can you point out where does it happen? I only found referencing the paths.xml here: https://github.com/bradenhurl/DeepGTAV-PreSIL/blob/635808cae200a001cabe4e519b001b179788a3fd/Scenario.cpp#L148

but it seems it only uses that file, when the "rewarder" is specified, otherwise it just ignores the file, or not?

I modify the function "void LaneRewarder::populateNodes(const char*pathsfile)" and edit "path.xml", and it works.