==============
    Makaqu
==============
Title    : Makaqu
Filename : Makaqu0.1.zip
Version  : 0.1
Date     : May/20/2005
Author   : Manoel "Fragger" Kasimier
Email    : manoelkasimier@yahoo.com.br
Website  : http://quakedev.dcemulation.com/fragger/index.htm



====================
    Introduction
====================

This is the Makaqu engine. It is a modified WinQuake engine, and contains many features I was hoping to include in nxQuake (a port of the Quake engine to the Sega Dreamcast). I ended up having some personal problems, so I wasn't able to port my changes to nxQuake. However, after all the work I put into this engine, it would be a waste to not release it.

I'm rather proud of some of the modifications I've made to it. There's a good number of features that were implemented thanks to the tutorials at quakesrc.org, and a few that were ported from other engines, but in the end I have the impression that most of the changes in the code were written by myself. There are tons of things I would love to do in the engine, and some of them are present in this release. Also, when adding code from other sources I studied them carefully, fixing bugs, looking for better ways to implement them, and sometimes improving them.

However, it's not perfect. I don't know why, but now the engine crashes when rendering alias models if the ASM code is used, so I had to disable the ASM code. At first I had disabled it so I could learn how the renderer works (because I don't understand ASM), but when I re-enabled it this problem appeared.

The following tutorials from the Quake Standards Group were implemented:
Rotating brushes (MrG)
Fixing the incorrect bounding boxes on rotating bmodel objects (LordHavoc)
enabling new EF_ effects (Kryten)
Frames Per Second Display (muff) - modified a bit
max_fps cvar (MrG)
QC Alpha Scale Glow (Tomaz) - modified a lot. Glow accepts negative values, alpha is stippled, and .alpha & .scale works in static entities.

I've implemented the skybox support and alias model interpolation from the version 1.11a of the ToChriS engine, and made heavy modifications to them.

Most of the code is marked with comments, so it shouldn't be hard to port most of the changes to any other engine.

There's probably a few things missing in this readme. I've tried my best to list all the changes here, but right now I don't have the time to read the whole source again.

Also, many thanks to Tyne/RenegadeC (jsnipez@hotmail.com) and DCmad/MasterMan (masterman194@hotmail.com) for their betatesting, to LordHavoc (lordhavoc@ghdigital.com) for tips on how to change the angles to 16 bit, and to BlackAura (badcdev@gmail.com) for his inspiration and moral support.



=====================
    Misc changes:
=====================
- Reduced the size of the config file (makaqu.cfg).
- Independent config file (makaqu.cfg). When loading the file config.cfg, if the file makaqu.cfg exists the engine will load it instead. And now the engine uses the file makaqu.cfg to save the settings.
- The message "execing file.ext" is a developer message now.
- Removed the message "VERSION 1.00 SERVER (%i CRC)" upon map loading.
- Various crashes changed to host errors.
- Added a FPS display and a cl_showfps cvar to toggle it.
- Increased the maximum resolution to 1600x1200.
- Added auto-repeat for the keys while in the console.
- Added the commands cmdlist, cvarlist, cvarlist_a and cvarlist_s.
- cvarlist_a lists the cvars which are saved in the config file, and cvarlist_s list the cvars used by the server.
- cvarlist, cvarlist_a and cvarlist_s shows the attributes of the variables, as well as their current value.
- cmdlist, cvarlist, cvarlist_a and cvarlist_s outputs the lists in alphabetical order, and accepts the beginning of the names of the commands/cvars as a parameter.
- Added cvars to control the size and position of the screen, and an "Adjust screen" menu to set them.



=========================
    Gameplay changes:
=========================

- Added horizontal autoaim, and a sv_aim_h cvar. Set the "Aim Assistance" option to "on" to enable it, or to "vertical" to use vertical autoaim only. The vertical autoaim is less effective when the aim assistance is set to "on".
- Horizontal aiming is on by default now.
- Added support to up to 16 clients.
- created "map transition lists" for normal game and deathmatch. It works like a maplist, by redirecting the changelevel command. The list for normal game is "maps\spmaps.txt" and the deathmatch list is "maps\dmmaps.txt". The contents of these lists should be as follows:

Each line contains the name of three maps. When you're playing in the first map and the game issues a changelevel to go to the second map, the changelevel will be redirected to the third map. Example:

start e1m1 e1m7 // When you're in the map "start" and tries to go to the map "e1m1", the game will load the map "e1m7"

Notes:
- Each line must contain three names of maps, without extension.
- Lines started with a double slash ("//") will be ignored.

Wildcard notes:
- You can replace the second name with an asterisk. It's useful for things like this:

start e1m1 e1m7 // if you try to go from the map "start" to the map "e1m1", you will go to the map "e1m7"
start * e1m8    // if you try to go from the map "start" to any other map, you will go to the map "e1m8"



==============================
    Command-input changes:
==============================

- Replaced the +mlook command with a m_look cvar.
- Mouse sensitivity is scaled according to the FOV. Zooming in is a pleasant experience now.
- Up to 256 keys/buttons can be bound for each command in the key config menu.
- Now you can unbind one key/button at each time in the key config menu if the command has multiple keys/buttons bound to it.
- Added the commands "menu_keys_clear" and "menu_keys_addcmd" so the key config menu can be fully customized.
- Added a "bindable" command to define which keys/buttons shouldn't have their bindings changed.

- Created a "function shift" system, similar to the L trigger in Soldier of Fortune for Dreamcast. Added commands: +shift, bindshift, unbindshift, unbindallshifts.
Example: if you enter "bind DC_TRIGL +shift;bind DC_TRIGR +attack;bindshift DC_TRIGR +jump" at the console, the R trigger will make the player shot, but if you hold the L trigger and press the R trigger, the player will jump.
- Added support for shifted keys to the key config menu.



============================
    Save system changes:
============================

- Fixed the initial value of the serverflags being not included in the saves. (not added to normal saves yet)
- Optimized the save system to reduce the filesize of the saves. The optimized saves can sometimes reach up to half of their normal size. They can also be loaded by any Quake engine, compatibility was not broken.
- The save menu supports up to 100 saves now.
- Now the save menu waits for confirmation from the user before overwriting savegames.
- Added an info panel to the save/load menus. It displays the name of the map (ex: E1M1), the skill, the elapsed time, the number of enemies (killed/total) and the amount of secrets (found/total).
- Added a "savename" cvar to set the filename of the saves. Its default value is "QUAKE___". The extension of the filename is defined by the save menu, and has the format ".G##" for small saves (savegames) and ".S##" for normal saves (savestates).
- Created a small save system, and added the console commands "savesmall" and "loadsmall".
- Renamed the "Save Game" and "Load Game" menus to "Save State" and "Load State", and added menus "Save Game" and "Load Game" for the small saves.



======================
    Sound changes:
======================

- Sounds with no attenuation will play full volume on both channels now.



============================
    2D renderer changes:
============================

- Added support for hi-res console backgrounds
- The console messages won't go off the bottom of the screen when the console is in full screen anymore. Now they will follow the height of the status bar.
- Removed the version number from the console background, because it's not needed anymore since the credits page was added to the help menu.
- Now the whole screen is refreshed every frame, to make the status bars work properly with low screen sizes.
- Made the character drawing functions to not give an error if a character is partially or entirely out of the screen
- Centered the intermission screen.



===========================
    Status bar changes:
===========================

- Made a new status bar system. You can choose between 4 status bar styles (classic, classic + inventory, classic + inventory & level status, and a new one). New status bar styles can be easily added in the Sbar_Draw function in the source code.
- You can select which status bar items will be displayed in the new status bar.
- Now the +showscores command (TAB key) shows the full status bar.
- Added a sbar_bg cvar to toggle the background of the classic status bar.
- Added status bar options to the Video menu:
|- Status bar
|- Status bar width
|- Status bar height
|- Background
|- Level status
|- Weapon list
|- Ammo list
|- Keys
|- Runes
|- Powerups
|- Armor
|- Health
|- Ammo



==========================
    Crosshair changes:
==========================

- Replaced the old crosshair with a new one featuring 4 styles and 10 colors.
- The crosshair isn't shown during intermission anymore.
- Added a "crosshair_color" cvar to set the color of the crosshair. It supports integer values from 0 to 9.
- Added a "Crosshair" and a "Color" options with a box showing a crosshair to the Player Setup menu.



============================
    3D renderer changes:
============================

- Added a "max_fps" cvar.
- Added a letterbox effect, and the cvar "r_letterbox" to toggle it. It accepts values from zero to 100.
- Rotating brushes.
- The sizeup and sizedown commands doesn't change the status bar anymore.
- The console variable "viewsize" isn't tied to the status bar anymore, and now its range is 50-100.
- The screen won't be rendered after 4 lines below the status bar.
- Fixed some classic bugs in the chase camera (chase_active).



=============================
    Sky renderer changes:
=============================

- Added transparent sky. The bottom layer (the one who moves faster) of the sky will be transparent if the cvar r_skyalpha is set to any value between zero and 1. It only works properly when all pixels in both layers are variations of the same color. The bottom layer won't be rendered if r_skyalpha is set to zero.

- Added support for skyboxes. 6 .pcx files, that should be placed into the gfx/env/ directory, are required. The names of the .pcx files should start with the name of the skybox, followed by "rt.pcx", "bk.pcx", "lf.pcx", "ft.pcx", "up.pcx" and "dn.pcx", without spaces.
The .pcx files must have the dimensions 256x256, 512x256, 256x512, or 512x512.
When a map is started, first the engine looks for the name of the skybox into the "sky" field of the world. If it's not set then it looks into the "r_skyname" cvar. You can also type "loadsky <name>" at the console.
It has a bug: Parts of the map which should be hidden by the skybox are shown. Start the map e4m7 and look up to see.



=======================================
    Alias models' renderer changes:
=======================================

- Dithered transparencies, used in the weapon model when the player is invisible, and in any entity with the self.alpha value between zero and 1. Also supported in 2D sprites.
- Interpolation of position, rotation, frames and lighting of alias models. It also interpolates transitions from single frames to framegroups, from framegroups to single frames, and from a framegroup to another.
- Timed framegroups are interpolated according to the time interval defined in their frames.
- Motion and rotation interpolation doesn't work well in demos (this also happens on ToChriS 1.11a).
- Changed some things in the lighting of alias models. They look darker now.
- There are some new cvars to adjust the position and intensity of the lighting: r_light_vec_x, r_light_vec_y, r_light_vec_z, r_light_shade and r_light_ambient.
- The lighting vector in alias models is changed according to the origin of the dynamic lights (which means now you can see the lights surrounding the models)



==================================
    Particle renderer changes:
==================================

- Round particles.
- Fixed the distance between particles generated by trails.
- Now the particles are scaled on zoom.



===========================
    Cvar value changes:
===========================

- Replaced +mlook with a m_look cvar
- Changed the default value of _cl_color to 22
- Changed the default value of v_centerspeed to 200
- Changed the default value of scr_printspeed to 16
- Added a "cl_nobob" cvar



=========================
    Protocol changes:
=========================

- Changed the angles to 16-bit
- Support for 16-bit ammo values in the statusbar (limited to 999)
- QC support for .glow (dynamic lights, including negative values), .scale (to shrink/enlarge alias models) and .alpha (to make sprites and alias models trasparent)
- .scale and .alpha also works in static entities



=====================
    Menu changes:
=====================

- Many optimizations to the menu code.
- Several cosmetic changes in the menus.
- Enabled transparent pixels in all menu's plaques.
- Now the images and sounds of the menus are precached on initialization. This eliminates the loading times in the menus.
- Included BlackAura's screen fading code in the source, but it's not being used because the engine was running too slow with it activated.

- Added a page for Makaqu's credits and another for the Quake engine's credits to the help menu.
- Added a console variable "help_pages" to define the amount of help pages shown in the help menu.
- If the "help_pages" variable is set to zero then only the credit pages of Makaqu and Quake will be shown in the help menu.
- The credit screens are displayed during initialization.

- Added mouse input to the menu. Use the mouse wheel to change the position of the cursor, and the left button to select the options. The mouse buttons 1 and 2 also scrolls through the previous and next values in options with multiple values.

- Now the settings of the multiplayer menu only takes effect when a game is started.
- Added deathmatch 2 and 3 to the multiplayer menu.
- Added a "Same Level" option to the multiplayer menu.
- Added the following commands to customize the maplist in the multiplayer menu:
|- menu_addepisode
|- menu_addmap
|- menu_clearmaps

- Created some submenus in the Options menu:
|- Controller options (disabled)
|- Mouse options
|- Gameplay options
|- Audio options
|- Video options

- Added the options "Save setup" (saves makaqu.cfg) and "Load setup" (loads config.cfg/makaqu.cfg) to the Options menu.
- Moved all options, except "Go to console" and "Reset to defaults", from the main options menu to the submenus.
- Moved the "Video modes" menu into the Video options menu.

- The "Player setup" menu is acessible from the Options menu now.
- Added the options "Crosshair" and "Color" (for the crosshair) to the Player Setup menu.
- Removed the "Accept Changes" option from the Player Setup menu.
- Now the settings in the Player Setup menu takes effect when you exit the menu.

- Added the "Walk Speed" and "Strafe Speed" options to the mouse menu.

- Added the following options to the "Gameplay" menu:
|- Aim Assistance
|- Weapon Position
|- View Player Weapon
|- Bobbing
|- Slope Look
|- Renamed the Lookspring option to "Auto Center View"
|- Body View (chase camera)
|- Body View Distance
|- Body View Height

- Added CD player controls to the audio menu:
|- CD music (on/off)
|- Play track (number/total) (left/right changes, enter key/A button plays)
|- Loop (on/off)
|- Pause (on/off)
|- Stop
|- Open drive (won't be in the DC version)
|- Close drive (won't be in the DC version)
|- Reset CD audio (won't be in the DC version)

- Added a Developer menu. Use the menu_developer command or press the X button at the "Go to console" option to go to it.

- Added the following options to the Developer menu:
|- cl_showfps
|- developer
|- registered
|- r_drawentities
|- r_fullbright
|- r_waterwarp
|- d_mipscale
|- gl_polyblend
|- loadas8bit
|- god
|- fly
|- noclip
|- notarget
|- impulse 9
|- timerefresh
|- timedemo



==================================
    Dreamcast-related changes:
==================================

- Added an on-screen keyboard that can be used to edit console commands, chat messages and the player's name.

- In the on-screen keyboard, you can use:
|- The L trigger to input a backspace
|- The R trigger to input a space
|- The X button to use the autocomplete feature in the console
|- The Y button to input the Enter key
|- The A button to input the key under the cursor
|- The B button to close the on-screen keyboard

- Added controller functionality to the console:
|- The up and down buttons scrolls the console
|- the L and R triggers scrolls the console to the bottom and to the top
|- the left and right buttons cycles through the previous entered commands
|- the Y button enters the command
|- the B button closes the console
|- the A button opens the on-screen keyboard

- Added controller functionality to the menu:
|- The start buttons turns the menu off
|- The A button acts as enter, or activates the on-screen keyboard
|- The B button returns to the previous menu (like in commercial games)
|- The X button acts as backspace
|- The Y button is used to confirm in the pop-up dialog boxes

- Added the following options to the "Controller options" menu:
|- Axis X Function
|- Axis Y Function
|- Trigger L Function
|- Trigger R Function
|- Invert Axis X
|- Invert Axis Y
|- Invert Trigger L
|- Invert Trigger R
|- Axis X Deadzone
|- Axis Y Deadzone
|- Trigger L Deadzone
|- Trigger R Deadzone
|- Axis X Sensitivity
|- Axis Y Sensitivity
|- L Sensitivity
|- R Sensitivity
