Pálya szerkeztés/Az első pályád (Portal 2)

From Valve Developer Community
Jump to: navigation, search
English (en)Deutsch (de)Español (es)Magyar (hu)Русский (ru)中文 (zh)한국어 (ko)
... Icon-Important.png


A brush az egy egyszerű 3D alakzat, amit a Hammer Block eszközével készitünk. A Brush-okat lényegesen nagy felületek megalkotására alkalmazzuk, szó szerint a pálya támfalait hozzuk vele létre. Mind a padlót, a falakat, a plafont Brush-okkal hozzuk létre, szóval első lépésként nekünk is most ezzel kell kezdenünk.

Padló készités

A Brush meghúzása.
  1. A baloldali Tool bar-ból, kiválasztjuk a Hammer block.png Block Tool-t.
  2. Most, a jobbfelső 2D nézetben Bal-klikket tartva és átlósan lefelé húzva az egeret létrehozunk egy Brush-t (pont úgy ahogy a kép mutatja).
  3. Megfigyelheted ahogy húzod átlósan a kurzort, úgy lesz egyre nagyobb a szagatott vonalas négyzet a képernyőn.
  4. Készíts egy 512x512 egységnyi (unit) nagyságú Brush-t és engedd el a bal egérgombot.
  5. Nyomd meg az Enter-t a billentyűzeten hogy véglegesitsd a műveletet.

Hogy visszatérj az alapértelmezet selection módba, kattints a Hammer select.png Selection tool iconra a Tool bar-on vagy nyomd meg a Esc gombot.

Ha selection módban vagy, akkor a Brush-t bal klikkel kiválasztva bármikor újra méretezheted, a 2D nézetben lévő kis fehér négyzetek segítségével.

Csökkentsünk egy kicsit a Brush vastagságán (amiből később a padlónk lesz). Szeretnénk a jelenlegi 64 egységről 16 egységre csökkenteni a vastagságot, ehhez lejebb kell vennünk a Rács-méretet.

A Rács

A rács vagy ahogy a program hívja grid, mindegyik 2D ablakban látható. Alapból minden objektum a rácshoz képest helyezkedik el, habár ezt a funkciót ki lehet kapcsolni, de ajánlot ezt nem piszkálni, mert nagyban megkönnyíti azt hogy minden egymáshoz simuljon és ne okozzon a pályán lékeket.

Az alapértelmezet rácsméret 64 egység, ami azt jelenti hogy a rács vonalai egymástól 64 egységre vannak. A rácsméretet a Hammer mindig a képernyő jobb alsó oldalán jelöli.

  • A Smaller Grid iconra kattintva Hammer SmallerGrid.png a rácsméretet feleakorára fog csökkenni, finomab elhelyezés érdekében. Ugyanígy változthatható a rácsméret a [ gyorsbillenytyű segítségével.
  • A Larger Grid iconra kattintva Hammer LargerGrid.png a rácsméretet duplájára fog nőni, durvább elhelyezés érdekében. Ugyanígy változthatható a rácsméret a ] gyorsbillenytyű segítségével.

Hogy levigyük a rácsméretet 16 egységre, nyomd meg a Hammer SmallerGrid.png gombot kétszer. közbe figyeld, hogy a Status bar a jobb alsó sarokban Grid: 16 írjon. Ha nem annyit ír, akkor addig nyomd a Hammer SmallerGrid.png és Hammer LargerGrid.png gombokat, amíg a Grid: 16 nem lesz.

A padló méretezése

Oldalsó nézetben a brush-vastagság csökkentése.

Mostmár a rács elég kicsi a művelethez.

Most vigyük át a kurzort a bal alsó ablakra, mikor átér oda az egérmutató, akkor egy Side feliratnak kellene megjelennie a nézet felső sarkában. Ezután a Brush felső részét húzd addig lefele amíg 16 egység vastag nem lesz.

Brushok mozgatása

Bal-klikk és húzással mozgatott brush.

Amint létrehoztunk egy brush-t, az onnantól mozgathatóvá válik. Válazd ki a Selection Tool-t Hammer select.png és vidd az egeret az eggyik 2D nézetre. Mikor az alakzat közepére értünk a kurzor nyilakká változik, amik különböző irányba mutatnak FourArrows.png, jelezvén hogy az objektumot mozgatni fogja.

A balklikket tartva tudod mozgatni a Brush-t a síkon bármerre, ha elengeded az egeret a brush abban a pozícióban marad.

