Compiling and Using the Flare Engine
Hi there!
I am trying to compile the Flare Engine in Microsoft Visual Studio 2010. Everything is properly linked and compiles with no errors, but when I go to run the program it loads a blank application window and immediately stops working (even using a .bat file). I think it has to do with some of the "warnings" Visual Studio produces while compiling, so this might not be the right place to ask about them. I'm also new to using MS Visual Studio C++, and I'm sure my lack of knowledge is definitely a factor here.
These are all variations of the warnings (C4305, C4355, C4244, C4800) it gives me:
- Enemy.cpp(68): warning C4355: 'this' : used in base member initializer list
- FontEngine.cpp(63): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
- GameStateConfig.cpp(634): warning C4244: '=' : conversion from 'Sint16' to 'Uint8', possible loss of data
- GameStateConfig.cpp(636): warning C4244: '=' : conversion from 'Uint16' to 'Uint8', possible loss of data
- GameStateConfig.cpp(857): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
- LootManager.cpp(77): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
- MapCollision.cpp(308): warning C4244: 'argument' : conversion from 'double' to 'const float', possible loss of data
- PowerManager.cpp(417): warning C4305: 'initializing' : truncation from 'double' to 'float'
- WidgetListBox.cpp(461): warning C4244: 'initializing' : conversion from 'float' to 'unsigned int', possible loss of data
I would also like to know more about the Flare Engine. When it's up and running on my computer, what will it look like? Is it the base Flare game but with source for modding, or something else entirely? And are there some documentation/guides for modding Flare? I found a couple old threads on the topic, but I do not know if they are outdated or not.
Thanks so much for your time!
If you just compile the engine, it'll look like nothing. You need at least one mod ("default," comes in the guthub repository) to get the title screen. You can't actually get into the game with just that mod though - all of the graphics are in fantasycore. and maps are in aphademo, both in Flare-game.
Because the engine is still in alpha, documentation tends to become out of date very quickly, but there is some on the flare-game wiki. I'm working up (slowly) a guide to making an entire game from-scratch. Otherwise, your best bet (for now) is to download flare-game, look through the mods/ files, and see what does or doesn't make sense.
I personally started (at 0.15, so late to the game, buh dum ching) modding a couple of enemies to see how it worked, and then adding some enemies, and some quests. Feel free to ask any specific questions here as well, or in IRC.
makrohn's correct, you at least need the mod/default folder to run the engine. For Windows purposes you should have your flare.exe and your mods folder in the same parent folder.
When you run Flare with just the default mod it will look plain grey, something like this:
http://flarerpg.org/images/screenshots/0041.jpg
Those warnings aren't a big deal, those are warning about possible loss of precision when converting values. We fix those up as we find them.
Check to see if your executable is creating a stderr.txt file -- this will contain various error messages that will often let you know why the engine decided to quit (usually a file not found). If you're not getting a stderr.txt file, you may want to run flare.exe from command-line. Just during dev where it's easy to break things.
For most people, modding flare is changing the game data or making new game data. E.g. Polymorphable is a game made with 99% just changing the data files. We're lacking in these kinds of tutorials because we're still in Alpha and making major changes -- once we hit Beta we will "freeze" (e.g. "nail down") these features so that we can make tutorials etc. For now feel free to post questions here on the forum, hop onto irc freenode #flare-rpg, post an Issue to GitHub, or contact one of us directly.
If you get ambitious there might be features you want to add by actually changing the source code. If your changes are good enough and general enough, we may like to merge them back into the main engine.
Thanks for the informative responses!
I only had default in my mods folder, so I've copied fantasycore and alpha_demo over as well. I also made sure that flare.exe and the mods folder are in the same parent folder.
Flare.exe is generating stderr and sddout, and stderr said it was unable to find classes.txt in /engine. I wasn't positive which /engine it meant, so I added a blank classes.txt file in the engine folder of both fantasycore and default. Same thing as before happened when I tried to run the application, except now stderr is empty.
Sounds like modding is pretty straight-forward, and I definitely want to try editing the data files as well as taking a stab at the actual code. Flare is the largest C++ program I have worked with as of now, so I'm looking forward to what it can teach me. I just have to get the Engine working first.
I've tested on my end with just the "default" mod.
It says "Unable to open engine/classes.txt!" in my stderr (it's a new feature we're working on) but the game should continue to run without it (we'll actually remove that warning message, it's not necessary).
When I run this I get the default title screen, not an early exit.
Can you tell if the engine is actually crashing or just quitting early? (usually if it's a crash Windows will give a pop-up message that it's looking for a solution, at least on Win7). If it's a crash there may be something not properly initialized in new code that we're working on.
If you're playing with the latest source instead of the latest release tag (0.17.1), make sure your source is up to date. I think the current master is relatively stable (but that isn't always the case, depending on what we're reworking).
The stderr feature is a great idea. It will be very helpful to see, in the program's own user-friendly terms, exactly what is happening when Flare is loaded.
The engine is actually crashing. Windows brings up standard "This program has stopped working" dialog almost instantaneously. I am playing with 0.17.1, and using 0.16-1212 for the engine, which I believe is also the newest release.
"using 0.16-1212 for the engine"
That may be the issue. I see now the flare-engine repo only has old tags. If you downloaded v0.16.zip from github/flare-engine you'll be using an out of date version.
Try downloading the very latest engine code from github with this link:
https://github.com/clintbellanger/flare-engine/zipball/master
But that's if you plan on making a completely new game or total conversion. If you want to start with the existing flare game and mod it, you should do that entirely from the "flare-game" repo.
https://github.com/clintbellanger/flare-game/zipball/master
Note that flare-game download will contain the latest source, plus plenty of art sources (large Blender files and unpacked sprite sheets).
If you don't plan on making code changes, you can easily start with the Windows build of Flare instead of compiling it yourself. Then you can mess around with the mods folders to see what's possible.
I downloaded the latest engine, compiled it as I did for the previous version of the engine, and ran into the same problem. Not entirely sure what is happening there, but I'm sure I've just done something silly. However, I was able to compile and run the contents of the Flare source zipball with no problems at all! I think I'll pick up the engine at a later date, and focus on learning and modifying the Flare source. Thank you guys so much for your help!