The Official Happiness Thread

Post Reply
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

Looks like good quality codez =)
However, I'm not quite sure how I'm meant to load a model's data from a map...

I see: Load(byte[] raw_data, DResource[] raw_resources, DCompressionRanges compression_ranges)
but where do I get raw_resources and compression_ranges?

I can has Read(BinaryReader br);?
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

XZodia wrote:Looks like good quality codez =)
However, I'm not quite sure how I'm meant to load a model's data from a map...

I see: Load(byte[] raw_data, DResource[] raw_resources, DCompressionRanges compression_ranges)
but where do I get raw_resources and compression_ranges?

I can has Read(BinaryReader br);?
Yea, tagblock loading is naff right now... You have to ask the map for one, then just pass out the properties from the model block.

Code: Select all

MapStream map = new MapStream(@"C:\Users\stem\Documents\headlong.map");
model tag = (model)map.GetTag(map.FindFirst((tag_class)"mode", "bridge_light"));
var raw = tag.Sections[0].GetRawPointer();
map.Position = raw.Address;
byte[] raw_data = new byte[raw.Length];
map.Read(raw_data, 0, raw_data.Length);
Mesh mesh_data = new Mesh();
mesh_data.Load(raw_data, tag.Sections[0].GetSectionResources(), tag.GetBoundingBox().GetCompressionRanges());
Clunky : definitely was not going to keep it this way, I just moved on to models for a bit.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

After a bit of messing about, I'm down to this error, which I can't do anything about...

'Moonfish.Core.model.BoundingBox' does not contain a definition for 'GetCompressionRanges'
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

XZodia wrote:After a bit of messing about, I'm down to this error, which I can't do anything about...

'Moonfish.Core.model.BoundingBox' does not contain a definition for 'GetCompressionRanges'
You might be be to call GetDefinition() on the model.BoundingBox object for the DCompressionRanges. I removed that property sometime I guess.
I just want to point out unless you're trying to edit the existing model or something you don't need to use the Load method to create a new model-tag for entity.
Just :

Code: Select all

Mesh mesh_data = new Mesh();
if (mesh_data.ImportFromWavefront(string_wavefront_filename))
{
      mesh_data.ExportForEntity(folder, tagname);
}
would make an entity tag
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

Its not for entity, I need access to the vertices, triangles and uv's
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

XZodia wrote:Its not for entity, I need access to the vertices, triangles and uv's

Code: Select all

var map = new MapStream(@"C:\Users\stem\Documents\headlong.map");
var tag = (model)map["mode", "pallet"].Export();
Mesh mesh = new Mesh();
mesh.Load(tag.Sections[0].Raw, tag.Sections[0].Resources, tag.Compression[0]);
mesh.Indices;
mesh.Vertices;
mesh.ShaderGroups;
Update maybe makes that more readable?
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

viewtopic.php?f=41&t=1942&p=36200#p36200

