Author Topic: Docs on creating/testing maps?  (Read 2031 times)

Godfrey

  • Hydlaa Resident
  • *
  • Posts: 69
    • View Profile
Docs on creating/testing maps?
« on: November 10, 2005, 02:17:19 am »
(If this is in the wrong forum, I apologize profusely.)

I\'d love to get into making maps.  I\'ve been doing 3D for a while, so the actual creation of the maps is no problem.

But I\'m having loads of trouble getting the maps into my test server.  I managed to find my way around the first couple of stumbling blocks by comparing my simple test map against the official ones; I made sure the camera was called Camera01 (thus getting past \"There is no starting position\"); I added the map to zoneinfo.xml, and added the sector to the database.  So I can now teleport into my test map.

However: even though it looks fine in the CrystalSpace walktest app (screenshot), I get solid blackness in the PlaneShift client (screenshot) -- even with -fullbright specified on the command line!  And the weird part is, if I teleport back to npcroom or anywhere else I\'ve loaded in, I continue to get blackness until I quit and restart the client.

So... are there any docs on what needs to be in a map, how to get it joined properly into the server worldspace, and so forth?  I tried searching the forum for several combinations of likely keywords, but came up empty.

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #1 on: November 10, 2005, 09:36:05 am »
Open the file \"world\" in text editor.
Look for section.
Delete \"yes\" and add 16 instead. Relight your map with walktest. Then log in and teleport :)
"Close the world, txEn eht nepO."

Godfrey

  • Hydlaa Resident
  • *
  • Posts: 69
    • View Profile
