What's new

Ship LODs Issue and simple solution

Status
Not open for further replies.

urquan

New member
Joined
Feb 4, 2012
Messages
14
Reaction score
0
Hey guys,

I want do address the developers of PG with a somewhat technical issue.
I play and enjoy the game very much but there's one thing that bugs me very much, and that is the ship LODs.

I seems to me that PD dev team has used the "Optimize" modifier in 3Ds max (or something similar) to create most of the LODs. This is not recommendable at all for 3 reasons:

First - the UV coordinates of ships are all bugged and textures are smeared all around, so even on LOD1 ships look awful.

Second - The "Optimize" modifiers (if you're using this) does not preserve mesh silhouettes very well

Third - It is known to create errors in meshes (Like irregular faces, open edges and faces with 0 area). Another thing is that meshes produced by this method are not very optimized for use in realtime 3D, since they are not properly striptified.


The solution is very simple. Instead of using "Optimize" use the "Multi-Res" modifier. It preserves UV coordinates (even when there are multiple channels) It is much better at preserving silhouettes and it does not create irregular faces that often.

I know that the ship assets in PG are quite many, but creating of those LODs can be easily done with a simple maxscript. Moreover all the ships are rigid bodies and no skin transfer is required which makes the task even easier.

Here's a generic maxscript that should work with most versions of 3DS MAX:

Code:
--Automatic LOD setup for static objects


global LODFloater

rollout AutoLOD_Rollout "Automatic LODs" width:200 height:300
	(
		button ok_btn "Make LODs for Selection" pos:[15,35] width:160 height:21 
		button cancel_btn "Close" pos:[60,65] width:65 height:21
		spinner lod_spinner "Number of LODs" pos:[80,10] width:72 height:16 range:[1,4,3] type:#integer
		  on ok_btn pressed do 
			(
				obj_list = getCurrentSelection()
				clearSelection()
				MultiRes_percentage = 100/(lod_spinner.value+1)
					for i = 1 to obj_list.count do
					(
						temp_obj = obj_list[i]
							for i = 1 to lod_spinner.value do
							(
								lod_copy = maxOps.cloneNodes temp_obj cloneType:#copy newNodes:&temp_lod
								select temp_lod[1]
                -- If you want to change the naming convention edit the line below
								temp_lod[1].name = "$lod" +(i as string)
								temp_lod[1].parent = temp_obj
								addModifier temp_lod (MultiRes())
								modPanel.setCurrentObject temp_lod[1].modifiers[#MultiRes]
								temp_lod[1].modifiers[#MultiRes].reqGenerate = off
								temp_lod[1].modifiers[#MultiRes].vertexPercent = 100/(2^i)					
							)
					)	
			)
		on cancel_btn pressed do closeRolloutFloater(LODFloater)
	)

if LODFloater != undefined do (closeRolloutFloater(LODFloater)) 
LODFloater  = newRolloutFloater "Automatic LODs" 200 150
addRollout AutoLOD_Rollout LODFloater
What this will do is create LODs using Multi-Res and name them. Each LOD will be half the polygons of the previous one. It should also preserve UV coordinates and silhouettes much better than "Optimize" modifier.

If there's something more specific that you need, like preserving hierarchies, specific naming conventions or any other requirements you can edit the script. Also if you provide mi with some details of what your pipeline requires it will be not a problem to make a scrip specifically for your needs.

Please bring this to the attention of the PG dev team.

Best regards.
 

Highway

Splitscreen Studios
Joined
Feb 23, 2010
Messages
1,733
Reaction score
1,206
Hey Urquan,

in "Pirate galaxy" the LOD meshes are created automatically with a simple algorithm during the export which saves our art team a lot of time. But since our technology evolves we are able to use a better LOD strategy in our latest project "Dino Storm". Especially since we are using skinned meshes this is a needed step forward.
Its possible that this gets adapted to future Pirate galaxy versions, since we also found a way to even further improve the performance on lower spec machines.

Using a script like you have posted is a very good idea to minimize the manual overhead. We really appreciate constructive posts like this.

Cheers
Highway
 

urquan

New member
Joined
Feb 4, 2012
Messages
14
Reaction score
0
Hey Highway,

I'd really urge you to at least test how MultiRes performs with your models. I think you'd be more than satisfied with the results. If however you don't want to use it, you can try to add to your LOD script/algorithm something like:

Code:
your_mesh.modifiers[#Edit_Poly].preserveUVs = on
This might solve some of the UV problems, although I doubt that it will fix everything.


As for "Dino Storm" LODs I'd recommend using "Skin Wrap" In my experience (about 10 years developing games) I've found that it's the easiest way to transfer skins and to create bone LODs. The beauty of it is that it doesn't require vertex order or other things to match, you can just transfers skins to and from any mesh you like. If you're interested I might write some example script.

But right now I have some mantis to kill :)

Best
 
T

The Rage

someones going to get a job offer lol, i hope you do cos the more devs the better
 

urquan

New member
Joined
Feb 4, 2012
Messages
14
Reaction score
0
The Rage said:
someones going to get a job offer lol, i hope you do cos the more devs the better
ROLF

I have a job, mate, one that I love and don't want to change. But I'd be happy if I can help improve PG, since I love the game.

Cheers!
 

WRAITH1

Well-known member
Joined
Jan 30, 2011
Messages
363
Reaction score
0
(sry if may b bit off topic pls dont b shy and delete my post)
many have liked/loved the game and still had to leave it because somethig didnt work/evolve right in this game.
many hopeful players in beta waited a long time for usefull changes to the game but it just stagnated (for whtever reasons), so after a long fight, boredom and hopelessness for a future won and they left.
its a good game principle even if copy pasted on many lvls noone cares for tht wht players care is for content tht offers entertainment.
ud b surprised how many players even pay for lousy graphics old style games if theres entertainment value tht isnt so limited as in pg.
pirate galaxy doesnt even have real pvp so only thing tht is close to the games name is stealing drops which is limited in value.
 
Status
Not open for further replies.
Top