Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Spotlight: Señor Casaroja's Noesis

General game file tools that are useful for more than one game
Satoh
mega-veteran
mega-veteran
Posts: 194
Joined: Sat May 09, 2009 3:07 pm
Has thanked: 13 times
Been thanked: 38 times

Re: Señor Casaroja's Noesis

Post by Satoh »

I suggest making a note of the type of model you're opening, and seeing if there are specific formats that cause the issue. It could be one particular plugin causing just the right circumstance on a particular type of file to give the error...

Or it could simply be Intel ***ing with you like they seem to do to me...

("Running a game from 1998 with minimal graphics requirements? ARE YOU MAD!? We can't handle that kind of POWER!!" "This game was made after 2001. It ain't happening.")
pro spy
beginner
Posts: 32
Joined: Mon Sep 12, 2011 4:36 am
Been thanked: 1 time

Re: Señor Casaroja's Noesis

Post by pro spy »

The contents of this post was deleted because of possible forum rules violation.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

I don't know about the NoeBitStream in particular, and I'm not quite sure what you'd be doing to leak memory from Python, but if you're getting it to leak memory and error internally (not just raise Python exceptions) from whatever you're doing in your scripts, that could very well be related. If you can get something that crashes semi-reliably, I'd appreciate you sending the script and model(s) my way so I can try to isolate it in debug.

I'm going to go ahead and look into implementing a custom exception handler to analyze and optionally report crashes automatically. I've been meaning to do that for a long time anyway.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

I think it is just my computer though, as the one I'm working on right now is rather old and the hardware is pretty crappy.

I will test it under a more modern computer and see if it still has the problem.
I think I had an "Out of Memory!" message at one point in time, which I've seen before when writing silly recursive code lol
Satoh
mega-veteran
mega-veteran
Posts: 194
Joined: Sat May 09, 2009 3:07 pm
Has thanked: 13 times
Been thanked: 38 times

Re: Señor Casaroja's Noesis

Post by Satoh »

It could be that the plugin you're using gets stuck in a completely viable loop, and your computer simply stops being able to process the data properly.

By this I mean the plugin is working, but it isn't meant for that particular file, and it causes an infinite loop error, but one that doesn't get flagged as an error.

Try watching the Commit Charge and CPU usage for noesis in the task manager and see if it spikes...

Also make sure that there are no shadow instances of noesis running in the background that have failed to properly close. I get that sometimes if I crash noesis with one of my poorly written plugins, the window gets destroyed, but the process continues for a while after.

Or sometimes if I try to open multiple noesis windows (IE forgetting I clicked the icon, and clicking it again before the first window has been created) I sometimes get multiple noesis processes with only one window. (I think that's not a bug in Noesis, but rather a windows error, as it's not confined to noesis. It happens with Firefox and Cygnus when I load big files into it.

With several Noesi running, I tend to run out of memory and get other random errors and messages.
User avatar
nightsqual05
ultra-n00b
Posts: 7
Joined: Mon Jul 26, 2010 4:38 am

Re: Señor Casaroja's Noesis

Post by nightsqual05 »

why i cant load the texture of dota 2 model? :(

Image
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

Cause you don't have the textures there.
vtx, vvd, and mdl do not contain texture information.
User avatar
nightsqual05
ultra-n00b
Posts: 7
Joined: Mon Jul 26, 2010 4:38 am

Re: Señor Casaroja's Noesis

Post by nightsqual05 »

^
so what i need to do bro so i can see it with textures

edit: nvm problem solved :)
pixellegolas
ultra-veteran
ultra-veteran
Posts: 423
Joined: Mon Aug 11, 2008 11:30 pm
Has thanked: 27 times
Been thanked: 15 times

Re: Señor Casaroja's Noesis

Post by pixellegolas »

whenever a problem is solved it is a nice netiquette to tell people how you solved it. There are probably others with the same, however small issue :)
Rolandonmilk
ultra-n00b
Posts: 6
Joined: Fri Jan 29, 2010 10:26 pm
Has thanked: 2 times

Re: Señor Casaroja's Noesis

Post by Rolandonmilk »

Is there any support for multiple UV maps, some games like final fantasy 13 have on some models.
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Señor Casaroja's Noesis

Post by Privateer »

