Page 1 of 2

New Ship Texture Problems

Posted: Fri Oct 28, 2011 4:18 am
by mandoman
I'm working on a ship at the moment, basically another Trader ship, and I have run into a snag that I have been struggling with for several weeks. The texture paint image that I packaged, and exported with the .obj file isn't showing in the game, even though I have tried three different times, with different textures, converting the .obj into a .dat. In other words, in the models folder is a ship.dat script that specifies the texture I packaged when I exported the model. I call it the StarMoth, and the .dat has a zillion lines in it listing StarMoth.png as the texture, but when I boot up the game, all I get is a big pink shiny ship, with no details, or colors, other than different shades of that aweful pink. Here is an image of how it looks in Blender with the (incomplete) paint texture I want.

Image

Here are some images of it as it appears in the game, even though the texture color in the Texture file in the oxp is the same as that of the picture above.

Image

Image

Image

In the last picture, it almost looks green, but that is just the reflection from the system star that gives it that hue. I have the basic oxp put together, with Config folder, Model folder, and Texture Folder, each containing the files that make it load up to the game when I put it into the AddOns folder in Oolite, but the texture is not following the model into the game. Does anyone know anything about this anomaly? Has this happened to someone that might be able to help me straighten it out? That pink about makes me sick. :(

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 7:09 am
by JD
The export and conversion process can leave references in the dat file to the full path of the texture file, which Oolite doesn't like. Have you tried getting rid of the path - eg:
TEXTURES
mytexture.png 1.0 1.0 0.79547 -2.42968 0.80620 -2.42983 0.75394 -5.10807
If you see a path in front of mytexture.png, remove it.

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 7:43 am
by Ironfist
mandoman,

One possible solution might be the file-name, Windows does not care about the difference between lower-case and upper-case characters in a file name but Oolite does. So StarMoth.png and starmoth.png are seen as different files, it is worth checking just in-case something like this is happening.
Hope this helps

Ironfist

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 7:48 am
by Eric Walch
One other reason could be that you don't have one object but several. Than the obj file gets a bit different structure that the obj2dat.py script can't convert. That results in a complete ship in oolite, but without the texture. In wings3d you can fix that by selecting all objects and doing a combine in the contextual menu. That will generate an obj file that the python script can convert to dat.

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 8:18 am
by Killer Wolf
there'll be an entry in your log telling oyu a texture can't be found, i guess - from that you should be able to tell if you've made any typos etc. i've had problems from
(a) having a full pathname in the .dat instead of just the texture name
(b) changing the texture name but neglecting to change the name in the .dat
(c) naming things incorrectly/typos in the shader part of the shipdata
(d) having the texture as a jpeg and the .dat referring to a .png (i only use PNG now)

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 1:47 pm
by mandoman
JD wrote:
The export and conversion process can leave references in the dat file to the full path of the texture file, which Oolite doesn't like. Have you tried getting rid of the path - eg:
TEXTURES
mytexture.png 1.0 1.0 0.79547 -2.42968 0.80620 -2.42983 0.75394 -5.10807
If you see a path in front of mytexture.png, remove it.
It did come out that way at first, but I removed everything but the StarMoth.png from the .dat file when it first happened. All it shows in the .dat file now is "StarMoth.png".
Eric Walch wrote:
One other reason could be that you don't have one object but several. Than the obj file gets a bit different structure that the obj2dat.py script can't convert. That results in a complete ship in oolite, but without the texture. In wings3d you can fix that by selecting all objects and doing a combine in the contextual menu. That will generate an obj file that the python script can convert to dat.
I don't understand completely what you are saying. The ship is formed out of one model, with nothing else combined with it. Is there some way for that one model to become multiple models?
Ironfist wrote:
mandoman,

One possible solution might be the file-name, Windows does not care about the difference between lower-case and upper-case characters in a file name but Oolite does. So StarMoth.png and starmoth.png are seen as different files, it is worth checking just in-case something like this is happening.
Hope this helps

Ironfist
That seems to be correct in the .dat file, AND in the Textures folder. Both are StarMoth.png.
Killer Wolf wrote:
there'll be an entry in your log telling oyu a texture can't be found, i guess - from that you should be able to tell if you've made any typos etc. i've had problems from
(a) having a full pathname in the .dat instead of just the texture name
(b) changing the texture name but neglecting to change the name in the .dat
(c) naming things incorrectly/typos in the shader part of the shipdata
(d) having the texture as a jpeg and the .dat referring to a .png (i only use PNG now)
You are correct in that the Log says the Texture can't be found, but I have checked all of the above possibilities, except the shader part, which I'm not sure what you mean. I don't do anything tricky at this time with shaders. I simply put "materials" = "StarMoth.png.". Is there something more I should be doing?

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 2:38 pm
by Smivs
It's not that stop '.' after the png is it? The texture should be 'StarMoth.png' not StarMoth.png.'
Also, if the .dat file specifies Starmoth.png and it's the only texture, you will not need to use 'matrials' in shipdata unless you are also using an emission_ map or want to specify reflectiveness and specular color.

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 5:30 pm
by Killer Wolf
I have checked all of the above possibilities, except the shader part, which I'm not sure what you mean.
it's part of the Shader attributes that form the Shipdata, if you happen to use that. i do, cos i nicked the shader stuff from Griff. the relevant bits of one of my Shipdata files looks like this :

Code: Select all

	shaders = 
		{ 
            "dback-mil-tex.png" = 
			{ 
                vertex_shader = "dbshaderv.vertex"; 
                fragment_shader = "dbshaderf.fragment"; 
                textures = 
						(
							"dback-mil-tex.png", 
							"dback purg normal.png",
							"dback effects.png",
							"dback lights.png"
						);
				uniforms =
						{
						uColorMap = { type = texture; value = 0; }; 
						uNormalMap = { type = texture; value = 1; }; 
						uEffectsMap = { type = texture; value = 2; };
						uGlowMap = { type = texture; value = 3; };	
						uTime = "universalTime";
						nearly_dead = "throwingSparks";	
						hull_heat_level = "hullHeatLevel";	 				
						engine_power = "speedFactor"; 
						}; 	
			}; 
		};
in this example, the "dback-mil-tex.png" mentioned twice has to be both (1) the texture mentioned in your .dat and (2) match the name in your Materials folder.

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 6:45 pm
by mandoman
Smivs wrote:
It's not that stop '.' after the png is it? The texture should be 'StarMoth.png' not StarMoth.png.'
Also, if the .dat file specifies Starmoth.png and it's the only texture, you will not need to use 'matrials' in shipdata unless you are also using an emission_ map or want to specify reflectiveness and specular color.
I'm not sure I'm following you on the first part. Here is what I have in shipdata.plist:

{
"StarMoth" = {
"ai_type" = "auto_ai";
"aft_eject_position" = "0.0 -5.5 -0.4";
"aft_weapon_type" = "WEAPON_BEAM_LASER";
"energy_recharge_rate" = 3;
"escort-ship" = "SunBat_alternate";
"escorts" = 2;
"exhaust" = (
"16.6 -3.2 -6.0 6.3 5.6 9.0",
"-16.6 -3.2 -6.0 6.3 5.6 9.0"
);
"forward_weapon_type" = "WEAPON_BEAM_LASER";
"laser_color" = "yellowColor";
"likely_cargo" = 4;
"max_cargo" = 45;
"max_energy" = 450;
"max_flight_pitch" = 1;
"max_flight_roll" = 2;
"max_flight_speed" = 350;
"max_missiles" = 8;
"missiles" = 3;
"name" = "StarMoth";
"missile_launch_position" = "0.0 -1.9 -2.0";
"model" = "starmoth.dat";
"roles" = "trader";
"thrust" = 35;
"scoop_position" = "0.0 -2.0 1.0";
"smooth" = "true";
"weapon_position_forward" = "0.0 2.5 18.7";
"weapon_position_aft" = "0.0 2.0 -18.7";
};
"StarMoth-player" = {
"aft_eject_position" = "0.0 -5.5 -0.4";
"aft_weapon_type" = "WEAPON_BEAM_LASER";
"energy_recharge_rate" = 3;
"exhaust" = (
"16.6 -3.2 -6.0 6.3 5.6 9.0",
"-16.6 -3.2 -6.0 6.3 5.6 9.0"
);
"forward_weapon_type" = "WEAPON_BEAM_LASER";
"has_ecm" = yes;
"has_fuel_injection" = yes;
"has_fuel_scoop" = yes;
"has_heat_shield" = yes;
"laser_color" = "yellowColor";
"likely_cargo" = 4;
"max_cargo" = 45;
"max_energy" = 450;
"max_flight_pitch" = 1;
"max_flight_roll" = 2;
"max_flight_speed" = 350;
"max_missiles" = 8;
"name" = "StarMoth";
"missile_launch_position" = "0.0 -1.9 -2.0";
"model" = "starmoth.dat";
"roles" = "player";
"thrust" = 35;
"scoop_position" = "0.0 -2.0 1.0";
"smooth" = "true";
"view_position_aft" = "0.0 1.8 7.6";
"view_position_forward" = "0.0 2.0 7.6";
"view_position_port" = "0.0 4.0 7.6";
"view_position_starboard" = "0.0 4.0 7.6";
"weapon_position_forward" = "0.0 2.8 18.7";
"weapon_position_aft" = "0.0 2.8 -2.7";
"custom_views" =
(
{
view_description = "Rear View";
view_orientation = "1.0 0.0 0.0 0.0";
view_position = "0.0 30.0 -250.0";
weapon_facing = "FORWARD";
},
{
view_description = "Rear Right View";
view_orientation = "0.9239 0.0 0.3827 0.0";
view_position = "191.42 30.0 -191.42";
weapon_facing = "FORWARD";
},
{
view_description = "Right View";
view_orientation = "0.7071 0.0 0.7071 0.0";
view_position = "250.0 30.0 0.0";
weapon_facing = "FORWARD";
},
{
view_description = "Front Right View";
view_orientation = "0.3827 0.0 0.9239 0.0";
view_position = "191.42 30.0 191.42";
weapon_facing = "FORWARD";
},
{
view_description = "Front View";
view_orientation = "0.0 0.0 1.0 0.0";
view_position = "0.0 30.0 250.0";
weapon_facing = "FORWARD";
},
{
view_description = "Front Left View";
view_orientation = "0.3827 0.0 -0.9239 0.0";
view_position = "-191.42 30.0 191.42";
weapon_facing = "FORWARD";
},
{
view_description = "Left View";
view_orientation = "0.7071 0.0 -0.7071 0.0";
view_position = "-250.0 30.0 0.0";
weapon_facing = "FORWARD";
},
{
view_description = "Rear Left View";
view_orientation = "0.9239 0.0 -0.3827 0.0";
view_position = "-191.42 30.0 -191.42";
weapon_facing = "FORWARD";
},
{
view_description = "Top View";
view_orientation = "-0.7071 0.7071 0.0 0.0";
view_position = "0.0 290.0 0.0";
weapon_facing = "FORWARD";
},
{
view_description = "Bottom View";
view_orientation = "0.0 0.0 0.7071 0.7071";
view_position = "0.0 -290.0 0.0";
weapon_facing = "FORWARD";
}
);
};
}

The game accepts that, and the shipyard.plist, but then it tells me that it can't find a texture for the StarMoth. I'm pretty sure I packaged the texture.png correctly, just before I exported the model as an .obj file. I have had no other ship.oxp that I have made so far react this way, though I still can't get my ufoship to show up in the game, even though the game says it's loaded with no Errors. There is plainly things here that I don't completely understand, so I guess I better go read up on some more tutorials. It's a puzzler to me, for sure.

Killer Wolf, would I need a shader listing like that if my texture is just a plain .png, with no other options added? Someday I'm going to start messing with the shader stuff, but I want to get making ships down right, first. It seems to be a handful for me right now, all by itself.

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 8:26 pm
by Killer Wolf
no bud, that's just if you're using the shader option, i just listed it as another potential place where you can make errors that end up w/ untextured ships in-game.

on a quick look, your shipdata looks fine to me (other than, above you say
I simply put "materials" = "StarMoth.png.". Is there something more I should be doing?
but i can't see that bit listed?).
can you post your starmoth.dat? i'm guessing the texture's not showing correctly in there. check it looks something like this :-

Code: Select all

// output from Obj2DatTex.py Wavefront text file conversion script
// (c) 2005 By Giles Williams
// 
// original file: "kw-kc-capsule.obj"
// 
// model size: 27.799 x 5.013 x 17.624
// 
// textures used: ['kc-subentskin.png']
// 
NVERTS 72
NFACES 84

VERTEX
13.95480, -1.01600, -1.52743
...etc etc etc...
-4.80030, 1.08261, -7.38413

FACES
1,0,0,	0.98345,-0.00000,0.18120,	3,	0,2,1
...etc etc etc...
1,0,0,	-0.00000,-0.00000,-1.00000,	3,	69,71,68

TEXTURES
kc-subentskin.png	1.0 1.0	0.06091 0.52528	0.09602 0.52528	0.06091 0.51775
kc-subentskin.png	1.0 1.0	0.12374 0.61313	0.16391 0.53363	0.05922 0.63280
...etc etc etc...
kc-subentskin.png	1.0 1.0	0.71816 0.26792	0.35066 0.18850	0.35066 0.26792
kc-subentskin.png	1.0 1.0	0.71816 0.18850	0.35066 0.18850	0.71816 0.26792

END
ie : the "textures used" bit and all the entries under "TEXTURES" show the same name, (and no hierarchical path info) and that the Materials folder has a texture w/ that exact name in too.

Re: New Ship Texture Problems

Posted: Fri Oct 28, 2011 10:06 pm
by mandoman
Killer Wolf wrote:
no bud, that's just if you're using the shader option, i just listed it as another potential place where you can make errors that end up w/ untextured ships in-game.

on a quick look, your shipdata looks fine to me (other than, above you say
I simply put "materials" = "StarMoth.png.". Is there something more I should be doing?
but i can't see that bit listed?).
can you post your starmoth.dat? i'm guessing the texture's not showing correctly in there. check it looks something like this :-

NVERTS 72
NFACES 84

VERTEX
13.95480, -1.01600, -1.52743
...etc etc etc...
-4.80030, 1.08261, -7.38413

FACES
1,0,0, 0.98345,-0.00000,0.18120, 3, 0,2,1
...etc etc etc...
1,0,0, -0.00000,-0.00000,-1.00000, 3, 69,71,68

TEXTURES
kc-subentskin.png 1.0 1.0 0.06091 0.52528 0.09602 0.52528 0.06091 0.51775
kc-subentskin.png 1.0 1.0 0.12374 0.61313 0.16391 0.53363 0.05922 0.63280
...etc etc etc...
kc-subentskin.png 1.0 1.0 0.71816 0.26792 0.35066 0.18850 0.35066 0.26792
kc-subentskin.png 1.0 1.0 0.71816 0.18850 0.35066 0.18850 0.71816 0.26792

END
[/code]

ie : the "textures used" bit and all the entries under "TEXTURES" show the same name, (and no hierarchical path info) and that the Materials folder has a texture w/ that exact name in too.
Oops, yeah, I forgot that I removed that entry as I remembered reading that it wasn't necessary unless I was using some special shader. Sorry. Here is parts on the .dat file, though I don't see any problems, maybe you will:

// output from Obj2DatTex.py Wavefront text file conversion script
// (c) 2005 By Giles Williams
//
// original file: "starmoth.obj"
//
// model size: 149.641 x 12.263 x 55.245
//
// textures used: ['StarMoth.png']
//
NVERTS 636
NFACES 1284

VERTEX
-71.76257, 0.09560, -26.54590
-68.30335, 0.05910, -29.32688
etc.................

FACES
128,127,127, -0.04339,-0.99868,-0.02757, 3, 203,0,199
128,127,127, -0.04702,-0.99842,-0.03091, 3, 203,199,71
128,127,127, -0.04103,-0.99844,-0.03794, 3, 1,0,203
etc....................

TEXTURES
StarMoth.png 1.0 1.0 0.45322 0.72537 0.45654 0.72793 0.45371 0.72585
StarMoth.png 1.0 1.0 0.45322 0.72537 0.45371 0.72585 0.45013 0.72252
StarMoth.png 1.0 1.0 0.45488 0.72665 0.45567 0.72723 0.45322 0.72537
StarMoth.png 1.0 1.0 0.44478 0.70587 0.44392 0.71538 0.44521 0.71457
StarMoth.png 1.0 1.0 0.44521 0.71457 0.44914 0.70672 0.44478 0.70587
StarMoth.png 1.0 1.0 0.46232 0.69220 0.44478 0.70587 0.44914 0.70672
StarMoth.png 1.0 1.0 0.44914 0.70672 0.44521 0.71457 0.44655 0.71461
etc.......................

Hope you can spot the problem. Thanks for helping, either way. :)

Re: New Ship Texture Problems

Posted: Sat Oct 29, 2011 6:42 am
by Killer Wolf
must admit i can't see any prob. can you upload the OXP somewhere so we can have a look?

Re: New Ship Texture Problems

Posted: Sat Oct 29, 2011 7:48 am
by mandoman
Killer Wolf wrote:
must admit i can't see any prob. can you upload the OXP somewhere so we can have a look?
Oh yeah, here it is. I sure hope you can find something. My eyes are about popping out of my head searching through this oxp. Here is a link to the zip file.

http://www.box.net/shared/xk10dmomecydn5khohxv

Thanks for helping me with this.

Re: New Ship Texture Problems

Posted: Sat Oct 29, 2011 8:05 am
by Thargoid
From a look-over:

Code: Select all

"ai_type" = "auto_ai";
should be

Code: Select all

ai_type = "route1traderAI.plist";
auto_ai = yes;
Then the log shows up

09:02:24.189 [files.notFound]: ----- WARNING: Could not find texture file "starmoth.png".

because your folder name is "Texture", when it should be "Textures" (it should be plural with the s). Because the folder name is wrong, the trunk engine can't see it and so your ship has no texture available.

It can also be useful to add a unique role to the ship (e.g. make the roles line "roles" = "trader starmoth";) to make it easier to test-spawn using the JS console[/color]

Re: New Ship Texture Problems

Posted: Sat Oct 29, 2011 8:44 am
by Smivs
and again, check those cases.
In Mandoman's post re the .dat file it's StarMoth.png, whereas in Thargoid's log it's starmoth.png!