Author Topic: Tileset Questions  (Read 884 times)

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Tileset Questions
« Reply #15 on: December 03, 2010, 08:30:40 pm »


               FunkySwerve, thanks.

Does anyone know of a skybox primer I could check out? If I can figure out what's causing the artifact then maybe I could fix it up myself.
               
               

               


                     Modifié par AndarianTD, 03 décembre 2010 - 08:30 .
                     
                  


            

Legacy_Tyndrel

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +0/-0
Tileset Questions
« Reply #16 on: December 03, 2010, 11:55:27 pm »


               There is this brief tutorial on the vault...

How to make NwN skyboxes by Mohss

I am certain I've seen another at some point in the past but where it was currently eludes me. ':mellow:'
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Tileset Questions
« Reply #17 on: December 04, 2010, 02:49:35 pm »


               Tyndrel: Thanks. Unfortunately, all the images on that page seem to be missing.

Still, I think I've gotten the basic idea from looking at the content in the haks. Basically, there seems to be a model (which I assume is wrapped like a cylinder around the perimeter of the area), and a .tga sky texture that I assume is painted on the inside of that cylinder. If that's the case then the problem is probably with the model geometry, particularly at the base.

The TROD_Vale skybox refers to a model named ctpsky_013.mdl, which leads me to believe that it was originally a CTP skybox. Unlike some of the other models I've looked at (disclaimer: I don't currently have a good .mdl browser available), it looks more like a curved sheet:

'Posted

Offhand I'd suspect that it's something about the bevel at the bottom of the model (probably set up that way to help reduce the corner distortion that appears with some other skyboxes?) that's causing the hole artifacts.

I still need the help of someone who knows more about how skyboxes work in NWN than I do, or alternatively a reference so that I can figure this out for myself. I'll start searching for one, but in the meantime any feedback along these lines would be greatly appreciated. '<img'>

- Andarian
               
               

               


                     Modifié par AndarianTD, 04 décembre 2010 - 02:56 .
                     
                  


            

Legacy_Invisig0th

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +0/-0
Tileset Questions
« Reply #18 on: December 04, 2010, 03:01:52 pm »


               [Edit - I see you posted a reply while I was typing. Seems like we came to the same conclusion]

A skybox can be thought of as a special, giant placeable that is automatically positioned at the exact center of an area. The actual model for a skybox is generally a sphere or a cross-section of one, and generally positioned so that the center of the 'sphere' would be some distance above ground level. One common problem with skyboxes is that the radius of the sphere is too small. In extreme cases, players may even be able to literally walk outside the skybox at the corners of the map.

So what you are seeing is probably the bottom curve of that "sphere" poking through the tileset models at ground level. This explains why you see it in all four corners -- particularly if your area's length and width are identical.

There are several things you can try to address this one. The easiest solution would be to move the model itself downward on the Z-axis a bit. If you open up the ASCII MDL file in a text editor, you should be able to experiment with this in one of several ways. Personally, I'd start out by trying to [edit - decrease] the Z-axis position of the "dummy" node. There should also be a single trimesh in there, and you could [edit - decrease] its Z-axis position as well. Any 3-D modeler could also do this for you very quickly.

