Entity 2.1.24

A wealth of applications with which you will need to mod Halo 2.
Post Reply
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

I opened ascension went to sbsp and decided id start testing there...

I extracted the bsp collision to .obj, then i extracted the visual mesh to single .obj, then i extracted bsp to multiple objects.
Everything worked fine, off to a good start. :D

I like how when extracting mesh to single .obj, you get two models, one main mesh and one with the perms. :D

Lightmap viewer didnt work and i dont know what the portal viewer is, but i assume these are for a later update.

Injecting bsp mesh still needs work.
Image
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

I knew this wouldnt work but i did it to see what would happen.

I saved lockouts bsp mesh to single model, then open ascension and tried to inject lockouts visual mesh.

Errer dialog was as usual, couldnt find ascension.mtl.

But the small window that says "loading model" dosnt close after ok'ing the errer msg, unless you close Entity.
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Entity 2.1.10

Post by troymac1ure »

bumlove wrote:It caught me by surprise too, I had a bit of free tv/xbox/living room to myself time so I thought I'd go at it and "pop up" "New update available" just upgraded my 64MB gpu to a 256MB so now orbit works for me too now, I like the 2nd Meta editor esp the big red bits saying "don't touch that here, touch it there"
oh one small thing prob my error, I tried adding a conversion map to the main menu but it froze on "Loading 100%",(stop to think did I sign it?, I'm sure I did but) like I say prob my error
This may be my fault. Like I said I haven't had a chance to xbox test the mainmenu.map, so it's possible that there is an error in my coding, that's why I wanted testers. I'll try to get a chance to test it, maybe with a known good map. It auto-resigns the mainmenu.map file for you, but not the maps themselves. I didn't write a whole lot on info on how to use it, but you can reorder the maps by dragging them to a new position.
What did you think of the mainmenu editor setup though?
Ogrish wrote:I opened ascension went to sbsp and decided id start testing there...

Lightmap viewer didnt work and i dont know what the portal viewer is, but i assume these are for a later update.

Injecting bsp mesh still needs work.
Image
I don't remember what I did to the BSP Viewer (it was a long time ago I was working on it). I thought I had just added the Gizmo to it (which wasn't working good enough, so I just disabled it for now), I totally forgot about the other stuff. I gave up on the BSP injection as it will lock the map up if new objects are added. You can move existing BSP objects around a bit, but they disappear if you are not looking in the original direction of the object. To fix it properly, the BSP tree would have to be recalculated I think so the engine knows what objects to cut out when you're looking a certain direction.

The Lightmap & portal viewers work I think, information on something... I dunno. I'll look at this again.
Thanks though for all the feedback.
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

Well ive been playing around with it, and i found it injects the model and shaders fine, but the lighting is whats currupted.
no lighting
Image
lighting
Image
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Entity 2.1.10

Post by troymac1ure »

I know. Unfortunately, because of the way I have to organize it to re-inject it, the lightmaps for ALL the BSP objects get messed up.

I would have to
1) extract the lightmap data as well, have the editing program create it and then have it injected back in.
2) Have the user select a point for the light source(s), then regenerate the lightmaps from that point source(s).

Obviously the first would be easier as I would just have to write extraction/injection routines, but I don't know how to do lightmap creation/injection/extraction with 3DS or Milkshape or whatever programs are used.

Also, I left this on the way side, b/c I got the models injecting, but I found if I play the level and look towards the new object it starts to massively lag before locking up completely. I am sure this has to do with the BSP trees rendering unneeded objects in the wrong order or something.
When I first tested this, I took the Coagulation base and lifted off the ground and tilted it. I found that if you looked up at it (with the viewpoint above where the original base was located) the base would disappear. I assume this is because the BSP tree tells the engine that the base is no longer in view (although it is since I moved it).
Image
Next I tried replacing it with a base from Beaver Creek. The moment you would look in the direction of the base, the game would slow to a halt.

That is why in order for BSP injection to work, we would need to be able to create a new BSP tree, and I just don't understand it all that well.

...or I'm way off and someone will correct me (Grim? you there?)

OGRISH: Just tried the lightmap viewer, takes a bit to load, but worked for me. Portal Viewer didn't load though.
Also, auto-update crashed for me. I'll have to fix it. I'm sure you had the same issues?
User avatar
bumlove
Posts: 524
Joined: Tue Dec 11, 2007 8:10 am
Location: England I'm not British, I'm English

