CAX Dependencies

From EQUIS Lab Wiki

Jump to: navigation, search


This page lists the compile dependencies of the Life is a Village game. See Will's Notes for more information about project.

Contents

Programming Language

This project will be coded in C/C++.

  • Compilers / IDEs:
    • MS Visual Studio .NET 2003 (main compiler)
    • Free Dev-C++ IDE including Windows port of the GCC compiler (MinGW).
    • Free Code::Blocks IDE, which can also be used with MinGW.
    • Borland has also released their ix86 compiler for free. Download a copy of their command line tools (no IDE) here.

Programming References

Coding Conventions

  • Defined types and classes are in title case (e.g., TProtocol, LoggerLevel, etc.).
  • Constants are in all caps (e.g., LOG_DEBUG).
  • Functions and variables all begin with lowercase letters (e.g., getLogger()).
  • Member variables all begin with m- (e.g., mComPortHandle), flags with f- (e.g., fGotLastButtonPress), and static variables with s- (e.g., sSingletonLoggerPtr).

Code Documentation

Code will be documented using Doxygen. You can view the generated documentation on this site.

Doxygen works very much like Javadoc (in fact, it is completely compatible with JavaDoc and will document Java classes happily); it is also heavily used to document C/C++, STL, Objective-C, IDL and others. The manual is quite complete and is available from the main web site.

Version Control

We are using Subversion for version control. Subversion is an open-source version control system to replace CVS.

TortoiseSVN is a version-control plugin for Windows Explorer like Tortoise for CVS, except for subversion.

Our subversion server is running on svn://dundee.cs.queensu.ca. My notes on the install are here: How to set up Subversion on Linux.

Graphics Library

This project will use the OGRE rendering engine for all 3D processing. See the Installing Ogre page for instructions on getting OGRE up and running.

  • Green-Eyed-Monster is one of the more gung-ho developers for OGRE out there. His site has lots of code samples and notes on integrating OGRE with ODE, a GPL physics engine.

Setting up PLSM2

The Paging Landscape Scene Manager is an OGRE plugin that handles memory management, loading and display of really large terrain data sets.

An introduction to splatting

Required Files

PLSM is distributed from this site.

  1. Getting the source: download the Paging Landscape Scene Manager source from the OGRE CVS (howto), or there is a binary package available on the PLSM site (link above).
  2. Make sure that you download the demo maps from the site above and put them into media/paginglandscape/datasrcs.
  3. Build everything (instructions are here)
  4. Run MapSplitter: run the mapsplitter program from the PLSM/ogrenew/Tools/Common/bin/release directory to build the scene pages. You don't need the front-end for this.
  5. Try the demo program.

Build Problems

  • Under Ogre 1.0.1, Visual Studio isn't compiling the Direct3D9 RenderSystem under Release build settings; this is caused by some kind of linker error ... Googling LNK2019 will return a list of similar problems, maybe involving Unicode compatibility?
RenderSystem_Direct3D9 error LNK2019: unresolved external symbol
_IID_IDirect3DBaseTexture9 referenced in function "protected: void
__thiscall Ogre::D3D9Texture::_loadCubeTex(void)"
(?_loadCubeTex@D3D9Texture@Ogre@@IAEXXZ)
You can fix this problem by simply commenting out the Direct3D9 line in the plugins.cfg file. This problem was not observed on upgrade to Ogre 1.0.2.
  • The PLSM2 code in the Ogre CVS assumes that you've built and installed the NatureSceneManager. Either download and compile the NatureSceneManager Plugin, or else remove the reference to it out of the plugins.cfg file in the PLSM2/ogrenew/Samples/Common/bin/Release directory.
  • The MapSplitter tool must be run on the downloaded data sources before the PLSM2 plugin will work. The easiest way is to run the Mapsplitter.exe executible in the /ogrenew/Tools/Common/bin/Release directory, which is, I believe, the way it is intended to be used. You can also put the MapSplitter.exe file (from /ogrenew/Tools/MapSplitter/bin/Release) into the /ogrenew/Samples/Common/bin/Release directory; the files resources.cfg, plugins.cfg and maptool.cfg should be present in this directory also. Getting thie mapsplitter tool to work requires a bit of fiddling. In particular, the following error
-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: PagingLandScapeOptions::load
Description: You need to define a GroupName where to find the map definition file . 
File: \Ogre\Ogre-1.0.2\ogrenew\PlugIns\PagingLandScape2\src\OgrePagingLandScapeOptions.cpp
Line: 185
Stack unwinding: <<beginning of stack>>
can occur when the maptool.cfg file is copied from the /ogrenew/Tools/MapSplitter folder (this copy of the file is stale and outdated); the correct file is placed in /ogrenew/Samples/Common/bin/Release when you install the PLSM2 plugin from CVS, or there is another copy in /ogrenew/Tools/Common/bin/Release.
  • Projects that use the paging landscape manager plugin's features (those that are unique to PLSM2 and don't override SceneManager functions) need to link against the PLSM2 library. This file is called Plugin_PagingLandScapeSceneManager2.lib and is located in /ogrenew/PlugIns/PagingLandScape2/bin/Debug (or .../Release).
  • On older versions of the PLSM2, I was unable to use the PLSM listener manager just mentioned. Updating to CVS code fixed this problem.

