Page 1 of 1

YSFLIGHT crashes when loading my addon

Posted: Tue Apr 02, 2019 6:24 pm
by -DELTA-Maciej
So I recently decided to enter a STEM competition. Since I've been playing ysflight for some time now, I decided to make an addon of our project for testing (small, 5m wingspan UAV). i created the model, rigged it, animated, made all the srf and dat files- but when it came to booting it up, as soon as I select it the game crashes.

This is not due to the size of the model; I copied the B-2 dnm, scaled it down and used it and it still crashes. Any ideas?

Thanks in advance :D :D

here is the packaged addon. All done, just drag and drop into the main folder.
user.rar
(2 MiB) Downloaded 17 times
Paste this into your aircraft.lst: user/delta/x1/x1.dat user/delta/x1/x1.dnm user/delta/x1/x1col.srf user/delta/x1/x1cockpit.srf user/delta/x1/x1coarse.srf

Re: YSFLIGHT crashes when loading my addon

Posted: Tue Apr 02, 2019 9:59 pm
by decaff_42
(1) What operating system?
(2) What version of YSFlight?
(3) What errors if any do you receive?


Also what are you using to build your DNM? I'm seeing a weird path for the SRFs in the .dnm file.

Code: Select all

SRF "e:\Work\DELTAXYS\aill"
FIL Mesh.008
CLA 0
NST 2
STA -0.0000 0.0000 0.0000 0 0 0 0
STA -0.0000 0.0000 0.0000 0 0 0 0
POS -4.4587 0.8048 11.9849 0 0 0 1
CNT 0.00 0.00 0.00
REL DEP
NCH 0
END
END

Re: YSFLIGHT crashes when loading my addon

Posted: Tue Apr 02, 2019 10:37 pm
by waspe414
The filepath is just in the name field, so it isn't causing problems. The crashes look to me like the line count specified for one of the SRFs within the DNM is wrong:

PCK Mesh.036 170646
SURF

They look about a factor or two of ten too high on cursory inspection, compared to other .dnms.

Also you mispelled cockpit in the cockpit filename.

I popped the model into Blender, and a) it's 200,000-odd faces, which is way excessive, b) engine innards and aileron models are floating around at like five times the drone scale (the engines accounting for a good 50k faces each). It looks like you copied the wing geometry twice, because there are two wings, one above the other, and they both have waaaay more faces than they need for YS. The landing gear springs also have way too many faces, and you could get rid of them entirely.

Probably your best bet would be to rebuild a low-poly model from scratch, because that will be faster than trying to break down the existing model. I don't know specifically what is causing YS to crash, but it could well be the massive face count.

Re: YSFLIGHT crashes when loading my addon

Posted: Tue Apr 02, 2019 10:56 pm
by decaff_42
200k faces is excessive in the extreme. I think Flasheart's Concorde topped out at like 110k vertices
Normal models range from 2k to 20k with more detailed models getting up to 40-50k vertices

Re: YSFLIGHT crashes when loading my addon

Posted: Wed Apr 03, 2019 5:24 am
by -DELTA-Maciej
I'm going to remake the model from scratch, this was a temporary model taken from our renders. I just wanted to know why exactly is it crashing; like i said, even the B2 model crashed.

Also, does ysflight handle small values well? The model has a wingspan of around 5 meters

Thanks for the replies :D

EDIT:
Forgot to add; running windows 7 with the latest version of YS. Also tested on 2012 release, still crashes, same error code (after a quick google search, "occurs when a process (application, driver, etc.) tries to execute a processor command that references memory outside the space allocated to that process by the Operating System."
This doesnt quite fit; the B2 model crashes as well. Im very confused.

Edit #2: I'm using blender 2.49. These massive ailerons and engines should be gone, I deleted them because animating them was utter hell. Blender shouldn't be importing them, no clue why this is happening.

Re: YSFLIGHT crashes when loading my addon

Posted: Wed Apr 03, 2019 2:35 pm
by waspe414
I replaced a stock aircraft with the X1 .dat file and it crashes YS. I've never experienced this before, but something in the .dat is the problem.

EDIT:
Aha! It's the WEAPONCH line that doesn't have a value after it, so it's reading it as a null (because the next value is RADARCRS which is a variable). You can delete it and it works fine.

It also has a negative CL slope error (negative coefficient of lift) and a negative CD constant (coefficient drag) error. You can fix these by setting REFTCRUS to more than REFTHRLD (I suggest 0.7 or 0.8 for cruise and 0.2 or 0.3 for landing), and decreasing landing speed to 62kt or less (or increasing cruise speed to 0.4).

Re: YSFLIGHT crashes when loading my addon

Posted: Wed Apr 03, 2019 3:11 pm
by -DELTA-Maciej
Holy jesus, thank you so much!!! :D :D Was thinking all day what was wrong, I tried checking if my files force ysflight to use memory it doesnt like. Again, thank you!
Also, for getting gear and cockpit positions, what would you recommend? I can't seem to find a way to do this well.

Re: YSFLIGHT crashes when loading my addon

Posted: Wed Apr 03, 2019 5:31 pm
by waspe414
You can set gear and cockpit positions by trial and error (set a number, check where it sits relative to the model, modify number, check again), or find the location in Blender and use those coordinates. I tend to use trial and error, and Decaff will know more about the Blender process.

Re: YSFLIGHT crashes when loading my addon

Posted: Wed Apr 03, 2019 7:37 pm
by -DELTA-Maciej
Trial and error is not an option- aircraft blows up as soon as I spawn on the ground.

Re: YSFLIGHT crashes when loading my addon

Posted: Wed Apr 03, 2019 8:37 pm
by waspe414
Set the gear position lower. The aircraft is blowing up because the origin is crossing below the ground, or enough of the collision file is. Probably a good idea to double check the .coll anyway by changing aircraft quality to minimum with the Control menu in-flight.

Re: YSFLIGHT crashes when loading my addon

Posted: Wed Apr 03, 2019 10:47 pm
by decaff_42
I place an empty where I think the head position should be and take that coordinates (Y,Z,X) into the .dat file

Re: YSFLIGHT crashes when loading my addon

Posted: Thu Apr 04, 2019 5:14 am
by -DELTA-Maciej
Thanks a lot! I'll try it later today. I'll also start rebuilding the model, although this one works fine (no problems at all).

Re: YSFLIGHT crashes when loading my addon

Posted: Mon Apr 08, 2019 2:20 pm
by Lupus 1
I would help you out, but I know nothing about creating mods. sorry.

Re: YSFLIGHT crashes when loading my addon

Posted: Mon Apr 08, 2019 4:39 pm
by waspe414
Lupus 1 wrote:
Mon Apr 08, 2019 2:20 pm
I would help you out, but I know nothing about creating mods. sorry.
It's a good thing the problem has already been solved, then.

Re: YSFLIGHT crashes when loading my addon

Posted: Tue Apr 09, 2019 12:05 pm
by Lupus 1
waspe414 wrote:
Mon Apr 08, 2019 4:39 pm
It's a good thing the problem has already been solved, then.
yeah... I just saw that seconds after I posted...