project-navigation
Personal tools

Author Topic: Problems with brush definition in blender and input in UFORadiant  (Read 19798 times)

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #15 on: February 02, 2011, 06:16:22 pm »
but don`t forget about brushcount, it should not be big.

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #16 on: February 02, 2011, 09:13:53 pm »
Wow, that's great. I might have to learn how to use Blender! Is this your own exporter or is it available somewhere. Just for the new 2.5 (?) or which versions of Blender?
In UFORadiant, when a face has more than a 45 degree angle, it aligns itself along a vertical axis rather than a horizontal axis, and this means that the texture can be rotated 90 degrees different depending on the direction (although both are at their 0 rotation in the surface properties). A bit of minor touchup is all that's involved.

It is for good ol' Blender v2.49 (I am backward in this case). I merely touched up the ".map"-exporter (unfortunately cannot remember the author's name to give him credit here). Should I write a tutorial about all this? Maybe we can keep Blender-learning to a minimum.

Understood about UFORadiant. You are right, it can be minor touchup. In this case, where only 32x32x2 = 2048 brushes (=faces, since the rest is invisible) are involved, it is already a major issue (but shouldn't be for flat terrains).

But imagine having a size of 2048x2048x2 regular lattice for height fields ... would very much need to use the poly reducer in blender.


Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #17 on: February 02, 2011, 09:21:35 pm »
but don`t forget about brushcount, it should not be big.

You are right, of course, Kildor. Just mentioned the poly reducer in Blender: see this example:

Screenie 1: 32768 triangular faces in Blender
Screenie 2: 8172 faces

The same in UFOAI since the rest of the faces is invisible. Cannot be sure whether the bsp pass will break into even smaller faces though.

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #18 on: February 02, 2011, 09:57:01 pm »
We can change the scale of the grid in Blender, I assume. Right now you're using 16x16 which is probably much smaller than it needs to be for our purposes.

Would be nice if you could share your version of the .map exporter in some format that those of us who don't compile can use (ie - is it just a plugin or something?). Also, a quick tutorial on creating the quad/trigrid in Blender would be useful.

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #19 on: February 03, 2011, 08:53:01 am »
I think it would be best if I prepared several input files in blender so that the hickups with learning it are not so steep.
Otherwise, people normally already get stuck with the view controls and how to delete the default cube, camera angles etc.

Will work on this probably tonight!

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #20 on: February 03, 2011, 04:02:52 pm »
Ok:

short tut here:
- open the blender file (terr_128_1042.blend). it is composed of a 128x128x2 triangles grid. This is scaled as an object to 2040x2048 for terrain size in UFO/radiant
- click on "Assign plane" in the ANT landscape generator (right)
- Play with ANTs parameters
- the grid is automatically decimated, set decimation to your liking (and see problems later) to get as few tris as you want
- Use "File -> Export -> UFO Radiant Prism/Tetra" Exporter
- Settings need not be changed for terrain, simply put the terrain texture name in
- Export (is fast)
- UfoRadiant: open the map file (very slow, allow for 10 minutes, you mileage may vary from machine to machine and your decimation parameter in Blender)
- Insert player starts
- you are done
- compile
- play in UFO

Disclaimer:
- I am not a code god so don't look at it
- there "can" be problems with degenerate brushes during bsp compile step - no solution in Radiant due to complexity and sluggish handling: play with decimation parameters
« Last Edit: February 03, 2011, 04:10:17 pm by mameister »

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #21 on: February 03, 2011, 04:09:32 pm »
The files:

- installing the script is copying into .blender/scripts next to all the other export_* scripts


PS: would be really useful to have larger scales for textures (> "1 1") see repetitiveness of textures
« Last Edit: February 03, 2011, 04:11:28 pm by mameister »

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #22 on: February 03, 2011, 04:39:21 pm »
Cool! I will check it out tonight or Saturday.

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #23 on: February 03, 2011, 04:48:21 pm »
A note on brushcount:
- see blender screenie: I used 1638 brushes (prisms)
- the bsp step makes them into 2234 it seems (see r_speeds viz)

Sizes:
- with solely "-extra" in ufo2map, these brushes get compiled into a 2.6 MB file
- with "-quant 2" we end up with 11 MB (and no visual difference, but this is due to the high sun angle = virtually no shadows)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #24 on: February 03, 2011, 08:26:10 pm »
very cool - i've added your script to our repository (src/tools/blender)

you could try ufo2map with e.g. -nocsg

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #25 on: February 03, 2011, 08:30:32 pm »
it would be really cool if you could write a small howto in the mapping section of our wiki

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #26 on: February 03, 2011, 11:00:29 pm »
There are some problem with height levels to think about. It is strange to walk your figures over continuous terrain and they suddenly disappear because they "switch" to the next level. Perfectly fine in architectural maps, but here?

See map as example. When you guys have time, maybe just playtest it, two aliens, two soldier starts. Idea is: there is an island with a crashed ufo. The guys come per boat and neutralize the aliens (ok, it is nowhere near pretty or anything, just for testing height transitions on smooth terrain)

Working on exporting brush height automatically ...

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #27 on: February 07, 2011, 11:06:07 pm »
Hello,

another request for someone else to check this map, I am stuck:
I wrote an exporter that solely exports tetrahedra, works well in a sense that we can export all triangular meshes without hassle.

See screenshot: assertion fails with planenum >= 0. Map file is attached.

Thanks to anyone trying or having an idea.

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #28 on: February 08, 2011, 11:58:19 pm »
Quick though: Make sure there are no walkable surfaces below 0 on the z axis (or maybe even right on 0).

Otherwise, I'm pretty busy until the weekend so wouldn't have much time to look, sorry.

Offline mameister

  • Rookie
  • ***
  • Posts: 71
    • View Profile
Re: Problems with brush definition in blender and input in UFORadiant
« Reply #29 on: February 10, 2011, 06:22:14 pm »
Hi I tried again, this time wi th everythin well above 0.0 and still no luck ...
Would be great if you could give it a try, thanks