Cosmetic Problems

The ATI cards that we have do something strange to scene tiles when using the OpenGL RenderSystem if vertex morphing is turned on. Make sure that each paged landscape .cfg file contains the instruction

VertexProgramMorph=no

or else use Direct3D9, which is able to fix this problem.

Input Library

Simple DirectMedia Layer

Game input will be managed using the Simple DirectMedia Layer, a cross-platform GPL'd multimedia library.

We're using version 1.2.8 of the SDL library. This library can be found in the concept\Dependencies folder in the subversion repository and should compile and build properly using a current version of the project. If the linker complains a lot about SDL-related stuff, add SDLmain.lib to the linker dependencies.

Installing pThreads on Win32

Our Tunturi bicycle interface code is buffered using the pthreads library. The sourceforge site for the Win32 port of the pthreads library (Posix threads) can be found here.

pThreads for win32 comes in several different flavours. We're using the straight-C no-exception-handling version of the library for maximum compatibility with other programming environments, which has the suffix C2.

The pthreads library has been added to the concept\Dependencies directory of the subversion repository, and the concept application should find it and compile and build properly using a current version of our project.

Game Data I/O

Taking my cue from Sinbad's XMLConverter tool in the OGRE project, I have started using the TinyXML parser for loading game object data at runtime (Sourceforge site).

The TinyXML headers and source are for now included directly in the project source and include directories in the Subversion repository.

Sound Library

The OpenAL Library looks ideal as a cross-platform sound API. It is designed as a complement to OpenGL, and all audio functionality is implemented in a 3D virtual space.

The OpenAL library has been added to the concept\Dependencies directory of the subversion repository, and the concept application should find it and compile and build properly using a current version of our project.

Tools I'm Using

I thought it might be a good idea to briefly list the tools that I'm using every day for coding, debugging, and creating game content.

  • The GIMP
    The Gimp is the GNU Image Manipulation Program, an open-source graphics editor that must surely replace Adobe Photoshop eventually. Other free graphics editing programs:
    • Paint.NET is a simple open-source image editor for windows
    • Inkscape is a free Scalable Vector Graphics (SVG) editor for Windows and Linux
    • POV-Ray is a very popular free raytracer for Windows, Linux and Mac
    • Context Free is a cool program that renders images from a user-defined grammar
    • DaFont is a site listing a large collection of free TrueType fonts
  • Python
    Python is an easy-to-learn object-oriented interpreted programming language with a very consise syntax similar to Java or C. I use Python scripts to create and manipulate image files, convert 3d mesh file formats, and process large XML files.
    • The Python Imaging Library (PIL) is a library for manipulating pixel data and reading/writing a number of common graphics file formats.
    • PyOpenGL is a project that allows OpenGL calls to be made from inside Python
    • wxPython is a Python port of the wxWidgets cross-platform GUI library
    • The CGKit project contains a number of functions to create, manipulate and render 3D data.
    • The pyMedia library allows you to manipulate, decode and encode media formats for sound and video data.
    • PyOgre is a library binding OGRE into Python, so that Ogre applications can be rapidly set up and tested using Python code. Clay is working on a Python module inside OGRE that would allow OGRE to be scripted using Python code.
    • Pyrex is a hybrid of Python and C for writing native-executable Python modules quickly.
  • Poseidon for UML
    is a Java-based source code prototyping tool. You can diagram classes in UML, and have Poseidon generate the Java source code for you. I'm just using it for the pretty pictures.
  • Diagramming Software
    Other pretty pictures on the site were made with Microsoft Visio, but that's definitely not free. Dia is an open-source replacement (which I haven't test-driven). There's a Windows installer here.
  • Cygwin
    Being rather uneasy about living on a 32-bit Wintel platform, I put on the Cygwin package, which is a set of tools and libraries to emulate Linux on a Windows system.
    • For Mac users using Windows who really miss their Mac desktop, check out the very impressive Fly A Kite, a Mac OS X Aqua-style theme for windows.
  • Report Analysis and Typesetting
    • MiKTeX is a LaTeX distribution for windows.
      • TeXnicCenter is an editor/shell for Latex
      • WinTeX is an editor built to use the MiKTex distribution.
      • GNU Texmacs is a GPL WYSIWYG LaTeX editor for linux and windows
      • LyX is another WYSIWYG editor, for linux and mac os x
    • Gnumeric is a spreadsheet program like MS Excel
    • GnuPlot is an open-source graphing package
    • GraphViz is a tool for drawing flowcharts and graphical diagrams