Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Bobboau on March 21, 2007, 10:05:10 am
-
http://freespace.volitionwatch.com/blackwater/PCSB.zip
for all you people who have problems with PCS saying; "one or more of the twenty thousand of your polygons is in some way not to my liking so I'm not going to convert your model" ie the stack overflow message, this should be somewhat more useful, unfortunately due to the way Kaz structured his BSP builder getting all the data together was extremely more complicated than it should have been, so I added in two more to give you information when it was easily available in the program. it'll tell you roughly were the problem is and then in what subobject, you need to remember that this is in FS units so what it gives you needs to be modified by the scaleing factor and TS XYZ == FS ZXY, and I think X is negitive, but other than that it usualy lands on at least one of the problem pollies, though in theory it could return a large box with multable polys inside.
anyway this is all just hacked in cause I was haveing problems with an increadably complex model I was trying to convert, and I needed a clue, and I figured it would be usefull to others.
it also suports auto-faceted shadeing. have fun:)
-
Well this is ****ing ironic. I spent all last night locked in mortal combat with PCS trying to get it to convert a model for BtRL.
It never worked but I did uncover a possible bug I'm wondering if your build fixes.
In cobconversion.cpp you have this
//BSPData = new char[409600]; // four hundred K should be enough
BSPData = new char[4194304]; // four MEGABYTES per sobj should be enough for SCP
Problem is that on two occasions elsewhere in the code you have this
memset(BSPData, 0, 409600);
So it's only flushing the first 400kB of the buffer.
Anyway is there any chance I can get hold of your source code for the is change (and also for SDL the download I have is borked, continually asking for strings.h with no clue of which of the 5 million variations of strings.h it actually wants).
-
ah cool, any chance you can add a few more formats?
-
Yay :yes:
Now while you're at it, add a simple edit box for the ship radius field, pretty please ?
-
Does this build do smooth groups correctly? And fix the glowpoint import bug? Per chance? Yes I know it's asking a lot put the answer just might be yes.
-
@karajorma:
well I didn't when you posted that, but I just went and added a geometry buffer size in the options frame, and altered those sections of code, don't know how well it works though.
I should mention it seemed like he figured some sort of dynamic buffer, so that might have been legacy code.
I'll post the sln tonight, I've been up way too long and I have school tonight.
@everyone else:
eye's gots ta sleep!
I'll do all that later sure(exept for the formats thing), but it'll be a horrable dirty hack. I consiter this dead code as Kaz has a replacement in the womb.
@IP:I think Kaz fixed the glowpoint import thingy a while back, and this was taken from CVS a few hours ago.
and it uses my auto-facet code from a while back, it works for me and I am a full bore artist as well as coder, (unlike kas who is primarily coding) so take that as you will.
BTW 90% of the time I spent was getting it to compile, Kaz and his damned non-standard libs...
and MS and it's damned dropped suport for standard libs.
-
Thanks bob. Actually I got my code from a CVS checkout yesterday so unless I checked out the wrong module or something I can't see how I'd have old code.
Mine also has the same build number as yours (1.3.5 R72) so it looks like we're working from the same source.
While I'm at it Kazan suggests getting write access to CVS and committing those changes.
-
heh that lack of flushing isn't a problem due to the way the system works, nice bug though, fix it pls
it's crufty because it's based off cob2pof or whatever the command line program was, and i didn't really understand what i was writing yet - PCS2 is much cleaner, and if both you guys would like to help me on PCS2.. it would help motivate me to work on it
PS: PCS2 requires wxWidgets, OpenIL .. and nothing else i think
-
Actually I checked out PCS2 earlier today. I won't have time to do much with it until the BtRL demo is out and even then I'm not much of a graphics, models or physics programmer so I doubt I'll be doing much except fixing bugs in the GUI for a long while :D
-
if one of you wants to do the GUI for me.. that would be the biggest help you could give - i hate writing user interface - an the module interface to PMF (the internal model format) is pretty straight up
PCS2 is really a design that shows
1) lessons i learned from mistakes with PCS1
2) my progress becoming a better programmer
3) my inability to type on insufficient sleep and too much stress
-
For anyone who uses this, a bit more useful version of Bob's coordinate conversion:
TS FS
X = Z
Y = -X
Z = Y
I used the output of this build, and it seems to get the coordinates exact. Good Job! :yes:
Now to find out how those 15 points differ from the rest of the model... :doubt:
-
Oh, and while you coding people are here. I've got a question on how the collision detection on a POF works.
I gather it uses a BSP tree, but is that data stored seperately from the polygon data in the POF ? If so, I guess there's a function in PCS that calculates the collision detection stuff from the COB file.
Now, would it be possible to get a feature into PCS, that would allow the user to re-generate the BSP stuff for an existing POF ? I'm asking because POFs generated with the 3DSMax exporter often have non-solid parts or collisions get detected slightly outside/inside the ship's hull.
If PCS could generate the collision detection data for such POFs, that would be super awesome.
-
any hope of a modelview style viewer so people can see where they're putting things? (remembers making a ship with PCS only to find the lasers and missles popped out of random places)
-
what is and is not done in PCS2?
I actualy got a lot of experience with wxWidgets from makeing proXimus.
source as promised
http://freespace.volitionwatch.com/blackwater/PCSsource.zip
I wasn't expecting anyone to ever see any of that, and I was a bit angery when I wrote that so it realy is an example of codeing violence, it's realy bad the few things I changed, it realy realy should not be made a permanent fixture of the code, I wasn't even planing to release this to the public until after how usefull it turned out to be.
you'll also need these odd creatures
http://freespace.volitionwatch.com/blackwater/ap.zip
and SDL, which I don't have a link to
-
most of the interface needs to be done in PCS2 and the COB->PMF conversion code (which is where all the "Autogen" features from PCS1 get ported to) - wxWidgets is capable of beautiful interfaces, and I am terrible at making beautiful interfaces.
all model files get converted into PMF once loaded into PCS2 - that allows me to only have to worry about doing the BSP split once in the PMF to POF conversion (when a POF is loaded the BSP is cached in the PMF so it doesn't have to be regenerated)
Col. Fishguts: I could easily make PCS2 regenerate POF BSP trees (the geometry and data is interleaved)
-
and SDL, which I don't have a link to
Damn. That was the one that was screwing me over. I kept getting errors in the actual SDL includes until I changed strings.h to string.h and although it compiled I'm not at all certain that was a good idea.
-
MS dropped suport for a lot of standard .h libraries when they went to .net (ie they used to suport <iostream> and <iostream.h> but now they don't), that was a huge pain to deal with, especaly all the std namespace crap.
alright, so basicly you have a fully functional POF handeling (loading/data accessing/saveing) class, and (little or) no interface code for it, that should be not too hard, I'll give it a shot.
are you useing some third party interface designer or is it just pure, by hand, WX?
and I hope you made more use of stl this time, in this sort of application you realy don't need to reinvent the wheel especially if it involves dropping functionality. lack of std::vector and std::string were a real hinderence when medling with the PCS source.
-
somone demonkey kaz, i bet it makes him feel unwelcome. you can give his monkey to say takashi :D
im sorta slowly learning c while i port my lua 3d engine to it. so i might (though very unlikely) be able to help on some stuff later down the line. but dont expect no miracles :D
-
BTW kaz, I'm using MSVC 2005 now if that's a problem for you.
and it looks like I'm going to have to do a lot of the same things to get it to compile, would you rather I used the std namespace explicitly everywhere I needed to (file/io streams) or would you prefer a type casting?
-
Sweet it looks like pcs2 might actually on the roll :)
-
PCS2 has been worked on in MSVC6 to date. If all three of us have MSCV8 i have no objection to porting it over, the hardest part i believe is getting wxWidgets set back up - it compiles to single target libs in MSVC6 but i think it compiles to a sicken slew of libs in MSVC8
i'm not using std::vector and std::string at the moment because i needed to be able to debug into those - so i have temp replacements (included in the util folder) called kaz_string and kaz_vector - they're interface compatable so when we're ready a simple string replacement will flip it back to std::(vector|string)
the internal model format of PCS1 was POF
the internal model format of PCS2 is PMF (PCS Model Format) - module interface defined in pcs_file.h
POF<-->PMF conversion in pcs_pmf_pof.cpp (implemented) - BSP compiler/decompiler in pcs_pof_bspfuncs.(h|cpp)
COB<-->COB conversion in pcs_pmf_cob.cpp (incomplete)
adding support for additional file types like COB is comparatively trivial in PCS2 when compared to PCS1
POF handling code in the POF folder
BSP handling code in the BSP folder (messy, but gets the job done)
COB handling code in the COB folder (minimal support - only that which we need)
util folder has various ****e (platform abstracting directory lister w/ search support), my templates, openGL texture loader that follows fs2 search path/VPs, VP reader
compat folder - obvious
GUI folder - obvious (split into source/headers) - most of the work to be done here is with the editors (in subfolders) and fancy stuff for the openGL window (wxGL_PMFCanvas.cpp)
[edit]
i think i already had it working in MSVC8 on my machine.. lemme double check.. i made a bunch of changes i needed to roll back
PS: i have 32bit <--> 64bit portability warnings turned on... and i'm not supressing warning C4267 - it aint pretty, we need to clean that up.. when i tried i made things worse (what i just rolled back)
-
somone demonkey kaz, i bet it makes him feel unwelcome.
very perceptive, thank you :D
-
building on MSVC8 - .sln file commited to CVS - requires wxWidgets 2.8 compiled to static link, not dll
[edit]
forgot to answer - been using the GUI by hand
[edit again]
i see you've already got write access bob (probably from ferrium)
Access List to my repo:
Me (admin),
Bob (cvs, release tech)
Kara (cvs, release tech, shell)
Goob (cvs)
Taylor (cvs)
[edit3]
i turned 32/64 portability warnings off
-
good ole signed/unsigned mismatch error, my own little project has that same issue, I got over 200 of em :lol: (mostly the same ones in a header getting tripped every time that header is included) when I first noticed them I figured it'd be easy to fix them later, now that it's later it's more like 'well it's not that big of a problem' so the lessen learned is if you are going to fix it fix it sooner rather than later.
it seems glcanvas isn't enabled by default, seems I need to recompile wx...
-
hmmm... got it to run, I though it was going to use a tree control for navigation, what ever happened to that?
ok, I'm going to start work on this, my basic plan is a ground up approach, I'm going to make sevral common editors derived from a panel, things like an array control that has new/erase/copy buttons, a combo box for selecting an indevidual item, and a sub panel for more controls (editors for the elements in the array) and a vector control (which could have derived normal control that handled things like normalisation).
-
hmmm... got it to run, I though it was going to use a tree control for navigation, what ever happened to that?
it was clunky, and ugly
and yeah i forgot to warn you about glcanvas
-
this needs it's own topic (http://www.hard-light.net/forums/index.php/topic,46093.new.html#new)
-
word of warning - the way PCS2 deals with infinite recursion situations is by terminating that path - thereby truncating the geometry
-
Good, at least then I'll know where the errors are, instead of having it freeze. :)
-
Good, at least then I'll know where the errors are, instead of having it freeze. :)
yup
-
you could have it make the last set of polygons red flat polys, that would make it even more aparent, or sence it's going to be internal just highlight them.
do you mind if I bring the tree back?
I realy liked the idea and I don't see how it could have been determined to be clunky seeing as PCS2 never got to a state were it could be used enough to make that determination
-
I realy liked the idea and I don't see how it could have been determined to be clunky seeing as PCS2 never got to a state were it could be used enough to make that determination
you can try.. lemme see if i deleted the code, or just disabled it
[edit]
disabled -
wxCTreeCtrl.h
yup.. most of the code is still there, just commented out
-
does it still leave the turrets in there proper places instead of sticking them in the middl of the ship?
-
I've never had that problem with PCS, now with Max exporter I've always had that problem.
-
hey, what do you use to convert xpm files?
-
hey, what do you use to convert xpm files?
paint shop pro
-
does it still leave the turrets in there proper places instead of sticking them in the middl of the ship?
word to the wise - don't blame me for other people's bugs
-
Kazan: Just ignore takashi... it's safer for your heart in the long run, truuust me.
-
yeah, read his title.
anyway PSP doen't have xpm as a type, but I found something that should work.
-
does it still leave the turrets in there proper places instead of sticking them in the middl of the ship?
its not the converters fault if you forget to reset xform :D
that said a max->pmf plugin would be cool. actually be sure to thouroughly document that pmf format so that plugin devs can write output scripts/plugins for *insert name of modeling program here*. also support for an ascii version of the format would be cool cause some scripting languages cant really deal with binary file types.
-
as i've said elsewhere - writing support for new file formats for PCS2 is trivial compared to PCS1
-
please CVS update PCS1 (i fixed all the line endings, and a bug) and commit your changes into the repo bob - then i can make an official build
-
oh, I really don't think the stuff I did in PCS1 should be allowed to pollute a stable code base, I did some serious coding violence in it, only cause I needed to know were it was having problems _NOW_, there was no forethought no plan, and it shows, I don't even want people to see this it's so ugly.
-
Yeah but so is the rest of the codebase :p
And PCS1 is being replaced by 2 anyway.
-
Yeah but so is the rest of the codebase :p
And PCS1 is being replaced by 2 anyway.
yup
PCS1 = mess