md3/mdm/mdx import/export quake-style-models and etxreal(otc6-mod)

another little step ahead …

got working doors and little explosives (boxes to be shoot)
and usual barb-wire hurting fence inside blender.

Trying to make the differences between part of structure
or only detail brushes (is it only the value after the texture-scaling?).

Wanna have some climbable stuff (like ladders, envy…) too
and after cleanup, a small blender-2.61 map blendfile with
its export script will be posted soon.

Last, this is to thank king arthurs wizard for the help to get the gtkradiant
running on my box … – its easy to view the settings there and not such
a kind of miracle to see it there.

btw. found a very good step-by-step starter-tut at
> http://www.pythononline.co.uk/et/tutorial.htm

– new 18.may. – (but i stilll use blender-2.61)
little change in the export_map script,
a try to set things as “detail” and not “structural”
(but i am not total shure if its this brush-flag value)
depending of the layer-setting. All structural things
should be in the same layer as the worldspawn.

this sample is with:
moving doors, rotating, sliding, one-time-move, pending
flagpole to mark occupy
health/ammo-supply
hurt-things like the barb-wire
ladder to climb up the house
smoke, with smoke-direction
one speaker at white smoke for some fire-burn-sound
destroyable little boxes, to shoot up or blast with nade

still not working, the command-map-markers. There is
something wrong for the compile of the map (with etxmap)
because if the cm-markers are working (they only give
a on-screen-message like "you are near health-supply2),
then the ladder-brush loses its texture and cannot be
used to climb up - and the doors lose their origin to rotate.
no adjustment of textures and last to activate the rain, i still
have no clue - don`t know.

so there is no video or picture because the effect of those changes
are only for the kind of action and not for any graphics.

Attachments

map_b.blend (375 KB)

another little step, creation of larger terrain like landscape out of blender.

some pics:

http://img269.imageshack.us/img269/5961/etxreal20120601115732ma.th.jpg

http://img217.imageshack.us/img217/561/etxreal20120601115752ma.th.jpg

http://img808.imageshack.us/img808/4404/etxreal20120601115540ma.th.jpg

http://img96.imageshack.us/img96/9244/etxreal20120601115615ma.th.jpg

http://img210.imageshack.us/img210/9412/etxreal20120601115604ma.th.jpg

The sample blend-file has it not made to the svn-site of otc6.
I have only the calculation uv-unwrap of rectangular faces in x or y-axis
orientation. The terrain is made of triangle-shapes and uses a displacement-map.
The buildings are only set into it and it looks a bit like in a desert with a lot of sand.

I still have the problem with objects crashing the map-compiler(etxmap, q4map) after rotation in blender (looks like the setting of the faces to grid-size gets lost - out of sync - with a rotation and i try to run a re-position of those vertices not on the needed quake-map-resolutions).

Needless to say, models are made with blender. Even some textures like the bump-map of the player-skull-heads. I tried to do simple textures for global mapped objects too and got nearly the same looking (besides light), so a texture in an material set to global, flat is exported as a baked-texture-image (a baked-normal-map too, like for the sand-texture).

maybe someone has a hint/solution why i cant get a clean baking
of the used textures.

this are 2 pictures -
one from the game-view

http://img444.imageshack.us/img444/2967/etxreal20120616181457ma.th.jpg

and one out of blender-2.61 with the map

http://img688.imageshack.us/img688/9673/blmap5export.th.png

from the distance the little break in the textures is not visible.
I use a separate scene in this blend-file to bake all materials to a flat plane,
but the plane has a funny size.
Its a square plane from left corner (0, 0) to diagonal corner (5.02, 5.02).
Even a little less, like only 5.01 will be show up in the stripes-texture as an offset at an fixed distance (where the texture is repeated).

This is the little script to generate all texture-mapping and normal-mappings for all materials (with “bl_” as first name-part):


import bpy
#
# ugly ... without knowledge ... baking to 1024x1024 png
# needs a plane 0,0 -> 5.02,5.02 -- why?
#
N_Scale = 2.  #Normal-Map scaling factor ..
if True:
    print(bpy.context.scene.name)
    if bpy.context.scene.name != "BakeScene":
        print("invalid scene selected")
    else:
        print("try . .. baking materials..")
        rplane = bpy.data.objects["renderplane"]
        bpy.context.scene.objects.active = rplane
        print(bpy.context.active_object.name)
        fshader = open("pak/scripts/bl.shader", "w")
        for m in bpy.data.materials:
            matchstr = "bl_" #"bl_brown"
            if matchstr == m.name[: len(matchstr)]:
                fpath = "pak/textures/bl/"
                if len(rplane.material_slots)==0: break
                rplane.material_slots[0].material = m
                print(rplane.material_slots[0].name)
                for t in m.texture_slots:
                    if t:
                        print("-----", t.name)
                        if t.use_map_normal:
                            t.normal_factor *= N_Scale   #maybe change strength of normal-mapping?
                for baketype, nameext in zip([  "NORMALS", "TEXTURE"],["_normal.png", ".png"]):
                    bpy.context.scene.render.bake_type = baketype
                    bpy.ops.object.bake_image()
                    bpy.data.images["bake_image"].save_render(filepath=fpath+m.name+nameext)
                for t in m.texture_slots:
                    if t:
                        if t.use_map_normal:
                            t.normal_factor /= N_Scale #set scaling for normal back
                
                fshader.write("textures/bl/"+m.name)
                fshader.write("
{")
                fshader.write("
	diffuseMap textures/bl/"+m.name)
                fshader.write("
	bumpMap    textures/bl/"+m.name+"_normal")
                fshader.write("
}
")
        fshader.close()

from the scaling (=100) of the output, i thought for a 1024x1024 image the bake has to go to a plane-size of 10x10, but that is wrong (from inside the game-view).

At this point i decided to stop with this way of mapping - old-school radiant-mappers will laugh about it anyway - because even now with the creation of a deluxe-map for this new map, the visible normal/bump-mapping is not what i did expect. (thats why there is this factor in the code above to increase the normal-map-value for the baking, because i thought the scaling of the output-map would need a higher normal-setting too).

(sorry did notice too late the huge size of the png-image … )

little script for blender-2.61
to create a labyrinth with walls suited for quake/et-map (q3map, etxmap).

image out of blender - with render in blender (after labyrinth creation)
http://img594.imageshack.us/img594/4686/labymap1.th.jpg

and from inside etxreal-otc6-mod (after some time, most of the 60 players
are running thru the maze)
http://img826.imageshack.us/img826/6211/etxreal20120625150838ma.th.jpg

and the blend-file (for blender-2.61) with the script to ready to run
for the maze-generation and the few hundert lamps.
To use it as a map, after maze-creation the wall-mesh has still no texture.
The two blender-materials named bl_floor and bl_bricks are valid shaders
in the game-engine.

The picture from the game was made with a quick-compile of the map, only
the bsp-stage and the light-stages with fast-option and no extensive bounces.
Normaly no one would make such a map … cause its too huge - like the screenshot shows it is possible to look over the whole map.

Attachments

map7.blend (223 KB)

tried some first tests with more normal-mapping and parallax-mapping,
but the performance-penalty is more than i thought. Two nearly
identical screenshots, both with normal-mapping on floor and building
and the second one with additional parallax-mapping.
I am using older hardware with an nvidia-8400-graka and the scene
without normal-mapping and quickest-shadows runs with 100fps.
(without shadows and 60 players it runs easy over 120fps)

http://img341.imageshack.us/img341/5901/etxreal20120711183648ma.th.jpg

http://img51.imageshack.us/img51/7729/etxreal20120711183727ma.th.jpg

just switch between both images to notice the different usage of parallax-mapping.

and here are some other with terrain-like map (terrain was made in blender)
http://img72.imageshack.us/img72/3580/etxreal2012071612252100.th.jpg
http://img155.imageshack.us/img155/9463/etxreal2012071612251100.th.jpg
http://img100.imageshack.us/img100/778/etxreal2012071612245000.th.jpg
http://img834.imageshack.us/img834/4603/etxreal2012071612243500.th.jpg
http://img72.imageshack.us/img72/5964/etxreal2012071612231100.th.jpg
http://img571.imageshack.us/img571/3766/etxreal2012071612230900.th.jpg
http://img152.imageshack.us/img152/5324/etxreal2012071612222500.th.jpg
http://img7.imageshack.us/img7/743/etxreal2012071612215100.th.jpg
http://img267.imageshack.us/img267/2848/etxreal2012071612213400.th.jpg

the textures on the buildings would need to be adjusted in gtk-radiant, it was only to test the parallax-mapping for those plain faces.

Hi, guys,
sorry can no topic
I in 3d n00b tell me plz as one can with Quake3 map throw in 3d max. Thx