Author Topic: Danmakufu Q&A/Problem Thread v3  (Read 141538 times)

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #60 on: January 30, 2010, 08:45:17 PM »
I had the same problem with MP3s, except that they seem to get cut a bit short instead of running long. I can't get OGGs to work right at all :V

tl;dr - Danmakufu has awful sound code

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #61 on: January 30, 2010, 10:15:30 PM »
Iryan I been down that road as well with Audacity + mp3/ogg looping by adding silences and such. I have still no idea how to proper setup the sound file, but I noticed a silence in the beginning of the track ( like a second ) seems to help getting closer.

Plus I have a following up question regarding sounds/music. I have this PlaySE in my stage where a sound file is being loaded and played but it only plays for 1seconds then gets cut off. I tried both wav and mp3.
wav - 4.55mb 0:54s
mp3 - 1.1mb 0:54s

Anybody has any idea ?


Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: Danmakufu Q&A/Problem Thread v3
« Reply #62 on: January 30, 2010, 11:36:14 PM »
When I look through the various background image rips from ZUN's games, he's got them all set at 256x256 resolution. How does he manage to get that to draw on a 512x512 screen? :S

Re: Danmakufu Q&A/Problem Thread v3
« Reply #63 on: January 31, 2010, 01:11:36 AM »
i wonder if there's a way to completely make STG_FRAME dissappear and let the player move through the once covered areas

There is, IRC if you're interested. It's a fucktonne of work, so I'm not posting it here.

You probably already know how to do it anyway.


Plus I have a following up question regarding sounds/music. I have this PlaySE in my stage where a sound file is being loaded and played but it only plays for 1seconds then gets cut off. I tried both wav and mp3.
wav - 4.55mb 0:54s
mp3 - 1.1mb 0:54s

Anybody has any idea ?

Probably has something to do with why the functions PlaySE and PlayMusic exist seperately.


When I look through the various background image rips from ZUN's games, he's got them all set at 256x256 resolution. How does he manage to get that to draw on a 512x512 screen? :S

The screen is 448x384, he stretches the images. In Danmakufu, this just means setting the parameters of SetGraphicScale(x, y) to something larger than 1 (so the image is expanded). Alternatively, you could use object effects and stretch the image dynamically or to fit the screen exactly.


Re: Danmakufu Q&A/Problem Thread v3
« Reply #64 on: January 31, 2010, 01:13:19 AM »
There is, IRC if you're interested. It's a fucktonne of work, so I'm not posting it here.
Wait it's actually possible!?

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #65 on: January 31, 2010, 01:35:54 AM »
Wait it's actually possible!?

What Sonic Rei said.

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: Danmakufu Q&A/Problem Thread v3
« Reply #66 on: January 31, 2010, 01:40:52 AM »


Code: [Select]
task green{
let randx = rand_int(1,512);
let dir = rand_int(0,180);
let randy = rand_int(0,120);
loop(5){
CreateShotA(1,randx,randy,60);

SetShotDataA(1,20,1,dir,0.6,0.02,4,145);

SetShotKillTime(1,300);

FireShot(1);
yield;
}
loop(60){yield;};
yield;
}
}

Ok, I'm wondering first why my stars are spawning as default red circle bullets? After a second or so they turn into a chain of 5 stars and go on their merry way. I actually have no problem with it- the red glow effect is pretty cool- but gives me an idea, can I make them spawn as a different graphic, such as larger stars?

Edit: Yes I drop yields every other line so that Danmakufu doesn't explode, I'm still new at this. :<
« Last Edit: January 31, 2010, 01:44:34 AM by Furienify »

Re: Danmakufu Q&A/Problem Thread v3
« Reply #67 on: January 31, 2010, 02:21:13 AM »
You don't set any actions for the bullet on the 0th frame (the status it has when it spawns). You set it at the 20th frame. The bullet has default actions and stati... Statuses... Sta-, whatever, actions that it will perform when you fail to call beginning attributes. Apparently, RED01 is the default graphic everything has.

