ancurio / mkxp Goto Github PK
View Code? Open in Web Editor NEWFree Software implementation of the Ruby Game Scripting System (RGSS)
License: GNU General Public License v2.0
Free Software implementation of the Ruby Game Scripting System (RGSS)
License: GNU General Public License v2.0
Let me preface this with mentioning that I have zero experience working with ES / on mobile. These are just observations I made while looking at the GLES2 specification and docs.
No 32bit index buffers (only 16 supported on ES2) (_DONE:_ 295e0e5)
The main user of that is Tilemap, where vertex counts often reach multiples of the 16bit limit. This should be resolved with the rewrite to only upload vertices that are on screen.
No PixelStorei(GL_PACK_ROW_LENGTH / SKIP_PIXELS / SKIP_ROWS) support (_DONE:_ b734617) (Allowed when GL_EXT_unpack_subimage
present)
Easy to work around, create temporary SDL_Surface as intermediate and SubImage from that.
No VAO support (_DONE:_ efb2fd2) (Allowed when GL_OES_vertex_array_object
present)
Creating a meta path that uses VAOs on desktop GL and BindBuffer/AttribPointer calls on ES is probably not worth it. Just use the latter on both platforms.
No framebuffer blits (_DONE:_ a26c739)
This is a big one. Obviously this will have to be emulated on the ES side via quad draws. There's one place (transition rendering) that draws to a renderbuffer, that needs to be converted to texture too.
Npot textures don't support wrapped sampling (GL_REPEAT) (_DONE:_ 20e46a9) (Allowed when GL_OES_texture_npot
present)
Used in Plane class. Maybe reuse TileQuads utilities?
If you have any other observations / comments / additions, feel free to add them.
Note: This was originaly an issue ticket about my troubles trying to compile mkxp on Mac OS X. I have succeeded in doing so by now, but I don't know where else I could write the instructions I wanted to share with people, so I wrote them here. Feel free to move them wherever suits you, this issue ticket probably isn't the best place, sorry.
I had a lot of troubles building mkxp on Mac OS X so I'll explain the procedure to everyone interested.
Unfortunately, I'm pretty sure I already forgot some part of what I did. At least you have some kind of guideline to start from! Let me know if you encounter problems building mkxp on Mac OS X using these instructions, I'll check what I did that isn't described here and I'll fix it.
To compile mkxp on Mac OS X, you first need to install MacPort (http://www.macports.org/), because it will help getting some of the depencies.
Use MacPort to install the following dependencies:
Get libsigc++ sources from their website: http://libsigc.sourceforge.net/ and compile it.
Decompress the archive, then run the following commands:
./configure
make
make install
Do the same for latest pixman that you can find at http://cairographics.org/snapshots/.
Again, the same for:
PhysFS is a bit different, you need Mercurial (http://mercurial.selenic.com/) to be able to download it.
Use the command: hg clone http://hg.icculus.org/icculus/physfs/
Which will create a physfs folder containing the sources. Enter it and build physfs like the previous dependencies.
SDL_Sound is more tricky, you need to use the command:
hg clone http://hg.icculus.org/icculus/SDL_sound/
Which will create a SDL_sound folder. We now need to patch SDL_sound sources with the provided patches for mkxp.
First enter the directory using the command cd SDL_sound.
Then patch the sources using the following command, where, PATH is the path to the folder of your mkxp sources where the pkgconfig.patch lies, for me it is /Users/Malorne/mkxp/patches/SDL_sound:
patch < PATH/pkgconfig.patch
Now you can compile SDL_sound like you did with previous packages.
Now you have all the depencies! Congratulations!
In mkxp root sources folder, use qmake -spec macx-g++.
If everything went fine, you should now have a file called Makefile. Unfortunately, I don't know why but qmake generates a wrong Makefile, at least for Mac OS X.
You have to edit the Makefile to replace "-lGL" by "-framework OpenGL" and "-lboost_program_options" by "-lboost_program_options-mt".
You can now make it, you should then have a mkxp application in the form of a mkxp.app application folder.
You have two possibles ways of running your game with mkxp on OSX.
Either you copy the mkxp executable file that is at mkxp.app/Contents/MacOS/mkxp and you put it at the root of your game files, or you put your game files into the mkxp.app/Contents/Resources/ folder.
I prefer the second way, as it will yield a nice runnable application containing all the required files to run your game, which is the standard way applications are bundled on OSX.
If you encounter any problem building mkxp on Mac OS X, let me know !
Vorbisfile is not linked when using the cmake build files.
I had previously converted the midi audio for RMXP to ogg for the sake of my PlayOnLinux wrapper script, but it seems mkxp doesn't like the way I did it. I don't suppose you have any suggestions?
Under windows and linux, mkxp's $LOAD_PATH
aka $:
variable is an empty array []
; adding a folder, lib
into this array would allow game developers to create custom ruby extensions with native interfaces (eg, written in c/c++ with ruby bindings) and load them from the lib
folder with require 'foobar'
, where foobar
is foobar.dll/so/dynlib inside the lib folder.
So If I'm trying to port Pokemon Omicron from http://www.pokemonzetaomicron.com to Linux using MKXP. Would I be better off trying to build a solution from the "Mirror Lied" tarball, or compiling myself? Or would there be some sort of in-between recommendation for your average A to B port?
Most wrapper functions use rb_get_args
which handles this already, but this is never used in 0 argument functions (eg. Graphics.freeze
).
binding-util.h in MRI has a handy rb_check_argc
helper ready.
The following user32.dll functions are commonly used in scripts to query keyboard keys:
GetKeyState: Queries the current state of a key, and also whether keys such as caps lock are toggled on
GetAsyncKeyState Queries the current state, but also reports whether the key was pressed inbetween calls (so key presses are never missed due to timing)
GetKeyboardState: Like GetKeyState
, but copies the state of all virtual key codes into a 256 byte array
The first two functions take Virtual Key Codes as parameters, which from what I understand, act similarly to SDL scancodes (ie. raw identifiers of physical keys, unaffected by keyboard layouts). The first few codes represent the mouse buttons, which are already available via mkxp's Input module extensions.
The way to enable implementing these that I currently have in mind is this: A single new function (let's call it raw_key_states
, either under the System
or Input
module) returns a 512 byte string into which all SDL scancode states are memcpied into. We already keep such a state array anyway, so the new code literally amounts to a few lines.
For GetKeyState
, we just translate the windows key code to the corresponding SDL one and return the byte in the array. I'm not sure if it's worth to do extra work for the special GetAsyncKeyState
behavior of not missing events; in practice, the RGSS Input functions act like GetKeyState
too. As for the state of toggled keys (capslock, numlock etc.), I don't think anyone makes use of this so it's not worth considering either. One thing I'm not sure of yet is how often to retrieve the raw SDL keystate array. In my current code I hook into Graphics.update and refresh one shared array there once per frame. I assume that a game that doesn't call Graphics.update
very often or not at all cannot do anything useful anyway, so that shouldn't lead to complications where script code expects completely fresh key states.
For GetKeyboardState
one would just iterate through all available Windows Key Codes and write the result of GetKeyState
into the provided string buffer.
Here's the tentative patch for mkxp to implement raw_key_states
, and here's my current win32api wrapper script that makes use of it.
If you have any comments / ideas / suggestions, please post them!
hello,Mr. Ancurio and other friends,I want to translate to the moon in Chinese,how can I do?I am use Debian and Ubuntu.please help me.Very thanks
been fiddling with building mkxp on windows, after catching a stray uint and trying again, it seems the main issue regarding building on windows is a gmtime_r
conflict that occurs upon inclusion of ruby's win32.h
The exact error generated can be found in this gist:
https://gist.github.com/ntzrmtthihu777/e81aaa9cd95277bf9991#file-gistfile1-txt
Note: compiled with clang/clang++ for more verbose error output.
Exception `NoMethodError' at (RMX-OS) Script:1322 - undefined method `CON' for #
<RMXOS::Network:0xd5046f8>
It's throwing a no method error for a argument in a method call.
Here's the call in question:
self.send('CON', RMXOS::VERSION, RMXOS::Options::GAME_VERSION)
Here's the self.send method:
def self.send(*args)
if self.connected?
message = make_message(*args)
@socket.send(message + "\n", 0)
end
end
I believe Last Scenario uses the RPG Maker XP.
When I try to play it with mkxp I get this:
ruby:1:in `eval': Section007:289: syntax error, unexpected ( arg, expecting keyword_do or '{' or '('
...s = otherweaponstr > -1 ? str (true) + otherweaponstr * 1.5 ...
... ^
Section007:289: syntax error, unexpected ':', expecting keyword_end
...(true) + otherweaponstr * 1.5 : str
... ^ (SyntaxError)
EventThread termination requested
RGSS thread ack'd request after 0 ms
Shutting down.
I'm not sure if this is some kind of limitation or if this can be fixed.
From the spec:
The font name. The default is "MS PGothic".
Include an array of strings to specify multiple fonts to be used in a desired order.
Currently, only strings are accepted. The easy solution would be to process a passed array in the binding, and only forward the first available font name to core mkxp.
The "correct" solution would be to actually turn the "name" property into a string array. This comes with a whole lot of other problems though (eg. what to do when the array contains non-string objects), as I see no way to cleanly translate this behavior to C++.
I'm really impressed by the pace of progress regarding RGSS2 and RGSS3!
I have tried Oh! Ko! game on my latest build of mkxp and it starts fine and the first few scenes are alright, but when you start to control the game some strange blue lines appear, like in this screenshot:
https://app.box.com/s/u9b1ln3vnpo24xteap0a
You can download Oh! Ko! from this link:
https://www.dropbox.com/s/d97obkdobkz2t79/Ko.exe
I know RGSS3 support is still work in progress, I just thought maybe you are not aware of this particular issue.
Because mkxp need a modified SDL_sound library, why may not we compile it as a shared library (in ./lib for example) ?
I think this should be interresting because we could make some hacks in SDL_sound and timidity++ code (like you say to not have a config file hard coded in the system dir).
I'm encountering three unrelated (?) graphical glitches when running mkxp on OS X.
The first two are explained here.
The third issue is that, on occasion, pressing keys will not graphically update the title screen. The sounds will still play, and you can still select other menu options, but the menu graphics don't change. This seems to only last during the title screen.
One of these games uses an rgssad archive, the other doesn't, so that seems to be irrelevant.
I'd be happy to help debug this issue if you need someone to test things out.
When I git clone the mkxp and then cd to the directory of it.
I make cmake . ,then it have some errors,I have tried to resolve some.Now it have 3 errors that I can not resolve.
xiaoji@xiaoji-KZ231AA-AB2-a6721cx:~/mkxp$ cmake .
-- checking for module 'physfs>=2.1'
-- package 'physfs>=2.1' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:279 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
CMakeLists.txt:81 (pkg_check_modules)
-- checking for module 'SDL2_ttf'
-- package 'SDL2_ttf' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:279 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
CMakeLists.txt:83 (pkg_check_modules)
-- checking for module 'SDL_sound'
-- package 'SDL_sound' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:279 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
CMakeLists.txt:85 (pkg_check_modules)
-- Boost version: 1.53.0
-- Found the following Boost libraries:
-- program_options
-- Configuring incomplete, errors occurred!
I have install libphysfs1 libphysfs-dev libsdl-sound1.2 libsdl-sound1.2-dev libsdlttf2.0-0 libsdl-ttf2.0-dev
More of an issue tracker than anything else. I'll see if I can get a compile going, and report back on where I can get the code running and broken, and how I can otherwise put off actually getting things done. Anyone who cares to join me, get something running, or take credit for stuff already done can do so here.
Every RPG Maker game I try to play, I encounter missing game file errors when running the mkxp players. I don't get this error when I run the default excutable that the game comes with. Is there a way I can fix this?
Yep.
https://github.com/Ancurio/mkxp/blob/dev/src/font.cpp#L119:
// FIXME 0.9 is guesswork at this point
font = TTF_OpenFontRW(ops, 1, (float) size * .90);
this mostly works when substituting the compiled-in Liberation Sans for Arial, at the default size of 22, but is otherwise horribly broken. I have tried to determine the font scaling factors for both SDL_TTF and RMXP (using the char '_'), using the resulting ratio to compensate for the difference, but it turns out the ratio is different for each font; at the moment I'm just at an dead end. I'm not even sure how RMXP does font rendering (I'd guess DirectWrite??) RMXP uses GDI for font rendering. There must be something like a hint hidden in the metadata on how to scale fonts correctly.
I'm trying to port a game I'm working on to Linux so that a friend of mine can play it, unfortunately I know nothing of coding, and don't have the slightest idea how to go about using mkxp. I've spent a good few hours searching for any form of tutorial on how to use it, but to no avail. Could someone please help give me a step by step instructions understandable by a newbie like myself, be it working from the files downloadable here, or working off those in TheMirrorLied, if that would be easier to do?
Here's what outdoor maps look like:
While indoor maps seem to render fine.
The console outputs tons of these:
[GLDEBUG] glTexSubImage2D has generated an error (GL_INVALID_VALUE)
But it's not outputting why it's generating an error exactly so I don't know where to look for fixing this.
EDIT: The game also seems to freeze for a second or so when it outputs one ot those gldebug errors
I have seen this issue with some games and I'm not sure what exactly causes them, but in case a game has an audio narration or dialog, sometimes it plays completely, sometimes it stops at near the end.
The odd thing is that it does not always happen, it happens once, you quit mkxp, run it again, it does not happen, quit it, run it again and this time it stops playing at another time!
I have a guess that it is somehow related to events and their stop time, but I don't know how to make sure.
Here is a free demo of a game having this issue just after starting a new game:
http://freebirdgames.com/forum/index.php?topic=5543.0
(It requires some script fixes to make it compatible with mkxp, I can send the fixes to you if you don't have time for it).
It happens with both my builds of mkxp and the one from To The Moon's official Mac port.
Need to compile a list of these classes first.
Exception message: "can't clone "
-- The C compiler identification is GNU 4.9.1
-- The CXX compiler identification is GNU 4.9.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- checking for module 'sigc++-2.0'
-- found sigc++-2.0, version 2.4.0
-- checking for module 'pixman-1'
-- found pixman-1, version 0.32.6
-- checking for module 'physfs>=2.1'
-- package 'physfs>=2.1' not found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:341 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPkgConfig.cmake:395 (_pkg_check_modules_internal)
CMakeLists.txt:88 (pkg_check_modules)
-- checking for module 'vorbisfile'
-- found vorbisfile, version 1.3.4
-- checking for module 'sdl2'
-- found sdl2, version 2.0.3
-- checking for module 'SDL2_ttf'
-- found SDL2_ttf, version 2.0.12
-- checking for module 'SDL2_image'
-- found SDL2_image, version 2.0.0
-- checking for module 'SDL_sound'
-- package 'SDL_sound' not found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:341 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPkgConfig.cmake:395 (_pkg_check_modules_internal)
CMakeLists.txt:93 (pkg_check_modules)
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- program_options
-- Found OpenAL: /usr/lib64/libopenal.so
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8")
-- checking for module 'ruby-2.1'
-- package 'ruby-2.1' not found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:341 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPkgConfig.cmake:395 (_pkg_check_modules_internal)
CMakeLists.txt:284 (pkg_check_modules)
-- Configuring incomplete, errors occurred!
I have the libraries and development files of all of these packages, but cmake is unable to read it. I would try using qmake, but Fedora 21 doesn't yet have a package for it. Is there a way you can add a normal configure script into the master branch?
The 'Graphics' and 'Audio' module will each have to implement their respective reset functions, putting them back into the state they were in right after creation.
The console will probably end up being spammed to death by ruby warnings due to all the redefenitions when executing the game scripts anew. Another option might be to completely shut down ruby and reinitialize it with all the mkxp gear instead, then start executing game scripts again.
More info here (in German): http://www.rpg-studio.de/scientia/RGSS/Reset
Some info on problems in RMXP impl (in Japanese): http://www.tktkgame.com/tkool/memo/rgss/reset.html
As I understand it, the bottleneck to port games to mobile platforms be it ARM based linux or pure Android is that MKXP requires Open GL calls. Could we use a project like GLShim, https://github.com/lunixbochs/glshim, to bypass that requirement and open up all sorts of new platforms to play with?
Not quite an issue with the code, but hosting of the precompiled versions for TML and TTM on bplaced seems to error out when I try to follow the links to them. Any ideas on how they work?
Tikilou, I need you to create a core dump at the point where the warnings are emitted. To do that, start the executable through gdb:
gdb ToTheMoon.amd64
set a breakpoint at the debug message proc:
break DebugLoggerPrivate::writeLine
then run the game by typing r
end pressing enter. Shortly after the game should freeze as the debug point is reached (and the gdb prompt appears again) saying something like "breakpoint 1 reached". Now dump the core:
generate-core-file
which will generate a file named "core." (you can quit gdb by entering q
then y
). Please upload it somewhere and post it here.
In file included from /home/khkramer/mkxp-master/src/main.cpp:36:0:
/home/khkramer/mkxp-master/src/gl-fun.h:54:152: error: conflicting declaration ‘typedef void (* GLDEBUGPROC)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar*, GLvoid*)’
typedef void (APIENTRY * GLDEBUGPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
^
In file included from /usr/local/include/SDL2/SDL_opengl.h:80:0,
from /home/khkramer/mkxp-master/src/gl-fun.h:25,
from /home/khkramer/mkxp-master/src/main.cpp:36:
/usr/local/include/SDL2/SDL_opengl_glext.h:2182:26: error: ‘GLDEBUGPROC’ has a previous declaration as ‘typedef void (* GLDEBUGPROC)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar*, const void*)’
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
^
make[2]: *** [CMakeFiles/mkxp.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/mkxp.dir/all] Error 2
make: *** [all] Error 2
I'm pretty new to compiling C++ programs, so could this be a mistake on my end?
There are still many games that are localized and encoded with charset other than UTF-8 like SHIFT-JIS or euc-kr, but since mkxp only supports UTF-8, many strings are broken thus I cannot play those games. Is there any way to specify encoding manually?
They say a picture is worth a thousand words, so i did a print-screen of my RMXP editor and the game running with the system to show it in action. As my pic says, it appears that the auto-tile fragment in index position 22 is using the one in index position 20.
This occurs within all the other auto-tiles. And you wouldn't really see this unless you used an auto-tile with a sort of 3Dish wall effect. It isn't noticeable with grass or land tiles at all.
After install all depends and qmake, on Ubuntu 13.04 or ArchLinux, same problem :
tikilou@tikilou-desktop:~/mkxp$ make
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_KEYWORDS -DBINDING_MRI -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++-64 -I. -I. -Isrc -Iruby/include -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/GL -I/usr/include/pixman-1 -I/usr/local/include/SDL2 -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I. -o main.o src/main.cpp
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_KEYWORDS -DBINDING_MRI -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++-64 -I. -I. -Isrc -Iruby/include -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/GL -I/usr/include/pixman-1 -I/usr/local/include/SDL2 -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I. -o audio.o src/audio.cpp
In file included from src/audio.cpp:27:0:
src/filesystem.h:74:13: erreur: invalid abstract return type for member function ‘FileStream FileSystem::openRead(const char_, FileSystem::FileType)’
src/filesystem.h:31:7: note: because the following virtual functions are pure within ‘FileStream’:
In file included from src/filesystem.h:25:0,
from src/audio.cpp:27:
/usr/include/SFML/System/InputStream.hpp:59:19: note: virtual sf::Int64 sf::InputStream::read(char_, sf::Int64)
src/audio.cpp:53:13: erreur: cannot declare field ‘MusicEntity::currentData’ to be of abstract type ‘FileStream’
In file included from src/audio.cpp:27:0:
src/filesystem.h:31:7: note: since type ‘FileStream’ has pure virtual functions
src/audio.cpp: In member function ‘void MusicEntity::play(const QByteArray&, int, int)’:
src/audio.cpp:126:80: erreur: cannot allocate an object of abstract type ‘FileStream’
In file included from src/audio.cpp:27:0:
src/filesystem.h:31:7: note: since type ‘FileStream’ has pure virtual functions
src/audio.cpp: In member function ‘sf::SoundBuffer& SoundEntity::allocateBuffer(const char_)’:
src/audio.cpp:438:62: erreur: cannot allocate an object of abstract type ‘FileStream’
In file included from src/audio.cpp:27:0:
src/filesystem.h:31:7: note: since type ‘FileStream’ has pure virtual functions
src/audio.cpp:437:15: erreur: cannot declare variable ‘data’ to be of abstract type ‘FileStream’
In file included from src/audio.cpp:27:0:
src/filesystem.h:31:7: note: since type ‘FileStream’ has pure virtual functions
make: *_* [audio.o] Erreur 1
Just doing a bit of reading around, and researching options for adding midi support to mkxp, and I keep on coming back to SDL2_mixer, which I had previously used for midi support in my prior abortive attempt at a native rgss player for linux, so I have to ask regarding the reasoning for using the patched sdl sound library.
According to my personal tests, the resulting alpha value is correct for all inputs (srcAlpha, dstAlpha, bltAlpha*), however, the color value is just an approximation as I have yet to successfully reverse-engineer the algorithm behind it. The approximation is written to favor text display (with eg. manual shadows, or at half opacity) as much as possible, but many visible irregularities remain and the code itself is quite ugly. Note that in case of blitting with bltAlpha = 1.0 on a cleared surface (the vanilla way text is displayed in RMXP games), no blending is necessary and the source is directly copied into the destination (ie. a literal blit).
The color value has 4 inputs: srcColor, dstColor, srcAlpha*bltAlpha and dstAlpha, The results get especially confusing once the alpha values start deviating from 1.0.
(*bltAlpha is the 'opacity' parameter passed into the blt functions, or the alpha value of the font used when drawing text).
I open this to address every issue I find in the game playing it with mkxp.
1)
In the hex mini games the tiles have a black grid over it.
2)
The status bar that shows information about spells/items/what you just stole/.... is missing
3)
When fighting the "smiley enemy" in the ether well the game crashes sometimes with:
Script 'Scene_Battle 4' line 155: NoMethodError occured.
undefined method 'id' for nil::NilClass
This happens only if I attack with the first character. (this error happens really quite often throughout the game, but the second comment seems to fix it completly.
When flying over the edge of the world(map) you get:
Script 'Sprite_Worldmap_Small' line 54: NoMethodError occured.
undefined method `alpha=' for nil:NilClass
My best guess right now is that it's either different rounding or get_pixel behavior.
Changing line 50 to
if i < 1 or j < 1 or i > 174 or j > 139
solves the issue.
5)
Some tiles are displayed wrong.This mostly happens outside with water tiles.
I will later on post a screenshot and maybe a savestate.(Problem is you can't pass this tiles even though you should be able to)
def self.update
# get current language layout
@language_layout = GetKeyboardLayout.call(0)
# get new keyboard state
GetKeyboardState.call(@state)
# this special code is used because Ruby 1.9.x does not return a char
# when using String#[] but another String
key = 0
@state.each_byte {|byte|
# if pressed state
if (byte & DOWN_STATE_MASK) == DOWN_STATE_MASK
puts 'yoloth'
# not released anymore
@released[key] = false
# if not pressed yet
unless @pressed[key]
# pressed and triggered
@pressed[key] = true
@triggered[key] = true
@repeatedKey = key
@repeatedCount = 0
puts "pressed key:" + key.to_s
else
# not triggered anymore
@triggered[key] = false
end
# update of repeat counter
if key == @repeatedKey
@repeatedCount < 17 ? @repeatedCount += 1 : @repeatedCount = 15
end
# not released yet
elsif !@released[key]
# if still pressed
if @pressed[key]
# not triggered, pressed or repeated, but released
@triggered[key] = false
@pressed[key] = false
@released[key] = true
if key == @repeatedKey
@repeatedKey = -1
@repeatedCount = 0
end
end
else
# not released anymore
@released[key] = false
end
key += 1
#puts 'key:' + key.to_s
}
end
This is the update method in question, it's working fine in vanilla rpgxp, the rpgvx ace player and arc.
The problem is that this piece of code always returns false:
if (byte & DOWN_STATE_MASK) == DOWN_STATE_MASK
While it should return true when a key is being pressed.
I have tried changing several things but none have worked so far.
I have added this simple code in the update method of Scene_Map:
Array.new(30){|index| index}.each { |i|
if Input.trigger?(i)
print i
return
end
I got very strange results!
A = 17
Z = 18
D = 16
S = 15
Q = 14
W = 11
X = 12
C = 13
Esc = 12
Space = 13
Shift = 11
CTRL = 22
ALT = 23
F5 = 25
F6 = 26
F7 = 27
F8 = 28
F9 = 29
Down = 2
Up = 8
Left = 4
Right = 6
Note only all letters except C has a wrong code with respect to https://github.com/Ancurio/mkxp/blob/master/src/input.h, some aren't even supposed to be supported like Space which triggers a C. I have been unable to find a key which triggered the code 21 for Shift.
I thought this was related to keyboard region so I switched my Belgian keyboard to US but that didn't affect the results.
Unless you didn't tested your button codes, which I doubt, perhaps it may be related to the Apple Keyboard or Mac OS X in general?
QtCore is nice and handy, but at the same time bundles a lot of unused functionality. Using libstdc++ for simple containers and boost for hash/set/program_options allows for a more targeted usage of dependencies.
This is a raw set of notes for porting:
QVector -> std::vector
Constructor(int size) -> same
::operator[] -> same (use size_t for indices)
::resize() -> same
::size() -> same
::count() -> ::size()
::constData() -> &vector[0] (::data() is C++11)
::data() -> &vector[0]
::clear() -> same
::append() -> ::push_back()
::operator<< -> ::push_back()
::reserve() -> same
::contains() -> (use std::find)
::isEmpty() -> ::empty()
::first() -> ::front()
QList -> std::vector (sufficient in most cases)
QStack -> std::stack
::pop() -> ::top() + ::pop()
QLinkedList -> std::list
::takeFirst() -> ::front() + ::pop_front()
::prepend() -> ::push_front()
QHash -> BoostHash (wrapper class)
QSet -> BoostSet (wrapper class)
QByteArray -> std::string
Constructor(const char *cstr) -> same
::constData() -> ::c_str()
::operator[] -> same
QSettings -> boost::program_options(?)
qDebug() -> Debug() (#include "debugwriter.h")
The first script can be successfully read, but when it tries to read the next one, it has 2 situations (both not good):
Thus, the program only executes the script that on the top of the script pack and quits immediately (w/ or w/o SIGSEGV)
The script pack can be read successfully by the following programs:
also, a simple test was done using MRI 2.0's irb...
irb(main):001:0> Marshal.load(IO.binread('Scripts.rxdata')).each { |scr| puts scr.class } Array Array ...
I try to port a RPG Maker XP game but some resources is in a shared directory "c:/Program Files/Common Files/Enterbrain/RGSS/Standard/".
This shared directory contains some jpg, png and ogg files, but when I copy the ogg files in the work directory, the game can not find the file. If I rename an ogg file by setting the extension to mp3, there is a SDL_sound error, if I convert the ogg file to mp3 file, it is working fine.
Exception `SocketError' at (RMX-OS) Script:771 - getaddrinfo: Either the applica
tion has not called WSAStartup, or WSAStartup failed.
I've googled around for this error but nothing relevant came up.
I've tried recompiling Ruby several times in the hopes that it would fix it but no luck so far.
Here is the output of $LOADED_FEATURES:
["enumerator.so", "G:/Pokemon_NoxMK/lib/zlib.so", "G:/Pokemon_NoxMK/lib/socket.so", "G:/Pokemon_NoxMK/lib/socket.rb"]
I'm using debian sid with OpenAL 1.14, g++ 4.8
It gives me the following error message:
[ 1%] Building CXX object CMakeFiles/mkxp.dir/src/audio.cpp.o In file included from /home/user/src/mkxp/src/al-util.h:26:0, from /home/user/src/mkxp/src/audio.cpp:29: /usr/include/AL/alext.h:139:22: error: ISO C++ forbids declaration of ‘ALCboolean’ with no type [-fpermissive] typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context); ^ /usr/include/AL/alext.h:139:22: error: typedef ‘ALCboolean’ is initialized (use decltype instead) /usr/include/AL/alext.h:139:22: error: ‘ALC_APIENTRY’ was not declared in this scope /usr/include/AL/alext.h:139:35: error: ‘PFNALCSETTHREADCONTEXTPROC’ was not declared in this scope typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context); ^ /usr/include/AL/alext.h:140:9: error: ‘ALCcontext’ does not name a type typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void); ^ In file included from /home/user/src/mkxp/src/al-util.h:26:0, from /home/user/src/mkxp/src/audio.cpp:29: /usr/include/AL/alext.h:282:9: error: ‘ALCdevice’ does not name a type typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*); ^ /usr/include/AL/alext.h:283:21: error: ISO C++ forbids declaration of ‘ALCboolean’ with no type [-fpermissive] typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum); ^ /usr/include/AL/alext.h:283:21: error: typedef ‘ALCboolean’ is initialized (use decltype instead) /usr/include/AL/alext.h:283:21: error: ‘ALC_APIENTRY’ was not declared in this scope /usr/include/AL/alext.h:283:34: error: ‘LPALCISRENDERFORMATSUPPORTEDSOFT’ was not declared in this scope typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum); ^ /usr/include/AL/alext.h:284:27: error: expected ‘)’ before ‘*’ token typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei); ^ make[2]: *** [CMakeFiles/mkxp.dir/src/audio.cpp.o] Error 1 make[1]: *** [CMakeFiles/mkxp.dir/all] Error 2 make: *** [all] Error 2
Using Qmake will produce the same error
Your resident werewolf here, and I recognize what appears to be the basis for the window class due to a very familiar glitch. Can I assume that you may have used Selwyn/Squall's window class script from 2006?
Let me explain.
Selwyn's window class assumes that the cursor rectangle 'border' area is only 1px thick, but RMXP's border was set to use a 2px wide border. Using an RMXP windowskin that uses a 2px wide border is oddly distorted, particularly the right-most side. I experienced it with Selwyn's system and with mkxp.
Selwyn's original version of the cursor rectangle class set up rectangle areas as such:
@rect['cursor_up'] = Rect.new(129, 64, 30, 1)
@rect['cursor_down'] = Rect.new(129, 95, 30, 1)
@rect['cursor_left'] = Rect.new(128, 65, 1, 30)
@rect['cursor_right'] = Rect.new(159, 65, 1, 30)
@rect['upleft'] = Rect.new(128, 64, 1, 1)
@rect['upright'] = Rect.new(159, 64, 1, 1)
@rect['downleft'] = Rect.new(128, 95, 1, 1)
@rect['downright'] = Rect.new(159, 95, 1, 1)
@rect['bg'] = Rect.new(129, 65, 30, 30)
Though it should have been:
# Rectangle Corners
@rect['cursor_up'] = Rect.new(194, 96, 28, 2)
@rect['cursor_down'] = Rect.new(194, 126, 28, 2)
@rect['cursor_left'] = Rect.new(192, 98, 2, 28)
@rect['cursor_right'] = Rect.new(222, 98, 2, 28)
# Rectangle Sides
@rect['upleft'] = Rect.new(192, 96, 2, 2)
@rect['upright'] = Rect.new(222, 96, 2, 2)
@rect['downleft'] = Rect.new(192, 126, 2, 2)
@rect['downright'] = Rect.new(222, 126, 2, 2)
# Rectangle Background
@rect['bg'] = Rect.new(196, 100, 24, 24)
And the routine that Selwyn used to draw the rectangle was unfortunately:
self.bitmap = Bitmap.new(@width, @height)
rect = Rect.new(1, 1, @width - 2, @height - 2)
self.bitmap.stretch_blt(rect, @skin, @rect['bg'])
self.bitmap.blt(0, 0, @skin, @rect['upleft'])
self.bitmap.blt(@width-1, 0, @skin, @rect['upright'])
self.bitmap.blt(0, @height-1, @skin, @rect['downright'])
self.bitmap.blt(@width-1, @height-1, @skin, @rect['downleft'])
rect = Rect.new(1, 0, @width - 2, 1)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_up'])
rect = Rect.new(0, 1, 1, @height - 2)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_left'])
rect = Rect.new(1, @height-1, @width - 2, 1)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_down'])
rect = Rect.new(@width - 1, 1, 1, @height - 2)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_right'])
When again, it should have been:
# Define cursor bitmap
self.bitmap = Bitmap.new(@width, @height)
# Handle background
rect = Rect.new(1, 1, @width - 2, @height - 2)
self.bitmap.stretch_blt(rect, @skin, @rect['bg'])
# Handle corner placement
self.bitmap.blt(0, 0, @skin, @rect['upleft'])
self.bitmap.blt(@width-2, 0, @skin, @rect['upright'])
self.bitmap.blt(0, @height-2, @skin, @rect['downleft'])
self.bitmap.blt(@width-2, @height-2, @skin, @rect['downright'])
# Handle side placement
rect = Rect.new(2, 0, @width - 3, 2)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_up'])
rect = Rect.new(0, 1, 2, @height - 3)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_left'])
rect = Rect.new(2, @height-2, @width - 3, 2)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_down'])
rect = Rect.new(@width - 2, 2, 2, @height - 3)
self.bitmap.stretch_blt(rect, @skin, @rect['cursor_right'])
As you can tell, I do have some insight. If you want a newer 'revised' version with an animated hand cursor, I can supply my version's code too.
-DerVVulfman ( http://save-point.org/ )
Is this possible?
In the configuration there's an option to execute a single script file but this is not what I'm looking for.
A library to support midi files in mkxp ideally:
The requirement of manually feeding events is there so the "0x6F" control value change event, which marks the loop start, can be detected, and event parsing can be restarted from this position in the byte stream (very cheap, as just a file seek).
It seems that RPG Maker/Ruby expect NFC filenames, but OS X normalizes filenames with (an outdated and frozen variant of) Unicode NFD on the filesystem. Here's an article explaining the difference, since I only learned about this topic after experiencing issues with filenames transferred from OS X to Linux.
As a result, the path cache generated by MKXP for files not in RGSS archives on OS X will be incorrect for filenames with decomposed characters (which are very common in Japanese games). Disabling pathCache seems to work around this, but it still seems to randomly cause some graphical issues (sometimes the title screen BG is missing, sometimes the menu doesn't update when the cursor is moved, sometimes it works perfectly; I can't tell if this is actually related to the path cache, but I haven't ever experienced these problems until now).
A suggested fix: OS X comes with a version of libiconv which can handle both NFC UTF-8, which is used by the regular old "utf-8" codec, and OS X's particular variant of NFD, which is used by the "utf-8-mac" codec. When the target host is OS X, all filename data returned by external libraries should be run through iconv to be normalized as NFC. When accessing files, outgoing filenames are automatically normalized by OS X, so iconv shouldn't be necessary for that.
The amount of possible config entries is starting to inflate the readme a little. Merging those two would lead to a smaller readme while making the sample conf a whole lot more useful (it's pretty useless atm).
It isn't that the commands aren't present. But their function was to retrieve the data contents is not present. You can try this statement within the Spriteset_Map class to see my point:
p $game_map.data[7,6,0]
my_dup = $game_map.data.dup
p my_dup[7,6,0]
In a normal RPGMaker XP project, this method would twice print the tile ID of a floor tile at the 7/6 location in the map.
However, it runs into a massive problem when run within mkxp. The question I asked myself was... WHY?
As the data field in $game_map is a table, I ran an additional check to ensure the issue was with the Table class.
s1 = Table.new(2,2)
s1[0,0] = 1
s1[0,1] = 2
s1[1,0] = 3
s1[1,1] = 4
p s1[0,1]
s2 = s1.dup
p s2[1,1]
A very simple test. I created a 2x2 table with data in each field. When I ran this within RPGMaker XP, it would retrieve data from both the original and duplicate tables. With mkxp, it again suffered an error. This again puzzled me. I looked at some info on the Table class, and it was a child class of the Object class that has both .dup and .clone commands......
So I did one more test. You COULD get a response from the below version, returning that a table exists...
s1 = Table.new(2,2)
s1[0,0] = 1
s1[0,1] = 2
s1[1,0] = 3
s1[1,1] = 4
p s1
s2 = s1.dup
p s2
And there in gave me an answer. I could get a response with both .dup and .clone indicating that it was actually copying the whole table itself. But once you try to retrieve contents from the duplicated/cloned table, you get an error. Both dup and clone were supposed to return a table with the contents, but that was where it failed. It duplicated the table, but not the contents as it is supposed to
It would have been nice if the 'Standard Library / Built-In Classes' part of the RMXP help file mentioned that the Table class was a child of the Object class. I tested the other object children and most are working fine. ;) Well, mebby not the Font class (duh), and I honestly wouldn't know how to test the IO, Viewport or Window classes. :P
I kinda forgot to add that when doing the RGSS3 Audio work. The fade-in progresses over one second, and the volume doesn't rise linearly, but by square-ly:
float fadeVolume = prog*prog; // with prog [0;1]
(RMVXA updates the progression every 20ms, but we can just stick to our trusted 10ms interval).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.