Configurációs opciók a hammerban.

Ugyanígy tudod mozgatni az objectumokat a kurzorbillentyűkkel. Ehhez, be kell állítanod az opciókban ezt a funkciót:

  1. Kattints a Tools fülnél az Options gombra, hogy megnyisd a Configure Hammer box-ot.
  2. kattints a 2D Views fülre.
  3. Vannak itt egyéb beállítások is, de ami most nekünk kell az a Arrow keys nudge selected object/vertex.
  4. Nyomj egy OK-t, hogy elfogad a változtatásokat.

Most mozgassuk a padlónkat 16 egységgel lefele, úgy. hogy kiválasztjuk és a kurzort a Side nézetre visszük, majd megnyomjuk a Down_arrow gombot egyszer.

Oldalsó nézetben egy brush lefele mozgatása.
Note.pngNote:Célszerű ha a padló egyszintben van a tengely origóval, hogy a nav file rendesen működjön.

Navigáció a 2D nézetben

  • Az egérgörgő megnyomásával képesek mozogni a 2D nézeten belül.
  • Ennek egy alternatív módja, ha a Space gombot tartva, bal klikkel benyomva mozgatjuk a 2D nézetben az egeret.
  • Az egérgörgő fel-le mozgatásával pedig Zoomolni tudunk.

Textúrák

Ahhoz hogy a 3D Camera nézetben textúrákat is lássunk, jobb klikkel kattints a camera szövegre és válazd ki a 3D Textured opciót.

A 3D texture mód kiválasztása a camera nézetben.

Navigáció a 3D camera nézetben

A 3D nézetben való mozgás egy kicsit eltér a 2D-jével szenben:

  • Tartsd a Space gombot és a bal klikket, hogy forgasd a kamerát.
  • Tartsd a Space gombot és a bal klikket, hogy mozogj fel/le és jobbra/balra.
  • Tartsd a Space gombot és a bal és jobb klikket, az előre és hátra mozgáshoz.
  • Ugyanígy használhatóak a W, A, S, és D gombok, hogy előre,hátra,jobbraésbalra mozogj.
  • A Z gombot használva pedig "mouse lock" módra váltasz. Vidd az egeret a 3D camera nézetre és nyomd meg a Z gombot, ekkor egészen addig amíg újra meg nem nyomod a nézet úgy viselkedik mintha játékban lennél.

A 3D Camera nézetben tolass egy kicsit hátra, hogy lásd a brush-t amit készitettél.

A Browse gomb a Texture felületen.

Most feltünhet neked az alap textúra a padlódon, nos ezt nagy esélyel le majd szeretnéd cserélni. Ehhez kattints a Browse gombra a Texture Box-on.

Ez fel fogja hozni a Textúra Böngésző ablakot.

A szürke fejlesztői (dev) textúra.

Lent a Filter mezőben tudsz szűrni (nevük szerint) a textúrákon. Most írd be a "dev_measure" (alsóvonallal együtt) textúranevet a keresőbe, hogy felhozd a fejlesztői textúrákat, egyenlőre ezek most bőven meg fognak felelni a feladatnak.

Válazd ki a dev/dev_measuregeneric01b nevű textúrát, úgy hogy duplán ráklikkelsz.


A kiválasztott brush-on megjelent új textúra.

Ezután bezáródik magától a Textúra Böngésző ablak, és a kiválasztott textúrádat fogja mutatni a jobb oldali kicsi négyzetben a Hammer.

Válazd ki a padlót a 3D camera nézetben, ami után pirosas árnyalatot fog kapni, jelezvén, hogy kijelölted.

Miután a padlót kiválasztottad, kattints a Hammer ApplyCurrentTexture.png Apply current texture gombra a bal oldalon, ha mindent jól csináltál, akkor sikeresen átálítottad a kiválasztott textúrára a objektumot.

Falak és a plafon létrehozása

Itt az ideje, hogy végleges formát adjunk a pályánknak. Ezt úgy a legkönnyebb megvalósítani, ha Duplikáljuk a előbb elkészült padlónkat.

Duplikálás

Bármikor lemásolhatunk egy, már meglévő Brush-t, hogy felgyorsítsunk a munkamenetünket.

Note.pngNote:A könyebb duplikálás érdekében célszerű, ha a beállításokban be van kapcsolva az Arrow keys nudge selected object/vertex, ennek beállításához az útmutatót megtalálod a Brushok mozgatása fejezetben.
Duplicating brushes to make a room.