task green{
      let randx = rand_int(1,512);
      let dir = rand_int(0,180);
      let randy = rand_int(0,120);
      loop(5){
         CreateShotA(1,randx,randy,60);
         SetShotDataA(1,0,1,dir,0.6,0.02,4,145);

         SetShotKillTime(1,300);

         FireShot(1);
         yield;
         }
         loop(60){yield;};
         yield;
      }
}

Wait it's actually possible!?
What Sonic Rei said.

:V
« Last Edit: January 31, 2010, 02:23:08 AM by Naut »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #68 on: January 31, 2010, 08:32:52 AM »
Probably has something to do with why the functions PlaySE and PlayMusic exist seperately.

You didn't get it :V I don't want to play it as a music. I want to play it as a SFX in the stage. I just tried mp3 format to see if it might work ( because mp3 is smaller filesize )

Also PlaySE or PlayMusic doesn't matter I discovered. It seems it is all about the music channel or something. If you call an mp3 with 'PlaySe' it will cut off the music. Seems like Danmakufu supports 1 channel for mp3/ogg and multiple channels for wav.

So again I'll reask it: Why does my wav file cuts off after 1 second =.=

Re: Danmakufu Q&A/Problem Thread v3
« Reply #69 on: January 31, 2010, 07:12:45 PM »
I think PlaySE can only play for up to like 5 seconds or something

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #70 on: January 31, 2010, 07:21:46 PM »
I made an SE play a song of 20 seconds before, so there's no time limit to sounds.
I've experimented a lot, and the cutting off has to do with the way you saved it. Apparently.
I'm not sure what it is exactly, but when I use Power Sound Editor Free to save my wavs, it always works right, but WavePad Sound Editor likes making my sound cut off when I use them in Danmakufu.