Another solution would be to trim your area size just a hair. Based on the screenshots, reducing your area by one tile in each direction might be enough. (In fact, you may want to just try this either way, just to see if we're on the right track here.)

Hope this helps!
               
               

               


                     Modifié par Invisig0th, 04 décembre 2010 - 08:15 .
                     
                  


            

Legacy_Tyndrel

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +0/-0
Tileset Questions
« Reply #19 on: December 04, 2010, 05:04:59 pm »


               If it were just for one area would raising/lowering the terrain be a workaround rather than getting into custom modelling?  Just a thought.
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Tileset Questions
« Reply #20 on: December 04, 2010, 06:38:36 pm »


               Invisig0th, thank you very much! Your feedback and suggestions are just what I needed. I'm going to give that a try and will let you know how it goes. A quick question to make sure I understand: you suggested lowering the skybox by raising the z value of the dummy node. Is that right? Does the engine attach the dummy origin to a specific point above the center of the area, so that increasing the z value in the model would force the whole thing to move down?

Tyndrel: I don't mind a bit of basic model editing. It's easy when it's just text files and the edits are minor, and I've done a lot of that kind of customization already. And I've been thinking for a while that I really should set up a model editor, so I'll probably do that in the next few days anyway. I heard recently that there's apparently a .mdl converter for Blender, which should do nicely for my needs.

Unfortunately, raising or lowering the terrain is a very undesirable option, especially since this is a fully completed area that took me a week to get "just right." And judging from what I'm seeing I don't think it would work anyway. For example, one of the four corners is raised quite high (it's essentially a mountain slope), and while it obscures view of that corner's artifact if the latter is behind it, it's fully visible from other vantage points where that's not the case. The whole idea of this area is to be a castle in the mountains surrounded lowlands, and the module design really needs the area to be like that. So I don't think there's anything I can really do to obscure the artifacts from all of the high vantage points without a complete redesign of the area. Trying to fix up the model is definitely a preferable solution to that. And it would also allow me to use this skybox in other elevated/flying areas, of which I have a lot in Sanctum 3.
               
               

               


                     Modifié par AndarianTD, 04 décembre 2010 - 06:39 .
                     
                  


            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Tileset Questions
« Reply #21 on: December 04, 2010, 06:57:11 pm »


               Surely the simplest solution would just be to make the skybox bigger? Maybe 105% or so using NWMax's built in scaling tool.
               
               

               


                     Modifié par _six, 04 décembre 2010 - 06:57 .
                     
                  


            

Legacy_Invisig0th

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +0/-0
Tileset Questions
« Reply #22 on: December 04, 2010, 07:57:54 pm »


               Andarian -- I meant to say you should *decrease* the Z-axis value, which should shift the entire model downward just a bit. Which is to say, you're pushing the "sphere" downward, meaning the parts that are clipping get lowered into the ground and are thefore no longer a problem. The apex of your sky won't be quite as high, but that shouldn't be noticable.

I have in the past  confirmed that the engine does center the skybox model in the area lengthwise and widthwise. I cannot confirm whether or not the engine somehow  "centers" the model on the z-axis, but I seriously doubt it. Since  testing it will be extremely easy, I would suggest changing the z-axis to see what happens. Considering the very minimal amount of clipping seen in the screenshots, that will very  likely solve your immediate problem -- assuming you  will not be  increasing the length or width of that area.


Six -- My suggestions were specifically tailored for Andarian, who (like me) is not a 3D modeler. As a 3D modeler yourself, your definition of "simpler" would be different. But for those of us without such skills, editing a single (and easily found) number in a text file makes a lot more sense than installing, configuring and learning to use a 3D modeling program. Admittedly it is a bit of a hack, but I suspect it is exactly what is needed for a quick resolution to this specific situation.

However, if you are volunteering to resize this model for Andarian, I'm sure he would take you up on that kind offer. Expanding the skybox model using 3D modeling software as you suggested is certainly the most definitive and professional solution.
               
               

               


                     Modifié par Invisig0th, 04 décembre 2010 - 08:13 .
                     
                  


            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Tileset Questions
« Reply #23 on: December 04, 2010, 08:15:47 pm »


               

_six wrote...

Surely the simplest solution would just be to make the skybox bigger? Maybe 105% or so using NWMax's built in scaling tool.


Actually, after some more tests I think the solution may well be to make the skybox cylinder tighter and/or lower. Take a look at this image:

'Posted

This is what the model looks like in gmax:

'Posted

It looks to me like what's going on is that if you're high enough, you're effectively able to look down the maw of the cylinder past the edges of the tileset padding and into the space between it and the lower edge of the skybox. Why the holes are only showing up in the corners I'm not exactly sure, but that's where there'd be the most distortion of the image. If the skybox cylinder were tighter and/or lower, I think it might mitigate the effect.

EDIT re: Invisig0th's followup: I agree, although I think that six's suggestion to try to resize the skybox model is probably within my limited skills. '<img'> I can stumble by in NWMax / GMax and have played a bit with Blender, and would dearly like to spend the time to become more proficient with 3D modeling tools. The tradeoff I keep facing, though, is that every time I think of setting aside the time to do that I realize that I could be using that same time to implement a dozen quests and areas for Sanctum 3.
I suppose that what I really should be trying to do is recruit a larger development team... ':wizard:'
               
               

               


                     Modifié par AndarianTD, 04 décembre 2010 - 08:35 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Tileset Questions
« Reply #24 on: December 04, 2010, 10:11:35 pm »


               Try lowering the cylinder - maybe so that the very bottom of the second line - where it no longer angles - rests at z -0-.
               
               

               


                     Modifié par Pstemarie, 04 décembre 2010 - 10:16 .
                     
                  


            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Tileset Questions
« Reply #25 on: December 04, 2010, 10:17:38 pm »


               Actually, on taking a closer look at your screenshots I'm inclined to agree with that, Andarian. It seems that the skybox may actually be disappearing beyond the limits of what NWN will render, in which case it should indeed be made smaller. Although it's puzzling why such clipping would happen on the corners specifically - perhaps NWN renders the skybox by distance from the closest area edge as opposed to distance from the player. 

Oh, and to answer a point invisig0th noted, I'd indeed be happy to have a mess around with the model if you're unable to come up with a solution yourself.
               
               

               


                     Modifié par _six, 04 décembre 2010 - 10:18 .
                     
                  


            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Tileset Questions
« Reply #26 on: December 05, 2010, 01:46:32 am »


               

AndarianTD wrote...

_six wrote...

Surely the simplest solution would just be to make the skybox bigger? Maybe 105% or so using NWMax's built in scaling tool.

Actually, after some more tests I think the solution may well be to make the skybox cylinder tighter and/or lower.

Well, that'll learn me not to argue with the master. It turns out that six's suggestion was right on the mark. Shrinking the skybox made it worse, and scaling it up by 105% fixed it perfectly.

It's as though there's some kind of virtual box-shaped space around the area, and any skybox geometry that falls within it is getting cut out. Geometrically, the corners are the parts that would fall furthest from the skybox center, and it looks like they were poking slightly through it. The holes look like they were shaped correctly for that explanation, too, and expanding the skybox a bit corrected it.

Thanks to everyone for their feedback, and especially to six for nailing the solution so exactly!
               
               

               


                     Modifié par AndarianTD, 05 décembre 2010 - 04:15 .
                     
                  


            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Tileset Questions
« Reply #27 on: December 09, 2010, 05:02:53 pm »


               

Pstemarie wrote...

Try lowering the cylinder - maybe so that the very bottom of the second line - where it no longer angles - rests at z -0-.


I've been messing around a bit more with customizing skyboxes, since they'll be critical to get just right for some areas on my upcoming modules. For a different modification I actually have need to do what Pstemarie suggested above. I tried to do this using the "select and move" tool, which seems to work, but for some reason it seems to be getting lost when I export the model. When I re-import it, the cylinder is back where it started. If I save and re-load it as a gmax file, the edit sticks.

Is there something about this process that I don't understand, like something special about how the nwn format identifies the origin of the model coordinate system?

Thanks in advance for any help - Andarian

EDIT: OK, I think I've finally figured this out. I was assuming there'd be a single coordinate system reference point for the whole model that I could just move, but it turns out (at least for this model) that's not the case. I had to find the two high level objects corresponding to each half of the cylinder and move them individually. Selecting the entire model and trying to move it as a whole doesn't seem to work.
               
               

               


                     Modifié par AndarianTD, 09 décembre 2010 - 10:55 .
                     
                  


            

Legacy_Michael DarkAngel

  • Hero Member
  • *****
  • Posts: 627
  • Karma: +0/-0
Tileset Questions
« Reply #28 on: December 09, 2010, 11:50:00 pm »


               

AndarianTD wrote...
Is there something about this process that I don't understand, like something special about how the nwn format identifies the origin of the model coordinate system?


Create a dummy at 0,0,0.  Link anything you want to move to the dummy.  Select the dummy, move as desired.  Re-link your moved objects to the original modelbase.  Delete the dummy.  Select the modelbase and all its children, under the "Mesh Tools" rollout click on the "ResetXForm" button.

This will, in effect, "bake" your new positions.

'Posted
  MDA
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Tileset Questions
« Reply #29 on: December 10, 2010, 12:36:04 am »


               

Michael DarkAngel wrote...

Create a dummy at 0,0,0.  Link anything you want to move to the dummy.  Select the dummy, move as desired.  Re-link your moved objects to the original modelbase.  Delete the dummy.  Select the modelbase and all its children, under the "Mesh Tools" rollout click on the "ResetXForm" button.

This will, in effect, "bake" your new positions.


Michael, thanks. Please bear with my very fragile grasp of how to use gmax. For example, I don't know how to "link" objects in the UI, although I think I understand the concept (I presume it's to make it a subnode in the scene graph with a fixed local coordinate system offset). Is that done by creating a compound object?

In any event what I was trying to do is to reuse the (fixed up) sort-of cylindrical TROD_Vale skybox model from earlier in the thread for several other skyboxes that have "square" models, which is causing noticeable distortion in the corners of the area. The most important one for me right now is grass_clear, which uses sky*_001.mdl in the hotu patch data. Unfortunately, what I'm discovering is that TROD_Vale is actually two beveled hemi-cylinders placed together. This is creating two rather noticeable "seams" in the sky, and they get worse the more I play around with moving the hemi-cylinders to get the proper look for the area. It's obvious to me that what I really need is either a hemi-sphere, or more likely a beveled cylinder, that's all in once piece to get rid of the seams. (The square model for sky*_001 is in one piece, but the number of sides is just too few to avoid some serious distortion.)

It sounds like your solution would be better at keeping the existing positioning between the hemi-cylinders intact, but I can't help thinking that what I really ought to do is just re-build the model. Do you (or does anyone else who may have played around with skyboxes a bit) have any advice, or know of a suitable model that I might use instead of building one from scratch?

EDIT: I'm checking the CSP for prospects, some of which look promising at first glance.
               
               

               


                     Modifié par AndarianTD, 10 décembre 2010 - 12:58 .