Model Converter [alpha released]

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

Sajt wrote:- The model's skin's height is greater than 200px (won't run in DOSQuake)
Aha! I thought this limit found its way into WinQuake too, but I got proven wrong, making me feel very confused, as I couldn't possibly have made this up.

goldenboy: apparently it was only a limit in DOSQuake :)
Sajt wrote:Yes, I would be willing to add OBJ support. I would just need a few example OBJ models for testing.
Any willing modelers?
I was once a Quake modder
metlslime
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Post by metlslime »

"Some more far-fetched major features for later versions: ...Convert MAP files (e.g. the health/ammo pickups) to models."
This would be a great feature for mappers wanting to make more geometric-style models and who have an easier time using their mapping software to make the shapes they want.

It would probably be better to convert from BSP rather than MAP, since BSP won't have any hidden, overlapping, or inter-penetrating surfaces, no t-junctions, and it would probably be easier to convert since all the faces, vertices, and edges already exist.
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

True about the hidden surfaces.

But as for difficulty, I already have code to convert a MAP to polygon mesh. The only difficulty will be creating a skin which includes all textures used by the MAP, including tiling them where they repeat...
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

can i upload this to moddb?
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

I would rather you wait until a somewhat more polished release. The next release is coming soon and includes MD2 exporting, and a more friendly viewer.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

hmm alright.
Teiman
Posts: 311
Joined: Sun Jun 03, 2007 9:39 am

Post by Teiman »

I have a stupid idea:

make the convertor work from mdl to mdl. and add a -f option that fix all problems magically (texture sizes) and make your rich, interesting and sexy.
Spirit
Posts: 1065
Joined: Sat Nov 20, 2004 9:00 pm
Contact:

Post by Spirit »

That would be fun. You could run it repeatedly on the same file and use the result as that evil monster from your nightmares.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

No, don't worry Spirit, I've been thinking about it - lossless load/save of MDLs. But I was not sure if it should be in the same tool or a different one. It could make the model converter more complicated. In a separate tool there would be some redundant code but it would be similar.

I would be able to fix bad skin sizes, change flags and other simple fields, import/remove skins, as well as do other interesting things like change the overall scale of the model or optimize the skin map (reducing skin size), while being completely lossless as to vertex position quantization.

I should make it clear that the current tool can import/export MDL, but it will probably "drift" the vertex positions by a small amount.

Another note about bad skin sizes: the skin is stored early in the model file, so if the overall skin width times height is not a multiple of four, it throws the alignment of all subsequent integer values out of whack. Such models would probably load on a normal x86 system (but be slow) but would totally crash certain other systems. I could still load such a model safely but it would take extra code to read every field byte by byte and reconstruct the integers. I don't know if there are any models out there with bad skins which would make this effort worthwhile.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
ajay
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Post by ajay »

Just tried it out on some md3 map models; really good results, very impressive :)
ajay
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Post by ajay »

Ok I've converted a md3 to mdl and the skin is all squiffy. I've tried conversion with Quick3d, which doesn't result in a squiffy skin, but the model won't run in many engines (fitzquake for one, DP plays it fine) due to the skin being >480.
So I've tried reducing the skin size (but this results in the squiffy skin on the model as with qwalk) I've tried reducing the model size (here's my semi-logical brain missing something relevant) by a corresponding amount (90%) but the skin is still squiffy, which confuses me but there's probably a good reason for it.

Is there a way of solving this ('this' being something I may not have explained too well.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

stverts in the mdl format are on the same scale as skin dimensions, so you'll need to rescale those.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
ajay
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Post by ajay »

Thanks mh, I've fixed it by changing the skin size within QuakeMe rather than exporting/importing.
dreadlorde
Posts: 268
Joined: Tue Nov 24, 2009 2:20 am
Contact:

Post by dreadlorde »

Using the latest svn revision (80), I get the following errors when trying to compile qwalk:

Code: Select all

gcc -g -MD -Wall -pedantic -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -c -o v_font.o v_font.c
gcc -g -MD -Wall -pedantic -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -c -o viewer.o viewer.c
gcc -o viewer anorms.o image.o image_jpeg.o image_pcx.o image_tga.o matrix.o model.o model_md2.o model_md3.o model_mdl.o util.o v_font.o viewer.o -g -lm -ldl -lGL -lSDL -lpthread
model_md2.o: In function `model_md2_save':
/home/!@#$/src/proj/qwalk-svn/model_md2.c:746: undefined reference to `palette_quake2'
model_mdl.o: In function `model_mdl_load':
/home/!@#$/src/proj/qwalk-svn/model_mdl.c:471: undefined reference to `palette_quake'
/home/!@#$/src/proj/qwalk-svn/model_mdl.c:479: undefined reference to `palette_quake'
/home/!@#$/src/proj/qwalk-svn/model_mdl.c:480: undefined reference to `palette_quake'
/home/!@#$/src/proj/qwalk-svn/model_mdl.c:481: undefined reference to `palette_quake'
/home/!@#$/src/proj/qwalk-svn/model_mdl.c:487: undefined reference to `palette_quake'
model_mdl.o:/!@#$/jake/src/proj/qwalk-svn/model_mdl.c:488: more undefined references to `palette_quake' follow
collect2: ld returned 1 exit status
make[1]: *** [viewer_] Error 1
make[1]: Leaving directory `/home/!@#$/src/proj/qwalk-svn'
make: *** [viewer] Error 2
There's also a lot of warnings, I can post them too if you think it would help.

Anyone else have this problem? I'm using gcc-4.3.3.
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Get off my lawn!
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

Dang... I forgot to include palettes.o in the makefile. That's fixed.

As for the warnings, they're all "value computed is not used", which is really annoying but I'm not sure if it can be disabled without disabling a bunch more warnings. All the warnings are triggered by my kind of sneaky way of returning descriptive errors from functions in one line of code. If I ever implemented a better error handling system (using setjmp/longjmp) these warnings would disappear. Once real life cools down I'll take a look at that.

Also, if you are any good at computers and whatnot, maybe you can rewrite the makefile! I know absolutely nothing about makefiles, and I think mine is a piece of crap (and it doesn't load dependencies either).
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Post Reply