Jump to content


Photo

Nxengine


  • Please log in to reply
33 replies to this topic

#1 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 19 June 2011 - 04:03 AM

Hi there,

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

Posted Image

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 ]

#2 Michoko

Michoko

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male
  • Location:France

Posted 19 June 2011 - 02:12 PM

Wow! Seems quite nice!! I need to get the data files and test this asap. Thanks for the port! :)

#3 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 19 June 2011 - 02:20 PM

I need to get the data files and test this asap.

The data are in the PND ;) just download it and start playing

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 ;)

Edited by sebt3, 19 June 2011 - 03:02 PM.


#4 Blue Protoman

Blue Protoman

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 391 posts

Posted 19 June 2011 - 03:35 PM

Can we turn off the scale2x, though? I don't like it. And what about loading mods, is that possible?

Edited by Blue Protoman, 19 June 2011 - 03:37 PM.


#5 Line O'Sevens

Line O'Sevens

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 382 posts
  • Gender:Not Telling
  • Location:Brisbane, Australia

Posted 19 June 2011 - 11:56 PM

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!

#6 Magic Sam

Magic Sam

    Forever Homebrew

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 565 posts
  • Gender:Male
  • Interests:Playing retro games, listening to weird music, reading books, learning foreign languages...

Posted 20 June 2011 - 08:22 AM

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

#7 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 20 June 2011 - 12:27 PM

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

errrr, no ? :D


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

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.

Edited by sebt3, 20 June 2011 - 12:29 PM.


#8 Magic Sam

Magic Sam

    Forever Homebrew

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 565 posts
  • Gender:Male
  • Interests:Playing retro games, listening to weird music, reading books, learning foreign languages...

Posted 20 June 2011 - 01:05 PM

@ 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

#9 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 20 June 2011 - 01:28 PM

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

Nice idea, but lot's of works to do so, way mopre than what I planned to do on this...

#10 Magic Sam

Magic Sam

    Forever Homebrew

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 565 posts
  • Gender:Male
  • Interests:Playing retro games, listening to weird music, reading books, learning foreign languages...

Posted 20 June 2011 - 02:23 PM

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

Edited by Magic Sam, 20 June 2011 - 02:29 PM.


#11 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 20 June 2011 - 02:42 PM

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....


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.

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

wont help either

#12 Magic Sam

Magic Sam

    Forever Homebrew

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 565 posts
  • Gender:Male
  • Interests:Playing retro games, listening to weird music, reading books, learning foreign languages...

Posted 20 June 2011 - 03:11 PM

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...

#13 Stouffa

Stouffa

    GP32 Hardcore

  • Members
  • PipPipPipPip
  • 118 posts
  • Gender:Male
  • Location:Cork, Ireland

Posted 20 June 2011 - 04:01 PM

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?

#14 Yod4z

Yod4z

    Mega GP Mania

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 885 posts
  • Gender:Male
  • Location:France

Posted 20 June 2011 - 04:14 PM

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

#15 fusion_power

fusion_power

    Mega GP Mania

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 2998 posts
  • Location:germany
  • Interests:GP2X ;)

Posted 20 June 2011 - 04:23 PM

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. ;)