Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Reversion - The Escape for iOs  (Read 3898 times)

0 Members and 1 Guest are viewing this topic.

fsaenz

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
Reversion - The Escape for iOs
« on: October 09, 2012, 10:07:41 PM »

Hello!

    I'm writing to let you know that we are launching the fist chapter of Reversion on the AppStore for iPhone/iPad
    Our publisher is Bulkypix.
    http://www.bulkypix.com/game/reversion

    The game will hit the stores on October 11th for iphone/iPad in Spanish, English, German, Italian, French and Chinese.

    We have made some changes to the wmelite source code, that we would like to share, but don't know how exactly. Any suggestions? Maybe we can share a svn .diff file?
    We made changes to support multiple devices resolutions and packages on the same ipa (iphone3Gs/iphone4/iphone5/iPad2/newiPad), multiple languages on the same ipa (it changes the package priority from the device language) and changes to support the bulkypack from our publisher.

Thanks a lot to all! :)
Francisco.-
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1454
  • Lamp dog!
    • View Profile
Re: Reversion - The Escape for iOs
« Reply #1 on: October 09, 2012, 10:46:26 PM »

Congratulations on the release.

About the sources, it's up to you. WME Lite license (MIT) doesn't require to share the changes but it would be nice if you do so. Especially if you use the same permissive license. A diff should be ok I guess. You can also go to wme lite website and add an issue as a patch including the code.
Logged
fl*p

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Reversion - The Escape for iOs
« Reply #2 on: October 10, 2012, 10:18:41 AM »

contratulation :)
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

fsaenz

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
Re: Reversion - The Escape for iOs
« Reply #3 on: October 12, 2012, 05:06:31 PM »

Hello!

    Thanks Keybone! Thanks odnorf!

    We now that it's not mandatory to release the source code, but we believe that it would be useful for someone. We are thinking about uploading it to github. I'll talk to my team members to see how to upload it.

Thanks a lot!
Francisco.-
Logged

MaaS

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Reversion - The Escape for iOs
« Reply #4 on: October 23, 2012, 03:09:07 PM »

Wow! great job... I'm running to get your game :)

I'm really interested on your work pipeline... Any advice from working on multiple resolutions? How you divided your rooms / packages and languages? What about scripts where you x,y coordinates or objects with walk-to positions and things like that?

And please yes, those changes for supporting multiple devices resolutions and languages are really welcomed.

Thanks!
Logged

fsaenz

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
Re: Reversion - The Escape for iOs
« Reply #5 on: October 27, 2012, 07:28:08 PM »

Hello Maas!

    Thanks a lot! Did you enjoyed the game? Let me know what you think about it!!! :)

    About the code, we are going to release the changes via bitbucket as Mnemonic suggest us.
    In the meantime, I'll share some of those changes here.
    If you find a way to improve this, please let us know!! :)

    We have made changes to the ios_utils.m file, so we can identify the device that the player is using and the language that it's configured.

Code: C++
  1. void IOS_GetCurrentLanguage(char* buffer)
  2. {
  3.     NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
  4.     NSString* forceLang = [infoDict objectForKey:@"3fForceLang"];
  5.  
  6.     //Obtenemos el codigo del lenguaje
  7.     NSString* language = [[NSLocale preferredLanguages] objectAtIndex:0];
  8.     if (forceLang != nil && !([forceLang isEqualToString:@""])) {
  9.         language = forceLang;
  10.     }
  11.    
  12.     // Ver: http://kb.applingua.com/2011/07/which-languages-does-ios-support/
  13.     if ([language isEqualToString:@"es"]) {
  14.         strcpy(buffer, "es");
  15.     } else if ([language isEqualToString:@"pt"]) {
  16.         strcpy(buffer, "pt");
  17.     } else if ([language isEqualToString:@"zh-Hant"] || [language isEqualToString:@"zh-Hans"]) {
  18.         // zh-Hant - T. Chinese
  19.         // zh-Hans - S. Chinese
  20.         strcpy(buffer, "nz");
  21.     } else if ([language isEqualToString:@"de"]) {
  22.         strcpy(buffer, "de");
  23.     } else if ([language isEqualToString:@"fr"]) {
  24.         strcpy(buffer, "fr");
  25.     } else if ([language isEqualToString:@"it"]) {
  26.         strcpy(buffer, "it");
  27.     } else {
  28.         strcpy(buffer, "en");
  29.     }
  30. }
  31.  
  32. void IOS_GetDeviceType(char* buffer, int hd)
  33. {   
  34.     //if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
  35.     //    strcpy(buffer, "tablet");
  36.     //else
  37.     //    strcpy(buffer, "phone");
  38.    
  39.     struct utsname systemInfo;
  40.     uname(&systemInfo);
  41.    
  42.     NSString *system = [NSString stringWithFormat:@"%s", systemInfo.machine];
  43.  
  44.     if ([system isEqualToString:(@"i386")] || [system isEqualToString:(@"x86_64")]) {
  45.         strcpy( buffer, "iphone5" );
  46.     } else if ( [system hasPrefix:@"iPhone3"] || [system hasPrefix:@"iPhone4"] ) {
  47.         (hd==1) ? strcpy( buffer, "iphone4" ) : strcpy( buffer, "iphone3g" );
  48.     } else if ( [system hasPrefix:@"iPod"] || [system hasPrefix:@"iPhone1"] || [system hasPrefix:@"iPhone2"]) {
  49.         strcpy( buffer, "iphone3g" );
  50.     } else if ( [system hasPrefix:@"iPad1"] || [system hasPrefix:@"iPad2"]) {
  51.         strcpy( buffer, "ipad" );
  52.     } else if ( [system hasPrefix:@"iPad3"] || [system hasPrefix:@"iPad4"]) {
  53.         (hd==1) ? strcpy( buffer, "ipad3" ) : strcpy( buffer, "ipad" ) ;
  54.     } else if ( [system hasPrefix:@"iPhone5"] ) {
  55.         strcpy( buffer, "iphone5" );
  56.     }
  57.  
  58. }
  59.  

    For the devices, the changes on the ios_utils are enough, because Mnemonic already coded the rest.

    For the languages, we make changes to the BFileManager.cpp of the wmelite code.
    we use the same idea that Mnemonic used with the devices, so we have one package for every device/language called "xLanguage_iphone4_en.dcp" "xLanguage_ipad3_en.dcp" ... "xLanguage_iphone4_it.dcp" ... and so on.
     Everyone of this packages has priority = 0 in the file. The data.dcp package, has priority = 1, and the devices packages has priority = 2.
     The data package and the devices packages are with the default language (spanish in our case), and with the changes to BFilemanager we managed to change the priority of the language packages at run time, if it was necesary.

