Model texture on mission screen

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
phkb
Commodore
Commodore
Posts: 2415
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Model texture on mission screen

Post by phkb » Thu Feb 16, 2017 9:32 am

I don't know if I've messed up somewhere, but anyway...

On the left is a mission screen with the model set to be "[Casteroid1]" from the Asteroid Storm OXP.
On the right is that same asteroid, but seen in space.

Image

Do I need to do something special to the mission screen to get the texture to appear? Or is this something to do with the Asteroid Storm OXP?

This is in v1.84 and v1.85.

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13652
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Model texture on mission screen

Post by Cody » Thu Feb 16, 2017 5:05 pm

I don't know the answer (though I feel I probably should), but is that a parcel delivery to a rock hermit (or something similar)?

Have you tried with an alternative asteroid - one of Griff's, perhaps?

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Disunited Kingdom
Contact:

Re: Model texture on mission screen

Post by Smivs » Thu Feb 16, 2017 7:47 pm

It looks a bit 'purple' which suggests it's not finding a texture, but there does seem to be a bit of texture on the 'display' one. Either way, it looks as if the game is calling the wrong asteroid so double check the name etc.
Commander Smivs, the friendliest Gourd this side of Riedquat.

User avatar
phkb
Commodore
Commodore
Posts: 2415
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Model texture on mission screen

Post by phkb » Thu Feb 16, 2017 9:18 pm

Cody wrote: is that a parcel delivery to a rock hermit (or something similar)?
Not quite. It's a standard parcel contract, but I forced the asteroid model onto it to demonstrate the issue.
Smivs wrote:it looks as if the game is calling the wrong asteroid
In this case I force the same model to be used by setting the model for the mission page to be [Casteroid1] (including the brackets), and I then manually created an asteroid of the same type by doing system.addShips("[Casteroid1]", 1, player.ship.position.add(player.ship.vectorForward.multiply(5000)), 1);

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13652
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Model texture on mission screen

Post by Cody » Thu Feb 16, 2017 9:42 pm

phkb wrote:
Thu Feb 16, 2017 9:18 pm
Not quite. It's a standard parcel contract...
Ah... shame!

User avatar
phkb
Commodore
Commodore
Posts: 2415
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Model texture on mission screen

Post by phkb » Thu Feb 16, 2017 10:29 pm

Cody wrote:Ah... shame!
It's got me thinking, though!

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13652
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Model texture on mission screen

Post by Cody » Thu Feb 16, 2017 10:35 pm

If you need any ideas, let me know... I've been thinking about it for years!

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13652
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Model texture on mission screen

Post by Cody » Sun Feb 19, 2017 11:47 am

Have you solved the texture problem?

User avatar
phkb
Commodore
Commodore
Posts: 2415
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Model texture on mission screen

Post by phkb » Mon Feb 20, 2017 1:29 am

No, it's a bit confusing actually. When using Griff's asteroids the issue doesn't seem to occur. I'm going to have a look under the hood at the Asteroid Storm asteroids to see what the differences might be, and see where that leads.

User avatar
phkb
Commodore
Commodore
Posts: 2415
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Model texture on mission screen

Post by phkb » Mon Feb 20, 2017 2:36 am

OK, I'm confused (yes, this happens a lot). Here's the shipdata.plist entry for a "Casteroid1"

Code: Select all

Casteroid1 = {
		"ai_type" = "dumbAI.plist";
		bounty = 10;
		"cargo_type" = "CARGO_NOT_CARGO";
		"debris_role" = astormBoulderC;
		density = 5;
		"energy_recharge_rate" = 0;
		"likely_cargo" = 1;
		"max_cargo" = 0;
		"max_energy" = 100;
		"max_flight_pitch" = "0.1";
		"max_flight_roll" = "0.1";
		"max_flight_speed" = 5;
		missiles = 0;
		model = "astormtiled01.dat";
		name = Asteroid;
		roles = "asteroid asasteroid";
		"scan_class" = "CLASS_ROCK";
		script = "AsteroidStormAsteroid.js";
		smooth = YES;
		thrust = 0;
	};
Now, I'm very prepared to admit I'm not very good at modelling, but with the little knowledge I have, something seems to be missing here. The definition includes a model, "astormtiled01.dat". But I'm expecting there to be some reference to materials in order to specify the texture file and normal map. But there's nothing.

Looking at the astormtiled01.dat file, it references "asteroid.png", but I thought that was just a placeholder name that the materials section of the model uses to hook into. That is, I expected to see this:

Code: Select all

		materials = {
			"asteroid.png" = {
				"diffuse_map" = {
					name = "astorm09.png";
					"repeat_s" = true;
					"repeat_t" = true;
				};
				"normal_map" = {
					name = "astorm12_normal.png";
					"repeat_s" = true;
					"repeat_t" = true;
				};
				"specular_map" = {
					name = "astorm_specular.png";
					"repeat_s" = true;
					"repeat_t" = true;
				};
				shininess = 30;
			};
		};
But that definition doesn't appear in "Casteroid1". It's in "Casteroid1-demo". When I create a "Casteroid1" and a "Casteroid1-demo" in space, they look almost identical. But to my way of thinking, "Casteroid1" shouldn't get any texture at all. Or if it does get one, it should get the texture "asteroid.png", which is included in the core game.

To test this, I replaced "asteroid.png" with "asteroid_x.png" in the "astormtiled01.dat" file. And now, if I create a "Casteroid1" I get an un-textured blob.

So, here's what I think is happening: In space, when a "Casteroid1" is created, it will keep the "asteroid.png" reference in the .dat file, an apply the texture accordingly. However, because there is no specific materials definition for "Casteroid1", no texture is applied on a mission screen.

I'm still thinking about how to distill this down to a repeatable test.

[Edit to say] Well, that's not it. I'm really not sure what's happening now. My test OXP didn't do what I expected it to do. I think...

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2553
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Model texture on mission screen

Post by spara » Mon Feb 20, 2017 9:07 am

Check the script "AsteroidStormAsteroid.js". It's got a shipSpawned event that sets the materials.

User avatar
phkb
Commodore
Commodore
Posts: 2415
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Model texture on mission screen

Post by phkb » Mon Feb 20, 2017 7:24 pm

Face? Meet palm. :oops:

I did notice the script file and even had a brief look at it, but then thought "Why am I looking for material stuff in a script? That stuff is in shipdata.plist!"

Which proves I should probably stay away from modelling.

On a positive note, this explains why using the Casteroid1 key as the model on a mission screen fails, but it works in space. I'll be able to sleep better now, so thanks spara!

Post Reply