BSG-TUDelft / Utopolis

City building game for TU Delft course (IN4302TU)
2 stars 2 forks source link

Some models refuse to parse #18

Closed spassvogel closed 10 years ago

spassvogel commented 10 years ago

A number of models will not parse properly. When centroids of geometry are being calculated there is a lookup on vertices using face, but in some cases this is a null reference, throwing an error.

Stack trace: THREE.Vector3.add (three.js:1531) THREE.Geometry.computeCentroids (three.js:8530) Mesh.parse (ColladaLoader.js:2402) Geometry.parse (ColladaLoader.js:2314) parseLib (ColladaLoader.js:247) parse (ColladaLoader.js:137) request.onreadystatechange (ColladaLoader.js:84)

How to reproduce: Uncomment out on of the models specified in model loader js files (eg PersModelLoader) that have PARSE ERROR!! at the end. Load the client and observe error being thrown.

spassvogel commented 10 years ago

List of models and any parsing / texture problems that occur

Rome

These models work. They use texture: textures/skins/structural/rome_struct_2.png

These models use a custom texture.

Hellenes

spassvogel commented 10 years ago

List of models and any parsing / texture problems that occur

These models work. They use texture: art/textures/skins/structural/maur_struct.png

These models have some problems

(.. at this point I gave up. these are the other models, unchecked)

spassvogel commented 10 years ago

Carthagenians

spassvogel commented 10 years ago

Possible solution: http://stackoverflow.com/questions/8678205/collada-to-json

  1. Load models into Blender
  2. Export to JSON
  3. Load JSON models instead of using ColladaLoader
  4. Profit
mvoda commented 10 years ago

Could work, but having some models in JSON rather than Collada would cause problems with our tablet thingy which only supports Collada, Wavefront or STL.

flatmap13 commented 10 years ago

I think we have enough models, we could just leave out the ones that cause problems....?

mvoda commented 10 years ago

Yes, that's what I'm also thinking. :+1:

spassvogel commented 10 years ago

Well, I mean it could work for the beta, and I guess even the final prototype. It still sucks though because choosing anything other than Iber or Pers means you're gimping yourself because you can build less buildings ....

flatmap13 commented 10 years ago

The users can build any type of building right? The user is not restricted to some race? Or am I missing something?

spassvogel commented 10 years ago

I thought that you had to choose an initial race (/empire /build style whatev) and you could gradually unlock the other ones? Like a rewarding mechanism?

flatmap13 commented 10 years ago

We already restrict the types of structures the player can build with the resource mechanics right? And you "unlock" them by generating enough resources to build them. I don't really see why we also should restrict the player per race as well.

spassvogel commented 10 years ago

Well yeah, but the players are supposed to be doing this for at least 10 weeks... I think it's good to have some more progression mechanics in there. Like, having built 10 houses of race X enables you to make a house of race Y and so on.

mvoda commented 10 years ago

Neah, this seems too forced to me. I think allowing everybody to build everything from the start (as long as they have enough resources) works better.

spassvogel commented 10 years ago

OKay but then we're dropping the part where you have to choose your race at the beginning.

flatmap13 commented 10 years ago

Yeah, I see no problem with that. Saves us work as well.

spassvogel commented 10 years ago

Fixed