PS Tech

From PigaLore
Jump to: navigation, search

PS Tech, also known as the Gambas 3D Engine, is a three dimensional engine project by Piga Software. It is named in homage of the id Software rendering engines ("id tech" engines), a scheme earlier mimicked by other such as Lithtech. It is a 3D rendering and game engine for Gambas written in OpenGL 2.1.

Implementation

PS Tech functions as a "3D tile engine", and as such is designed to work via a gird system inside a three dimensional data array. Each point in the array contains two values reprsented as 000|000. The first three characters slots are used to define object type (block wall, door, collectible item, etc), while the last three characters are meant to assign a texture value. The grid has a scale of 1x1x1 representing a single point (so that an object drawn with value of 1x1x1 will fill the entire point, with smaller object dimensions specified as decimals), and can be made up of primitives, MD2 models or sprites. Most architectural pieces are made up as texturable primitives or combinations of such, although MD2 models could also be used to make specialized wall templates. Multiple entries for a single object are needed to represent it from differing angles (typically 0°, 90°, 45° or 135°).

A height system is present wherein the player can ascend up objects from 0.1 to 0.9 without entering a higher grid point on the Y axis. Between Y grid points in the map data there are values available for deciding the existence and texture for world's skydome, or whether to give the X by Z gird area a textured floor or ceiling. Individual floor and roof tiles can also be added, specifed in the map format in a range from 0x0|000 to 9x9|000 ("x" replaced with "f" for floor, "r" for roof and "b" for both). Regions can also be encased in a fluid tile of either low ("l"; only submerged when crouching), medium ("m"; can be escaped by jumping) or high height ("h"; must get out before drowning). For objects that have a static texture, the texturing portion of an entry can be used to confer other information, such as objects to placed atop of table.

A basic map is a 25x25 grid, which renders with high frame rates regardless of whether or not a system of culling is in use and can easily be edited in the world editor. Larger maps can be done through a system of distance culling keeping load in check, either by continually rendering only objects within a certain grid point radius around the player, or a system that draws objects for a certain distance in front of the player's current perspective. A system to call in smaller versions of textures as a performance fall-back is being considered. Lighting is yet to be properly implemented, but is to be based on a selection of specific light emitting sources, such as fireplaces, torches or candelabra mixed with the use of the fog feature to try and recreate the "diminished lighting" seen so often in mid-1990s games.

The objective of the engine is ease of use and performance (given the innate overhead of Gambas as a high-level language, as well as limited experience and manpower), and has no ambitions of photorealism or implementation of advanced features. All rendering is currently done in the antiquated immediate mode or with display lists, so an eventual conversion to using modern and sleeker vertex buffer objects and shaders is planned as Graham L. Wilson learns more about OpenGL and GLSL. It should be noted however that Gambas utilizes OpenGL through the original SDL, and so it does not yet support vertex buffers and arrays yet itself.

Alpha

"Glut" alpha

An early alpha build for a game draft called Glut is available to download from the Piga Software file directory at icculus.org, and is the current state of the project since November 2014. It features a functioning 3D world as a 3D tile engine (ala Wolfenstein 3D) with basic movement, drawing and interactivity. Environmental clipping however is a major issue still to be properly addressed, requiring a major overhaul of the player coordinate system. Support for lighting is also rudimentary at this time, and can be turned on by pressing F4. Fog is accessible by pressing F3. The engine can be made full screen by pressing F1. Movement is done via the arrow keys, and basic mouse look (upon mouse click and drag) is active. All geometry is done in pure OpenGL immediate mode currently, although MD2 model support is included in the source code.

History

See Also: Gambas Projection Engine#History

Game Maker

Office Drone, a prototype

The closest thing Piga previously ever done towards making an actual first-person shooter, was using the Direct3D integration of the Game Maker game creation tool. This for them made the usage of 2-Step obsolete beyond its novelty value. Work on this began in September 2005 when they finally acquired the full version of Game Maker 6.1. The first thing they tried was based on a 2.5D example downloaded from the Internet. The experiments took the form of a game called Castle Coyotestein, a Wolfenstein 3D spoof using the graphics from the famous early 1990s game. In the end, limitations to this code base were discovered and a more easily usable demo was found created by Mark Overmars.

A variety of game concepts were played around with. Some versions contained usable computers, key puzzles, a variety of weapons and other objects. Environments that were created were varied as well, from military bases, Gothic mansions, city locales, office blocks and such. One game featured limited squad AI while another featured limited bots.

Other engines

Various other engines have been experimented with at different times. Malcolm Wilson Multimedia has experimented successfully with modifying ioquake3 models. Both Hamish and Graham L. Wilson have played with the Doom engine, (in both Doom Builder and Yadex, as well as its modern fork Eureka). Although having a personal liking for the id Tech family of engines, they admit that its lack of modern scripting languages such as Python or Lua is a disadvantage (not having an inclination towards learning QuakeC or similar). This makes an engine like OGRE or Irrlicht more attractive; a long-term conception for PS Tech is the eventual inclusion of a lower-level C++-written renderer, with Gambas used as a high-level scripting system. The most interesting alternative engine at the moment is Godot engine, in that it will provide Unity-type simplicity while still being properly free software, although they still feel it will probally take awhile to develop to that point.

Gambas Development

MetaMetal draft

PS Tech proper was first conceived after learning of the OpenGL component added in for Gambas 2 in the summer of 2007. Attempts by Graham L. Wilson to study from provided examples were eventually jump-started in late 2010, when Tomasz "tommyline" Kolodziejczyk ported over more complete examples by NeHe Productions, which have since been mainlined into Gambas. Kolodziejczyk continued to push the support for OpenGL in Gambas until switching to C++ in May 2013 in order to take advantage of later versions of the OpenGL specification, and receive performance boosts. By this time, he had shared much of his code and imparted much of his knowledge to Wilson, who has taken up the banner of finishing a Gambas-made grid-based 3D engine. Wilson had waited to see how far Kolodziejczyk would take things, but eventually started learning the system himself first starting in August 2011, but more properly in December 2012.

See Also