PDA

View Full Version : Platform independency advices.



xelanoimis
11-04-08, 09:48 AM
Hello,

I started this thread to post a few advices on how to make your DizzyAGE games ready to support future platforms implementations. Well since right now, DizzyAGE only runs on Windows, this might be a little theoretical, but still a good practice. So here it goes:

xelanoimis
11-04-08, 09:48 AM
----------------------------------------
Running from read-only mediums.
----------------------------------------

Consider that your game should be playable when executed from a read-only medium, like a CD or DVD. One problem in this situation is that you can't adjust the options in the Setup application and save them in the dizzy.ini config file to be used in the game. More to it, the game can't change and save these options in this config file.

So, don't assume you can write in the dizzy.ini file and don't use this file as a storage for essential game data. That means, don't keep there a value that you read and save and then read back, during the game. The best practice is to use game variables and use the dizzy.ini only to remember user settings during game sessions. If the values can't be saved, the user will adjust them again next time. Like the audio voumes.

Test your game by running it from a CD or DVD, to find if it does work on read-only mediums.

xelanoimis
11-04-08, 09:57 AM
----------------------------------------
Installers and Windows Vista
----------------------------------------

As far as I know (I don't have Vista), games installed in the ProgramFiles folder, can't write files there. This is a silly security measure, but all games have to deal with it one way or another. Theoretically, if you install or copy a DizzyAGE game in a folder inside ProgramFiles it will not be able to save it's options in the dizzy.ini file.

PTeal has an installer with his latest game, but I can't remember now, in which folder the game goes, by default. So someone should test this on Vista, please!

I recommend against custom installers, because a simple zip will allow people to easy extract the game's data and use it with another version of the engine, or eventually on a different platform. And as mentioned above, who knows what Microsoft brings us next...

xelanoimis
11-04-08, 10:11 AM
----------------------------------------
Graphic formats
----------------------------------------

You definitely don't want to have tile textures, bigger than 256x256 pixels.
Some "old" videoboards and some "new" portable devices are restricted to this size.
So, if a DizzyAGE porting will happen on such devices, this restriction must be respected by the games.

Consider that the standard DizzyAGE screen is 256x192 pixels, like the old Z80 machines. However, it is possible to paint outside this area, like the border art in PTeal's remakes (using negative coorinates).

Porting can happen on devices that have screens at least of this size. Now, since the 320x240 is a pretty common resolution (on recent mobile devices), you can assume your border art will be visible on these devices too. But don't place important HUD elements, that are essential to the player, outside the standard 256x192 area.

xelanoimis
11-04-08, 10:18 AM
-------------------------------
Audio formats
-------------------------------

I can't tell much about the audio formats right now. You can use the standard OGG (or uncompressed WAV), YM and MOD (or other MOD-like formats). Hopefully every port will be able to play them, since the audio module in the engine provides "codecs" for these formats. So even if used with other audio libraries, it should be able to accept audio data from these codecs.

In the worst case, the games will have to convert instrumental files (YM,MOD) to a digital format (like WAV, OGG or MP3) and provide a different set of data for the port. But this is no problem, because such conversions are always possible.

xelanoimis
11-04-08, 10:25 AM
---------------------------
File system
---------------------------

The game must run in the standard format, with it's data packed in the dizzy.pak file, and config options in the dizzy.ini. As said before, consider that in some cases, the game will not be able to write in the dizzy.ini file (but will always be able to read... if the file exists).

Don't read from other files outside the data pak archive (except the dizzy.ini).
Use standard INI functions to access (read/write) data in dizzy.ini.

All files inside the pak archive must have normal file names (with english characters). And it would be a good idea to limit the file names to a decent length (in characters).

xelanoimis
11-04-08, 10:33 AM
-----------------------------------------------
Support NO SOUND
-----------------------------------------------

The games must be able to run with no sound.
You can disable the sound from setup (dizzy.ini) and see if your game works.
Not to lower the audio volumes, but to disable the whole audio driver.
If the audio fails for someone, he should still be able to play the game with no sound.

In practice, this means to consider that a SamplePlay() call may return -1, as for invalid sound id. So don't do SamplePlay and then wait for that sound to finish playing, or try to use it, without checking the returned voice index. If you have to wait until the sound ends, estimate it with a WaitTime or WaitFrames call, and if you want to be accurate, add the "wait for sound to finish" test, after this few seconds wait, only if the sound was started.

Peter
11-04-08, 12:17 PM
PTeal has an installer with his latest game, but I can't remember now, in which folder the game goes, by default. So someone should test this on Vista, please!

it works fine under vista as that is a o/s i used when developing the game :)

NigeC
11-04-08, 01:32 PM
I've had no problems either
IF folks did, they could switch off the cr*ppy acount control system, which is the root of a lot of problems under Vista
Mine was still switched on when i installed the last game that used an installer

delta
11-04-08, 04:16 PM
only problem i can see for my games is the 'running from read only media' issue. basically, DWD, RRD, MSD and DMD v2 all save stuff to the .ini file (BTD and IID will also do so). additionally, all my games except TTD, WWD and MSD have save games, and i'd like to see someone attempt to solve all puzzles in RRD without saving the game once.

basically playing games from read only media is silly, and i'm not going to adjust my older games to specifically make allowances for people wanting to do something silly.

xelanoimis
11-04-08, 05:48 PM
Yeah, it's quite silly to ignore a save-load feature in an adventure game :)
The "run from read-only medium" is just a positive aspect, not a "must have".
And I don't think there will be a platform to port to, that won't support saved games.

But theoretically, a game should be able to be playable without writing data on the disk. Consider the original Dizzy games. Or remember the cabinet arcades, in the old days... In fact this is a standard requirement for older consoles, like PS2 where you could only save on a memory card, if you have one. But users should be able to finish the game, without having a memory card. On nextgen consoles, you can say the game requires the use of the hard drive and get away with it, easier...