Coder Social home page Coder Social logo

carlsonsantana / convert_rpggame_to_android Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 1.0 31 KB

Convert a RPG Maker 2000 or RPG Maker 2003 in a Android game using EasyRPG.

Shell 100.00%
rpg-maker-2000 rpg-maker-2003 easyrpg android standalone-game rpgmaker rpgmaker2000 rpgmaker2003

convert_rpggame_to_android's People

Contributors

carlsonsantana avatar ghabry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ghabry

convert_rpggame_to_android's Issues

Support new standalone mode

There will be soon a better standalone mode for EasyRPG Player.

The changes are minimal:

Instead of assets/game the game folder must be a zip archive with Deflate compression called assets/game.zip. I wanted to support both but the APK API does not report directory when listing directory content, so is unusable for us.

The ZIP can have one of two structures:

  • The game content directly in the root, e.g. /RPG_RT.ldb, /Map0001.lmu, etc.
  • A single folder containing the game, e.g. TestGame/RPG_RT.ldb, TestGame/Map0001.lmu

The second case will only work when there is nothing else except the folder in the ZIP root.

Script can be simplified

Based on the documentation here https://developer.android.com/studio/build/application-id.html it would be enough to replace the applicationId in build.gradle with the new APK name and keep the one in the XML untouched.

Gradle does some magic and ensures that after compiling (to ensure ".R"-stuff works) the XML package name is replaced.

So in the end most of the sed and mv stuff is unnecessary and makes it hard to update to recent Player versions.

Here is the simplified script. When I run the script and compile a APK it is still correctly reported as "com.your.game" and works on Android.

#!/bin/bash

set -e

# Standalone game variables
GAME_FOLDER=$(pwd)/your_game
GAME_APK_NAME=com.your.game
GAME_NAME='Your game'
[email protected]
GAME_SITE='http://example.com/'
GAME_VERSION_CODE=100
GAME_VERSION_NAME=1.0.0
GAME_METADATA=$(pwd)/metadata
GAME_ICON_PATH=$GAME_METADATA/en-US/images/icon.png
GAME_ICON_PROMOGRAPHIC=$GAME_METADATA/en-US/images/promoGraphic.png
EASYRPG_PLAYER_FOLDER=$(pwd)/Player
##############################

ANDROID_FOLDER=$EASYRPG_PLAYER_FOLDER/builds/android

cd $EASYRPG_PLAYER_FOLDER

# Ignore game folder on commit
sed -i ':a;N;$!ba;s|\n\n# Game folder||g' .gitignore
sed -i ':a;N;$!ba;s|\n/builds/android/app/src/main/assets/||g' .gitignore
echo "" >> .gitignore
echo "# Game folder" >> .gitignore
echo "/builds/android/app/src/main/assets/" >> .gitignore

cd builds/android/app/src/main

# Copy game
rm -fr assets/game
cp -r $GAME_FOLDER assets/game

# Change APK name
sed -i "s|org\.easyrpg\.player|$GAME_APK_NAME|g" $ANDROID_FOLDER/app/build.gradle

# Change game name
sed -i "s|EasyRPG Player|$GAME_NAME|g" res/values/strings.xml

# Change game email
sed -i "s|easyrpg@easyrpg\.org|$GAME_BUG_REPORT_EMAIL|g" java/org/easyrpg/player/player/EasyRpgPlayerActivity.java

# Change game site
sed -i "s|https://easyrpg\.org/|$GAME_SITE|g" res/layout/browser_nav_header.xml

# Change version code
sed -i 's/android\:versionCode="[0-9]\+"/android:versionCode="'$GAME_VERSION_CODE'"/g' AndroidManifest.xml

# Change version name
sed -i 's/android\:versionName="[0-9A-Za-z\-\.]\+"/android:versionName="'$GAME_VERSION_NAME'"/g' AndroidManifest.xml

# Convert icon to HDPI: 72x72
convert $GAME_ICON_PATH -resize 72x72 res/drawable-hdpi/ic_launcher.png

# Convert icon to MDPI: 48x48
convert $GAME_ICON_PATH -resize 48x48 res/drawable-mdpi/ic_launcher.png

# Convert icon to XHDPI: 96x96
convert $GAME_ICON_PATH -resize 96x96 res/drawable-xhdpi/ic_launcher.png

# Convert icon to XXHPDI: 144x144
convert $GAME_ICON_PATH -resize 144x144 res/drawable-xxhdpi/ic_launcher.png

# Convert icon to XXXHDPI: 192x192
convert $GAME_ICON_PATH -resize 192x192 res/drawable-xxxhdpi/ic_launcher.png

# Convert icon to promoGraphic.png: 180x120
convert $GAME_ICON_PATH -resize 120x120 $GAME_ICON_PROMOGRAPHIC
convert $GAME_ICON_PROMOGRAPHIC -resize 180x120 -size 180x120 xc:none +swap -gravity center -composite $GAME_ICON_PROMOGRAPHIC

# Change metadata
rm -r $ANDROID_FOLDER/metadata
cp -r $GAME_METADATA $ANDROID_FOLDER/metadata

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.