The Allegro Wiki is migrating to github at https://github.com/liballeg/allegro_wiki/wiki

Monday project

From Allegro Wiki
Jump to: navigation, search

Intro

It's a Monday Project. it started on n http://www.allegro.cc/forums/thread/597566/ Webpage : http://www.zeoxdesign.com/monday/

Getting the game

You need to install Allegro 5 first. Guide for windows Installing_4.9_Windows

Then you need LUA 5.1. Helpful guide for Windows http://lua-users.org/wiki/BuildingLua

Then checkout the monday/trunk dir from SVN


<highlightSyntax language="bash">

 mkdir %your source dir%/monday
 cd  %your source dir%/monday
 SVN co http://svn.miquelfire.com/monday/trunk
 make
 ./monday  

</highlightSyntax>

Alternatively, you can replace make with scons, if you have that installed.

Games & Scripting

Design Team

  • Lead - 23yrold3yrold & Mark Oates

Art

Art page SPOILERS!! Don't go here if you want to enjoy the surprise

Music

WE NEED SOME MUSIC!! - Can we have an overture to play over the menus please? in OGG

Maps

OnlineCop has been assigned the coding task.

File format

Format to be decided by programming team. 23yrold3yrold will make his editor spit out maps accordingly.

Interface

A script should be able to order a map switch.


Entities (Items & Objects & Characters)

  • Entity
    • Lua bindings
    • Set_function(action, function)
    • Set/get position
  • Entity_manager
    • Pick_up
    • Attack
    • Interact
    • Lua bindings
      • Create_entity
      • Destroy_entity

Location

    Map   -  every object is associated with the map it is on.  
    Parent Object -  An object may not be in plain view on the map, but may be  e.g. in a player's inventory
    x,y,z - In terms of the Map renderer or relative to the Parent Object      
    quat rot;  <-- may be handy here too, giving the same properties as LocRot in blender


This class is not in the code so far, but is a candidate to replace the Vector in Item, Character & Player

<highlightSyntax language="cpp"> class Locator { public:

  float Get_angle_256();              /* returns angle (in allegro degrees) on x,y plane from rot */
  void  Set_angle_256(float angle);   /* sets rot to angle (in allegro degrees) */
  float Get_map_distance(Locator& l2);   /* returns distance (in map units) to another locator.  This could be x,y for now */
  Map *   map;     /* Map that the Item is on */  
  Item *  item;    /* parent object.  set for an Item if it is attached to another Item or in a Player's inventory */
  Vector3  xyz;    /* position of Item in parent's axes */
  AL_QUAT  rot;    /* rotation of Item relative to parent */  

} </highlightSyntax>

Item* takes priority over Map* (they should ideally be merged into a single global object). If (item!=NULL) then xyz and rot are in parent-defined coords, otherwise they are in map coords


Inventory

Trezker's TODO

  • Inventory
    • Item management //No, it's pretty different from the Item_manager, so no inheritance please.
  • Inventory menu // Yes, this is a menu. Opened with some button in game.
    • Info about item // On mousover
    • Render function // Layout?
    • Equip // just a click; right click to bind to right mouse button, left to bind to left.
    • Use/Drop item // Low prio, this is not in design

Matt Smith: An inventory can be implemented as a map. An Item's location will have a parent which can be a Map, a Character , or even another Item.

Code

Main Class

At the moment, trunk just instantiates game and lets Game::Run() handle all the initialisation and the main loop

Matt Smith's TODO

  • add command line params to main() - Done in /branches/mattsmith, will merge with trunk asap
  • read system .cfg file or [System] section of monday.cfg
  • move Allegro initialisation from Game.cpp to Main.cpp
  • move main loop to Main. add main_event_t to receive communcation from Game
  • save changes to system .cfg file or [System] section of monday.cfg

Loading and Saving

Trezker's TODO

  • Loading // Can use Init script for now
    • Map
    • Entities


Game Class

Game interface.png


The interface between the Game and the system (Main.cpp) should do the following

<highlightSyntax language="cpp"> class Game() { public:

  Init();      /* This is called before any other Game method */ 
  NewGame(int num_Players);   /* Resets the game state to a new game */
  Run();       /* Sets the game state into power on/ menu mode */        
  Play();      /* Sets the game state into game playing mode */  
  main_event_t Update();    /* This is called once per frame. the return value is used to trigger system events */
  Render();    /* The game draws the current frame onto display */
  int Get_frame_rate();    /* Returns the Games chosen refresh rate.  
                           Main uses this to decide how often to call Update() and Render() */

} </highlightSyntax>


  • MAIN_EVENT_EXIT Game saves .cfg and exits
  • MAIN_EVENT_PAUSE Game requests system goes into paused mode
  • MAIN_EVENT_RESUME Game requests system comes out of paused mode
  • MAIN_EVENT_GAME_REINIT Game requests that it be shut down and reinitialised.
  • MAIN_EVENT_GAME_ERROR Game requests that it be shut down and an error reported.
  • MAIN_EVENT_MENU_SAVEGAME Game requests system savegame manager
  • MAIN_EVENT_MENU_LOADGAME Game requests loadgame
  • MAIN_EVENT_MENU_KEYBOARD Game requests system keyboard preferences manager
  • MAIN_EVENT_MENU_JOYSTICK Game requests system Joystick preferences manager


initialisation

  A list of maps.
  A list of levels.  each level can take place over several maps
  A game state. 

game scripts

Menu Class

Trezker & Matt Smith are making a top level menu system, which will may be configurable by a LUA script

Contributors

  • Trezker
  • OnlineCop

HUD and visuals

The player will see their own health on the HUD.

The player will see weapon-specific information on the HUD as well:

  • Remaining ammo
  • Weapon recharge