Which brings up what Helepolis said: So sounds can overlap? No matter what I do, if a sound is repeated over itself, it just restarts instead of stacks. Got a way/program to fix that, but without having Danmakufu cut off half-played sounds?
« Last Edit: January 31, 2010, 07:23:46 PM by puremrz »
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread v3
« Reply #71 on: January 31, 2010, 07:31:38 PM »
DMF will only cut off the sound if it's the same file, to prevent things like playing the "bullet shot" sound 30 times per second being really annoying. However, if you play two different sound effects one after the other (or on the same frame), they will both overlap. Official Touhou games do the same thing.
If you really need the sounds to overlap (which you usually don't, it almost always sounds really ugly), you could probably save the same file under 3 different names and cycle through them.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #72 on: January 31, 2010, 09:55:35 PM »
I'll try to edit my wav file tommorow. I have to say I didn't quite build it nicely so I'll retry that. But it is the same way I managed to build the mp3 for my title screen which was the same method. Hmmmm. Will try to let it know tommorow.


Re: Danmakufu Q&A/Problem Thread v3
« Reply #73 on: February 01, 2010, 12:59:53 AM »
You didn't get it :V I don't want to play it as a music.

I did get it (I even know what you're using it for), I wasn't answering your question, I was just speculating as to why it might do that.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread v3
« Reply #74 on: February 01, 2010, 01:24:57 AM »
If you play two different sound effects one after the other (or on the same frame), they will both overlap. Official Touhou games do the same thing.

Wasn't Danmakufu once a one of the official game's game engine?
If I had to guess, it was probably PCB's.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #75 on: February 01, 2010, 01:38:19 AM »
No, it wasn't. Danmakufu is based off of Touhou, but really has nothing to do with it other than that.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #76 on: February 01, 2010, 03:36:24 AM »
About the sound issue, I can't contribute much but more data gets us closer to the root of the problem right?

While working on my contest "entry" (lol), the sound effects I got were saved as MP3s, and when Danmakufu played them as sound effects, many of them would be cut off before they finished playing for no apparent reason. After using Audacity to convert them to WAVs with absolutely nothing else changing, Danmakufu played them perfectly fine. At that point, I just assumed that Danmakufu was just terrible at playing MP3s and only knew how to use WAVs correctly. Apparently I'm wrong about that.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #77 on: February 01, 2010, 03:38:57 AM »
Actaully danmakufu often plays WAVs better than mp3s for me as well :/

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #78 on: February 01, 2010, 08:06:49 AM »
Hey guys, just want to let you know something.

Ever notice how when using effect objects, whenever you set them as alpha rendering, whenever you set the alpha value in ObjEffect_SetVertexColor to a lower value, it seams like the RBG colors go down with it?
The truth is, it does! If you set an image in @DrawLoop with half opacity, and the same image using Effect Objects with the same alpha value as the one in @DrawLoop, the object effects seam a bit darker even though the RBG are all 255, don't they?
It seams Danmakufu renders effect objects a little differently than it does in @DrawLoop.
It only took me a few minutes to figure out how to fix this so it doesn't go dark, so here it is.
When drawing the image in effect objects, you'll actually have to make two objects. One in Alpha, and the other in Additive.

The effect object with Additive rendering goes beneath the one with Alpha. Meaning, if you were to put them both on the same ObjEffect_SetLayer, the ADD-rendered one goes in first. This will brighten the layer as much as it's darkened underneath the Alpha-rendered object, leaving the texture itself as bright as it really is, and other textures underneath the two unaffected, without loosing any brightness. Altogether, it makes effect objects look a lot more beautiful. It looks really dull if you use half-transparency using ALPHA rendering and only that one object. The ADD one is kind of needed to stabilize it all. I'll give an example, if someone asks for it.  IMPORTANT NOTE: there must be TWO images loaded. Any transparency will come out white in the ADD-rendered object, so the transparent parts must be black. Sometimes black may show when using Alpha rendering, so there must be two images, one transparent for Alpha, and one black-for-tranparent for ADD.


This is a real NEED if you make custom CutIns. You'll like the result.

Just want to say that you are awesome for finding this fault and a fix for it. I'm now using it for some of my effects.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #79 on: February 01, 2010, 08:16:44 AM »
Actaully danmakufu often plays WAVs better than mp3s for me as well :/
Except you obviously don't want WAVs for BGMs now do you.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #80 on: February 01, 2010, 08:18:02 AM »
Except you obviously don't want WAVs for BGMs now do you.
I still use em anyways :smug:

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #81 on: February 01, 2010, 09:28:26 AM »
Blargel and I started brainstorming about the WAV issue and we concluded there is a limit to using WAV files as SFX. And the limit is highly suspected < ~2 megabytes.

How did I test this? I used an original ZUN sfx ( se_extend.wav ) and started repeating it few times in audacity so the lenght increases etc. No matter how I lengthened or shortened it from 60 seconds to 30 seconds and so on, the wav file would keep cutting off. Then suddenly at 20 seconds, I got it working but also noticed the file size was relative small. To eliminate this I started testing the filesize differences.

30 seconds - 22khz Stereo 32bit - filesize ~3mb --> Gets cut off
30 seconds - 22khz Mono 16bit - filesize ~1.5mb --> No cutting off
45 seconds - 22khz Stereo 32bit - filesize ~3.4mb --> Gets cut off
45 seconds - 22khz Mono 16bit - filesize ~2.07mb --> Gets cut off  <-- Note, it is just above 2mb


?10:17:34? <Helepolis> original was 45 seconds -> stereo 32bit -> filesize 3.40mb --> cuts off
?10:17:43? <Helepolis> I am suspecting the max filesize = 2mb somehow
?10:17:54? <Helepolis> But I need to produce a wav file that reaches this limit
?10:17:57? <Helepolis> let me continue to test. got now a file 2.07mb
?10:18:46? <Helepolis> and it got cut off, 49 seconds
?10:18:52? <Helepolis> lets see if I can bring it down even further
?10:19:41? <Helepolis> yep it is filesize
?10:19:44? <KimoKeine> we need to figure out what causes mp3s to loop badly too lol
?10:19:53? <Helepolis> Filesize limits WAV usage
?10:19:57? <Helepolis> the limit is suspected 2mb
?10:20:00? <Helepolis> 2.07mb got cutoff
?10:20:03? <KimoKeine> time to post lol
?10:20:04? <Helepolis> anything below not


Finally I made a 49 seconds wav file, 16khz! Mono 16bit, filesize 1.50mb ( below 2 ) and it didn't got cut off. Conclusion: Estimated memory limit for WAV files is ~2mb.

Perhaps this is also the reason why other wav files which are played simultaneously get cut off. I don't know if Danmakufu uses the 2mb as buffer memory or each file is allowed to be < ~2mb.

So yea, there you go folks.

Edit:

Edit. Unfortunate, it is not even 2mb, maybe even less ( atleast what I encountered ). My danmakufu wav file got cut off being 1.97mb. I would advise people to experiment and try to stick as close as possible to 1.50mb
« Last Edit: February 01, 2010, 10:27:10 AM by Helepolis »

DgBarca

  • Umineko fuck yeah
  • Spoilers ?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #82 on: February 02, 2010, 04:52:02 PM »
Code: [Select]
while(!Obj_BeDeleted(obj)){

if(Turn == 0){

loop(30){yield;}
Obj_SetAngle(obj,Obj_GetAngle(obj)+ang*4);
loop(8){
loop(15){yield;}
Obj_SetAngle(obj,Obj_GetAngle(obj)+ang*2);
}
Turn=1;
}

Obj_SetSpeed(obj,Obj_GetSpeed(obj)-0.01);

if(Obj_GetSpeed(obj) <= 0){
//so stuff//
}


yield;
  }

I never knew how to make 2 different things in the while(!ObjBedeleted(obj)) thing for a obj bullet...
[21:16] <redacted> dgbarca makes great work
[21:16] <redacted> i hope he'll make a full game once

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread v3
« Reply #83 on: February 02, 2010, 06:52:47 PM »

I never knew how to make 2 different things in the while(!ObjBedeleted(obj)) thing for a obj bullet...

Please clarify what you're trying to do.

DgBarca

  • Umineko fuck yeah
  • Spoilers ?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #84 on: February 02, 2010, 07:54:24 PM »
A bullet that slow down every time, and change angle 1 time after 30 frame after the creation and 8 time with 15 frame of interval.
It's a Yamame Non-spell (just for fun)
[21:16] <redacted> dgbarca makes great work
[21:16] <redacted> i hope he'll make a full game once

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #85 on: February 02, 2010, 08:46:48 PM »
i wanted to make one certain task in a stage script stop playing, but implementing eternal yields in Wait seems to freeze danmakufu. is there any possible way besides filling the task itself with these yields?

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread v3
« Reply #86 on: February 02, 2010, 08:50:44 PM »
A bullet that slow down every time, and change angle 1 time after 30 frame after the creation and 8 time with 15 frame of interval.
It's a Yamame Non-spell (just for fun)

assuming the object bullet will be called 'obj', we would do it like this.

Code: [Select]
task bullet{let angle=0; let speed=2;
Bullet
Creation
Code
Goes
Here
Obj_SetAngle(obj,angle);
Obj_SetSpeed(obj,speed);



loop{Obj_SetAngle(obj,angle); Obj_SetSpeed(obj,speed); angle+=1/30; speed+=-0.01; yield;}
}

It doesn't HAVE to be a while(!Obj_BeDeleted(obj)) for it it to work. Loop and Ascent work too.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #87 on: February 02, 2010, 08:55:28 PM »
i wanted to make one certain task in a stage script stop playing, but implementing eternal yields in Wait seems to freeze danmakufu. is there any possible way besides filling the task itself with these yields?

Code: [Select]
loop { Wait(1); yield; }

I might be wrong.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread v3
« Reply #88 on: February 02, 2010, 09:03:39 PM »
Code: [Select]
loop { Wait(1); yield; }

I might be wrong.



the function wait(1); and yield; are practically the same thing.
that code up there tells it to loop {yield; yield;}

It's no wonder why it would just crash or freeze after that. All it's doing is delaying frames

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread v3
« Reply #89 on: February 02, 2010, 09:47:57 PM »
Code: [Select]
task ___ (var)
{
if (freezethistask == 0)
{
do anything this task want to do;
}
else
{
nothing cause freezing state;
}
yield;
}

will this method working?
when you want to freeze it, set freezethistask to 1.