Beta Nxengine


sebt3

homebrew player (P. & C.)
Joined
Sep 9, 2008
Messages
4,885
Age
44
Location
France
Website
sebt3.openpandora.org
Hi there,

Here is NXEngine. It's an opensource engine for Cave Story.

nxengine2.png


Changes to the original sources :
- use scale2x to scale the graphics
- Widescreen support
- pandora control

Still todo :
- find why it slowdown for half a second regularly

[ Download ] - [ website ]
 
Wow! Seems quite nice!! I need to get the data files and test this asap. Thanks for the port! :)
 
Michoko said:
I need to get the data files and test this asap.
The data are in the PND ;) just download it and start playing

sebt3 said:
Still todo :
- find why it slowdown for half a second regularly
Found... But it doesnt realy help : every 2 seconds the musics buffers have to be filled which takes about 0.25s. That's the slowdown.
I keep looking at a solution :(

EDIT:
Uploaded a new version, changes :
- Centered scene that doesnt fit the screen
- fixed the stutters (the trick is to spread the work to fill the buffers in smaller batches)

it's now as good as it can get imho ;)
 
Last edited by a moderator:
Can we turn off the scale2x, though? I don't like it. And what about loading mods, is that possible?
 
Cave Story running natively on the Pandora? This is sweeeeet. No Pandora yet, but it prompted me to grab the PC version of the NXEngine and start playing Cave Story all over again.

This'll rock on the Pandy. :)

Thanks sebt3!
 
Hi,

Thanks sebt3 :)

I never took the time to really play this game before, can you believe it ?!

The game is a little slow @ 500 / 600 MHz IMO, is there a frameskip option we could turn on ?

This engine requires SDL to build, would notaz improved version be of any use ?

Bye, and thanks again !

Magic Sam
 
Magic Sam said:
I never took the time to really play this game before, can you believe it ?!
errrr, no ? :D


Magic Sam said:
The game is a little slow @ 500 / 600 MHz IMO, is there a frameskip option we could turn on ?
there is a builtin frameskip code that is working not that bad

Magic Sam said:
This engine requires SDL to build, would notaz improved version be of any use ?
Scalling is done beforehand : on sprite loading. After that, no scalling is done when playing, so notaz SDL wont help much here.

What slowdown the game is music generation. Yep, you read right : the music is generated. From the code, it look like midi on dope.

The first PND I published shuttered : the game regenerated the music every 2seconds. and it took about 0.25sec each time.
So I splitted the job in smaller batches : now the game regenerate its sound buffer every 0.3s for a 0.07s impact. (as a matter of comparaison, AI + game event + redraw code cost about 0.02s every frame). Here are the solutions :
- even lower the batch size, but then you'll get hicups in the sound, not sure you want that
- stop the music generation. pretty sure nobody want that
- optimize the music generation code. but is way over my head. You'll need Exophase or notaz or any other ARM guru around here. dont hold you breath.

This not the real Cave Story engine (which I bet is more optimized). I tryed hard to get access to its source code, but Pixel never replied to my emailsand the few around here that have access to that code either did not replyed to my PM or refused to give me the source.
So that all we have.
 
Last edited by a moderator:
@ sebt3

I'm in grasstown now, and it's amazing :D

Would it be possible to remove the music generation from the code, and play these files instead ?

On a side note, what is the "legal" status of this game, now that it's available on Wiiware and co. ?

Maybe that's the reason why people around here don't want to share the source code with you ?

Anyway, bye and thanks again for your hard work !

Magic Sam
 
What would it take to make the game to play sound files, instead of generating them ?

Is OpenGL ES 2.0 an option ? If the CPU has less work to do, maybe it could cope better with music generation ?