Re: Entity 2.1.10

Post by bumlove »

hi I can't save (recursive & parsed) a plasma grenade proj everything else Ive tested (very limited ) is ok for extraction
I get "error not found" is it my noobishness?

oh and out of curiosity is it the first bit of the exception your interested in or all of it?

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at entity.Meta.ReadMetaFromMap(Int32 tagnum, Int32 mapnumberx, Boolean dontreadraw) in C:\GAMES\XBox\Halo2\Programs\Source\Entity 2.1 Source\HaloMap\HaloMap\Meta\Meta.cs:line 105
at entity.Meta.SaveRecursiveFunction(Meta meta, ArrayList& metas, Int32 mapnumber, Boolean parsed,
Last edited by bumlove on Fri Mar 18, 2011 1:56 pm, edited 1 time in total.
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

I dont use recursive unless im duplicating a tag.
I havnt tried this version, but the last one eeFF'd up tag names if i saved them recursive then built them in.

would it br possible to rename a tag recursivly?

Like say i take mach tag, swap/add/remove/etc, all the other attached goodies, then i want to save it for another map, so i tick Recursive, then right click
the mach tag and rename it at the time of saving, (this is where the magic happens) durring saving the App should change the prefix/name of all linked tags being saved.

So if the mach was named "Ogrish_lift" the hlmt, coll, mode, phmo, shaders' oops that would be a problem all shaders with one name. :XD:
Upon more thought, Just forget you read this part, i must need my meds!
User avatar
bumlove
Posts: 524
Joined: Tue Dec 11, 2007 8:10 am
Location: England I'm not British, I'm English

Re: Entity 2.1.10

Post by bumlove »

^ that IS a good idea

heres what I'm trying to do with varying degrees of failure
I'm making a trip/land mine like I had done before
I need 3 frag clones 1 plasma clone and 3 rocket launcher explosion effe clones,
When I'm saving meta (lets say frags) if I extract all the tags in the same folder and then build, in entity only builds in the last thing I extracted like its over-writing the previous entries (if all entries are the same thing, yes I rename the tags when extracting) so thats a problem (extracting to different folders solves that)
I still can't extract the plasma nade proj recursively on any map (and goddamn the idiot who forgot to type the full stop before xml on previous versions of entity)
To keep it simple I'm prob complicating it, the plan was extract recursively & parsed all the things I need, inject into another map to link everything together then extract again all bundled up to put into a SP conversion anyway back on topic
yeah Ogrish I've noticed some things have messed up I extracted and added a battery I got the message "strings might be fur##xed" and one of its predicted resource was Co-ags sky.mode!?!?
It was going ok until the last update this morning (I was feeling optimistic then and hadn't tried anything much)
Oh one more thing while I'm rattling on (and I know MEv2 solves this I haven't grown to love it yet) ME 1 and it tendancy to move the page when scrolling through reflexives. Ogrish got any spare meds?

*chilled out edit*
troymac1ure wrote:What did you think of the mainmenu editor setup though?

Straight forward and to the point, no nonsense, all that you need and nothing more, will defiantly use it. Any future in (shit I can't think of the tag) deeper game variables
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Entity 2.1.10

Post by troymac1ure »

bumlove wrote:hi I can't save (recursive & parsed) a plasma grenade proj everything else Ive tested (very limited ) is ok for extraction
I get "error not found" is it my noobishness?
I just tried and extracted the Plasma grenade proj with no errors on two different maps (using v2.1.10). The output below from Coagulation, though you will have to change the info file to suit your directories (hmmm.. never noticed that it uses a drive listing instead of just from the info file directory...I think this should be changed):
Plasma_Nade.rar
Plasma Grenade Extract
(387.34 KiB) Downloaded 350 times
bumlove wrote:oh and out of curiosity is it the first bit of the exception your interested in or all of it?

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at entity.Meta.ReadMetaFromMap(Int32 tagnum, Int32 mapnumberx, Boolean dontreadraw) in C:\GAMES\XBox\Halo2\Programs\Source\Entity 2.1 Source\HaloMap\HaloMap\Meta\Meta.cs:line 105
at entity.Meta.SaveRecursiveFunction(Meta meta, ArrayList& metas, Int32 mapnumber, Boolean parsed, ToolStripProgressBar pb, Single percent, Single percentsize) in C:\GAMES\XBox\Halo2\Programs\Source\Entity 2.1 Source\HaloMap\HaloMap\Meta\Meta.cs:line 380
at entity.Meta.SaveRecursiveFunction(Meta meta, ArrayList& metas, Int32 mapnumber, Boolean parsed, ToolStripProgressBar pb, Single percent, Single percentsize) in C:\GAMES\XBox\Halo2\Programs\Source\Entity 2.1 Source\HaloMap\HaloMap\Meta\Meta.cs:line 405
at entity.Meta.RecursivelyLoadMetas(Int32 mapnumber, Boolean parsed, ToolStripProgressBar pb) in C:\GAMES\XBox\Halo2\Programs\Source\Entity 2.1 Source\HaloMap\HaloMap\Meta\Meta.cs:line 291
at entity.Meta.SaveRecursive(String outputFilePath, Int32 mapnumber, Boolean parsed, ToolStripProgressBar pb) in C:\GAMES\XBox\Halo2\Programs\Source\Entity 2.1 Source\HaloMap\HaloMap\Meta\Meta.cs:line 297
at entity.MapForm.saveMetaButton_Click(Object sender, EventArgs e)
Basically I only need the first 2-3 lines, but the above is all I need at tops. The top is the function that messed up and each one below is the function that called the function above, so gives me an idea of what you were trying to do when it crashed, but unfortunately, doesn't tell me detailed info.
bumlove wrote: I still can't extract the plasma nade proj recursively on any map (and goddamn the idiot who forgot to type the full stop before xml on previous versions of entity)
:XD: Yeah, it bothered me too, that's why I fixed it.
bumlove wrote: Oh one more thing while I'm rattling on (and I know MEv2 solves this I haven't grown to love it yet) ME 1 and it tendancy to move the page when scrolling through reflexives.
Yeah, b/c of the setup and my learning as I go programming technique, well... That's why I started from scratch and developed a new method of editing. You may not love it yet, but don't even think about using ME1 for editing the SCNR tag with ME2/ME+ around. No more memorizing how far down a certain reflexive is or waiting for it to load, only to have it run out of memory. Now you want to edit the Weapons, the tree listing is all alphabetical, so boom, there it is. They both have their advantages/disadvantages, but ME+ is alot cleaner and in the future will allow you to undo any changes made in the tag before you hit Save.
I am going to encorporate a right-click feature to restore a single value, a reflexive (single or all) or the whole tag back to pre-edited state. The base work is all done, adding these features would probably only take 30 mins. Also, b/c of this setup, once a working RTH can be implemented, it can scan the tag for changes and just poke those values in a more efficient way so it's not as slow.
Anyways, back on topic, from what I remember I think I can get rid of the scroll jumping thing, at the loss of the info in the bottom right corner that tells you the current reflexive name and selection. eg. "Resource: (5/6)" and maybe the current status thing too (".:Idle:.", ".:Saving:.", etc). When updating this the editor loses focus and when the focus returns it causes it to jump to the top of the first refelxive.
bumlove wrote:
troymac1ure wrote:What did you think of the mainmenu editor setup though?

Straight forward and to the point, no nonsense, all that you need and nothing more, will defiantly use it. Any future in (shit I can't think of the tag) deeper game variables
Not sure what tag you're referring to, sorry.
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Entity 2.1.10

Post by troymac1ure »

Since my last post was soo long already and this one will be too, I double-posted. :shock:

This image is taken from the lightmap viewer of a BSP injection of the Beaver Creek base into coagulation with lightmaps turned off:
(if you're running out of memory, close the map, re-open and select it before doing anything else):
Image

This image is taken from the lightmap viewer of a BSP injection of the Beaver Creek base into coagulation with lightmaps turned on:
Image

This is how it looks through the BSP viewer without lightmaps turned on:
Image

This is how it looks through the BSP viewer with lightmaps turned on:
Image

This is the above, but I adjusted the lightmap palette to reduce the strength and saturation of the lightmap:
(This gives a kind of cool alien looking effect to the map)
Image

But again, in-game does not work even remotely alright. You could however extract and reinject the BSP to get the screwed up lightmap result.
Another thought I had was that in the lightmap viewer, the user could have a paintbrush and just color the BSP as desired for lighting, but probably will never get anywhere as H2 has come to a crawl.
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

I built some of lockout into ascension and the map loaded, but i didnt mess around enough to see if it would lag.

Im not able to get my custom models strings correct for bsp injection, so ive moved away from this, (It was fun to play with).
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

(D/P)

Bitmap injection still needs work.
Im just going to make a quick mod with this version, but bitmaps im injecting with dothalo.
Ill post if i run into any problems.
User avatar
bumlove
Posts: 524
Joined: Tue Dec 11, 2007 8:10 am
Location: England I'm not British, I'm English

Re: Entity 2.1.10

Post by bumlove »

I've been using this a lot the past week and am very impressed some bug bears but they're nothing but mild irritations,
a couple of things MEv2 I've learnt to love it, Hot keys to unearth/show tag list would be nice, my screen gets filled with ME2 windows (good for comparisons) I'd never noticed the fill in the unknown part to MEv1 will it be used in MEv2?
User avatar
Grimdoomer
Admin
Posts: 1835
Joined: Sun Dec 09, 2007 9:09 pm

Re: Entity 2.1.10

Post by Grimdoomer »

Bsp injection will not work the way you are doing it. The only way to build in a new bsp mesh would require that you generate new MOPP data for that bsp. The reason your injections have worked, is because you used the existing MOPP data that was generated for those bsp nodes. I'm not sure if moving the object (such as the base) in any way would cause it to no longer have collision, although its likely.
Don't snort the magic, we need it for the network.
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

Hell i didnt even think to check for collision, i can fake it, i just want to be able to inject either one large model with many groups and shaders to replace the old visual mesh, or possibly overwrite just the bsp permiatations with custom models.

With decent model injection :wink:

Twin reaper figured out how to get the texcodes right to inject pretty decent models over the bsp visual mesh, last year, he tried to teach me but i rode the shortbus to Halo modding school.

Anyways its a start, and im all ready having fun extracting perms from one map and putting them in other maps, although im spawning them as scenery.

Shaders swaps on objects in viewer, with a viewer that would update and show the changes, (for the people who cant get RTH to work), Would be Orsm

Image
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Entity 2.1.10

Post by troymac1ure »

Grimdoomer wrote:Bsp injection will not work the way you are doing it. The only way to build in a new bsp mesh would require that you generate new MOPP data for that bsp. The reason your injections have worked, is because you used the existing MOPP data that was generated for those bsp nodes. I'm not sure if moving the object (such as the base) in any way would cause it to no longer have collision, although its likely.
It's been a long time since I tried it, but I think the base collision was in the usual spot and just the visual mesh was moved from what I remember. I guess the BSP tree would fix the disappearing and the MOPP would fix the collision? I never quite understood what those were for.
bumlove wrote:I've been using this a lot the past week and am very impressed some bug bears but they're nothing but mild irritations,
a couple of things MEv2 I've learnt to love it, Hot keys to unearth/show tag list would be nice, my screen gets filled with ME2 windows (good for comparisons) I'd never noticed the fill in the unknown part to MEv1 will it be used in MEv2?
(1) What bugs? Feedback will help those things.
(2) I could have the tree list on auto-hide with a pin button. That way it's there when you need and hides away when you don't.
(3) I also don't like how you end up with so many windows open when looking through tags. I suppose I could just add each tag to a tab at the top of the one window, then you can just click back and forth between the tabs. Didn't think of this before, but I think it would be better.
(4) As for the the fill in, I assume you mean the "Copy this value to all reflexives" or whatever I called it. All that can easily be added to the new editor. It's so much easier to work with. The only downside is editing reflexives that actually reside in a different tag, but that I figure is a minor annoyance with the "double-click to open this tag reflexive" and will allow for undo if needed (future).
Ogrish wrote:(D/P)
Bitmap injection still needs work.
Im just going to make a quick mod with this version, but bitmaps im injecting with dothalo.
Ill post if i run into any problems.
I didn't do anymore work on that front. ME+ was my main focus for this release.
Ogrish wrote:Anyways its a start, and im all ready having fun extracting perms from one map and putting them in other maps, although im spawning them as scenery.
Shaders swaps on objects in viewer, with a viewer that would update and show the changes, (for the people who cant get RTH to work), Would be Orsm
Image
I don't remember building those options into the BSP viewer. Someone else must have taken that apon themselves... alright! :p
That does look like a good idea. Originally that was what I wanted. A BSP Viewer with a built-in ME, but focuses get changed.

Always lots of ideas to try to implement, but very little time. If anyone else wants to try their hand at programming, I posted the source to the FTP server :roll:
I'd be glad to help out answering what questions I can...
User avatar
bumlove
Posts: 524
Joined: Tue Dec 11, 2007 8:10 am
Location: England I'm not British, I'm English

Re: Entity 2.1.10

Post by bumlove »

troymac1ure wrote:(1) What bugs? Feedback will help those things.
(2) I could have the tree list on auto-hide with a pin button. That way it's there when you need and hides away when you don't.
(3) I also don't like how you end up with so many windows open when looking through tags. I suppose I could just add each tag to a tab at the top of the one window, then you can just click back and forth between the tabs. Didn't think of this before, but I think it would be better.
(4) As for the the fill in, I assume you mean the "Copy this value to all reflexives"......
(1) only mild irritations, occasionally the bsp editor changes (blocs is all I've noticed) items on its own on, every other annoyance is practices that I need to learn and and in no way a problem for you
(2) A great idea, how about the same for the right hand side too
(3) An even better idea, a tab system with in ME2 double click for open in new tab right click option to open in new window
(4)No, I mean the control swapper will it be incorporated into MEv2? (a great way to rewrite pluggins without rewriting) (I still have to get to grips with this properly)
other small things,
Bsp options like "show lighting" "show permutations" should be a option before opening the viewer (I don't know if this would help with speed)
The custom pluggin selector should ask where the pluggins are on your HDD, at present you would go to settings and point entity to the pluggins folder, I've realised it's better to have several sets newest/oldest/neodos coll phmo & mode collection, plus the many individuals for adding reflexives to tags that don't have have that reflexive (like DS's biped attachments video tut)

*edit*
System.Exception: Whoops! Forgot to code in "TagType" data type for labels!
Slap the programmer and tell him about this message!
at entity.Forms.MetaEditor.WinMetaEditor.loadLabels(reflexiveData rd)
at entity.Forms.MetaEditor.WinMetaEditor.treeViewTagReflexives_AfterSelect(Object sender, TreeViewEventArgs e)
I love it I was looking at weap attachments in me2
System.Exception: Whoops! Forgot to code in "TagType" data type for labels!
looking at jmad elite effects and sounds
I'm finding a few of these "System.Exception: Whoops! Forgot to code in "TagType" data type for labels!" do you want me to report them all or is something I'm doing screwed cos Im only looking in ME2

*edit* changing string id's and emuns requires to alter another value (float etc) to save in both me1 and sometimes doesn't save at all in meta editor enhanced (I like ME² as a name)
hex editor is a bit of a car crash, click twice on the scroll bar to fur##x it up, centre click scroll doesn't work,
now I've got my pluggins in order things are working pretty well
oh I was trying to look a H1 map and it wouldn't have it, but I've never tried this before,
And a few whoops exceptions, would you like for me to post them all or could that be plug related?
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

My favorite part of this is permiatation extractions so far.
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Entity 2.1.10

Post by troymac1ure »

bumlove wrote: System.Exception: Whoops! Forgot to code in "TagType" data type for labels!
Slap the programmer and tell him about this message!
at entity.Forms.MetaEditor.WinMetaEditor.loadLabels(reflexiveData rd)
at entity.Forms.MetaEditor.WinMetaEditor.treeViewTagReflexives_AfterSelect(Object sender, TreeViewEventArgs e)
I love it I was looking at weap attachments in me2
System.Exception: Whoops! Forgot to code in "TagType" data type for labels!
looking at jmad elite effects and sounds
I'm finding a few of these "System.Exception: Whoops! Forgot to code in "TagType" data type for labels!" do you want me to report them all or is something I'm doing screwed cos Im only looking in ME2
Just if it has a different data Type. If they are all "Tag Type", then I only get 1 smack :?
bumlove wrote: *edit* changing string id's and emuns requires to alter another value (float etc) to save in both me1 and sometimes doesn't save at all in meta editor enhanced (I like ME² as a name)
hex editor is a bit of a car crash, click twice on the scroll bar to fur##x it up, centre click scroll doesn't work,
now I've got my pluggins in order things are working pretty well
oh I was trying to look a H1 map and it wouldn't have it, but I've never tried this before,
And a few whoops exceptions, would you like for me to post them all or could that be plug related?
The stringID/Enum saving thing I will look into. I may have forgotten something with ME². As for ME1 I shall see if I can find it, but I'm not a big fan of working with the coding on it. Might as well get rid of the jumping bug while I'm there too.

The Hex editor was a WIP that got left midway as I didn't think many people used it. I was trying to make it a Hex Editor instead of a hex viewer, but as with alot of stuff, it would've been easier to start from scratch. Do you actually use (or would use) it?

All the "Whoops!" stuff is just for labels (the names listed in the Reflexive dropdown). I added the type I figured would be getting used, but apparently I forgot Tag/Idents or misnamed something. I'll check into it. If the H1 issues are "Whoops!" stuff, then that would be the same thing again.
User avatar
bumlove
Posts: 524
Joined: Tue Dec 11, 2007 8:10 am
Location: England I'm not British, I'm English

Re: Entity 2.1.10

Post by bumlove »

the hex viewer not used massively, if I could extract a tag as hex it would make it easy to check the pluggins (can I do this already?) anywho great work
User avatar
OwnZ joO
Posts: 1197
Joined: Sun Dec 09, 2007 4:46 pm

Re: Entity 2.1.10

Post by OwnZ joO »

bumlove wrote:the hex viewer not used massively, if I could extract a tag as hex it would make it easy to check the pluggins (can I do this already?) anywho great work
Extract the meta and open it in a hex editor?
User avatar
Twinreaper
Posts: 299
Joined: Sat Feb 23, 2008 7:41 pm
Location: PA

Re: Entity 2.1.10

Post by Twinreaper »

I saw the part about textures at the top, and thought I would help a little.

The whole reason i found this out, is because I got overly fustrated with textures when we would try to inject something. I couldn't quite figure out why the textures would be all fudged up. I finally realized, that when Entity extracts bsp mesh, it extracts it for use in a obj format is easily usable by any 3d app. However the flaw, was that when re-injecting this obj data, the material syntaxes were not easily usable by Entity, since they are exported from a 3d app. When you open a obj file from entity in notepad, you will notice it is very well constructed. You have all the sections of the mesh lined up nice and neat. As you go thru the file, and get towards the end, you come to the material assignments section. The format the obj from Entity uses is similar to this:
g 7.0
usemtl shield_energy


The way the materials look after you export from 3dsmax, look similar to this:

usemtl tower_metal_trim_f
f -108/-108/-108 -107/-107/-107 -106/-106/-106
f -107/-107/-107 -105/-105/-105 -106/-106/-106
f -104/-104/-104 -103/-103/-103 -102/-102/-102
f -103/-103/-103 -101/-101/-101 -102/-102/-102
f -100/-100/-100 -99/-99/-99 -98/-98/-98
f -99/-99/-99 -97/-97/-97 -98/-98/-98
f -96/-96/-96 -95/-95/-95 -94/-94/-94
f -95/-95/-95 -93/-93/-93 -94/-94/-94
f -92/-92/-92 -91/-91/-91 -90/-90/-90
f -91/-91/-91 -89/-89/-89 -90/-90/-90
f -88/-88/-88 -87/-87/-87 -86/-86/-86
f -87/-87/-87 -85/-85/-85 -86/-86/-86
f -84/-84/-84 -83/-83/-83 -82/-82/-82
f -83/-83/-83 -81/-81/-81 -82/-82/-82
f -80/-80/-80 -79/-79/-79 -78/-78/-78
f -79/-79/-79 -77/-77/-77 -78/-78/-78
f -76/-76/-76 -75/-75/-75 -74/-74/-74
f -75/-75/-75 -73/-73/-73 -74/-74/-74
f -72/-72/-72 -71/-71/-71 -70/-70/-70
f -71/-71/-71 -69/-69/-69 -70/-70/-70
f -68/-68/-68 -67/-67/-67 -66/-66/-66
f -67/-67/-67 -65/-65/-65 -66/-66/-66
f -64/-64/-64 -63/-63/-63 -62/-62/-62
f -63/-63/-63 -61/-61/-61 -62/-62/-62
f -60/-60/-60 -59/-59/-59 -58/-58/-58
f -59/-59/-59 -57/-57/-57 -58/-58/-58
f -56/-56/-56 -55/-55/-55 -54/-54/-54
f -55/-55/-55 -53/-53/-53 -54/-54/-54
f -52/-52/-52 -51/-51/-51 -50/-50/-50
f -51/-51/-51 -49/-49/-49 -50/-50/-50
f -48/-48/-48 -47/-47/-47 -46/-46/-46
f -47/-47/-47 -45/-45/-45 -46/-46/-46
f -44/-44/-44 -43/-43/-43 -42/-42/-42
f -43/-43/-43 -41/-41/-41 -42/-42/-42
f -40/-40/-40 -39/-39/-39 -38/-38/-38
f -39/-39/-39 -37/-37/-37 -38/-38/-38
f -36/-36/-36 -35/-35/-35 -34/-34/-34
f -35/-35/-35 -33/-33/-33 -34/-34/-34
f -32/-32/-32 -31/-31/-31 -30/-30/-30
f -31/-31/-31 -29/-29/-29 -30/-30/-30
f -28/-28/-28 -27/-27/-27 -26/-26/-26
f -27/-27/-27 -25/-25/-25 -26/-26/-26
f -24/-24/-24 -23/-23/-23 -22/-22/-22
f -23/-23/-23 -21/-21/-21 -22/-22/-22
f -20/-20/-20 -19/-19/-19 -18/-18/-18
f -19/-19/-19 -17/-17/-17 -18/-18/-18
f -16/-16/-16 -15/-15/-15 -14/-14/-14
f -15/-15/-15 -13/-13/-13 -14/-14/-14
f -12/-12/-12 -11/-11/-11 -10/-10/-10
f -11/-11/-11 -9/-9/-9 -10/-10/-10
f -9/-9/-9 -8/-8/-8 -10/-10/-10
f -10/-10/-10 -8/-8/-8 -7/-7/-7
f -6/-6/-6 -4/-5/-4 -5/-4/-5
f -5/-4/-5 -4/-5/-4 -3/-3/-3
f -3/-3/-3 -4/-5/-4 -2/-2/-2
f -4/-5/-4 -1/-1/-1 -2/-2/-2
# 328 faces

g

Now you notice that each material does not have a "g" or a "number" before the material. This is why Entity does not re-inject textures properly. Entity looks for those certain characters before each material so it knows what faces belong to what material group. Without them, Entity sees thes only the faces, and assigns a default material to ALL the faces. Also on top of that, before the material groups in the exported obj, there are uneeded characters in the beginning of the group and at the end. The uneeded ones are the "g" at the end of my example, and there will be a "G" and a "#" in the beginning.

Anyway, I think this is getting confusing.....so here's the solution. Copy the obj file you want to edit. Label each one as original and new. Delete everything material wise in the new file. Then, starting with the first material section, label it from: g 7.0 usemtl shield energy to: G 1.0 usemtl shield energy.
After that continue the ordering of 1.1 and so on.

Once you have the list of materials done, now you need to start going thru the original file, and copying over every face pair, to the new material sections you set up. So this way, all faces of the same material will be with all like material faces.

Now the fun part. Now that we have told Entity what order what faces should be re-injected first and with what material, now we have to edit the actual mtl file. The reason we need to edit the mtl file, is becasue Entity uses this to determine how many shader chunks are in the actual bsp. On top of that, each material in the mtl file, needs to be written in the order the obj file has materials defined.

When dealing with large multi part obj files, you will need to make each obj material list appear in order in the mtl file. If you don't, Entity, will assign each obj after the first one, with the materials from the first obj. That will lead to many ugly meshes.

So there you have it. A very confusing and not well written method I discovered about mesh injection and keeping materials correct. Perhaps one day, I'll make a more well constructed tutorial on this.
Image
User avatar
Ogrish
Posts: 1512
Joined: Wed Dec 12, 2007 2:56 am

Re: Entity 2.1.10

Post by Ogrish »

we need an app that simplifies this process, and saves both the .obj and the .mtl correctly, for injection, or another model injecter that can read the models exported with other 3d apps.
User avatar
kornman00
Posts: 104
Joined: Wed Jan 20, 2010 7:48 pm

Re: Entity 2.1.10

Post by kornman00 »

Wavefront's obj format is outdated and shit by today's standards. COLLADA would be a better solution, but there's not too many out-of-the-box APIs for it in .NET (though you can generate code based on it's xml schema, or you can purchase a 3rd party lib made just for COLLADA).
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: Entity 2.1.10

Post by Click16 »

or use .3ds files, apparently adobe photoshop CS3 can open OBJ's and 3ds's
Image
Post Reply