BlitzMax Game Framework FAQ V1.06 (Technical)

   General | Technical

Index

Q. What do I compile to run the AOTMG mini-game demo?
Q. What does the AOTMG.ini file do?
Q. If I have several files open at once, how can I get the IDE to always compile AOTMG.bmx?
Q. Why is the Include folder outside of the AOTMG folder?
Q. Why is GameTypes.bmx not in the Include folder?
Q. How can skip all the intros and screen fades so that I can test the code faster?
Q. Why is VSync off by default instead of on?
Q. Why do I get a funny little black window behind the game window in windowed mode?
Q. How do I make a icon which is automatically included in the exe?
Q. How do I make icons that are anti-aliased to a transparent background?
Q. Why do I need a .ico (icon) file?
Q. What module tweaks do I need to make for perfect VSync in windowed mode?
Q. How can I enable Build Modules in the IDE?
Q. What is "Vertical Tearing"?
Q. What causes jerkiness?


Q. What do I compile to run the AOTMG mini-game demo?

A. The main example source you compile is in the AOTMG folder and is called AOTMG.bmx.

Q. What does the AOTMG.ini file do?

A. The AOTMG.ini file can be edited with Notepad and controls
several aspects of the game as follows:

Q. If I have several files open at once, how can I get the IDE to always compile AOTMG.bmx?

A. In the IDE, open up all the files you need, then click on AOTMG.bmx. Then click Program/Lock Build File. This  means that when you compile (with F5 or whatever), it will always compile AOTMG.bmx, no matter what other file you are currently viewing.  This is very useful because if you try to compile one of the other files, it won't compile because it's not a standalone piece of code; it depends upon the other files which are all included in the AOTMG.bmx file.

Q. Why is the Include folder outside of the AOTMG folder?

A. It's intentional that the Include folder is outside of the AOTMG folder so that when you make other games you can put their source code in a folder on the same level as the AOTMG folder; then you can use the same set of include statements at the top of your game code.

Q. Why is GameTypes.bmx not in the Include folder?

A. GameTypes.bmx contains types specific to AOTMG, which is why it's in the AOTMG folder instead of the Include folder.  The Include folder is only for generic reusable code and types.

Q. How can skip all the intros and screen fades so that I can test the code faster?

A. Whereas all the splash screens and fading look cool, you'll want to switch them off when developing to save time.  So go into AOTMG.ini and change FADE to 0 and PORTAL SPLASH to 0 (don't forget to re-enable them when you make a release version!)   Also in AOTMG.bmx, find the line that says:

    If Game.Fade Then GreyAlienSpash(Game.Sound)

and comment it out.  This way, even if you enable FADE in the .ini file for testing, you won't have to watch the Grey Alien splash screen each time.

Q. Why is VSync on by default instead of off?

A. I did a lot of testing and found that VSync off worked on a wider range of PCs without jerking problems, even though a small amount of random vertical tearing is sometimes visible.  However, VSync on simply looks better in my opinion.  By all means try pressing V to toggle VSync on/off in-game.  If you decide that you want VSync off in your game, just make sure VSYNC is 0 in the Default.ini file when you release the game.  The user can also toggle VSync via the options page.

Q. Why do I get a funny little black window behind the game window in windowed mode?

A. In the BlitzMax IDE make sure that you have Program/Build Options/Build GUI App ticked,
otherwise you will get a little black console window appearing behind your game.

Q. How do I make a icon which is automatically included in the exe?

A. Please follow this guide by Jim Brown.  This is only suitable for Windows builds.  A different process is required for Mac OSX builds.

Q. How do I make icons that are anti-aliased to a transparent background?

A. Use a professional paint package to make your icon, and save it as a 32-bit icon file with an 8-bit Alpha Channel.  Then you can have an icon that is anti-aliased to a transparent background - this looks cool and professional.  I think this only works in XP/Vista/MAC OSX though.  So check to see what your icon looks like in Windows 98/Me/2000; it may only have a solid background.

Q. Why do I need a .ico (icon) file?