Hogy duplikálj:

  1. Válszd ki a Brush-t amit az előbb csináltál.
  2. Vidd a kurzort a Side nézetre.
  3. Tarsd a Shift billentyűt, majd nyomd meg a Up_arrow, hogy duplikáld a Brush-t 1 egységgel felfelé.

Ezzel lett egy tökéletes másolat a padlonkról, közvetlen 1 egységgel felette.

Mostmár átméretezheted a duplikált formát az oldalsó, és felső nézetekben, úgy hogy a formát a közepénél fogva elhúzod a padló eggyik szélére és egy 128 egység hosszú 16 egység széles falat csinálsz belőle.

Tip.pngTip:Nem csak egérrel tudod mozgatni a Brush-okat hanem a kurzor nyilakkal is, csak vidd abba az ablakba az egeret amelyik síkon akarod mozgatni a kiválasztott brush-t.

Most ismételd meg ezt háromszor, a padló minden eggyes oldalára ugyan ezt, közben ügyelj, hogy a falak közvetlenül rajta feküdjenek a padlón. Kerüld el, hogy véletlenül se legyen lyuk a pályán.

Duplicating the floor to create a ceiling.

Mégegyszer másold le a padlót, hogy a falakra fektetve plafont csinálj.

Tip.pngTip:Próbáld elkerülni, hogy a Brush-ok egymáson átmenjenek, vagy összeérjenek. Ha hanyagul illenek össze a felületek, és futtatod a pályát, a falakon a textúra "z-fight"-ol, és csúnyán villogni kezd.

Brush-ok törlése

Hogy törölj egy brush-t, válazd ki a Selection Tool-al Hammer select.png és nyomd meg a Delete billentyűt.

Többszörös kiválasztás

Applying the generic orange developer texture to the walls.

Mikror camera nézetben mozogsz, kissé zavaró tud lenni, hogy minden textúra egyforma. Ezért következőként kicseréljük a falak textúráját, hogy a pályánkon a navigációt megkönnyítsük.

Válazd ki az összes falat camera nézetben az egérrel, miközben tartod a Ctrl billentyűt. Ahhoz, hogy foroghas a camerával tarsd lenyomva a SPACE billentyűt, vagy vidd a kameranézetet "mouse lock" módba a z billentyűvel.

Mikor kiválasztottad az összes változtatni kívánt felületet, kattints a Browse gombra a jobb oldali Texture felületen. Ezúttal, válazd ki a narancssárga textúrát a jelenlegi mellet, dev/dev_measuregeneric01 néven. Kattints rá duplán, hogy kiválazd, és bezárd a böngésző ablakot.

Kattints a Hammer ApplyCurrentTexture.png gombra a baloldali Tool felülete, ahhoz hogy megváltozzon a falak textúrája.

A fájl elmentése

Hogy elmentsd a pályád, használd a Ctrl+S parancsot, vagy a or File fülön belül kattints a Save-re.

Mikor elsőként mentesz a pályádon akkor a program meg fog kérni téged, hogy neved el a fájlt amit csináltál.

Ezt a pályát most szimplán nevezzük el "tutorial01" néven. Amit a program ebbe a mappába fog elmenteni:

C:\Program Files\Steam\steamapps\common\portal 2\sdk_content\maps\

Ettől egy kicsit eltérhet a te mappád helye, ez igazából attól függ hová installáltad annó a Steam-et.

Mikor elnevezel egy pályát, ne adj neki hosszú nevet, előfordúlhat, hogy emiatt a játék nem indítja majd el.

Tip.pngTip:Ha egy portal 2 pálya neve elé teszed a következőket: , "sp_a1_", "sp_a2_", "sp_a3_", "sp_a4_", azzal meg tudod változtatni a pálya elején a töltőképernyőt.

Csatolt sablonpályák

Mikor elmented a pályád, feltűnhet neked, hogy a mappában nem csak a te alkotásaid kaptak helyet. Ezek a sablonpályák vagy magából a játékból, vagy külön azzal a céllal készültek, hogy bármikor a segítségedre legyenek. (A Portal 2 pályák bármelyike megnyitható, ha egy BSPSource nevű programmal decompile-olod, és utána Hammer-ben futtatod őket.)

Név Tartalma Mit tanulhatsz belőle
maps\mp_coop_doors Egy szimpla eggyütműködő pálya. Hogyan kezdj el és zárj le egy eggyütmüködő pályát; hogyan készíts ablakokat eggyütműködő pályán.
maps\mp_coop_paint_red_racer Földalatti Eggyütműködő pálya propulziós géllel. Hogyan kezdj el és zárj le egy eggyütmüködő pályát, földalatti kinézettel; turretek működése, lézerek és gél működése eggyütműködő módban.
maps\sp_a2_column_blocker Egyjátékos pálya szilárd fényhíddal, meg egyébbel. Fényhidak, lézerek, lézer vevők, lézer kibocsájtók, panelek, turretek, ablakok, rácsok, halálos trutyi, és hajítópadok működése portal 2 pályán belül.
maps\sp_a2_trust_fling Egyjátékos pálya hajítópadokkal. Hajítópadokkal kapcsolatos tudnivalók egy rekonstruált pályán.
maps\sp_a3_speed_ramp Egyjátékos pálya a földalatt, propulziós és repulziós gélel. Hogyan készíts rendes földalatti témájú pályákat.
maps\sp_a4_laser_catapult Egyjátékos pálya utazócsatornákkal, lézerrel, és pár dugattyús platformal. Hogyan helyezz el rendesen utazócsatornákat, és dugattyús platformokat egy Wheatley témájú pályán.
maps\zoo_mechanics Gyakori pályaelemeket tartalmazó, egyszerű felépítésű sablonpálya. Részletes információk a utazócsatornák, adagolók, gélek, és halálos trutyikról, stb.

Placing entities

Entitás kiválasztása.
Info_player_start elhelyezése.

Next we'll place an entity in our level:

  1. Select the Hammer entity.png Entity Tool on the Tool Bar.
  2. Once the Entity Tool is enabled, the Entity selection list on the Object bar becomes active.
  3. Keep the Categories entry as Entities.
  4. Click the arrow on the Objects drop down list and select info_player_start.
  5. Now, navigate in the Camera viewport to the middle of the inside of the room.
  6. left-click on the floor to place the entity.
  7. Do the same with weapon_portalgun and try to place it in a position so the info_player_start is touching it.


This will place an info_player_start entity in the middle of the room. You will also receive a Portal Gun when you spawn.

Placing a light

