Cave Story for Android/iOS (via PSX4droid/PSX4All) Theory

Dec 21, 2012 at 7:47 PM
Junior Member
"Fresh from the Bakery"
Join Date: Oct 19, 2012
Location:
Posts: 13
Okay so I have the iOS angle on this. IPad 1: works fairly well, has some slowdown in big places (I.E. egg corridor,Mimiga Village)...but that's to be expected. I haven't spotted any major bugs yet. iPod (4th generation): Just about the same, though it handles big maps a bit better. I will soon be trying it on iPhone 3G and iPad 2 (and maybe iPhone 5). It would be lovely to see some wiimote support for the ios's but I don't want to ask for too much. Also Dunc2403 you stressed your sarcasm too much.

Thank you for the testing on different devices. iPad 2 will be fine I think. The video on YouTube shows game on iPad 2. Situation with iPhone 3GS is much harder. It has resolution 480x320. As the all previous devices. Game base resolution is 320x240. Engine will rescale it for screen, but it will cut a lot of vertical space. I'm afraid, ingame UI will be broken. By anyway, check it please.

iPhone 5 will also cut some vertical space (as the 4/4s), but it will add a lot of horizontal space. Some UI can appear not in the center. Also, you will probably be able to see how Igor disappears with the Sue.

About wiimote. There is some library wiiuse, which is probably what is needed to introduce wiimote support. But I have wii device, so this support is highly unlikely now.
 
Dec 22, 2012 at 3:33 AM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Oct 24, 2012
Location:
Posts: 22
Looks like for both of our projects, a rewrite of the rendering system is in order. Yours for scaling, mine for speed. BTW, for some reason on the iOS port, the map renders at about 2-3 fps. My android port renders it at the same ~15-25 fps as everything else.
 
Dec 24, 2012 at 12:19 AM
Junior Member
"Fresh from the Bakery"
Join Date: Oct 19, 2012
Location:
Posts: 13
I have ported engine to SDL2 and changed render to use new API for hardware-accelerated rendering. But I have not changed the order of rendering operations and, sometimes, I have used closest analogues to simulate what old API does. Of course, current render is far from effective, but even this allowed me to increase average FPS from 15 to full 50. But, in case of minimap such simple way have failed.

I unable to check source code now, but, if I remember correctly, the problem is in next. Old API renders minimap to in-memory surface, which is cheap (if you forgot that old API is software rendering and everything is fucking expensive in it compared to new API). In my version of engine, minimap is drawn to the texture (FBO). But it binds FBO, draws one pixel of minimap, unbinds FBO, repeats for the next pixel. Binding/unbinding is expensive, so thats why it is so slow. But it is the close enough simulation of the render using old API.

When I moved to new renderer, I have introduced another bugs, so I left minimap problem because it was not so important.
But I remember about this issue.

By the way, I think, there must be something in new API for rendering in batches. I want to use it for level rendering. Currently each tile is rendered separately. Batching will increase performance.
 