*** This is now obsolete because since V1.02 the framework grabs the icon directly from the .exe file (providing it contains an icon.) ***

A. Even though the AOTMG.bmx source code imports projecticon.o, this only makes the .exe and the task bar have an icon.  To have an icon in the top left of windowed mode and on the Alt+Tab task switching screen, you need to make an .ico file with the same name as your .exe name and put it in the same folder.

Q. What module tweaks do I need to make for perfect VSync in windowed mode?

*** This is now obsolete because Blitz Research have fixed the module themselves. ***

A. In windowed mode, you may notice some vertical tearing.  This is because BlitzMax does not perform any kind of waiting for vertical refresh even with Flip 1 or -1!  Therefore if you toggle the Game Framework VSync option in windowed mode, you will not notice any difference.  To obtain perfect VSync in windowed mode you have two choices as follows:

a) In CommonTypes.bmx look for the TGame.PostDraw() method.  There is a comment about Skidracer's module tweak and a line of code commented out underneath.  If you uncomment this line, ccVWait() will be called in windowed mode.  This works well on some faster PCs but may result in a permanent tear somewhere near the top of the screen on slower PCs.  The best solution is b) as follows.

b) You need to tweak two of BlitzMax's modules (until BRL apply this tweak themselves, if ever).  Remember, until BRL apply these tweaks themselves (may require a Game Framework update), you'll have to tweak the modules again each time they do a release, because the changes will get overwritten when you Synchronise Modules.  There is no way round this I'm afraid.  This method gives a much better result than method a) because it doesn't seem to result in any permanent tears.  Note that some cards are unable to wait for vertical refresh, or their drivers have VSync completely disabled; therefore these module tweaks will have no effect on such systems, unfortunately. The tweaks are as follows:

Q. How can I enable Build Modules in the IDE?

A. You need to download and install MinGW and set/alter two environment variables.  You can download MinGW from here (although you should probably check for a more up-to-date version via a Google search or check the BlitxMax forums).  Then you need to do the following (in Windows XP):

Q. What is "Vertical Tearing"?

A. Please read the essay posted here.

Q. What causes jerkiness?

A. Please read the essay posted here.

LIMITED WARRANTY (Disclaimer of Warranty)

THIS SOFTWARE PACKAGE, SERVICE AND THE ACCOMPANYING FILES ARE SOLD 
"AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF 
MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR 
IMPLIED. ADDITIONALLY, NO WARRANTY OF FITNESS FOR A PARTICULAR 
PURPOSE IS OFFERED. ANY LIABILITY OF THE SELLER WILL BE LIMITED 
EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE. NO 
OTHER WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE 
LAW, JAKE BIRKETT COMPUTER SOLUTIONS LTD, DISCLAIMS ALL OTHER 
WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, 
BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 
FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD 
TO THE SOFTWARE, AND THE PROVISION OF OR FAILURE TO PROVIDE 
SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL 
RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM COUNTRY/JURISDICTION 
TO COUNTRY/JURISDICTION. 

LIMITATION OF LIABILITY

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT 
SHALL JAKE BIRKETT COMPUTER SOLUTIONS LTD OR ITS SUPPLIERS BE 
LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL 
DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR 
LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS 
INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE 
OF OR INABILITY TO USE THE SOFTWARE OR THE PROVISION OF OR FAILURE 
TO PROVIDE SUPPORT SERVICES, EVEN IF JAKE BIRKETT COMPUTER 
SOLUTIONS LTD HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
IN ANY CASE, JAKE BIRKETT COMPUTER SOLUTIONS LTD'S ENTIRE 
LIABILITY UNDER ANY PROVISION OF THIS EULA SHALL BE LIMITED TO THE 
GREATER OF THE AMOUNT ACTUALLY PAID BY YOU FOR THE JAKE BIRKETT 
COMPUTER SOLUTIONS LTD PACKAGE OR £5.00 GBP. BECAUSE SOME 
COUNTRIES AND JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR 
LIMITATION OF LIABILITY, THE ABOVE LIMITATION MAY NOT APPLY TO 
YOU.