Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [SH09] Secret of Fantasy

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
[SH09] Secret of Fantasy
MiquelFire
Member #3,110
January 2003
avatar

The dtou and utod were DJGPP programs. I'm not sure if anything exists in Windows land outside of that.

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Næssén
Member #5,025
September 2004
avatar

bamccaig said:

I beat him in a matter of seconds, IIRC.

codnik said:

Took me a few seconds as well.

I've made an update where I've tweaked Vapor to be more challenging. I've also changed some of the dungeon's sizes to be more challenging.

I included a Code::Blocks project and a CMake file, so compiling should be easy.

I've updated our source package with your CMake file and I've also converted all text files to use Unix line feeds. Thanks for the CMake file Simon!

_____________________
darkbits.org | Google+

bamccaig
Member #7,536
July 2006
avatar

Yes, got it to compile and run. Here's the modified source -- I included a Code::Blocks project and a CMake file, so compiling should be easy.

[bamccaig@rufus build]$ cmake ..
...
[bamccaig@rufus build]$ make
...
[ 98%] Building C object src/CMakeFiles/secret_of_fantasy.dir/dumb/it/itorder.c.o
[ 99%] Building C object src/CMakeFiles/secret_of_fantasy.dir/dumb/it/loadmod.c.o
[100%] Building C object src/CMakeFiles/secret_of_fantasy.dir/dumb/it/itmisc.c.o
Linking CXX executable ../secret_of_fantasy
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../lib64/liballeg-4.2.2.so: undefined reference to `_i_cx_r'
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../lib64/liballeg-4.2.2.so: undefined reference to `_i_is_cpuid_supported'
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../lib64/liballeg-4.2.2.so: undefined reference to `_i_get_cpuid_info'
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../lib64/liballeg-4.2.2.so: undefined reference to `_i_is_486'
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../lib64/liballeg-4.2.2.so: undefined reference to `_i_cx_w'
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../lib64/liballeg-4.2.2.so: undefined reference to `_i_is_cyrix'
/usr/lib/gcc/x86_64-redhat-linux/4.3.0/../../../../lib64/liballeg-4.2.2.so: undefined reference to `_i_is_fpu'
collect2: ld returned 1 exit status
make[2]: *** [secret_of_fantasy] Error 1
make[1]: *** [src/CMakeFiles/secret_of_fantasy.dir/all] Error 2
make: *** [all] Error 2

What am I missing? ???

SiegeLord
Member #7,827
October 2006
avatar

On Linux you are supposed to use allegro-config instead of specifying the library directly.

Specifically, alleg_unsharable library is not linked.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

bamccaig
Member #7,536
July 2006
avatar

SiegeLord
Member #7,827
October 2006
avatar

A small addition in the CMakeLists.txt located in the src subfolder fixed it for me.

LIST(APPEND Src ${SrcGame} ${SrcGuichan} ${SrcDumb})

execute_process(COMMAND allegro-config --libs OUTPUT_VARIABLE LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
link_libraries(${LIBS})
add_executable(secret_of_fantasy ${Src})
set(EXECUTABLE_OUTPUT_PATH ..)

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

bamccaig
Member #7,536
July 2006
avatar

SiegeLord said:

LIST(APPEND Src ${SrcGame} ${SrcGuichan} ${SrcDumb})

Where do SrcGame, SrcGuichan, and SrcDumb come from? ??? I'm guessing I need to define them somehow, but as I said I'm completely unfamiliar with CMake. :P

SiegeLord
Member #7,827
October 2006
avatar

Sorry, what I posted was a handmade diff, heh. Just look at the end of the CMakeLists.txt in question and you'll see what I mean (look at its end).

The modified CMakeLists.txt is attached for your convenience.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

bamccaig
Member #7,536
July 2006
avatar

[bamccaig@rufus build]$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:27 (add_executable):
  add_executable called with incorrect number of arguments


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.6)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
[bamccaig@rufus build]$ cmake -Wno-dev ..
CMake Error at CMakeLists.txt:27 (add_executable):
  add_executable called with incorrect number of arguments


-- Configuring incomplete, errors occurred!
[bamccaig@rufus build]$ 

:'(

Simon Parzer
Member #3,330
March 2003
avatar

I'm not very familiar with CMake either, so I didn't know about the execute_process command. Thanks to SiegeLord for pointing that out.
bamccaig, you have two CMakeLists.txt files, one in the main directory, and one in the src/ subdirectory. Maybe you replaced the wrong one.

Næssén said:

I've updated our source package with your CMake file and I've also converted all text files to use Unix line feeds. Thanks for the CMake file Simon!

Sorry for not telling you right away, as I stated above there are two CMakeLists.txt files, you only included one of them. Also I had to make a few changes to the source code, or it wouldn't compile with GCC.

#SelectExpand
1diff -Naur db-06_secret_of_fantasy-7_src/src/CMakeLists.txt db-06_secret_of_fantasy-7_src_linux/src/CMakeLists.txt 2--- db-06_secret_of_fantasy-7_src/src/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 3+++ db-06_secret_of_fantasy-7_src_linux/src/CMakeLists.txt 2009-07-19 11:36:47.000000000 +0200 4@@ -0,0 +1,29 @@ 5+include_directories(. guichan dumb) 6+ 7+# Game 8+FILE(GLOB SrcMain "*.cpp") 9+FILE(GLOB SrcEntities "entities/*.cpp") 10+FILE(GLOB SrcItems "items/*.cpp") 11+FILE(GLOB SrcGui "gui/*.cpp") 12+LIST(APPEND SrcGame ${SrcMain} ${SrcEntities} ${SrcItems} ${SrcGui}) 13+ 14+# Guichan 15+FILE(GLOB SrcGuichanMain "guichan/*.cpp") 16+FILE(GLOB SrcGuichanAllegro "guichan/allegro/*.cpp") 17+FILE(GLOB SrcGuichanWidgets "guichan/widgets/*.cpp") 18+LIST(APPEND SrcGuichan ${SrcGuichanMain} ${SrcGuichanAllegro} ${SrcGuichanWidgets}) 19+ 20+# DUMB 21+FILE(GLOB SrcDumbAllegro "dumb/allegro/*.c") 22+FILE(GLOB SrcDumbCore "dumb/core/*.c") 23+FILE(GLOB SrcDumbHelpers "dumb/helpers/*.c") 24+FILE(GLOB SrcDumbIt "dumb/it/*.c") 25+LIST(APPEND SrcDumb ${SrcDumbAllegro} ${SrcDumbCore} ${SrcDumbHelpers} ${SrcDumbIt}) 26+ 27+LIST(APPEND Src ${SrcGame} ${SrcGuichan} ${SrcDumb}) 28+ 29+execute_process(COMMAND allegro-config --libs OUTPUT_VARIABLE LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) 30+link_libraries(${LIBS}) 31+add_executable(secret_of_fantasy ${Src}) 32+set(EXECUTABLE_OUTPUT_PATH ..) 33+ 34diff -Naur db-06_secret_of_fantasy-7_src/src/animation.hpp db-06_secret_of_fantasy-7_src_linux/src/animation.hpp 35--- db-06_secret_of_fantasy-7_src/src/animation.hpp 2009-07-10 19:34:08.000000000 +0200 36+++ db-06_secret_of_fantasy-7_src_linux/src/animation.hpp 2009-07-19 11:42:18.000000000 +0200 37@@ -2,6 +2,7 @@ 38 #define DBSH07_ANIMATION_HPP 39 40 #include <vector> 41+#include <string> 42 #include <allegro.h> 43 44 class Animation 45diff -Naur db-06_secret_of_fantasy-7_src/src/entities/chest.hpp db-06_secret_of_fantasy-7_src_linux/src/entities/chest.hpp 46--- db-06_secret_of_fantasy-7_src/src/entities/chest.hpp 2009-07-12 19:29:26.000000000 +0200 47+++ db-06_secret_of_fantasy-7_src_linux/src/entities/chest.hpp 2009-07-19 11:40:49.000000000 +0200 48@@ -13,7 +13,7 @@ 49 void draw(BITMAP *dest, int scrollx, int scrolly); 50 bool isToBeDeleted(); 51 Item* getItem(); 52- Chest::~Chest(); 53+ virtual ~Chest(); 54 55 private: 56 static const int NO_FRAMES_TO_BE_OPEN = 40; 57diff -Naur db-06_secret_of_fantasy-7_src/src/entities/towerdoor.hpp db-06_secret_of_fantasy-7_src_linux/src/entities/towerdoor.hpp 58--- db-06_secret_of_fantasy-7_src/src/entities/towerdoor.hpp 2009-07-13 00:11:58.000000000 +0200 59+++ db-06_secret_of_fantasy-7_src_linux/src/entities/towerdoor.hpp 2009-07-19 11:42:59.000000000 +0200 60@@ -16,7 +16,7 @@ 61 void draw(BITMAP *dest, int scrollx, int scrolly); 62 63 private: 64- std::string TowerDoor::buildGameStateVariableString(); 65+ std::string buildGameStateVariableString(); 66 Animation animation; 67 bool open; 68 std::string targetDungeon; 69diff -Naur db-06_secret_of_fantasy-7_src/src/os.hpp db-06_secret_of_fantasy-7_src_linux/src/os.hpp 70--- db-06_secret_of_fantasy-7_src/src/os.hpp 2009-07-09 21:52:34.000000000 +0200 71+++ db-06_secret_of_fantasy-7_src_linux/src/os.hpp 2009-07-19 11:41:47.000000000 +0200 72@@ -1,3 +1,5 @@ 73+#define DB_DATA_PREFIX "data/" 74+ 75 #if defined (__MINGW32__) 76 #define DB_WIN32 77 #define DB_DATA_PREFIX "data/" 78diff -Naur db-06_secret_of_fantasy-7_src/src/room.cpp db-06_secret_of_fantasy-7_src_linux/src/room.cpp 79--- db-06_secret_of_fantasy-7_src/src/room.cpp 2009-07-13 15:50:26.000000000 +0200 80+++ db-06_secret_of_fantasy-7_src_linux/src/room.cpp 2009-07-19 11:41:28.000000000 +0200 81@@ -18,6 +18,7 @@ 82 #include "resourcehandler.hpp" 83 84 #include <cmath> 85+#include <algorithm> 86 87 Room::Room(TileMap* tileMap, Animation *tileSet) 88 { 89@@ -328,18 +329,18 @@ 90 91 } 92 93-void Room::drawGame(BITMAP *buffer, int scrollX, int scrollY) 94+class EntityComparator 95 { 96- std::vector<Entity *> toDraw(mEntities); 97- 98- class EntityComparator 99- { 100 public: 101 int operator()(Entity *a, Entity *b) 102 { 103 return (a->getY() + a->getHeight()) < (b->getY() + b->getHeight()); 104 } 105- }; 106+}; 107+ 108+void Room::drawGame(BITMAP *buffer, int scrollX, int scrollY) 109+{ 110+ std::vector<Entity *> toDraw(mEntities); 111 112 std::sort(toDraw.begin(), toDraw.end(), EntityComparator()); 113 int drawEntityIndex = 0; 114diff -Naur db-06_secret_of_fantasy-7_src/src/room.hpp db-06_secret_of_fantasy-7_src_linux/src/room.hpp 115--- db-06_secret_of_fantasy-7_src/src/room.hpp 2009-07-13 15:50:26.000000000 +0200 116+++ db-06_secret_of_fantasy-7_src_linux/src/room.hpp 2009-07-19 11:39:11.000000000 +0200 117@@ -167,7 +167,7 @@ 118 BITMAP *mZoomBuffer; 119 120 std::vector<Entity *> mEntities; 121- std::map<Entity::Type, std::vector<Entity *>> mEntitiesByType; 122+ std::map<Entity::Type, std::vector<Entity *> > mEntitiesByType; 123 124 Game* mGame; 125 Player* mPlayer; 126diff -Naur db-06_secret_of_fantasy-7_src/src/stringutil.hpp db-06_secret_of_fantasy-7_src_linux/src/stringutil.hpp 127--- db-06_secret_of_fantasy-7_src/src/stringutil.hpp 2009-07-11 13:07:08.000000000 +0200 128+++ db-06_secret_of_fantasy-7_src_linux/src/stringutil.hpp 2009-07-19 11:40:16.000000000 +0200 129@@ -64,7 +64,11 @@ 130 131 inline std::string toUpperCase(const std::string& str) 132 { 133- return std::string(_strupr((char *)str.c_str())); 134+ std::string str_up(str); 135+ for (unsigned int i=0; i<str_up.size(); ++i) { 136+ str_up[i] = toupper(str_up[i]); 137+ } 138+ return str_up; 139 } 140 141 inline int stringToInt(const std::string &str) {

The following things turned out to be problems:
- MSVC supports class declarations inside functions, GCC doesn't
- MSVC provides _strupr, GCC/ANSI C doesn't
- MSVC tolerates declarations like vector<vector<blah>>, GCC doesn't (>> is an operator)
- MSVC includes modules like <algorithm>, <string> and <vector> by default, GCC doesn't
- MSVC allows additional qualifiers inside class declarations (like int Blah::x inside class Blah{ }), GCC doesn't

On the other hand, there were zero problems concering case sensitive path names on UNIX, which made porting a lot easier than usual.

bamccaig
Member #7,536
July 2006
avatar

I'm not very familiar with CMake either, so I didn't know about the execute_process command. Thanks to SiegeLord for pointing that out.
bamccaig, you have two CMakeLists.txt files, one in the main directory, and one in the src/ subdirectory. Maybe you replaced the wrong one.

My bad. :-[ Thanks both of you. :)

Matthew Leverton
Supreme Loser
January 1999
avatar

I've only briefly played it ... but it was well done.

In terms of rating it as a SpeedHack game, I have a hard time giving it a good score if there was a lot of code re-use and not much attention paid to the rules. But I haven't played it enough to judge it in terms of the rules, nor have I checked to see how much recycled material was included.

So if I get a chance to play it, I'll give you a better review. :-*

Næssén
Member #5,025
September 2004
avatar

you have two CMakeLists.txt files, one in the main directory, and one in the src/ subdirectory.

Ah, I see. I should have known as I'm familiar with CMake, guess I was tired or something. I should really boot up my Linux machine and make a decent source package.

if there was a lot of code re-use and not much attention paid to the rules

There was not a lot of code re-use in this game. In all our Speedhack and TINS entries the engines have always been rewritten from scratch, it's not like we have a finished engine laying around that we use in Speedhack and TINS (as a lot of people seem to believe). Of course we reuse some code like utility code - for handling strings, files and such - and some Guichan widgets - like the dialogue widget. Sometimes we are lucky (perhaps experience is a better term), adding a bomb in this games was very easy as I have written two other games that included a similar bomb (just as you have written a lot of Tetris games). As far as I understand, code reuse is a part of the competition and not something that should make a game less competitive as long as there is a code reuse at a reasonable level. A games code structure is usually very similar, having written a couple of games you get pretty fast at structuring your engine.

The rule we didn't really pay much attention to was the "Fantastically Mundane" rule (although the game is about buying milk, the implementation was quite lame...), all other rules are present. Read our readme file.

We always take these competitions quite seriously and we usually work our asses of during the whole competition. I think we enjoy Speedhack and TINS not so much for the sake of competing, but for having a good excuse for family and friends to sit infront of our computers for 72 hours making silly games :)

_____________________
darkbits.org | Google+

Wilson Saunders
Member #5,872
May 2005
avatar

Fantastic game. I was impressed by both the ambition and the execution of this project. I always looked at RPG's as insane amounts of work, that Team Darkbits put one together for a Speedhack and made it good just boggels the mind. I salute you.

________________________________________________
Play my games at http://monkeydev.com

Næssén
Member #5,025
September 2004
avatar

I've updated the source package with the missing CMakeLists.txt file and with the changes that Simon Parzer did to the code. I managed to get it up and running with my Ubuntu installation (no sound though... which bothers me...). Again, thank you very much Simon!

I always looked at RPG's as insane amounts of work

We did too! I've never done an RPG before but we just couldn't resist the challenge. Most of the game content, all the dungeons, are generated using a custom rand function. Thanks to the generated content we could focus on adding cut scenes, enemies, items and design a couple of custom rooms (like the map, the cut scene rooms and the grocery store) making the game look and feel like an RPG with a lot of content for a Speedhack game. As I've said before, we never got around to play the game through until after the deadline, we relied on the generated content to work (and it did, but we forgot to add a dungeon in the Speedhack version so the game shouldn't be beatable, but thanks to a clever mistake by me letting the player begin with 6 calcium crystal in the inventory there really was no need to look for crystals in the Speedhack version...).

_____________________
darkbits.org | Google+

 1   2   3 


Go to: