{"id":241,"date":"2010-05-08T22:29:35","date_gmt":"2010-05-09T01:29:35","guid":{"rendered":"http:\/\/rockbot.upperland.net\/?page_id=241"},"modified":"2015-05-09T10:34:56","modified_gmt":"2015-05-09T13:34:56","slug":"dev-tutorial","status":"publish","type":"page","link":"https:\/\/rockbot.upperland.net\/?page_id=241","title":{"rendered":"Dev Guide"},"content":{"rendered":"<p>This is a guide for people willing to develop Rockbot in several platforms.<\/p>\n<div id=\"_mcePaste\" style=\"padding: 0px; margin: 0px;\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div id=\"_mcePaste\" style=\"padding: 0px; margin: 0px;\"><strong>BUILD INSTRUCTIONS<\/strong><\/div>\n<div id=\"_mcePaste\" style=\"padding: 0px; margin: 0px;\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div><strong>Linux:<\/strong><\/div>\n<p>Packages needed:<\/p>\n<ul>\n<li>Qt Creator 2.0 beta1 or later: <a href=\"http:\/\/qt.nokia.com\/developer\/qt-qtcreator-prerelease\">http:\/\/qt.nokia.com\/developer\/qt-qtcreator-prerelease<\/a><\/li>\n<li>SDL<\/li>\n<li>SDL_ttf<\/li>\n<li>SDL_image<\/li>\n<li>SDL_mixer<\/li>\n<\/ul>\n<p>In Ubuntu, just type:<\/p>\n<ol>\n<li><em>sudo apt-get install build-essential libsdl1.2debian libsdl1.2debian-dev\u00a0libsdl-image1.2 libsdl-image1.2-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev<\/em><\/li>\n<\/ol>\n<p>Ubuntu normally ships with an old version of Qt Creator, download the newest from\u00a0<a style=\"font-size: 0.8em; line-height: normal;\" href=\"http:\/\/qt.digia.com\/\">http:\/\/qt.digia.com\/<\/a>\u00a0and install it from terminal<span style=\"font-size: 0.8em;\">:<\/span><\/p>\n<ol>\n<li>chmod +x qt-creator-linux-x86-opensource-2.0.0-beta1.bin<\/li>\n<li>.\/qt-creator-linux-x86-opensource-2.0.0-beta1.bin<\/li>\n<\/ol>\n<p>Download source from this site, or from svn:\u00a0https:\/\/svn.code.sf.net\/p\/rockbot-game\/code\/v1.<\/p>\n<p>Now run Qt Creator and open the cpp_rockbot.pro file inside the rockbot (v1) folder you created, then the Rockbot_Editor.pro in editor folder, click on project button, check and change it to build folder or copy the build\/data folder to <span style=\"font-size: 0.8em;\">where project is configured to be built into.<\/span><\/p>\n<p>The qmake project cpp_rockbot.pro, contains a section with CONFIG flags to build for several platforms, if your computer have the corresponding SDK installed on it, just uncomment the desired one and comment out all the rest, run qmake again on the IDE and rebuild to have binaries for other systems.<\/p>\n<div id=\"_mcePaste\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div id=\"_mcePaste\"><strong>PROJECT STRUCTURE<\/strong><\/div>\n<div id=\"_mcePaste\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div id=\"_mcePaste\">Rockbot is divided in three parts:<\/div>\n<div id=\"_mcePaste\">\n<ol>\n<li>game is the game-engine that uses the SDL library<\/li>\n<li>editor is game data editor, that uses the Qt 4.X library<\/li>\n<li>editor\/conversor is a command line utility used to copy game data to a new format, if needed<\/li>\n<\/ol>\n<\/div>\n<div id=\"_mcePaste\">All of those are edited with QtCreator and have a project made with it, we recommend it as editor, but you can also use any other, since you can generate Makefiles from the qmake project,\u00a0thus, the IDE use is not mandatory.<\/div>\n<div><\/div>\n<div><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div id=\"_mcePaste\"><strong>DATA STRUCTURE<\/strong><\/div>\n<div id=\"_mcePaste\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div id=\"_mcePaste\">the project files are stored in the bin\/data folder, with the following structure:<\/div>\n<div id=\"_mcePaste\">\n<ul>\n<li><strong>build<\/strong> &#8211; contains binaries for game, editor and conversor, plus data files\n<ul>\n<li><strong>data<\/strong> &#8211; contains game data\n<ul>\n<li><strong>fonts<\/strong>\u00a0&#8211; holds the ttf fonts used in the game<\/li>\n<li><strong>game\u00a0<\/strong>&#8211; holds game and stages data files<\/li>\n<li><strong>images<\/strong>\u00a0&#8211; hold all images, sprites and tilesets\n<ul>\n<li><strong>backgrounds<\/strong>\u00a0&#8211; holds image files for backgrounds like menu and stage select<\/li>\n<li><strong>faces<\/strong>\u00a0&#8211; npc, character and boss faces and logos<\/li>\n<li><strong>map_backgrounds<\/strong> &#8211; used for parallax effect or static background<\/li>\n<li><strong>projectiles<\/strong> &#8211; sprites for the weapons and projectiles<\/li>\n<li><strong>scenes<\/strong>\u00a0&#8211; scenes for intro and storyline<\/li>\n<li><strong>sprites<\/strong>\u00a0&#8211; holds sprites for players, enemies and bosses\n<ul>\n<li><strong>backgrounds<\/strong> &#8211; for large NPCs, contains a static background used altogether with the sprites<\/li>\n<li><strong>enemies<\/strong>\u00a0&#8211; should be dropped, and all files must be in it&#8217;s parent folder<\/li>\n<li><strong>objects<\/strong> &#8211; all object sprites<\/li>\n<\/ul>\n<\/li>\n<li><strong>tilesets<\/strong>\u00a0&#8211; contains scenary tilesets and special effects animation (ready message, explosions) graphics<\/li>\n<\/ul>\n<\/li>\n<li><strong>music<\/strong>\u00a0&#8211; holds mp3 background music files and it&#8217;s licenses notes<\/li>\n<li><strong>sfx<\/strong>\u00a0&#8211; holds wave sound files with sound effects<\/li>\n<\/ul>\n<\/li>\n<li><strong>packages<\/strong> &#8211; scripts for generating release packages for several platforms<\/li>\n<\/ul>\n<\/li>\n<li><strong>character<\/strong> &#8211; all classes related to players and NPCs<\/li>\n<li><span style=\"font-size: 12px;\"><b>docs &#8211; <\/b>some information and game manual<\/span><\/li>\n<li><strong>editor<\/strong> &#8211; contains the editor and conversor projects\n<ul>\n<li><strong>conversor<\/strong> &#8211; data conversion utility<\/li>\n<li><strong>mainwindow_tab<\/strong> &#8211; individual components for each tab in editor<\/li>\n<li><strong>resources<\/strong> &#8211; images and icons used in the editor GUI<\/li>\n<\/ul>\n<\/li>\n<li><strong>file<\/strong> &#8211; classes that handle file format (game data structure) and I\/O<\/li>\n<li><strong>graphic<\/strong> &#8211; some classes that handle showing graphics, menus, cursor and other visual elements<\/li>\n<li><b>objects<\/b> &#8211; classes related to objects<\/li>\n<li><strong>options<\/strong> &#8211; classes that hold and change game options<\/li>\n<li><strong>ports<\/strong> &#8211; files that are needed by some particular systems\/devices<\/li>\n<li><strong>scenes<\/strong> &#8211; classes related to game intro, dialogs and ending<\/li>\n<\/ul>\n<\/div>\n<div><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div id=\"_mcePaste\"><strong>BASIC GAME SOURCE STRUCTURE<\/strong><\/div>\n<div id=\"_mcePaste\"><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/strong><\/div>\n<div><\/div>\n<div>(@TODO: use graphic to describe character(player, npc) and game (stage, map) structure)<\/div>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<strong>GRAPHICS FORMAT<\/strong><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<div style=\"background-image: url('http:\/\/rockbot.upperland.net\/wp-content\/themes\/mystique\/images\/main-left.jpg'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font: normal normal normal 13px\/19px Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; font-style: normal; color: #4e4e4e; min-height: 380px; line-height: normal; background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px;\">\n<p style=\"line-height: 19px; padding: 0px; margin: 0,6em 0px 0,3em 0px;\">Each tile (part that composes the tileset, used to render the background) have a size of 16&#215;16 pixels.<\/p>\n<p style=\"line-height: 19px; padding: 0px; margin: 0,6em 0px 0,3em 0px;\">A boss or stage enemy can have any width, but height must be multiple of 16 (16, 32, 48, etc)<\/p>\n<p style=\"line-height: 19px; padding: 0px; margin: 0,6em 0px 0,3em 0px;\">The image files are in PNG format (with the given palette).<\/p>\n<p style=\"line-height: 19px; padding: 0px; margin: 0,6em 0px 0,3em 0px;\">There is no need to separate parts for the sprites, we are using complete animation frames (each frame is the whole picture).<\/p>\n<p style=\"line-height: 19px; padding: 0px; margin: 0,6em 0px 0,3em 0px;\">Boss\/players faces are of size 32&#215;32 pixels.<\/p>\n<p style=\"line-height: 19px; padding: 0px; margin: 0,6em 0px 0,3em 0px;\">Some examples and a reference to our palette (in RBG). Please note that the last 3 colors are used for effects of color-cycling.<\/p>\n<p style=\"line-height: 19px; padding: 0px; margin: 0,6em 0px 0,3em 0px;\"><a href=\"http:\/\/sourceforge.net\/p\/rockbot-game\/code\/825\/tree\/v1\/build\/data\/nes.gpl\">Color Palette<\/a><\/p>\n<div id=\"attachment_798\" style=\"width: 186px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/palette.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-798\" class=\"size-full wp-image-798 aligncenter\" src=\"http:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/palette.png\" alt=\"Colors\" width=\"176\" height=\"44\" \/><\/a><p id=\"caption-attachment-798\" class=\"wp-caption-text\">Colors<\/p><\/div>\n<p style=\"text-align: center;\">\n<div id=\"attachment_799\" style=\"width: 755px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/default1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-799\" class=\" wp-image-799  \" src=\"http:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/default1.png\" alt=\"Tileset\" width=\"745\" height=\"77\" srcset=\"https:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/default1.png 1552w, https:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/default1-180x18.png 180w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/a><p id=\"caption-attachment-799\" class=\"wp-caption-text\">Tileset<\/p><\/div>\n<\/div>\n<p style=\"text-align: center;\">\n<div style=\"background-image: url('http:\/\/rockbot.upperland.net\/wp-content\/themes\/mystique\/images\/main-left.jpg'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font: normal normal normal 13px\/19px Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; font-style: normal; color: #4e4e4e; min-height: 380px; line-height: normal; background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px;\">\n<div id=\"attachment_800\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/apebot1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-800\" class=\"size-full wp-image-800\" src=\"http:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/apebot1.png\" alt=\"Apebot's sprites\" width=\"560\" height=\"78\" srcset=\"https:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/apebot1.png 560w, https:\/\/rockbot.upperland.net\/wp-content\/uploads\/2010\/05\/apebot1-180x25.png 180w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-800\" class=\"wp-caption-text\">Apebot&#8217;s sprites<\/p><\/div>\n<p style=\"text-align: center;\">\n<p style=\"line-height: 19px; padding: 0px; text-align: center;\">\n<p style=\"line-height: 19px; padding: 0px; text-align: center;\">\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is a guide for people willing to develop Rockbot in several platforms. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; BUILD INSTRUCTIONS &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Linux: Packages needed: Qt Creator 2.0 beta1 or later: http:\/\/qt.nokia.com\/developer\/qt-qtcreator-prerelease SDL SDL_ttf SDL_image SDL_mixer In Ubuntu, just type: sudo apt-get install build-essential libsdl1.2debian libsdl1.2debian-dev\u00a0libsdl-image1.2 libsdl-image1.2-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev Ubuntu normally ships with an old version of Qt Creator, download the newest from\u00a0http:\/\/qt.digia.com\/\u00a0and install it from terminal: chmod +x qt-creator-linux-x86-opensource-2.0.0-beta1.bin .\/qt-creator-linux-x86-opensource-2.0.0-beta1.bin Download source from this site, or from svn:\u00a0https:\/\/svn.code.sf.net\/p\/rockbot-game\/code\/v1. Now run Qt Creator and open the cpp_rockbot.pro file inside the rockbot (v1) folder you created, then the Rockbot_Editor.pro in editor folder, click on project button, check and change it to build folder or copy the build\/data folder to where project is configured to be built into. The qmake project cpp_rockbot.pro, contains a section with CONFIG flags to build for several platforms, if your computer have the corresponding SDK installed on it, just uncomment the desired one and comment out all the rest, run qmake again on the IDE and rebuild to have binaries for other systems. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; PROJECT STRUCTURE &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Rockbot is divided in three parts: game is the game-engine that uses the SDL library editor is game data editor, that uses the Qt 4.X library editor\/conversor is a command line utility used to copy game data to a new format, if needed All of those are edited with QtCreator and have a project made with it, we recommend it as editor, but you can also use any other, since you can generate Makefiles from the qmake project,\u00a0thus, the IDE use is not mandatory. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; DATA STRUCTURE &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; the project files are stored in the bin\/data folder, with the following structure: build &#8211; contains binaries for game, editor and conversor, plus data files data &#8211; contains game data fonts\u00a0&#8211; holds the ttf fonts used in the game game\u00a0&#8211; holds game and stages data files images\u00a0&#8211; hold all images, sprites and tilesets backgrounds\u00a0&#8211; holds image files for backgrounds like menu and stage select faces\u00a0&#8211; npc, character and boss faces and logos map_backgrounds &#8211; used for parallax effect or static background projectiles &#8211; sprites for the weapons and projectiles scenes\u00a0&#8211; scenes for intro and storyline sprites\u00a0&#8211; holds sprites for players, enemies and bosses backgrounds &#8211; for large NPCs, contains a static background used altogether with the sprites enemies\u00a0&#8211; should be dropped, and all files must be in it&#8217;s parent folder objects &#8211; all object sprites tilesets\u00a0&#8211; contains scenary tilesets and special effects animation (ready message, explosions) graphics music\u00a0&#8211; holds mp3 background music files and it&#8217;s licenses notes sfx\u00a0&#8211; holds wave sound files with sound effects packages &#8211; scripts for generating release packages for several platforms character &#8211; all classes related to players and NPCs docs &#8211; some information and game manual editor &#8211; contains the editor and conversor projects conversor &#8211; data conversion utility mainwindow_tab &#8211; individual components for each tab in editor resources &#8211; images and icons used in the editor GUI file &#8211; classes that handle file format (game data structure) and I\/O graphic &#8211; some classes that handle showing graphics, menus, cursor and other visual elements objects &#8211; classes related to objects options &#8211; classes that hold and change game options ports &#8211; files that are needed by some particular systems\/devices scenes &#8211; classes related to game intro, dialogs and ending &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; BASIC GAME SOURCE STRUCTURE &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; (@TODO: use graphic to describe character(player, npc) and game (stage, map) structure) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; GRAPHICS FORMAT &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; Each tile (part that composes the tileset, used to render the background) have a size of 16&#215;16 pixels. A boss or stage enemy can have any width, but height must be multiple of 16 (16, 32, 48, etc) The image files are in PNG format (with the given palette). There is no need to separate parts for the sprites, we are using complete animation frames (each frame is the whole picture). Boss\/players faces are of size 32&#215;32 pixels. Some examples and a reference to our palette (in RBG). Please note that the last 3 colors are used for effects of color-cycling. Color Palette<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":2,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-241","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=\/wp\/v2\/pages\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=241"}],"version-history":[{"count":16,"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=\/wp\/v2\/pages\/241\/revisions"}],"predecessor-version":[{"id":989,"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=\/wp\/v2\/pages\/241\/revisions\/989"}],"wp:attachment":[{"href":"https:\/\/rockbot.upperland.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}