harfang3d / dogfight-sandbox-hg2

Air to air combat sandbox, created in Python 3 using the HARFANG 3D 2 framework.
GNU General Public License v3.0
161 stars 48 forks source link

A Bug where "set" will affect the speed of "get" #96

Open fangyichen123 opened 4 months ago

fangyichen123 commented 4 months ago

Sorry to bother you, I'm back again. I found a possible bug in your project. I have done many tests in my own projects and your project(Both in Ubuntu20.04). I found the following problem:

If a function "df.set_plane_yaw()" that sets environment parameters is executed at some point before a function "df.get_plane_state()" that gets environment information is executed, the speed of "df.get_plane_state()" will become very slow, which looks like an abnormal delay. Otherwise, the speed of "df.get_plane_state()" is normal.

image The above figure shows the normal speed of obtaining status information. This speed is obviously no problem. But if I add the "df.set_plane_yaw()" function in front, the following will execute very slowly:

image As you can see, the time increased from about 0.0003 to about 0.040 seconds!!

My guess is that this may be because the TCP connection is disconnected when "df.set_plane_yaw()" is executed, and reconnection is required to obtain status information again. There may be other reasons, but I don't know how to solve them.

For single-agent reinforcement learning training, this time delay may be acceptable, but for large-scale multi-agent reinforcement learning, because the state information of each agent needs to be obtained, this delay will greatly affect the training speed. I really need your help!

fangyichen123 commented 3 months ago

Hi, could you please give me some suggestions on this issue?

muraatozbek commented 3 months ago

Hi, Thank you for your contribution. I will check cause of this situation and let you know.

fangyichen123 commented 3 months ago

OK, thank you very much!

fangyichen123 commented 3 months ago

Is there any progress on this issue?

Angar0Os commented 2 weeks ago

Hello ! Sorry for the delay of the answer. We are working on this issue right now and keep you updated. Thanks for your patience.