Page 1 of 1

Newbie Questions: Making a ship model in 3D Studio

Posted: Tue Mar 15, 2011 12:53 pm
by Big Bene
Hello!

I want to try making a ship / station of my own. I'm new to Oolite, but I have some experience in 3D modelling. It's no problem to me to export a textured and uvw-mapped .obj file, but there are still questions left. I searched the forum, but there is so much information scattered in so many bits around here, that I got rather confused. So I hope it's OK to make a new thread and ask my questions all in one place.

- When I made the .obj file and run it through the Obj2dat.py converter, how do I include the resulting file into the game with the minimum efford, if I just want to test how it looks ingame?
- I can handle bumpmaps and normals pretty well in 3D studio, but how do I export a normalmap that works in oolite?
- what is the maximum number of polygons recommended?
- Oolite ships are almost all convex, having no inward pointing angles. Is this compulsive?

Thanks very much in advance

Re: Newbie Questions: Making a ship model in 3D Studio

Posted: Tue Mar 15, 2011 1:22 pm
by Smivs
Hi Big Bene, and welcome to the friendliest board this side of Riedquat.
Although I've done quite a few OXPs, I'm not an expert on Oolite models except to confirm they need to be a .dat file, but someone will be along shortly to help I'm sure.
In the meantime, the Wiki page might give you a few pointers.

Re: Newbie Questions: Making a ship model in 3D Studio

Posted: Tue Mar 15, 2011 1:27 pm
by Big Bene
Hi!
Thanks for the quick reply and the nice welcome!
:D

Re: Newbie Questions: Making a ship model in 3D Studio

Posted: Wed Mar 16, 2011 9:16 am
by Griff
Hi Big Bene, A simple little ship spawning oxp will do the job, i've cobbled one together here, it's very basic it'll spawn 3 copies of your ship with all the properties of asteroids outside the station when you launch (basically just floating and spinning slightly on the spot):
http://www.box.net/shared/1c2kjlf5v7

Inside the OXP are 3 folders - 'Config', 'Textures' and 'Models'
'Textures' is where you put your texture .png's if you have them (not needed if you're just testing geometry, you don't even need to UV the model) and 'Models' is where you'll put your ship object in .dat form.

The 'Config' folder has 2 items, a script.js file which spawns the ships and a shipdata.plist file which contains all the stats and stuff for your ship (which you can open and edit in any text editor program except for 'Notepad' if you're on Windows (notepad adds some secret end of line formatting characters that stop Oolite from being able to read the file in propery -Wordpad is fine to use though)

if you choose to use this oxp, you'll need to edit it's shipdata.plist to type in your models filename, it's the only line you'll need to edit to get the oxp to work (or you could name your exported model file yourshipfilename.dat

Code: Select all

{
"my_new_ship" = 
	{
	like_ship = "asteroid";
	model = "yourshipfilename.dat"; // you need to edit the filename so it's correct for your ship
	name = "My Cool New Ship";
	roles = "mytestship";
	};	
}
Just change "yourshipfilename.dat" to whatever your model is called, if you'd like to spawn more or less ships, edit script.js and change the this.count = 3; line to however many ships you want to spawn.

Note that after editing lines in OXP's, the next time you start Oolite, you need to hold down the shift key on the keyboard from the moment the program starts loading up until the spinning cobraIII appears on the title screen, this is done because Oolite keeps a cache of the previously loaded oxp files and the shift key forces oolite to clear out it's cache and re-read them all in again fresh with your new changes applied

Re: Newbie Questions: Making a ship model in 3D Studio

Posted: Wed Mar 16, 2011 9:54 am
by Disembodied
Big Bene wrote:
- Oolite ships are almost all convex, having no inward pointing angles. Is this compulsive?
The original Elite ships were all convex, as a clever way of simplifying hidden-line removal when running in 32K ... it's not compulsory (although I like the fact that it gives a coherent overall form: just as all seagoing vessels share a similar "boatness" about their shapes, so all the core Oolite ships, and a lot of the OXP ships, have the same underlying design logic).

Re: Newbie Questions: Making a ship model in 3D Studio

Posted: Wed Mar 16, 2011 6:12 pm
by Big Bene
Thanx, these answers were very helpful, and special thanx to Griff!
You are great, guys!

One question still unanswered:
When I make a normal map (can do this in 3D Studio), how do I include it in the Oolite model?

Re: Newbie Questions: Making a ship model in 3D Studio

Posted: Wed Mar 16, 2011 8:00 pm
by Griff
It's really simple to do, Oolite lets you describe surface properties using 'Materials', which is a dictionary (i think that's the right term) of settings you write into the ships shipdata.plist
Have a look here for all the different types of materials commands
http://wiki.alioth.net/index.php/Materials_in_Oolite

and say for your current testship oxp, we could add in a Materials dictionary to specify a normal map, an emission map (which has all your ships hull lights painted in it) and a specular colour and shininess setting to give it a nice metal looking surface

Code: Select all

{
"my_new_ship" = 
   {
   like_ship = "asteroid";
	materials = 
	{ 
		  "my_ship_diffuse_texture.png" = // This is the diffuse texture
			{ 
				normal_map  = "my_ship_normal_map.png";
				emission_map = "my_ship_emission_map.png";
				specular_color = ( 0.2, 0.2, 0.2 );
				shininess = 5; 
				}; 
		};

   model = "yourshipfilename.dat"; // you need to edit the filename so it's correct for your ship
   name = "My Cool New Ship";
   roles = "mytestship";
   };   
}
The normal map in the above example uses just the RGB channels from the texture, but Oolite also supports Parallax mapping and if you want to use it, just embed the parallax map into your normalmap's Alpha channel and instead of writing normal_map = "myshipnormalmap.png"; you'd write something like

Code: Select all

normal_and_parallax_map = "myshipnormalmap.png"; 
parallax_bias = 0.3;
parallax_scale =  0.03;

Re: Newbie Questions: Making a ship model in 3D Studio

Posted: Thu Mar 17, 2011 11:51 am
by Big Bene
OK, thanx again for the detailed info.
I think I for now I know everything I need. Will start shipbuilding now - so you won't hear from me for a while :wink:
I'll be back when I have something to show... :mrgreen: