User Tools

Site Tools


hpl3:game:guides:scripters_guide

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
hpl3:game:guides:scripters_guide [2013/08/07 09:41]
thomas [Rules]
hpl3:game:guides:scripters_guide [2014/11/12 11:38]
thomas [Code Structure]
Line 60: Line 60:
   * Press F3 to speed up the update rate in the game. This is especially useful to quickly playing through conversations,​ long events, etc when testing.   * Press F3 to speed up the update rate in the game. This is especially useful to quickly playing through conversations,​ long events, etc when testing.
   * Press F7 to go into spectator mode. This allows you to easily move around in the map. Hold down shift to go extra fast.   * Press F7 to go into spectator mode. This allows you to easily move around in the map. Hold down shift to go extra fast.
-  * Press F2 to pauses the game. This is nice to use with Spectator mode and you can closely inspect something ​so look for bugs and make sure it plays out like it should.+  * Press F2 to pauses the game. This is nice to use with Spectator mode and you can closely inspect something ​to look for bugs and make sure it plays out like it should. 
 + 
 +===== Code Structure ===== 
 + 
 +Since a lot of people will be working on the same piece of code it is important that the same structure is maintained. This way it makes it easier for people to find what they need to do to change something. 
 + 
 +//Note: In the code below, spaces are used to indent, do NOT use this, use tab instead!//​ 
 +<code c++>//​-------------------------------------------------- 
 + 
 +/*Place any global values here. These must be const variables as they will not be saved*/ 
 +/*This is also the place for enums and classes, but these should be avoided whenever possible*/​ 
 + 
 +//​-------------------------------------------------- 
 + 
 +class cScrMap : iScrMap 
 +
 + //​-------------------------------------------- 
 + 
 + //////////////////////////////////////////////////////////////////////////////////////////​ 
 + // ============== 
 + // MAIN CALLBACKS 
 + // ============== 
 + //​{///////////////////////////////////////////////////////////////////////////////////////​ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*OnStart, OnEnter, OnLeave, Update (avoid this), OnAction (debug only), OnPlayerDead,​ etc are here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + //} END MAIN CALLBACKS 
 + 
 + //////////////////////////////////////////////////////////////////////////////////////////​ 
 + // ============== 
 + // MAIN FUNCTIONS 
 + // ============== 
 + //​{///////////////////////////////////////////////////////////////////////////////////////​ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*Put any variables that are used in more than one scene here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*Put any functions that are used in more than one scene here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + //} END MAIN FUNCTIONS 
 + 
 + //////////////////////////////////////////////////////////////////////////////////////////​ 
 + // ============== 
 + // SCENE X *NAME OF SCENE* 
 + // ============== 
 + //​{//////////////////////////////////////////////////////////////////////////////////////​ 
 + 
 + /////////////////////////////////////////​ 
 + // Scene X GENERAL 
 + //​{//////////////////////////////////////​ 
 +                 //​------------------------------------------------------- 
 + 
 + /*Put any variables that are used by many events in Scene X here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*Put any functions that are used in more than one event in Scene X here.*/ 
 + 
 + //​------------------------------------------------------- 
 +                 //} END General 
 + 
 + /////////////////////////////////////////​ 
 + // Event *Name Of Event* 
 + //​{//////////////////////////////////////​ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*Put any variables that are only used in Scene X, Event X here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*Put any functionsthat are only used in Scene X, Event X here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + //} END Event *Name Of Event* 
 + 
 + //} END SCENE X 
 + 
 + /////////////////////////////////////////​ 
 + // ============== 
 + // TERMINALS 
 + // ============== 
 + //​{//////////////////////////////////////​ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /////////////////////////////////////////​ 
 + // Terminal *Name Of Terminal* 
 + //​{//////////////////////////////////////​ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*Put any variables that are only used Terminal here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + /*Put any functions that are only used Terminal here.*/ 
 + 
 + //​------------------------------------------------------- 
 + 
 + //} END Terminal *Name Of Terminal* 
 + 
 + //} END TERMINALS 
 + 
 +
 +</​code>​ 
 + 
 +**Note1:** \\ 
 +It is OK if terminals use variables that are scene or event specific! 
 + 
 +**Note2:** \\ 
 +Have snuck in some { and } to make code folding for sections possible. 
 + 
 +**Note3:** \\ 
 +Remember to always separate functions with a comment line, like this: 
 + 
 +<code c++>void Func1() 
 +
 + 
 +
 + 
 +//​------------------------------------------------- 
 + 
 +void Func2() 
 +
 + 
 +
 +</​code>​ 
 + 
 +==== Naming Conventions ==== 
 + 
 +A few naming conventions for map scripting and level building: 
 + 
 +=== Areas === 
 + 
 +Name trigger areas in the level Trigger_xxxx to make them easier to find. 
 + 
 +=== Sequences === 
 + 
 +Name sequence functions in your map script Seq_xxxx 
 ===== Design ===== ===== Design =====
  
Line 108: Line 258:
  
  
-==== Rules ====+==== Foundational ​Rules ====
 **No Puzzles**\\ **No Puzzles**\\
 Do not think of our puzzles as such. Think of them as //​Activities//​ in stead. This is very important to keep in mind as they are not meant to pose a challenge but to make the player feel more part of the world. The player might still be required to think, but we do not want to end up in a "guess the designer"​ type of gameplay. It should feel natural and the player should "​solve"​ any activity by simply just trying enough. For instance in Amnesia you can break down a wall by throwing a rock at it or simply clicking on it a lot. In either case the player has made a proper attempt at breaking down the wall and needs to be rewarded. Being streamlined,​ intuitive and coherent comes way ahead of being a satisfying problem to solve. Do not think of our puzzles as such. Think of them as //​Activities//​ in stead. This is very important to keep in mind as they are not meant to pose a challenge but to make the player feel more part of the world. The player might still be required to think, but we do not want to end up in a "guess the designer"​ type of gameplay. It should feel natural and the player should "​solve"​ any activity by simply just trying enough. For instance in Amnesia you can break down a wall by throwing a rock at it or simply clicking on it a lot. In either case the player has made a proper attempt at breaking down the wall and needs to be rewarded. Being streamlined,​ intuitive and coherent comes way ahead of being a satisfying problem to solve.
Line 120: Line 270:
 **Physics When Possible**\\ **Physics When Possible**\\
 Do not "​hard-code"​ behaviors, but try and use physics when ever possible. This will also allow the player to experiment more and to allow a great set of possible solutions to activities. Beware that physics can be very unruly and make sure that there are restraints on what can be done. When using physics you really need to test a lot. Do not "​hard-code"​ behaviors, but try and use physics when ever possible. This will also allow the player to experiment more and to allow a great set of possible solutions to activities. Beware that physics can be very unruly and make sure that there are restraints on what can be done. When using physics you really need to test a lot.
 +
 +==== Specific Guidelines ====
 +
 +**Readable items must have consistent placement**\\
 +When placing things that can be read, such as notes, books, newspapers, pamphlets, etc, it is very important to follow strict rules on this. We want the player to figure out by simply looking, what is possible to read and what is not. The player should not need to go pixel hunting. Here are the two basic rules for this:\\
 +1) Readables lying by themselves can always be interacted with.\\
 +2) Readables that can not be read, bust be in groups; piles, stacks, rows, etc.\\
 +Also make sure that the colors on the readables that are slightly more saturated than the group ones. The only exception for this is scraps of paper, which are possible to have lying by themselves. But these can not have any longer text, but only pictures, diagrams, etc with some small written notation. They must also feel crumbled and fairly useless.
 +
 +**Longer must be confined to single lang entry**\\
 +Any longer text for notes, descriptions,​ books, etc must be inside a single lang entry. They cannot be spread out over several entries for any reason. When having a single lang entry, it makes it a lot easier to maintain and translation gets easier.
 +
 +=== Books ===
 +For books, we can show the front, the back, or an interesting page in the middle (swapping the model lets us show an '​open'​ version).
 +  * If the back, then we show text of blurb
 +  * If the front, then we just show title, author & whatever
 +  * If somewhere in the middle, then we show an extract from the book.
 +The key thing to remember here is:
 +"If the protagonist picked up this book, which bit would he be most interested in?" ​
 +
 +i.e. it's unlikely we'd show an extract from the middle, unless it's critical to the protagonist'​s current plans e.g. the instruction manual for a device he's interested in or something.
  
 ==== Further information ==== ==== Further information ====
hpl3/game/guides/scripters_guide.txt · Last modified: 2015/09/25 11:10 by jens