Code: C++
  1.  
  2. #ifdef __IPHONEOS__
  3.     AnsiString deviceType = Game->GetDeviceType();
  4.     IOS_GetUserSelectedLanguage(language);
  5.     //La idea es que todos los paquetes de idioma tengan prioridad 0.
  6.     //Si de repente estamos en ingles, forzamos una prioridad que sabemos que va a cargarlo.
  7.     char lang_pattern[128];
  8.     //Reconstruimos el paquete de idiomas que esperamos. Si encontramos algo con este patron... le damos prioridad
  9.     sprintf( lang_pattern, "xlanguage_%s_%s.dcp", deviceType.c_str() , language );
  10.    
  11.     //Game->LOG(0, "Main package will be %s", lang_pattern);
  12. #else
  13.  
  14.     ...
  15.     ...
  16.     ...
  17.  
  18.     BYTE priority = hdr.Priority;
  19.     #ifdef __IPHONEOS__
  20.          if( !strcmp( Name, lang_pattern ) )
  21.              //Le damos prioridad al paquete.
  22.              priority = 3;           
  23.     #else
  24.  
  25.     ...
  26.  

For the resolucions, we had to make a hack on the BGame.cpp file, because the resolution you specify in the startup.settings file can't be changed for every package.

Code: C++
  1.             case TOKEN_RESOLUTION:
  2.                 {
  3.                     //El siguiente codigo es solo para iphone, en Mac no hace falta modificar la resolucion.
  4.                     #ifdef __IPHONEOS__
  5.                         //HACK: 3f. Como el archivo de configuracion de la aplicacion es el mismo
  6.                         // para todos los paquetes
  7.                         // no se puede tener resoluciones diferentes para iphone3G y iphone4.
  8.                         // No se me ocurre otra cosa.
  9.                         AnsiString device = this->GetDeviceType();
  10.                         LOG(0, "Detected device is: %s", device.c_str());
  11.                         if( StringUtil::CompareNoCase(device, "iphone3g" ) )
  12.                         {
  13.                             m_SettingsResWidth = 480;
  14.                             m_SettingsResHeight = 320;
  15.                         }
  16.                         else if( StringUtil::CompareNoCase(device, "iphone5" ) )
  17.                         {
  18.                             m_SettingsResWidth = 1136;
  19.                             m_SettingsResHeight = 640;
  20.                         }
  21.                         else if( StringUtil::CompareNoCase(device, "iphone4" ) )
  22.                         {
  23.                             m_SettingsResWidth = 960;
  24.                             m_SettingsResHeight = 640;
  25.                         }
  26.                         else if( StringUtil::CompareNoCase(device, "ipad" ) )
  27.                         {
  28.                             m_SettingsResWidth = 1024;
  29.                             m_SettingsResHeight = 768;
  30.                         }
  31.                         else if( StringUtil::CompareNoCase(device, "ipad3" ) )
  32.                         {
  33.                             m_SettingsResWidth = 1280;
  34.                             m_SettingsResHeight = 960;
  35.                         }
  36.                         else
  37.                         {
  38.                             LOG(0, "Engine will use default DCP resolution", m_SettingsResWidth, m_SettingsResHeight);
  39.                             parser.ScanStr((char*)params, "%d,%d", &m_SettingsResWidth, &m_SettingsResHeight);
  40.                         }
  41.                     #else
  42.                             parser.ScanStr((char*)params, "%d,%d", &m_SettingsResWidth, &m_SettingsResHeight);                       
  43.                     #endif
  44.  
  45.                     LOG(0, "Resolution is set at %d x %d", m_SettingsResWidth, m_SettingsResHeight);
  46.                 }
  47.             break;
  48.  

I hope you find this helpful.
Cheers.
Fran.-
Logged

Dendrobats

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 30
    • View Profile
Re: Reversion - The Escape for iOs
« Reply #6 on: May 27, 2013, 01:04:31 PM »

Hey I am trying to use those hacks, but it seem that it only working in landscape mode, if I change to portrait half of my screen is not working on touch and do not rotate. Please help.
Logged
 

Page created in 0.616 seconds with 65 queries.