A few models work, but most don't...

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: Attempt to set the position to a negative value
System.IO.FileStream.set_Position (Int64 value)
Moonfish.Core.MapStream.set_Position (Int64 value) (at Assets/Editor/Moonfish/Moonfish.Core/MapStream.cs:176)
Moonfish.Core.ModelRaw.Moonfish.Core.IResource.CopyFrom (System.IO.Stream map) (at Assets/Editor/Moonfish/Moonfish.Core/Structures/TagBlockDefinition.cs:612)
Moonfish.Core.TagBlock.Parse (System.IO.Stream map) (at Assets/Editor/Moonfish/Moonfish.Core/Structures/TagBlockDefinition.cs:244)
Moonfish.Core.TagBlockList`1[Moonfish.Core.model+Section].Moonfish.Core.IFixedArray.CopyFrom (System.IO.Stream source) (at Assets/Editor/Moonfish/Moonfish.Core/Structures/TagBlockDefinition.cs:185)
Moonfish.Core.TagBlock.Parse (System.IO.Stream map) (at Assets/Editor/Moonfish/Moonfish.Core/Structures/TagBlockDefinition.cs:239)
Moonfish.Core.MapStream.GetTag (Moonfish.Core.Tag tag) (at Assets/Editor/Moonfish/Moonfish.Core/MapStream.cs:299)
Moonfish.Core.MapStream.Moonfish.Core.IMap.Export () (at Assets/Editor/Moonfish/Moonfish.Core/MapStream.cs:151)
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

XZodia wrote:viewtopic.php?f=41&t=1942&p=36200#p36200

A few models work, but most don't...
Internal models only right now, and I don't check in the code when setting the address :p
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

Your texture coordinates are wrong, they all come out as (0.5, 0.5)

Also, there appear to be missing vertices...

Can you explain how I use shader groups?

Finally, how would you feel about joining my efforts to turn unity into a halo 2 editor?
i.e. instead of using OpenTK, you use the UnityEngine libraries.
(cause its a pain for me to have to go through and switch them over each time) =P
It also means less work overall, because unity handles all the heavy lifting for rendering etc.

On topic happiness:
Various Banshee Permutations
Image
Attachments
Halo 2 Banshee in Unity.png
(133.52 KiB) Not downloaded yet
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

I wouldn't mind, I only really use value_types from OpenTK anyways, its not hard to write operators to convert between platforms. As for the texture coords I'm gonna take a look right now because I noticed that too. And I originally thought that the indices were a single strip, but that was a incorrect assumption. They are all the shader group strips laid end to end without degenerative tris between them: so to render it you actually need to use the start and length values in the groups.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

Attachments
Halo 2 Viewer.zip
My Progress
(2.76 MiB) Downloaded 361 times
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

Image
Just gonna leave this right har'.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

an animation rig?

Btw, It just occurred to me that I gave you the wrong unity link, as I haven't tested it on 4.x I'm using http://download.unity3d.com/download_un ... -3.5.7.exe
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

Been working a little bit on the Collada format, and for fun wanted to see if I could export the nodes for models into it. Was pretty straight forward... now to figure out how to export meshes and link them to nodes... I want to get model injection working up to at least rigid bones this time before moving onto jmad, coll, or phmo.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

Sounds like a plan.

Unity supports up to 4 node weights per vertex, H2 will likely be similar but may be less.

For each connected node, a vertex should have an index to the connected node and a floating point "weight" value (between 0 and 1).

http://docs.unity3d.com/Documentation/S ... eight.html
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

My teams game (Tick Tock Toys) has been approved for the App Store! =)
Scheduled for release 24th February!
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
CaptainPoopface
Posts: 714
Joined: Sat Feb 16, 2008 5:47 am

Re: The Official Happiness Thread

Post by CaptainPoopface »

Congratulations!

I wish I could leverage my creative output into a revenue stream...
User avatar
DoorM4n
Posts: 2154
Joined: Sun Dec 09, 2007 3:01 am
Location: Houston

Re: The Official Happiness Thread

Post by DoorM4n »

damn! That is so awesome xzodia!!
Image
Remnant! We were the last stand.
User avatar
neodos
Posts: 1493
Joined: Sun Dec 09, 2007 8:58 pm

Re: The Official Happiness Thread

Post by neodos »

Grats XZodia, that's awesome! the Halo 2 to Unity app too, gotta try that!
User avatar
DoorM4n
Posts: 2154
Joined: Sun Dec 09, 2007 3:01 am
Location: Houston

Re: The Official Happiness Thread

Post by DoorM4n »

ZOMG halo 4 snipers is the greatest thing on earth!!!!
Image
Remnant! We were the last stand.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

Image
Weee.

Also:
Congratulations Xzodia and Xzodia's team :p must feel good man.

boredom bonus:
http://files.remnantmods.com/jacksoncou ... _nodes.gif
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

Cool, are the nodes connected to the vertices?
And have you fixed the missing triangles?
I want to get this in unity =)
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: The Official Happiness Thread

Post by JacksonCougar »

Adding the skinning information when exporting for Collada is my next check-point. Not there just yet. Collada is really dense to find anything out about how the format is supposed to work. And I'm not sure what you mean by missing triangles? How can they be missing?
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: The Official Happiness Thread

Post by XZodia »

For example of missing triangles, see the pics of the banshee I uploaded.
For the skinning info, If you can read the it from the map, I can make it work in unity.
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
Grimdoomer
Admin
Posts: 1835
Joined: Sun Dec 09, 2007 9:09 pm

Re: The Official Happiness Thread

Post by Grimdoomer »

So my xbox 1 started turning on by itself as soon as you plugged it in, and the power button did not work at all. Opened it up for the 10th time in 2 weeks. Checked a couple resistors, traced a few circuits, etc. Finally found that there was some sort of black corrosion on the bottom of the board which had eaten through a trace for the power button circuit. Used some 24 gauge wire and patched it up, also cleaned a few areas of the board with alcohol to remove corrosion. Works like a charm, now I just need to get a hold of a Samsung SD616T dvd drive so I can spartan kick this Philips piece of shit out the window.
Don't snort the magic, we need it for the network.
Post Reply