Now we'll place a source of illumination in the map:

  1. Select the Entity Tool again
  2. Select light from the Objects drop down list on the Object bar.
  3. This time, place the light on the ceiling (above the player's head).
  4. Go back into selection mode by clicking on the Hammer select.png Selection tool in the Tool Bar or by pressing the Esc key.
The Object Properties for a light.

Next we'll change some settings on the light. Bring up the light's properties by double-clicking it in the Camera viewport or by selecting it (left-clicking on it) and then pressing the Alt+ Enter keys. This will bring up the Object Properties dialog box.

From the Object Properties, you can change various properties of the entity. For example, you can change the Brightness of this light. Click on the Brightness row under Keyvalues and you will see a set of numbers on the drop down menu on the right side. The default setting for the brightness of a light is 255 255 255 200. The first three numbers represent the RGB values (color) and the last number represents the intensity of the light.

You can click on the Pick Color button to select a color rather than input values for it.

Picking a color for a light.

Simply click on the color you want the light to be and click OK.

This will bring you back to the Object Properties dialog box for the light. You should see any changes you made to the brightness on the Brightness row and the drop down field on the right side if the Brightness row is selected.

Click the Apply button to set your changes to the entity and close the dialog box by clicking on the "X" at the upper right side of the window.

Placing a prop_static

The Object Properties for a prop_static entity.

Entities also consist of props like furniture, decoration, and complex parts of architecture. There are a variety of different kinds of props. Prop_static entities are props that are static – they don't move, animate, turn on or turn off. There are also prop_dynamic entities that can move, animate, be enabled and disabled. There are also prop_physics entities which the player can interact with and behave physically as they would in the real world.

To place a prop:

  1. Select on the Entity Tool again.
  2. Go to the Object bar and change the Objects field to prop_static.
  3. Point to the floor in front of the info_player_start and left-click to place a prop_static. You will see a red cube that represents the prop_static before a model is attached to it.
  4. Go back into selection mode by clicking on the Hammer select.png Selection tool in the Tool Bar or by pressing the Esc key.
  5. Double-click on the red cube to open the properties.
  6. Double-click on the World Model field to open the Model Browser.
Warning.pngWarning:The first time that the Model Browser window loads, it can take a while to load in all of the models. It might not immediately look like the image you see below. If you cannot find the model you're looking for, give it a minute to finishing loading.

Selecting the model

Selecting the paintdropper model in the Model Browser.
  1. In the Filter field at the bottom of the dialog box, type in "paint". This will show all the models that have the word "paint" in their name.
  2. Scroll down to the one named:
    "props_underground\underground_paintdropper.mdl".
    It should look like the image shown.
  3. Click OK to select it and close the browser and return to the Object Properties dialog box. You should see the name of the model now in the World Model row.
  4. Click the Apply button to set your changes to the entity.
  5. Close the Properties box.

You will see the paintdropper that you just placed in the room in the viewports in the editor.

Moving entities

You can move entities like our paintdropper the same way you can move brushes. Click and drag inside the bounding box of the selected entity to move it around with your mouse or put your mouse over any of the viewports and use the arrow keys on your keyboard to move them around.

Rotating entities

To rotate an object , you simply select the object you wish to rotate using the Selection Tool Hammer select.png, then click once on the object. You should see the object surrounded at the corners with circles. Mouse over a circle in any 2D view, then click and drag to rotate the object.

Use your mouse wheel to zoom into the Front viewport and click once inside the bounding box of the paintdropper model to make its four corners highlight with circles around each one.

Left-click and drag in a counter-clockwise motion to rotate the paintdropper so that it can drop paint from the ceiliing.

Running your level in the game

Change the Run Map parameters to match these settings, then click OK.

You have saved your map, but you will also need to compile it before it can be played in the game engine.

When a map is compiled, it is converted from the raw .VMF file that you just saved, into the .BSP format used by the game engine. The geometry is processed and the proper lighting and shadows are pre-calculated with several compile programs.

  • Open the File menu, and choose Run Map... or press the F9 key.
  • The Run Map dialog will open.
  • This dialog is used to set some basic compile parameters.
    1. Make sure that Normal is set under the Run BSP, Run VIS, and Run RAD settings.
    2. Under Additional game parameters:, make sure these settings are present, and type them in if not:
      -toconsole -dev -console +sv_lan 1
    3. You may wish to check "Wait for keypress" so that you can see any error messages that occur.
    4. Now click the OK button to start the map compile process.

The Compile Process Window will show the progress of the compile. When the compilation is done, the game you are mapping for will automatically launch, and load your map in the engine.

Note.pngNote:If you wish to compile with High Dynamic Range lighting, simply check the box that says HDR. The time to compile the map will be twice as long, but that is completely normal.

Your level in the game should load up after compiling. It may take a minute or two.

Next time you compile, you may wish to check the "Don't run the game after compiling" checkbox. Otherwise, it will complain that only one instance of the game can run at once. Instead of exiting and relaunching the game (slow!), you can simply recompile the map (F9) and then type map myMapFileName in the developer console to reload the map.

Running the level in the game.

The Developer console

Making levels for Portal 2 sometimes involves using commands typed into the Developer Console window. The console can also be used to do things like spawn cubes and turrets to test your level.

Enabling the developer console.

If you haven't already, make sure the console is enabled in the game:

  1. Press the Esc key in the game.
  2. Click on Options, then Keyboard/Mouse.
  3. Click on the Allow Developer Console and select "Enabled".
  4. Click on the Done Button.
  5. Click on Return to Game.

Using the developer console:

  1. Bring down your developer console ` (tilde).
  2. Type any console command and press the Enter key.
  3. Hide the console again with `.

Noclip mode

One console command you'll find constantly useful is noclip mode. This is a mode that let's you fly around the level without being stopped ("clipped") by anything in the level. It's useful to get around large levels quickly.

To enter noclip mode:

  • Press ` to enter the console.
  • Type noclip in the console and press Enter.
  • Fly around the level.
  • Type noclip again to leave noclip and walk around the level normally.
  • You can toggle noclip with the press of a button with the bind console command. For example, bind mouse3 noclip for the middle mouse button.

Some useful console commands

There are lots of console commands available. Here is a very small sampling:

sv_cheats 1
Turns on cheats. Necessary for many console commands.
map <name of map>
Loads a map or reloads the level you're in.
changelevel <name of map>
Loads a map while continuing the session.
god 1
Turns on god mode for all players. The players are invulnerable.
noclip
Allows you to fly through the world.