Automatically convert old maps to well-textured mesh-maps

Discussion, updates, modifications, etc for the various map editors...
Post Reply
KTL
Private First Class
Private First Class
Posts: 11
Joined: Mon Oct 23, 2006 5:25 pm
Location: Belgium

Automatically convert old maps to well-textured mesh-maps

Post by KTL » Tue Jun 24, 2008 8:12 pm

Simple python script that renovates old maps.
Copy paste from the file:
# code written by KTL
# * skydome and referenced textures coming from Optic Delusion
# * referenced hills texture from Blaster Wisconsin
# * use this code freely to make life more complicated.
# * everyone free to deliver me pizza, no beer.

# code
# * usage: python convert.py <inputmap> [<outputmap>]
# if no outputmap specified it writes to out.bzw
# * the code runs through old style bzw files
# * boxes and pyramids become meshes
# * texture coordinates are put in such a way that textures from overlapping faces fit exactly on each other.
# this is true for horizontal faces (the easy ones) and for box-sides
# it still works wether the boxes are rotated or not.

# * It now also works for faces of pyramids. As long as the pyramids got the same height their overlapping faces should be aligned well.

# * elevated teleporters get a small doorstep box
# some buggy code does not allow passing through porters on elevated meshes.
# * no normals are inserted since boxes and pyramids seem to have trivial normals.
# * skydome and hills are placed around the map.
# * inside points are placed, 8 per box close to the corners, 5 per pyramid.
# * places 4 banners of the local dragon/god/pet, they fit nice on the modified mad city map.
# * it adds some default options
# * if it should copy what it does not touch (not box,pyr,tele,link) then uncomment the last 2 lines.
# * makes a difference between texture materials for boxtop, boxwall, boxwall shootthrough, boxwall drivethrough, boxwall passable, ceiling, pyramid, pyr shootthrough, pyr drivethrough, pyr passable
# * works fine with most maps, tested on modified mad city, badgerking's map, field and streams (aka the happy pinguin map)

# bugs
# .. all fixed?

# todo
# * better handling of secondary attributes like shootthrough and drivethrough DONE
# * add more decorations (shootthrough/drivethrough) DONE
# * change the sky periodically with dynamic colors, there are nice textures available.
# * there are pyramids with a negative height too... DONE
# * ...
Attachments
pyconvert08sept2008.zip
Contains: python script and big mad city before and after conversion.
(83.49 KiB) Downloaded 121 times
bzfi0324.jpg
overlapping pyramid surfaces arent a problem anymore if the pyramids are at the same height.
(204.09 KiB) Downloaded 43 times
bzfi0129.jpg
The texture depends on the drivethrough/shootthrough properties of the objects.
(71.29 KiB) Downloaded 43 times
bzfi0128.jpg
boxes are textured correctly. overlapping surfaces wont be a problem too.
(63.53 KiB) Downloaded 45 times
Last edited by KTL on Sat Sep 13, 2008 2:50 pm, edited 3 times in total.

KTL
Private First Class
Private First Class
Posts: 11
Joined: Mon Oct 23, 2006 5:25 pm
Location: Belgium

Post by KTL » Tue Jun 24, 2008 8:21 pm

Forgot to mention, I got a collection of old maps here:
http://users.pandora.be/dpf/bz/

lol_u died

Post by lol_u died » Tue Jun 24, 2008 8:28 pm

are any of the old maps hosted?
Last edited by lol_u died on Tue Sep 09, 2008 12:32 am, edited 2 times in total.

KTL
Private First Class
Private First Class
Posts: 11
Joined: Mon Oct 23, 2006 5:25 pm
Location: Belgium

Post by KTL » Tue Jun 24, 2008 8:40 pm

They are much less popular now but some of them have been very important. One of the reasons why they are less popular now is their look. This script tries to do something about that. The work that has been put in those old maps should not be wasted.

KTL
Private First Class
Private First Class
Posts: 11
Joined: Mon Oct 23, 2006 5:25 pm
Location: Belgium

update

Post by KTL » Mon Sep 08, 2008 10:57 pm

Now the script also deals correctly with overlapping faces of pyramids.

Post Reply