Finally, I think the use of the DSP is out of question at the moment :(

EDIT: what about using SDL 1.3, which is Pandora optimized by cpasjuste ?

Bye, Magic Sam
 
Magic Sam said:
What would it take to make the game to play sound files, instead of generating them ?
Add support for SDL_Mixer (the internal engine use dsp directly). Remove the current threading (as SDL_Mixer use it's own). Find everywhere in the code where it change musics/sound to adapt with the new api for SDL_Mixer... and hoping that CS dont use more than 1 tune at a time....


Magic Sam said:
Is OpenGL ES 2.0 an option ? If the CPU has less work to do, maybe it could cope better with music generation ?
Once again way too much works to get something usefull. Anyway, the rendering is far from the problem in the engine.

Magic Sam said:
EDIT: what about using SDL 1.3, which is Pandora optimized by cpasjuste ?
wont help either
 
Last edited by a moderator:
sebt3 said:
Add support for SDL_Mixer (the internal engine use dsp directly). Remove the current threading (as SDL_Mixer use it's own). Find everywhere in the code where it change musics/sound to adapt with the new api for SDL_Mixer... and hoping that CS dont use more than 1 tune at a time....
Wow, a lot of work indeed ! Could the Nxengine dev(s) give you a hand on some of these issues ?
I've had a look at sound.cpp in the nxengine source code, and it seems to me that each level has its own tune, so no multiple tunes at a time IMO :) I could be wrong though...
 
Last edited by a moderator:
is there anything that could be taken from the old GP2X version of the original Cave Story to see how they handled the music generation there?
 
Stouffa said:
is there anything that could be taken from the old GP2X version of the original Cave Story to see how they handled the music generation there?
No, because Pixel don't give his permission to Notaz to port Cave Story directly to Pandora then he can't use code from the original source code
 
Last edited by a moderator:
Interesting. I play Cave Story with Ginge at the Moment, so I can continue directly with my GP2X Version of the Game straight onto the Pandora, runs flawlessly and Full Speed. :)
However, this way, it is still 4:3 through Ginge, "real" 16:9 (unstrechted of course) would be very interesting and a real reason to try this port here. ^^ But I guess I wait until these Speed Problems are gone, remember, original Cave Story runs at 200MHz onto the GP2X. ;)
 
How do I run it in 800x480? It's stuck in 640x480 here and if I try to change resolution (by pressing F3, then press X on the screen resolution option) it just drops straight back to the desktop.

D.
 
fusion_power said:
Interesting. I play Cave Story with Ginge at the Moment, so I can continue directly with my GP2X Version of the Game straight onto the Pandora, runs flawlessly and Full Speed. :)
However, this way, it is still 4:3 through Ginge, "real" 16:9 (unstrechted of course) would be very interesting and a real reason to try this port here. ^^ But I guess I wait until these Speed Problems are gone, remember, original Cave Story runs at 200MHz onto the GP2X. ;)
I'm not sure you could copy your save from the original CS, but it worth testing imho ;)
While the speed issue can still be feeled, it doesnt harm the game play.
I know the original CaveStory run on gp2x fullspeed but this is not the original engine but a clone.....


Dunny said:
How do I run it in 800x480? It's stuck in 640x480 here and if I try to change resolution (by pressing F3, then press X on the screen resolution option) it just drops straight back to the desktop.
800x480 is the default mode, I should say the only one available (as the others will crash the game :D)
May be you should get in a cave larger that the original screen :)
 
Last edited by a moderator:
Yod4z said:
Stouffa said:
is there anything that could be taken from the old GP2X version of the original Cave Story to see how they handled the music generation there?
No, because Pixel don't give his permission to Notaz to port Cave Story directly to Pandora then he can't use code from the original source code

My mistake, forgot that the GP2X one was running on the original engine, not this new one....
 
Last edited by a moderator:
sebt3 said:
fusion_power said:
Interesting. I play Cave Story with Ginge at the Moment, so I can continue directly with my GP2X Version of the Game straight onto the Pandora, runs flawlessly and Full Speed. :)
However, this way, it is still 4:3 through Ginge, "real" 16:9 (unstrechted of course) would be very interesting and a real reason to try this port here. ^^ But I guess I wait until these Speed Problems are gone, remember, original Cave Story runs at 200MHz onto the GP2X. ;)
I'm not sure you could copy your save from the original CS, but it worth testing imho ;)
While the speed issue can still be feeled, it doesnt harm the game play.
I know the original CaveStory run on gp2x fullspeed but this is not the original engine but a clone.....


Dunny said:
How do I run it in 800x480? It's stuck in 640x480 here and if I try to change resolution (by pressing F3, then press X on the screen resolution option) it just drops straight back to the desktop.
800x480 is the default mode, I should say the only one available (as the others will crash the game :D )
May be you should get in a cave larger that the original screen :)

Ah yes - my save game was near the start of the sand world. Looks lovely, but it's a real shame it's not as smooth or playable as the GP2X version via Ginge - I shall watch this one develop (if it does) with interest :)

Thanks for the port, but for now I'll stick to Ginge for Cave Story :)

D.
 
Last edited by a moderator:
Sorry if this has been rehashed in other historic threads, but I guess EvilDragon never got a response from Pixel, over porting to the Pandora, or was it a definite no answer from him? Thanks.
 
Back
Top