Dec 24, 2012 at 9:31 AM
Demon taming, headphone wearing, casanova
"All your forum are belong to us!"
Join Date: Dec 31, 2010
Location:
Posts: 560
Ok pashkoff, for starters. Distribution of the original cave story is allowed so long as it remains only playable on pc (as in windows pc, mac and linux). However what is not allowed is creating and or distributing a version of cave story made for any other platform (in simpler word's a port). For example, its okay for cnet or some other website to distribute cave story on pc. However if they are distributing a port of cave story for any other platform, then it's not. And as a response to 1. While legally you're not doing anything against the law. Still, your main reason for doing this is still so you can play cave story on mobile platforms. And i think that many of this forum's members would appreciate it if you would stop. Since at the end of the day your're still to an extent, porting cave story to mobile platform's. And that is disrespectful to pixel, and we owe him some respect considering that he made cave story free and was fine with having aeon genesis translate the game and with us making mods.
 
Dec 24, 2012 at 1:07 PM
Been here way too long...
Discord Group Admin
Org Discord Moderator
"Life begins and ends with Nu."
Join Date: Oct 18, 2011
Location:
Posts: 2335
You can distribute Cave Story in whatever way you choose so long as it's a port that has already been made such as the Mac, Linux or even PSP ports. What is not allowed is to create a new port of Cave Story without permission from Pixel. What these guys are doing is not porting Cave Story, it's porting NXEngine, which is not Cave Story. The only thing they're doing that's wrong is including the Cave Story data files in their distributions. However, they are doing this simply for debugging purposes, and plan to remove the files as soon as possible. Also, why do you think many of us would want them to stop? Many of us have wanted this for a long time, but have had no way of doing it. These guys took the initiative and are working towards having it playable (key word "playable") on mobile devices other than the PSP. Once they complete the projects it will be possible for us to play Cave Story on an Android or iOS device. Whether or not somebody actually includes the Cave Story data files in their installation will be up to them, and not at all the creator of the application's fault.
 
Dec 24, 2012 at 4:43 PM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
You should remove the original Cave Story data files.

It is legally impossible to GPLv3 the original Cave Story files. They are 100% copyrighted by Nicalis and Pixel.

If the user wants to run Cave Story on NXEngine, they have to copy the data files themselves.
This is what SPG is doing with his CS clone, which is not really a clone, but a generic game engine.
 
Dec 24, 2012 at 4:51 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
none of you are lawyers
 
Dec 24, 2012 at 5:40 PM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Neither are you Noxid.

I would hire a law student, but they charge $200 or more per hour.
 
Dec 24, 2012 at 7:30 PM
Demon taming, headphone wearing, casanova
"All your forum are belong to us!"
Join Date: Dec 31, 2010
Location:
Posts: 560
Okay i will admit that in both terms i was wrong, i should have investigated a little more before answering.
 
Dec 26, 2012 at 9:52 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Oct 24, 2012
Location:
Posts: 22
pashkoff said:
I have ported engine to SDL2 and changed render to use new API for hardware-accelerated rendering. But I have not changed the order of rendering operations and, sometimes, I have used closest analogues to simulate what old API does. Of course, current render is far from effective, but even this allowed me to increase average FPS from 15 to full 50. But, in case of minimap such simple way have failed.

I unable to check source code now, but, if I remember correctly, the problem is in next. Old API renders minimap to in-memory surface, which is cheap (if you forgot that old API is software rendering and everything is fucking expensive in it compared to new API). In my version of engine, minimap is drawn to the texture (FBO). But it binds FBO, draws one pixel of minimap, unbinds FBO, repeats for the next pixel. Binding/unbinding is expensive, so thats why it is so slow. But it is the close enough simulation of the render using old API.

When I moved to new renderer, I have introduced another bugs, so I left minimap problem because it was not so important.
But I remember about this issue.

By the way, I think, there must be something in new API for rendering in batches. I want to use it for level rendering. Currently each tile is rendered separately. Batching will increase performance.
I'm still using SDL 1.3 so I guess I should update to 2 and see if it renders faster.

As for everybody else complaining about legal issues, according to Dunc2403:
Note: cavestory.org is not a licensed distributor of Cave Story.
You seem to be perfectly fine with downloading the PC versions+data but reject our new mobile ports of nxengine. Just saying.
 
Dec 26, 2012 at 10:13 PM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 31
You seem to be perfectly fine with downloading the PC versions+data but reject our new mobile ports. Just saying.
That was the official release of Cave Story for the PC though, and Nicalis and Pixel have explicitly stated 2 things:

-They're not going to inhibit the distribution of the original PC version
-No ports (Pixel said this himself, some time ago)
 
Dec 27, 2012 at 3:37 AM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Oct 24, 2012
Location:
Posts: 22
-No ports (Pixel said this himself, some time ago)
Again, these are ports of nxengine. Perfectly legal to port to anything. What I am planning on doing is adding a downloader to nxengine-ae to grab the data from cavestory.org and extract it to the proper folder.


pashkoff: I've compiled your nxengine port with sdl 2 for android and I have to say it is MUCH faster. Unfortunately, as android devices do not have the same oversized resolution as iOS devices and I can't seem to force the screen to the more compatible resolutions. Also, there are some weird graphical glitches that are also probably caused by scaling as well. Other than that great work with the gfx updates.
 
Dec 27, 2012 at 10:55 AM
Junior Member
"Fresh from the Bakery"
Join Date: Oct 19, 2012
Location:
Posts: 13
xperia64 said:
pashkoff: I've compiled your nxengine port with sdl 2 for android and I have to say it is MUCH faster. Unfortunately, as android devices do not have the same oversized resolution as iOS devices and I can't seem to force the screen to the more compatible resolutions. Also, there are some weird graphical glitches that are also probably caused by scaling as well. Other than that great work with the gfx updates.
I'm really glad that it helped to run engine much faster.

So which resolution is set? And what kind of glithces?

Wikipedia says that your xperia play has resolution 848x480. So there must be line in the log file looking like "closest w = 848, h = 480, dm = ...".
Resolution selection is made in graphics.cpp:93 in function bool Graphics::SelectResolution().
Function tries to select actual resolution with biggest width. If SDL_GetNumDisplayModes and SDL_GetDisplayMode works as it stated in documentation, than it have to be 848x480.
For your device it will select scale factor = 848/320 = 2. Than it will set engine base resolution (resolution used by everithyng in the engine for rendering before scaling) to
w = 848/2 = 424 - much bigger than standard 320
h = 480/2 = 240 - same as the standard
 
Dec 27, 2012 at 7:18 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Oct 24, 2012
Location:
Posts: 22
I enabled the iphone resolution chooser and it set it to
Code:
Graphics::SetResolution(3)
closest w = 854, h = 480, dm = 2232750082
SDL_CreateWindow: 852x480 @ 16bpp
Now the game is offset to the right but it looks like its scaled correctly. As for the graphical glitches, I fixed the major ones by using the data you included instead of mine. The only real issue is that except when the game is first started, the stage textures don't load. When I forced the resolution to 320x240, it would load these textures but at the correct scaling it doesn't. In the first cave, the only things that show up are enemies, the star blocks, and a health container.
 
Dec 27, 2012 at 7:22 PM
Junior Member
"Fresh from the Bakery"
Join Date: Oct 19, 2012
Location:
Posts: 13
xperia64 said:
Now the game is offset to the right but it looks like its scaled correctly. As for the graphical glitches, I fixed the major ones by using the data you included instead of mine. The only real issue is that except when the game is first started, the stage textures don't load. When I forced the resolution to 320x240, it would load these textures but at the correct scaling it doesn't. In the first cave, the only things that show up are enemies, the star blocks, and a health container.
I have no idea, what causes such glitches. Never seen such stuff.
 
Dec 28, 2012 at 5:02 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Oct 24, 2012
Location:
Posts: 22
Btw, the map draws at the same 30-50 fps as everything else on android. I'll see if I can figure out why it isn't loading the textures.


I managed to fix the missing texture glitch by forcing it to reload the tileset even if it thought it was already loaded.
 
Jan 5, 2013 at 4:19 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Dec 19, 2012
Location:
Posts: 3
Hey there again, just to try to reiterate the issue I'm having with NXEngine.

For some reason the program doesn't resize it to my resolution (probably because it's at such a weird resolution of 1280x672), so after clicking the screen to boot the game engine, it remains at the original size of 320x240, which on my end makes it very tiny, about 1/9th of the entire screen.

