Author Topic: Ultima 0.40 and .p Format  (Read 17647 times)

Cyberman

  • *
  • Posts: 1572
    • View Profile
Ultima 0.40 and .p Format
« Reply #25 on: 2002-12-25 23:01:54 »
Danke' Fice I've read some of it but haven't had a successful decode yet.  I probably should 'buffer' 8k of the output stream so that I can not worry about getting all the data. LZS is a interesting dictionary format to say the least. Nothing like LZW compression (which I have written tools to do).  It looks like it's a 'intelegent' form of compression that could be challenging to encode with.  As for the decoding it looks simple enough just need to have a successful decoding of one file (grin). I suppose I could decode a file using your routines and compare the outputs. :)

Cyb

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Ultima 0.40 and .p Format
« Reply #26 on: 2002-12-26 10:55:01 »
Alhexx: I *think* NeutopiaW said the normals are stored in what we thought was the 'small model'.

Cyberman: Yeah, decoding LZSS is fairly easy, since it's just following whatever the coded data says to do. Efficiently compressing it is more of a challenge; I never managed to get anything as quick and efficient as the 'original' LZSS code written by Prof. Haruhiko...

You should only need to buffer 4K of the output IIRC, although the buffer is a good idea for speed.

And yes, the best way to make sure you've got decoding right is to decode a file using your routine and a 'known working' routine (I *think* mine would count as that ;) ) and see if you get the same output...the parts that are hardest to get right (well, not *hard*, but easy to miss) are making sure that repeat runs, and reads from before the beginning of the file, give correct output. My code didn't do repeat runs at first, but I didn't notice for a while...

Alhexx

  • *
  • Posts: 1894
    • View Profile
    • http://www.alhexx.com
Ultima 0.40 and .p Format
« Reply #27 on: 2002-12-26 11:54:40 »
Hm ... looks like I've gonna read NeutopiaW's topic one more time ... :D

 - Alhexx

mirex

  • *
  • Posts: 1645
    • View Profile
    • http://mirex.mypage.sk
Ultima 0.40 and .p Format
« Reply #28 on: 2002-12-26 17:12:36 »
Alhexx: I think that in polygon pool are pointers into 'small model', which are normals (but sometimes normals are not present in model, so these indexes are messy); But im not sure, because i calculate them.

Alhexx

  • *
  • Posts: 1894
    • View Profile
    • http://www.alhexx.com
Ultima 0.40 and .p Format
« Reply #29 on: 2002-12-27 12:51:24 »
mirex: yes, in the polygon pool there are pointer to these "normals". However, only in field models(?)

ficedula: A very important question:
Is there somethin useful for hit-testing in OpenGL?
I mean, if a user clicks with the cursor on the renderer view, I have the coordinates of the mouse position. Now is there a possibility to find out which "renderer object" (vertiex, polygon etc.) is rendered at this position?
This would be very useful for the "drag-and-drop"-movement of vertices...


 - Alhexx

Cyberman

  • *
  • Posts: 1572
    • View Profile
Ultima 0.40 and .p Format
« Reply #30 on: 2002-12-27 18:33:31 »
Quote from: Alhexx

ficedula: A very important question:
Is there somethin useful for hit-testing in OpenGL?
I mean, if a user clicks with the cursor on the renderer view, I have the coordinates of the mouse position. Now is there a possibility to find out which "renderer object" (vertiex, polygon etc.) is rendered at this position?
This would be very useful for the "drag-and-drop"-movement of vertices...


 - Alhexx

I know this is to Fice.. but in order to drag vertices you might need to 'constrict' movement in one 3d plane IE XY Z is frozen YZ X frozen etc. This also works if you freeze say XY and can only move the Z axis coordinates of the vertices.

This is called constraint based manipulation of a 3d scene.  As for what object or objects or things the pointer is near.  You could translate the objects to a clust of 2d points and depth sort them. IE the closest object would be a 'top' layer of active points.

Think of it this way:
Ugly ASCII
Code: [Select]


Viewer

   B
A    C
   D

D you could NOT click on because it's below the faces that are part of A B and C you could click on A B or C since they are 'visible'.  Although in your modeler it's not likely you are to see D you could still have some conflicts.  Also selection critera might want to use the GROUP information IE group of polygons edges etc.  So if you click on a group that's Yuffies head you can move the whole head instead of one of the vertices on her eyebrow.

Ahhh the fun of a UI! ;)
Recap:
You need to consider what object types you need to grab.  IE Vertices (3d points essentially in this case), polygons, or groups.
You need to consider how you are going to move them IE what axis or axis' you are going to have movement in for what you just selected.
You need to consider 'how close' the objects are in order to decide what was or can be selected.

Just some hopefully useful thoughts! ;)

Cyb

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Ultima 0.40 and .p Format
« Reply #31 on: 2002-12-27 19:10:15 »
Alhexx: Yes, there *is* such a mode in OpenGL, called 'selection mode'. Look at the glRenderMode command to get started. However; I've never actually used it myself, and I've heard it's not that simple to work with ... but you may want to try it and see.

