Author Topic: Level file format - final ?  (Read 3429 times)

Offline rob

  • byte
  • *
  • Posts: 2
    • View Profile
Level file format - final ?
« on: November 03, 2003, 12:24:59 am »
I am thinking about using jPCT for a project I am working on, but I have a couple questions.
First, there are a lot of Loaders for model files, is there any built in support for level files - or just the XML format? What was used to build the demos?
Second, It seems almost every thing is "Final" in the engine and we can't extend anything (for example we have a byte array memory image, but can not make a texture out of it) is that for speed and never going to change?

This is a dope engine btw - I am amazed at how well it works - thanks for putting it out there :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Level file format - final ?
« Reply #1 on: November 03, 2003, 05:44:20 pm »
I'm not quite sure what you mean with "level-format"...you can basically use any supported format (well, except MD2) for storing your level. The demos are using the 3DS-format. It's quite small (at least compared to the ASCII-based formats) and a lot of tools are available for conversion from and to 3DS.
The XML-format was an attempt to create something that's easy to read/write, extendable and that supports portals. You may use it, but you have to do the conversion into jPCT's XML-format yourself.

About the final-thing: There are two reasons for this. Older VMs like it performance wise and there's not much encapsulation used within jPCT, so it would be quite hard to extend Texture (for example) without knowing something about the inner workings. I did this to keep the API small and fast...the price you pay for this is, that it's not easy for others to extend it. I can remove the final and see how it works out performance wise, but i doubt that you'll be very happy with it. What exactly do you have in mind? Using an int[](byte[])-array from an instance of your Image-object as a texture instead of loading it from somewhere else?

Offline rob

  • byte
  • *
  • Posts: 2
    • View Profile
Level file format - final ?
« Reply #2 on: November 24, 2003, 05:36:28 am »
> I'm not quite sure what you mean with "level-format"
We were looking for something that we could design levels with and then just use in the engine (like .map or .wads). From what we could tell 3ds is more of a modeling format, but since I wrote this I found that you can use the Valve Hammer editor export to dxf and then using a program called crossroads we can save it into a 3ds format that seems to work for a level editor. So it was our confusion.

> What exactly do you have in mind? Using an int[](byte[])-array from an
> instance of your Image-object as a texture instead of loading it from
> somewhere else?
Yes, something like that. We have/had a simple doom engine port that we were going to use for our levels (http://ruinworld.sf.net), but its just not quite working out.  The way the we are using textures now makes it rather fast (albeit they look kind of bad).  Another method we were thinking about using is loading pre made (serialized) texture objects instead of loading jpg and turning them into textures. Also we were thinking evenuatlly we would like to manipulate the textures on a pixel level.

Anyway, we are just trying to find something that will help us get the game built faster instead of f**king about with the engine - which we seem to suck at and you do not :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Level file format - final ?
« Reply #3 on: November 26, 2003, 11:02:32 pm »
Quote from: "rob"
Another method we were thinking about using is loading pre made (serialized) texture objects instead of loading jpg and turning them into textures. Also we were thinking evenuatlly we would like to manipulate the textures on a pixel level.

Anyway, we are just trying to find something that will help us get the game built faster instead of f**king about with the engine - which we seem to suck at and you do not :)
Serialization is supported by jPCT, but the serialized output can be quite large...at least if you serialize the whole world. Manipulating textures on the pixel level is also possible by implementing the ITextureEffect interface. However, this can't be used to create textures. If it's a showstopper for you that you don`t have a constructor for textures that takes an int[] as parameter, i'll possibly add this.

I like your Doom-engine...what's wrong with it? (Except for the limitations these engines always have).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Level file format - final ?
« Reply #4 on: December 02, 2003, 10:40:49 pm »
Quote from: "rob"
> I'm not quite sure what you mean with "level-format"
We were looking for something that we could design levels with and then just use in the engine (like .map or .wads). From what we could tell 3ds is more of a modeling format, but since I wrote this I found that you can use the Valve Hammer editor export to dxf and then using a program called crossroads we can save it into a 3ds format that seems to work for a level editor. So it was our confusion.
One thing to keep in mind when doing this (i remembered this today while doing some conversion of Quake3-maps to 3DS): 3DS limits the length of the texture names for a material (to 12 or 13 IIRC). This may cause problems, if you named your textures like "my_very_own_texture1.jpg, my_very_own_texture2jpg" etc. The converted file may contains material with textures pointing to "my_very_.jpg" and you don't know what was what after that.
I've described my way to deal with this here:

http://www.jpct.net/forum/viewtopic.php?t=75