Which file do I have to edit in order for this to stop happening? I'm not looking for a perfect fix to make it fit the entire screen, but if I can get it to work even at 640x480, I could then mess around with it some more. Thanks.
 
Jan 5, 2013 at 4:58 AM
Junior Member
"It's dangerous to go alone!"
Join Date: Dec 6, 2012
Location: Edolas
Posts: 40
andwhyisit said:
1. It was Pixel that requested a halt on ports, not Nicalis.
2. Pixel has no interest in having Cave Story ported to touchscreen-only devices.
3. PSX means Playstation 1, the Playstation had the name PlayStation Experimental or PSX during development and the abbreviation PSX stuck. Cave Story is an unsigned PSP eboot, you cannot emulate it on a PSX emulator.
4. There is no DOS Cave Story port.
5. PSX4PSP eboots are just Playstation 1 isos packaged into an eboot to use on the psp's inbuilt PSX emulator. This doesn't mean that it can acually emulate PSP eboots.
6. You'd have a better chance of finding a GP2X emulator than a PSP one working on iOS or Android, and even that is unlikely. Let's be honest here.
7. I hear NXEngine has problems with it like broken hitboxes and the like.

Linux for iOS might be your best bet, but it's still in the works.

EDIT: But you can already get linux with Andriod by the looks so you can try that if you have an android phone.

http://www.youtube.c...h?v=4d_diU7i7Z0

You might be able to skip ubuntu and run CS Linux directly from the command line if you want. *shrug*

Of course you will likely need to edit key assignments in the CS Linux binary with a hex editor in order to make it work with the keypad. You'll also need to find a way to inject CS Linux into the linux .img file if you are running from ubuntu. Oh and make sure that SDL 1.2 is installed.

Any way you look at it you'll have a fair amount of work ahead of you trying to get this working and it won't be as simple as plugging it into an emulator.

Captain Fabulous said:
  • Thanks for double posting.
  • Nicalis has asked for no more Cave Story ports to be made, since that is their business now and they own the rights to Cave Story.
  • Welcome to the forums.
  • :3

Lord_Solrac2 said:
Ok... I've read few topics and I've come to realize... the only handheld, closest port is the PSP...
PSX4* can Play PSX4PSP eboot files... meaning... If We Can Get the Whole package (eboot+data.csz) into a psx compatible package :3 we might be able to play it on our devices!! (Yes, Im a bit unwaitable for Cave Story for iOS :3)

Any Suggestions??

IF There's such a thing as "GXP2 emulator for handhelds" it would be even cooler for us :3

IF there were such a port as a port for DOS, x10 Easier! We all get to have the DOSBox! (iDOS for iOS though)

PS:: Android/iPT4 Owner, iOS Dev.

IDEA >> We Could Port the NX-Engine! :D (Cave Story Emulator/Port)
I heard that there's a port for a texas graphing calculator.... Is that true?
 
Jan 5, 2013 at 10:21 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Apr 19, 2009
Location:
Posts: 3788
Age: 17
Yep.
(next time check cavestory.org/downloads_game.php)
 
Top