Possible NSF plugin?

New releases and general discussions.

Post » Sat Aug 18, 2012 9:32 am

I'm a big retrophile (clearly, as the maker of IWBTG and IWBTG:G) who is currently making a game that's trying to have a lot of NES authenticity, down to having my music guy make music in the authentic NSF format. The idea was to take these, export them and then loop them somehow, but the thought arose... that it'd be kinda awesome to just put the NSF in there and play everything authentically. No trying to find perfect loop spots or change it every time a song is updated or converting stuff or whatever while saving a ton on file size. Now, this probably sounds really stupid, partially because it is, but such stupidity has never stopped people who are serious about this kinda stuff.

So I went looking around and found this, a set of libraries for various video game formats rolled into one. Now, I'm not a "real" programmer, but I'm not above hacking away at the sourcecode of things I barely understand to try and make things I want, so I just wanna do a few things.

Ask if anyone who's made plugins is interested in taking a swing at this (I'm not the only one interested it!). It seems relatively straight forward (maybe!) and someone experienced might be able to whip together something that would take me weeks of misery to try and kick together.

AND

Ask that if anyone has any advice when it comes to dealing with audio stuff in Construct. I know R0j0 made Audiere (which is awesome, BTW!) and has some experience with that end of things. If I take a stab at this, I'll be going in really blind

I also might be seeeeverely underestimating the potential complexity of what I'm doing. It seems to me that I could, theoretically, after trying to figure out what everything does, plug the things in the example player sourcecode into a construct plugin and hope that it works and that I can get something barebones but workable (One thing playing at a time, track select, play, pause and maybe volume). I might be totally out of my league though.

Any thoughts are appreciated. Now Imma go stare at source code and try and figure out what I'm doing.
B
12
S
4
G
4
Posts: 238
Reputation: 2,426

Post » Sun Aug 19, 2012 11:00 pm

It would be a tad time consuming making a plugin for this, the library converts the nsf to a wav stream which in turn needs some sound library to play.

I found this dll that is simpler to get working with python.
http://forum.tuts4you.com/topic/27443-nsf-player-dll-for-nes-music-files/

It has "play track"(or subsong in the example)
and "stop". It doesn't have pause or volume but perhaps it may still be useful.

The cap with needed files:
http://dl.dropbox.com/u/5426011/examples14/nsf_play.zip
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Mon Aug 20, 2012 12:01 am

The Python route seems fascinating and less hair pulling. I haven't messed with Construct's python stuff. Is there any big "gotchas" I should be concerned about? Problems that Python stuff might risk introducing?

Edit: Checked out the cap. This is awesome. It even plays VRC6 tracks as well (which would be required for my purposes). This is good enough that I might use it as is (Pause and volume would be nice but frankly, I'll live if I have to). But more importantly, this whole setup with the python scripts seems very very workable. I might look for other DLLs and other options to get a few more features, but this is loooovely. Thanks for making my life less hairpulling.kayin2012-08-20 00:13:46
B
12
S
4
G
4
Posts: 238
Reputation: 2,426

Post » Mon Aug 20, 2012 12:31 am

In the case of this example, no. You just need to include the py directory with your exported project along with python26.dll and nsf_player.dll otherwise it won't work.

Edit:
Glad it was useful.R0J0hound2012-08-20 01:01:51
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Mon Aug 20, 2012 1:55 am

ffff I tried plugging this stuff into my project and I get two python errors...

File "<string>", line 13344
class1UpInstance:
    ^
SyntaxError:invalid syntax


and

Trackeback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'System' is not defined

It's a big project so it's kinda hard to break the project down and figure out what's causing it. =/

Any advice would but lovely but at this point I might just have to accept the reasonable solution of converting things into OGGs so don't beat your self up. :Pkayin2012-08-20 01:57:19
B
12
S
4
G
4
Posts: 238
Reputation: 2,426

Post » Mon Aug 20, 2012 5:34 am

The first error is from object names that start with a digit, which is an error in python. You can fix it by making sure all object names start with a letter. The second error is a cascade from the first.

Also I fixed a small flaw in the example where it would crash if using a larger nsf file. The loaded file was being freed before the player was done using it. I updated the first link.
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Mon Aug 20, 2012 7:04 am

I read that in another thread and looked for one and couldn't find it, making me assume it was something else. So, I just looked again.

It was "1up".

:| durrrrrrrrrrrrrrrrrrrrrrrrr no wonder the class name seemed weird. I feel so dumb now, thanks!
B
12
S
4
G
4
Posts: 238
Reputation: 2,426

Post » Mon Aug 20, 2012 9:23 am

impressive work r0j0!
i'm amazed how little effort that took you, hahaha
i'm not any good with python, but i saw there was also a SPC dll (which i immediately downloaded) that i'm guessing could also be implemented by a similar method?

i'll try to keep in mind the python bug when naming objects XD



btw, could these stuff be integrated into audiere by any chance?
B
6
S
1
G
1
Posts: 52
Reputation: 858

Post » Mon Aug 20, 2012 9:39 am

No Hyphens either! Pain for me, because I have one in a family and can't figure out how to change family names!

GME in Audiere would rule, since it supports like, every retro format ever.
B
12
S
4
G
4
Posts: 238
Reputation: 2,426

Post » Mon Aug 20, 2012 6:16 pm

Here is a utility to remove the hyphens from the family names:
http://dl.dropbox.com/u/5426011/utility/rename_family2.zip
To use:
1. Put your cap in the same folder as the utility cap.
2. Change FileToLoad to reference your cap in the script.
3. Run the cap and it should create fixed.cap which should be the same as your cap except the hyphens in the family names will now be underscores.

Edit:
The use of the spc_player.dll is identical, just load it instead of nsf_player.dll.

I'm sure it's possible to integrate gme into audiere, but I'd have to investigate it further. R0J0hound2012-08-20 18:25:53
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests