basics.rst 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Basic concepts
  2. ==============
  3. The source directory
  4. --------------------
  5. The source directory contains all the files that make up an application.
  6. There is no fixed structure for the files and folders in the source directory, you can organize your content as you see fit. You can for example decide to put all the textures and sounds in the "textures" and "sounds" folders respectively, or maybe sort the content on a per-object basis by putting all the assets for an enemy in the "units/enemy" folder.
  7. There is, however, a small number of required files which are needed for the engine to start-up correctly:
  8. .. code::
  9. .
  10. ├── boot.config <- First file loaded by the engine
  11. ├── boot.package <- Package to load on boot
  12. ├── boot.lua <- Lua script to launch on boot
  13. └── global.physics_config <- Global physics-related configurations
  14. The boot directory and the boot.config file
  15. -------------------------------------------
  16. Any directory within `the source directory`_ containing the file named ``boot.config`` is a boot directory.
  17. The ``boot.config`` is the first file loaded by Pepper; it specifies the package to load and the lua script to execute on boot and various other boot-time settings. See `boot.config file reference`_ for more details.
  18. There can be an arbitrary number of boot directories. You can set which boot directory Pepper should use with the switch ``--boot-dir``.
  19. In the example below, the engine is told to load the package ``boot`` and run the Lua script ``lua/game``.
  20. .. code::
  21. boot_package = "boot" // Package to load on boot
  22. boot_script = "lua/game" // Lua script to execute on boot
  23. The data directory
  24. --------------------
  25. Pepper reads source data from `the source directory`_ and compiles it into efficient binary representation.
  26. The result of the compilation process is stored in the data directory.
  27. .. code::
  28. .
  29. ├── data <- Contains compiled data files
  30. | ├── a14e8dfa2cd... <- Compiled file
  31. | ├── 72e3cc03787... <- Another compiled file
  32. | └── ...
  33. ├── temp <- Temporary files from data compilers
  34. └── last.log <- Text log from the last engine execution
  35. The .bundleignore file
  36. ----------------------
  37. Many programs store metadata files alongside edited files. This is often the case with text editors and version control systems.
  38. When Pepper bumps into unknown files in the source directory, it quits the compilation and reports an error.
  39. The ``.bundleignore`` file specifies files that Pepper should ignore when compiling data.
  40. Example:
  41. .. code::
  42. # This is a comment.
  43. # Blank lines are ignored.
  44. # Everything else is simple glob pattern (*, ?).
  45. *.txt
  46. Units of measurement
  47. --------------------
  48. Pepper uses MKS (meters, kilograms and seconds) units and radians for angles.