Cottage
Cottage is a simple game engine which is implemented on top of HTML5's canvas and audio elements.
Cottage aims to be an easy to use library for web-based game development.
- Cottage source code (HTML, CSS, and JavaScript files) are licensed
under the term of the
GNU Lesser General Public License (GNU LGPL) either version 3 of the license,
or (at your option) any later version as published by the Free Software Foundation.
- Cottage documentation files are licensed under the the term of the
GNU Free Documentation License (GNU FDL) either version 1.3 of the license, or
(at your option) any later version as published by the Free Software Foundation.
- Cottage media files (image, audio, etc.) are licensed under the term
of the
GNU General Public License (GNU GPL) either version 3 of the license, or
(at your option) any later version as published by the Free Software Foundation.
Cottage's Patch-based renderer was originally developed based on the code from:
Features
These features are currently available in the library:
- Graphics system:
- Scene renderer:
- Backend:
- Patch-based software renderer on top of HTML5's canvas element; or
- WebGL-based renderer for supported browsers and video cards.
- Wall rendering with texture and solid color.
- Sky rendering with texture, color gradient, and solid color.
- Floor rendering with texture, color gradient, and solid color.
- Sprite with image-array-based and strip-based animations.
- Map-wide particle system (for snow, rain, etc.).
- World map presenter.
- Status presenter (for HP, MP, etc.).
- Dialog presenter with simple theming support for presenting common dialogs:
- Message box.
- Choice box.
- Definition box.
- Shop box.
- List box.
- Extended list box.
- Grid list box.
- Selector box.
- Equipment box.
- Memo box.
- Formation box.
- Horizontal rolling-menu box.
- Progress bar.
- Cyclic progress bar.
- Effect presenter; currently available effects:
- Wipe to color.
- Fade to color.
- Explode to color.
- Wave.
- Mosaic.
- Motion blur.
- Managers:
- Image loader/manager.
- Static sprite manager.
- Dynamic sprite manager.
- Scene manager with passive triggers.
- Overlay-object manager.
- Support for WebGL in Internet Explorer 9 via IEWebGL.
- Sound system:
- Sound playback using HTML5's audio element.
- Sound loader/manager.
- Game-development system:
- Game-rules classes:
- State-Trait modifier and modifier-list.
- Equipment and equipment-list.
- Item and item-list.
- Key-item and key-item-list.
- Ability and ability-list.
- Player and player-list.
- Enemy and enemy-list.
- NPC (inn, shop, story).
- Treasure-box.
- Character mappers (for player, enemy, NPC, treasure-box, and save-point).
- Transition rules (for scene to scene, site to world-map, and world-map to site).
- A high-level container class for all the above classes.
- Game-states classes:
- Player.
- Enemy.
- A save-able state class that also act as a high-level container for the above two classes.
- A strategic-turn-based-mode battle engine that can be controlled through callback functions.
- Integration system:
- Standard event handlers for common keyboard and mouse events.
- A simple application class and a game-application class to simplify game development using the library.
- Common game-dialogs (integrating the game-rules and game-states classes with the rest of the system):
- Dialog box for browsing the owned key-items.
- Dialog box for browsing the owned equipments.
- Dialog box for buying and selling items.
- Dialog box for buying and selling equipments.
- Dialog box for buying and selling abilities.
- Dialog box for using items from the party's inventory.
- Dialog box for using abilities owned by the players.
- Dialog box for attaching abilities to players.
- Dialog box for changing the players' equipments.
- Dialog box for changing the party's members.
- Dialog box for changing the party's formation.
- An XML-HTTP request (AJAX) class and the related convenience-functions.
- Support for internationalization and localization.
- Some other convenience-utilities.
A high-level utility application (Cottage Designer) is also provided. This application can be used to
manage and/or edit sound, image, sprite, character, battle-effect, battle-formation, scene, site, world map,
and game-rules (entities, mappers, and transition-rules).
Cottage has been tested with most of the major browsers. It should work correctly in Google Chrome 5.x+,
Mozilla Firefox 3.6.x+, Opera 10.6x+, and Internet Explorer 9rc+ (with and without
IEWebGL).
Currently, Google Chrome produces the best result and performance.
Konqueror 4.3.x (with WebKit v527.x rendering engine) may not be able to play any audio. Internet Explorer 9rc
may produce erratic layout and/or behavior when running Cottage Designer. Also, the keyboard and mouse sometimes seems
to be frozen when running the test applications (the test applications do not respond to any user input). In this case,
you will need refresh the page.
Classic Internet Explorer (IE 8/7/older) is not supported.
If you are using Google Chrome, you can start the browser with the command line option
--allow-file-access-from-files so that it allows AJAX requests and cross-scripting to local disk and file.
If you are using Mozilla Firefox 5.x and WebGL no longer can load textures from local files, you may have hit a Firefox bug.
Try to go to
about:config and set the value of
security.fileuri.strict_origin_policy to
false. Acording to this
MozillaZine's Knowledge Base, same directory
or sub-directory counts as same origin (even when
strict_origin_policy is set to
true). However,
early releases of Firefox 5 seem to have bugs that causes
file:// URIs to be treated differently for WebGL
textures than for other things for which same-origin restrictions apply.
Key assigment in the test applications may conflict with the keyboard shortcuts in some