(No subject)
« Reply #2 on: November 10, 2005, 01:26:25 pm »
That works, thanks!  (Relighting in walktest let me at least see my character, but I had to relight it through psclient to actually see the map... and it\'s quite a bit darker -- which is good, because I was wondering how to get it dark like the Death Realm.)

So again, is there any documentation for this sort of thing, so I can know how to avoid little pitfalls like this without bothering people with better things to do?  I mean, I\'m still in the dark about things like how to make multiple maps connect their geometry together:
  • Do you duplicate geometry from the maps they connect to?
  • Do you just position them appropriately in the worldspace of your 3D app of choice? (i.e. if you\'ve got one map on the ground level, and one underneath it, do you put the floor of the first one near the 3D ground plane and build the second map under it?)
  • Do you just center them on <0,0,0> and then tell the game engine somehow where to place them relative to each other?

A search of the entire forum doesn\'t reveal any instances of \"lightmapcellsize\" except in this very thread.  Googling the term results in only 48 hits on the entire Web, none of which actually come right out and say \"if you want to see your maps in PlaneShift, you need to add this\".

If there isn\'t any documentation like \"How to build maps for PlaneShift\", I\'d be more than happy to compile one from any tips people would be willing to share with me.

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #3 on: November 10, 2005, 02:44:03 pm »
Well, this is, what was (almost) enough for me:
 - CS documentation (it is very incomplete and some sections are outdated, but You should be able to figue out some things by yourself)
 - CS forums
 - blender2crystal manual (web pages at http://b2cs.delcorp.org)
 - You can peek inside Planeshift files ;)

As for the other questions:
  • If I understand You right: no, You don\'t need to have the same objects in both connecting maps, if You don\'t need them to be fully visible/accesible on both maps. However, for example, jayose map in planeshift contains laanx temple mesh, which is high and should be visible.
  • You can put maps wherether You want. They can even occupy the same space (i mean share the same coordinates). This is described in CS manual.
  • It is easier to place maps in a way, wich do not require to do space transformations (moving/rotating), I mean, for example, the planes acting as portals in both maps should have the same global coordinates. However, You can connect ANY two locations between ANY two maps, but proper portal options are required (blender2crystal manual gives good overview).
About and : Yes, it is weird, but Planeshift requires this (and I had discovered it experimentally by comparing Planeshift files with those generated by me). I think it is a matter of some settings in data/config directory (or in the code).
"Close the world, txEn eht nepO."

Godfrey

  • Hydlaa Resident
  • *
  • Posts: 69
    • View Profile
(No subject)
« Reply #4 on: November 10, 2005, 05:46:03 pm »
Quote
If I understand You right: no, You don\'t need to have the same objects in both connecting maps, if You don\'t need them to be fully visible/accesible on both maps. However, for example, jayose map in planeshift contains laanx temple mesh, which is high and should be visible.


Okay...   If I\'m interpreting it correctly, the Laanx temple mesh is present in the Jayose map because the actual temple is in a different zone, and therefore wouldn\'t get loaded when you cross over into Jayose.  Is that correct?

What about maps that are in the same zone -- for example, the tavern interior appears to be an entirely different map than the street outside it.  You can see the tavern interior from the street, and the street from inside the tavern.  How is that accomplished?  If you want to join a map to an existing one, obviously the existing map will need to be modified to allow access to the new map.  But do you need to build the new map that far away from the origin, or can you build it at the origin and just tell PlaneShift where to relocate it to once it\'s loaded?

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #5 on: November 10, 2005, 07:04:36 pm »
Quote
Okay... If I\'m interpreting it correctly, the Laanx temple mesh is present in the Jayose map because the actual temple is in a different zone, and therefore wouldn\'t get loaded when you cross over into Jayose. Is that correct?
Yes, but not exactly. The mesh (mesh factory) could be loaded (by adding an appropriate entry to zoneinfo.xml), but it would not be visible, because there is no object using that mesh in sector \"jayose\". Basically - You can see only objects, which occupy the sector, in which you are (unless you look through warping portal, see the following).
Quote
What about maps that are in the same zone -- for example, the tavern interior appears to be an entirely different map than the street outside it. You can see the tavern interior from the street, and the street from inside the tavern. How is that accomplished?
Interior of the tavern is the different sector in the same \"world\". Actually, portals connect sectors, not maps. That\'s why you need zoneinfo file, which makes associations between sector names and map files. It doesn\'t matter, if you say about crossing sectors or maps, you always change sectors.
Quote
But do you need to build the new map that far away from the origin, or can you build it at the origin and just tell PlaneShift where to relocate it to once it\'s loaded?
As I wrote before - coordinates of areas do not matter, portals can warp the space in a way you like. Example: check the coordinates with /pos command before and after leaving ojaroad and entering korogan passage; coordinates are not continuous there, you make a big jump through the space. Hmmm... read bug report #1124 at the Planeshift bug tracker.
"Close the world, txEn eht nepO."

Induane

  • Veteran
  • *
  • Posts: 1287
  • What should I put here?
    • View Profile
    • Vaalnor Inc.
(No subject)
« Reply #6 on: November 10, 2005, 07:11:38 pm »
I believe that the interior of the tavern buildings interior wan\'t exported as a CS world file, instead it is a library file - library files are nearly identical except that they begin with a and end with instead of

To use one first add the library to vfs - so for me that involved editing my vfs.cfg file and adding a line like $data/house1.zip

then next in the world file add each library you are  going to use

house1.zip

THEN you have to make a meshobj for each meshfactor in the library file, and give it coordinates - I\'ll update this post later on how.  Using this you can make a world file that is a terrain and add normal mesh objects to it anywhere on the map. In walktest hitting Ctrl + C shows your coordinates which can be helpful for the layout.

Godfrey

  • Hydlaa Resident
  • *
  • Posts: 69
    • View Profile
(No subject)
« Reply #7 on: November 10, 2005, 07:14:42 pm »
(in response to Wired_Crawler)

Ohhh... I think I get it now.

So a portal isn\'t just something which transports you into another sector, it actually shows what\'s on the \"other side\" of the portal it\'s linked to.  They just look physically contiguous because that\'s the way the maps are designed to look.  Is that about right?


(in response to Induane)

I see... so you could, say, build a town by creating just the landscape, and then include multiple instances of several different buildings created as library files, rather than intrisically modeled as physical features of the main map?
« Last Edit: November 10, 2005, 07:18:47 pm by Godfrey »

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #8 on: November 10, 2005, 09:25:02 pm »
@Godfrey: Yes! This is one of the greatest features of CS.

@ Induane: We were both wrong. tavern_de_kadel.zip is the same kind of map as other maps, with separate \"world\". Some kind of library is hydlaa_common.zip, but it contains only textures and materials.
Better example of map with many sectors is arena. Arena has 9 sectors connected by multiple portals (and multiple graphics glitches ;) )

@Godfrey (in response to response to Induane): Yes! In the meantime, when Induane prepares his example, look at the following:
Code: [Select]

      (mesh definition and parameters here, vertices, faces, uv maps etc)



      house
      (coordinates here)
      (rotation here)
      (other params)



      house
      (coordinates here)
      (rotation here)
      (other params)
AFAIK scaling of factories is unsupported.
"Close the world, txEn eht nepO."

Godfrey

  • Hydlaa Resident
  • *
  • Posts: 69
    • View Profile
(No subject)
« Reply #9 on: November 10, 2005, 10:07:13 pm »
The move comes before the matrix?  My head asplode!    8o  I take it, then, that the matrix performs its actions relative to the local origin, rather than the global one?

(And, wow, after looking it up, the matrix syntax is quite different than I\'m used to.  I\'m used to a twelve-term matrix for 3D manipulations, which can perform translation, scaling, skewing and rotation all at once.)
« Last Edit: November 10, 2005, 10:11:43 pm by Godfrey »

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #10 on: November 10, 2005, 10:30:38 pm »
My mistake, shoud be inside .
Code: [Select]

     
     
         rx
         ry
         rz
     


(don\'t trust that either ;) , check the real examples)
"Close the world, txEn eht nepO."

Induane

  • Veteran
  • *
  • Posts: 1287
  • What should I put here?
    • View Profile
    • Vaalnor Inc.
(No subject)
« Reply #11 on: November 11, 2005, 03:19:44 am »
OK so the howto goes like this:

First create a box and add a cheapo texture.  I made this one:



use whatever exporter you wish to use to export it to CS as a library file.  the library file it spits out should be similar to this (the world file is in the zip file the exporter creates).

http://rafb.net/paste/results/DWsrs625.nln.html

What I did was plunk the zip in a directory and extract it - then delete the main zip file.  This library file is going to need some hand editing.  In order for the library to appear in a terrain like the example terrain \"terrain\" in crystalspace, it needs to have some nice stl shaders attached to it. This has something do do with the renderloop it employs - I\'m not sure why though.

First place the shader in the shader section of the library file like this:  

Quote
       
     /shader/std_lighting.xml
 


Then apply that texture to each material in the file by adding this before the

Quote
std_lighting


so the library file should look something like this:

http://rafb.net/paste/results/B5rj5a53.nln.html

don\'t know if that nopaste will stay up very long...

Next take the texture out of the \"textures\" folder  which is in the folder you extracted the zip into.  Place this texture in the textures folder of the terrain world.  (Just in  case it can\'t be found - I\'ve had this issue - if anyone can point me to a different solution taht would be cool.) the terrain example doesn\'t have a textures directory so you\'ll have to make one.

Now that that is all done, zip up your box into box.zip and place it in the data directory of CS.

Now open vfs.cfg and add a line like this

VFS.Mount.lib/box  = $@data$/box.zip

you\'ll see where it goes.

Now that thats all done, lets open up the terrain world file.

add the stl shader to the shaders section of this file as well:

    /shader/std_lighting.xml

Next - we need to import the library file - do it like this:

I put this above the first meshfact in the terrain world file.

/lib/box/world

NOw that we have done that, we have to add a meshobj for every meshfact in the world file - my only meshfact in the box is a meshfact named \"cube\"
 add it in the meshobj section like this:



Quote
   
      thing
      object
     
     
       Cube
     

     
     
       
     

   


meshobj name isn\'t important - it can be anything  but the factory entry is key - it must be the same as the meshfact on the library file. some of the other stuff probabily isn\'t necessary but I was having some troubles getting it to show up lol.
after this is all good and done, go ahead and save it all and now run from the cs dir
walktest /data/test -relight
 (test is what I named the copy of \"terrain\")

when you are in walktest hit Ctrl -C to get your coordinates - go back to the world file and input your starting coordinates for the stuff - this way its easy to find.  If you can\'t get your box to show up try disabling the custom render loop by commenting it out wiht

lynx_lupo

  • Veteran
  • *
  • Posts: 1431
  • Sorbus aria!
    • View Profile
    • Linux pri nas
(No subject)
« Reply #12 on: November 11, 2005, 12:23:10 pm »
Interesting thread.
Can you perchance in the end integrate this documentation into http://www.ps-mc.com/docs/index.php/Main_Page for the future generations?  :)
"Amor sceleratus habendi"- Ovid
"First they ignore you, then they laugh at you, then they fight you, then you eat them." -Godzilla