Jump to content

[SOLVED] [2.6.1] Unigine Editor crashing when loading world


photo

Recommended Posts

Hello,

I attached a zip that contain a data folder I am currently trying to use in Unigine 2.6.1.

The editor crashes while trying to load the world "1901".

The crash seems to be happening at an update_surfaces function at line 125.

Is there something wrong with the meshes in the data folder?

Thanks in advance

data.zip

Link to comment

Just to be more precise, the crash happens in Unigine::Object::update_surfaces.

image.png.56fb0451a47aeb80c4ba9378dff46b4f.png

Link to comment

Hi Karim,

I've tried to load your sample, copied it to the new project and got following errors on loading:

14:15:03 Unigine~# world_load "1901/graphics/skins/1901"
14:15:03 Xml::load(): can't open "Environment.prop" file
14:15:03 PropertyManager::load(): can't open "Environment.prop" file
14:15:03 Xml::load(): can't open "Label.prop" file
14:15:03 PropertyManager::load(): can't open "Label.prop" file
14:15:03 Xml::load(): can't open "FlashingLight.prop" file
14:15:03 PropertyManager::load(): can't open "FlashingLight.prop" file
14:15:03 Xml::load(): can't open "1901/graphics/layers/test_track_trackbed.node" file
14:15:03 World::loadNodes(): can't open "1901/graphics/layers/test_track_trackbed.node" file
14:15:03 NodeLayer::loadWorld(): can't load "1901/graphics/layers/test_track_trackbed.node" node
14:15:03 Editor::load_world(): can't load "NodeLayer" node
14:15:03 Xml::load(): can't open "1901/graphics/layers/platform.node" file
14:15:03 World::loadNodes(): can't open "1901/graphics/layers/platform.node" file
14:15:03 NodeLayer::loadWorld(): can't load "1901/graphics/layers/platform.node" node
14:15:03 Editor::load_world(): can't load "NodeLayer" node
14:15:03 Xml::load(): can't open "1901/graphics/layers/enviroment.node" file
14:15:03 World::loadNodes(): can't open "1901/graphics/layers/enviroment.node" file
14:15:03 NodeLayer::loadWorld(): can't load "1901/graphics/layers/enviroment.node" node
14:15:03 Editor::load_world(): can't load "NodeLayer" node
14:15:03 Xml::load(): can't open "1901/graphics/layers/terrain.node" file
14:15:03 World::loadNodes(): can't open "1901/graphics/layers/terrain.node" file
14:15:03 NodeLayer::loadWorld(): can't load "1901/graphics/layers/terrain.node" node
14:15:03 Editor::load_world(): can't load "NodeLayer" node

More likely if you will fix them there will be no crashes, but it's hard to tell.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

I've checked meshes that you have in this project and I guess it would be better if you fix them before actually saving to the .world file.

Try to add some generic name for each surface instead of leaving it completely empty. While it technically possible in earlier releases like 2.6, it's better to have named surfaces to avoid any issues in the future.

Second issue that I can see - you have very large offsets from mesh pivot. In some meshes it can be even 40 kilometers. In .mesh files all the vertices are stored with float precision, so you may have issues with mesh shaking or incorrect vertex positions when camera moves near surfaces. It's better to keep offset from pivot to actual mesh less than 10km, ideally no offset at all. If you generate this meshes from some external data anyway you can instead try to save offset (positiion) to the .world file rather than baking directly to the .mesh. It should also make spatial tree update a bit easier and faster, since 6000 meshes would not be placed in a single coordinate and would be scattered around the world.

Third issue is the normals generation. A lot of surfaces has some inverted or weird-looking normals (checked them in the latest Editor):
image.png

As a result you will get incorrect lightning for these objects (they may appear dark when directly lit by sun).

We need some additional time to debug crash, but in the meantime if you can at least add names for surfaces and check one more time - it would be great.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Yes, we are aware of these issues. We are currently planning to migrate all of our OpenSceneGraph CGI content into Unigine 2.6 and then to 2.15.

The data is converted using an editor plugin.

Yes, the large offsets will be reduced in the future version of the plugin.

Link to comment

Could you please check maybe you have stored previous SDKs somewhere in your intranet / file servers? If you don't have anymore access to previously downloaded 2.6.1.1 Source SDK, I can send you a new link in PM, just let me know.

To fix this issue you need to change void Object::changed_mesh() in <SDK>/source/engine/objects/Object.cpp to this implementation:

// fix works only for 2.6.1.1 SDK
void Object::changed_mesh()
{
	if (!is_changed_mesh())
		return;

	// number of surfaces
	int num_surfaces = get_num_surfaces();

	Vector<Surface> surfaces_new;
	surfaces_new.resize(num_surfaces);

	for (int i = 0; i < num_surfaces; i++)
	{
		String name = getSurfaceName(i);
		int id = surfaces_name.findIndex(name);

		Surface &s = surfaces_new[i];

		if (id != -1)
		{
			s = surfaces[id];
		} else
		{
			// create surfaces
			s.options.set(OPTIONS_DEFAULT);
			s.light_mask = 1;
			s.viewport_mask = 1;
			s.intersection_mask = 1;
			s.collision_mask = 1;
			s.material_inherited = false;
			s.property_inherited = 0;
			s.material = engine.materials->getBaseMaterial(getMaterialNodeType());
			s.property = engine.properties->findProperty("surface_base");
			s.sector = nullptr;
			if (s.lost_material_guid.isValid())
				engine.materials->removeSurfaceWithoutMaterial(this, i);
			s.lost_material_guid.clear();

			// create surface lods
			s.enabled = 1;
			s.folded = 0;
			s.visible = 1;
			s.faded = 0;
			s.parent = -1;
			s.min_parent = 1;
			s.max_parent = 1;
			s.min_visible_distance = -INFINITY;
			s.max_visible_distance = INFINITY;
			s.min_fade_distance = 0.0f;
			s.max_fade_distance = 0.0f;

			// create surface bounds
			s.bound_box.clear();
			s.bound_sphere.clear();
		}
	}

	if (num_surfaces > surfaces_size) // new additional check
	{
		surfaces_name.resize(num_surfaces);
		surfaces.resize(num_surfaces);
	}

	for (int i = 0; i < num_surfaces; i++)
	{
		surfaces_name[i] = getSurfaceName(i);
		surfaces[i] = surfaces_new[i];
	}

	surfaces_size = get_num_surfaces();
	update_world_position();
}

Thanks!

  • Thanks 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • silent changed the title to [SOLVED] [2.6.1] Unigine Editor crashing when loading world
×
×
  • Create New...