Esri / arcgis-maps-sdk-unreal-engine-samples

Sample code for the ArcGIS Maps SDK for Unreal Engine.
https://developers.arcgis.com/unreal-engine-sdk/
Apache License 2.0
73 stars 36 forks source link

Flight simulator sample - Physics update #19

Closed PauFlorenti closed 4 months ago

PauFlorenti commented 2 years ago

Sample

Updating the Flight Simulator sample in its branch.

Summary

ArcGIS Maps SDK Version 1.0.0

mrnelson6 commented 2 years ago

Ok a couple things of feedback. Overall looks good.

  1. There is an API Key in your level. Can you remove that?
  2. Can you make it so the ship has a higher top speed and a faster acceleration? I think it would be cooler if the pilot was able to cover larger distances. With that being said I noticed something weird when you went a distance from the start where the airplane disappeared do you know what is up with that?
  3. We want the sub levels to be linked to the parent SampleViewer level. So when you launch the sample viewer level it is visible on the side bar. To accomplish this you need to first click Window->Levels-> and Add the flight sim level. and the other thing you need to do is add another entry in the SamplesDataTable for your level
PauFlorenti commented 2 years ago

API key removed and top speed increased to x3 what it previously was. I could not reproduce the airplane disappearing. Does it happen straight from the track at a distance? Or by doing a specific path or movement? Level has been added to the sampler viewer level, but I found a few issues when restarting the level after crashing the plane regarding the API Key.

PauFlorenti commented 2 years ago

@arash-sh I've found an issue working in this sample. When loading the level from the sample viewer level, the mouse is not being captured for the movement of the ship. Any leads on why the mouse is not being captured?

arash-sh commented 2 years ago

@arash-sh I've found an issue working in this sample. When loading the level from the sample viewer level, the mouse is not being captured for the movement of the ship. Any leads on why the mouse is not being captured?

In the SampleViewer level, the mouse is only captured when a mouse button is pressed. I think the controls should be changed in so that it behaves the same way in the standalone level. I also noticed that the SampleSelector UI is removed when the flight sim level is loaded. Is that OK @mrnelson6 ?

Other comments:

arash-sh commented 2 years ago

I don't know if it makes sense from the physics/realism point of view, but for me it feels more natural if the keys 'e' and 'q' only change the yaw rather than the whole rotation. Right now, for example, if the plane is tilted upwards and you hold 'e' it will end up pointing downwards. You can change this in the UpdateYaw function by using the up vector of the ENU transformation without multiplying it with the rotation of the ship mesh. But you should get the opinion of others on this as well.

In the UpdateYaw/Pitch/Roll functions, I don't think the Lerp has an effect since the alpha value is constant. You can remove the lerp and adjust the speed value instead.

I wasn't able to run the flight simulator level (without loading it through sample selector). The plane falls through the surface before the map is loaded. I think you should place the Ship_BP in the scene instead of using the game mode

When the plane crashes and the level is restarted there is a blueprint runtime error in the SampleSelector

If I remember right, this sample should use a global scene. This may cause some new problems that need to be fixed.

PauFlorenti commented 2 years ago

The ship exploding at the beginning of the level is due to the elevation being enabled in the MapComponent, so to avoid the ship crashing at the beginning I am delaying the elevation of the map for a few seconds. The ideal would be to have a way for runtimecore to tell us if the map is fully loaded and then spawn the ship and start flying. Until that is not added we will stick with this solution.

PauFlorenti commented 2 years ago

It would be nice to improve the "flight dynamics" like when you want to go right, you'll press the right key (D or Arrow Right) and the plane will yaw to the right while rolling to the right as well. When you stop pressing the right key, it would stop rolling.

Do you mean to roll and change pitch at the same time with just pressing a key? I don't think that is the way a plane should move, I believe we should give the option to roll, pitch and yaw independently. We could add another key to do both roll and pitch at the same time though

airaolagoitia commented 2 years ago

I think you should merge unless somebody else has comments. @mrnelson6 can review when he's back.

airaolagoitia commented 2 years ago

@mrnelson6 can you give this a look before we merge it?

Jade-JadeH commented 1 year ago

I'm checking this PR today to see if we should close or keep it. but was not able to compile this with 1.0.0 (which is what this was built for). @PauFlorenti Do you think it's worthwhile to make this to work with the current version?

image

airaolagoitia commented 1 year ago

@Jade-JadeH that error is probably due to an unclean setup

Jade-JadeH commented 1 year ago

@airaolagoitia I did try a clean setup by removing all unnecessary folders and the VS file

airaolagoitia commented 1 year ago

@Jade-JadeH I tested Pau's branch with 1.3. The only issues I got were:

both easily fixable.. I wasn't able to push the fixes probably because this is in Pau's account repo.

Jade-JadeH commented 1 year ago

@airaolagoitia Ok thanks was able to get that to work, still have other two issues @PauFlorenti which is that

  1. when you open the flightsim level, and put API key in the ArcGISMapActor, you get the "Game Instance has no valid widget menu!" error and plane just crashed. This error doesn't occur when you open from the sample viewer level.
  2. the H key doesn't work

Other than this the sample looks great. I do think that when the speed drops the plane's falling speed needs to be faster @avr757 also the UI needs to be reworked too