Reading through the information in the plugins folder I see Half Float but it's not what I need as I'm understanding it.
I need to convert a signed short to a Float 16 or half float as it's also called.
I do have the Python code to do this.

Am I understanding this Half Float correctly in Noesis Python documents?
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Señor Casaroja's Noesis

Post by chrrox »

there is a difference between signed shorts and floats
half float is an actual 16 bit floating point number
some games use signed shorts as floats these are not half floats.
signed shorts are normally you read the number then divide by 0xFFFF and use that as the float.
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Señor Casaroja's Noesis

Post by Privateer »

I understand that but that is not the case here.
Divideing the signed short in the SWTOR 3D meshes does not work to get the correct output.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
Satoh
mega-veteran
mega-veteran
Posts: 194
Joined: Sat May 09, 2009 3:07 pm
Has thanked: 13 times
Been thanked: 38 times

Re: Señor Casaroja's Noesis

Post by Satoh »

Can I get a rundown on how the noesis API handles triangulation?
The files I'm working with are odd, and seem pretty inefficient...
They list vertex positions in the order used to create a triangle, and for triangles that share vertices, the shared vertices are listed many times. I can't be certain there's not a bit of the file to tell which edges are linked, but as far as I can tell, there is no separate info on which vertex is part of which triangle... Also, there seems to be no indexing of vertices, they seem to simply be referred by their order of creation... (as in the UV for a vertex is created in the same order as the vertex itself, rather than any sort of referential index being called to link the UV to the vertex...)

All of this seems pretty inefficient, and complicates my ability to make triangles and UV's in noesis... Partly because I only know how to use the function as it's presented in chrrox' tutorial. I don't know what kind of data its expecting in order to make triangles out of points... I assume it's looking for tuples of vertex indices...right? Or does it only accept raw byteArrays?

I tried feeding it the vertex data for both data arguments of rpgCommitTriangles... which as predicted just caused noesis to crash when loading the model...

If I make an array to document the order of vertex creation, and feed that array into the triangle data argument, would that work (Assuming you understood any of that disjointed explanation)?

For instance, this is the data from the file I have... They are signed shorts (just like chrrox just mentioned) and there is no extranious data or padding between them. (Obviously these are the translated coords, for easier reading)

Code: Select all

0,		0,	519
-347,	0,	1038
0,		0,	1038
0,		0,	0
-347,	0,	0
0,		0,	519
-347,	0,	519
-347,	0,	1038
0,		0,	1038
347,	0,	1038
0,		0,	519
347,	0,	519
347,	0,	0
0,		0,	519
347,	0,	0
0,		0,	0
Notice how several of these coords are repeated? They are presumably the same vertex, but part of another triangle... I don't know how to format that data for rpgCommitTriangles to understand it.
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Señor Casaroja's Noesis

Post by Privateer »

My bad chrrox,
I stated that I need to change a signed int to a float 16
That is not the actual case.
I needed to change 4 bytes to a float 16 (Half Float)
Here's the Python code to do what I needed.

Code: Select all

import struct

def HalfToFloat(h):
    s = int((h >> 15) & 0x00000001)    # sign
    e = int((h >> 10) & 0x0000001f)    # exponent
    f = int(h & 0x000003ff)            # fraction

    if e == 0:
       if f == 0:
          return int(s << 31)
       else:
          while not (f & 0x00000400):
             f <<= 1
             e -= 1
          e += 1
          f &= ~0x00000400
          print s,e,f
    elif e == 31:
       if f == 0:
          return int((s << 31) | 0x7f800000)
       else:
          return int((s << 31) | 0x7f800000 | (f << 13))

    e = e + (127 -15)
    f = f << 13

    return int((s << 31) | (e << 23) | f)


if __name__ == "__main__":

    # sample (1.0) - see Wikipedia
    FP16='\x00\x3c'

    v = struct.unpack('H', FP16)
    x = HalfToFloat(v[0])

    # hack to coerce int to float
    str = struct.pack('I',x)
    f=struct.unpack('f', str)

    # print the floating point
    print f[0]
I also remembered that the texcoords are always inverted in GR2 files so adding the negate to the print f line will do that.
Note that We ONLY do that to the V not the U
So the code needs to account for that.
print - f[0]
This is done so We don't need to flip the texture upside down.
Last edited by Privateer on Sat Dec 24, 2011 8:03 pm, edited 1 time in total.
Post Reply