Personally, my favoured UI for the 3d editing is the four view ... three 2d views (front, side, top) and a 3d view ... mainly because it's fairly easy to code ;)  I just use GL for the 3d view and draw the 2d view using normal GDI graphics.

Alhexx

  • *
  • Posts: 1894
    • View Profile
    • http://www.alhexx.com
Ultima 0.40 and .p Format
« Reply #32 on: 2002-12-27 19:44:48 »
Cyb: Thanx for the info, but I have already made my thoughts on those selection problems, it fine to see them all listed here anyway ;)

Fice: Okay, I'll take a look at that in the MSDN library ... maybe I'll find something useful...

 - Alhexx

 - edit -
As for the four different views: Yes, this is also planned in Ultima. That's why the Ultima Client Window can be dynamically splitted into 1, 2 or 4 Frames. But until now, it is not possible to render them in 2d... but this'll come

phaeron

  • *
  • Posts: 30
    • View Profile
Ultima 0.40 and .p Format
« Reply #33 on: 2002-12-27 22:37:07 »
I'm a bit skeptical about proper support for OpenGL selection -- it's not commonly used on the PC platform and so it's likely to be emulated in software or even broken.  It's safer just to transform your pick vector into world space and intersection test it against your triangle meshes; I think you'll need to do that anyway for a "nearest" hit test, as needed for vertices.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Ultima 0.40 and .p Format
« Reply #34 on: 2002-12-28 02:18:06 »
Quote from: Alhexx
Cyb: Thanx for the info, but I have already made my thoughts on those selection problems, it fine to see them all listed here anyway ;)

Fice: Okay, I'll take a look at that in the MSDN library ... maybe I'll find something useful...

Hey.. I've survived making a modeler before just sharing my Pain err experience :)  I found that being able to locate the constraints (planar or single axis) is kind of a good idea ;) ) helped a LOT.

Hmmm MS support for OGL is only 1.1 last I checked. You might have to get a MESA GL port for you card for windows or something akin to that.  I know MS's GL drivers included with windows are software only as well. Hmmm not sure what other encouraging things to say to you! ;)

I haven't looked at OGL's support for such things as mouse, I didn't look at the bitmap manipulation interface and it was pretty nice.  As another user said, you might need to look at it and see if it's for you mostly ;)

Cyb

NeutopiaW

  • Guest
ZanGan
« Reply #35 on: 2002-12-28 05:53:04 »
ficedula:

Nice work on the battle location viewer! What is the format of the battle locations like? Any info you have would be greatly appreciated.

I spent some time a while back looking at the battle animation format, man its tough. Went with the PSX version so that I could do direct testing through a PSX Emulator and Loading Memory states, otherwise its way to slow to load it up and get into battle everytime.

Its really complicated and seems to be a variable sized format. Wasn't even able to set a complete animation to still. Got like one offset on one bone remaining. Where the hell is it?!

Character motion is also controlled in the animation. Like running towards the enemy etc. I got it screwed up once where I ended up setting Clouds position way up high in the sky. The engine zoomed in for something, and the effect was zooming out. It was cool cause you could see the whole battle scene.

-Neutopia

Alhexx

  • *
  • Posts: 1894
    • View Profile
    • http://www.alhexx.com
Ultima 0.40 and .p Format
« Reply #36 on: 2002-12-28 12:57:49 »
Okay, I think I'll leave this selection thingy 'til later. Maybe we'll find another way in the meantime...

 - Alhexx

mirex

  • *
  • Posts: 1645
    • View Profile
    • http://mirex.mypage.sk
Ultima 0.40 and .p Format
« Reply #37 on: 2002-12-28 23:25:58 »
I think i read some docu on some library which cooperates with OpenGl, it was AuxGL or something, which handled things like this (highlighting objects pointed by mouse and such) but i have to search for the document, it was on other computer ...

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Ultima 0.40 and .p Format
« Reply #38 on: 2002-12-29 13:37:16 »
Yeah, I wouldn't be surprised if there's no proper support for selection. GL 1.1 has selection in it, so theoretically the MS DLL's *could* support it ... but I wouldn't be too surprised if they did it in software or not at all, like Phaeron suggested.

NeutopiaW: Check Alhexx's site for the battle location format (just standard P files, basically). His description is mostly up-to-date ;)

Alhexx

  • *
  • Posts: 1894
    • View Profile
    • http://www.alhexx.com
Ultima 0.40 and .p Format
« Reply #39 on: 2002-12-29 20:18:16 »
Hm ... that description has been un-published ... and it looks like I don't have it anymore ...
Hey, Fice, could you do me a favor and send the latest version of it to me, so I can upload it back? :D

 - Alhexx

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Ultima 0.40 and .p Format
« Reply #40 on: 2002-12-30 14:28:39 »
Sure, next time I can get my computer online I'll do so...