Author Topic: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry  (Read 243905 times)

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #600 on: June 12, 2015, 06:32:53 AM »
How many sprites (objects) do you have anyway in your stage? Or do you have large number of meshes?

I'm literally just learning how to do these, I really only fully understand 2d sprites. For more complicated backgrounds I'm using maybe 20 of them with vertexes. I was hoping to take the lazy man's route if the video thing worked out (I could just do a video of my 20 objects then use that one video as the background) but since that didn't work out I'm going to learn more about 3d sprites and look into metasequoia. I just figured it was worth asking if it could be done before I went and tried to learn a new skill. I'd like to do something like the columns in SA extra.
« Last Edit: June 12, 2015, 06:39:23 AM by TresserT »
My name is Tres. It sounds like "Tray". Tressert is "Tray-zurt"; like Tres dessert.
I've cleared every touhou game on Lunatic, and beaten every extra except SoEW.
NMNB: MoF Hard, SA Extra, UFO Extra

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #601 on: June 12, 2015, 06:42:13 AM »
20 sprites is in my opinion nothing to make the engine lag / cause FPS issues. Why are you using 2D sprites with Vertexes? Triangle strips and fans and such I guess? Why not just rectangles using the 3D sprite?

Edit: Columns in SA Extra or MoF stg6 are quite easy to make in Meta and being 6-sided they won't have much impact on the engine either.


Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #602 on: June 12, 2015, 07:01:09 AM »
20 sprites is in my opinion nothing to make the engine lag / cause FPS issues. Why are you using 2D sprites with Vertexes? Triangle strips and fans and such I guess? Why not just rectangles using the 3D sprite?

Edit: Columns in SA Extra or MoF stg6 are quite easy to make in Meta and being 6-sided they won't have much impact on the engine either.

I can do some pretty fancy stuff with 2d objects but beyond that I have no idea what I'm doing. I don't want to waste anyone's time, I'm sure I can learn how to use the other stuff (I don't even have Metasequioa), I was just asking if I needed to learn how to do that or if I could stick to my 2d objects.

Anyways, when I say vertexes I'm using around 60 of them for some objects which I thought was a lot (usually those aren't in the background though). If that shouldn't be causing lag... I don't know what could be causing it :/. Maybe my computer is just too old.
« Last Edit: June 12, 2015, 07:03:18 AM by TresserT »
My name is Tres. It sounds like "Tray". Tressert is "Tray-zurt"; like Tres dessert.
I've cleared every touhou game on Lunatic, and beaten every extra except SoEW.
NMNB: MoF Hard, SA Extra, UFO Extra

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #603 on: June 12, 2015, 07:58:40 AM »
Well, 60 is quite a lot for one object. One column should only be about 16/20 vertices (for 8/10 sides) and maybe another 3 if you have a top part.  And really many of those can be taken out if you never see the backs of the columns.

Prerendering a 3d model into a single sprite and playing with the camera properly is often more than good enough, just to mention. People have a tendency to overcomplicate backgrounds when it often isn't necessary at all. Many really nice backgrounds in Touhou games barely use anything but rectangles. What textures you use for backgrounds are more important than moar vertices, imo.

Either way, I think it would be useful to learn how to manipulate simple 3D backgrounds. If you can fiddle around with flat 2D sprite movement you can fiddle around with 3D sprite movement. The main thing is how to work the camera, and my post on the last page is basically half of a tutorial on its own.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #604 on: June 12, 2015, 08:25:00 AM »
Pretty sure you're wasting nobody's time. Out of my own curiosity I asked because reading things like: " My 3D stage lags / fps drops " means something is wrong.

@ Drake's post: Was about to say, Tresser is having lots of vertexes and if you're also "moving"  them around, the Engine is logically going to have lots of trouble rendering. ZUN hardly uses any complicated backgrounds if you examine the textures for the levels.

Meta is free to download if you stick to the free version which has all the functionalities you need to make simple models. (if you really want to use meshes)

In my HouEnbu, I have a city level which consists of lots of rectangles creating quite "complex" 3D background and I haven't heard people complaining about FPS drop. I also have several 3D models in the level, but they are usually cube-shaped. I tried avoiding as much as possible multi-sided models. Though originally, I wanted to add cars in the level. I had these free to use models with immense number of polygons. It ran fine on my system but I was afraid it could cause lag for weaker ones thus I omitted them. The actual mqo files are inside the game files and the code is commented out.


Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #605 on: June 15, 2015, 05:38:12 PM »
I need help. I would be very pleased to your help.
1) Items used to spawn in (0;0). Is there a way to delete them?
2) What I need to do, that touhou.exe opened a script immediately?
3) How to make glowing effect in 3-D backgrounds? (For example an glowing Lantern).  I can use Metasequoia  :V

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #606 on: June 15, 2015, 07:59:59 PM »
I need help. I would be very pleased to your help.
1) Items used to spawn in (0;0). Is there a way to delete them?
2) What I need to do, that touhou.exe opened a script immediately?
3) How to make glowing effect in 3-D backgrounds? (For example an glowing Lantern).  I can use Metasequoia  :V
Not quite sure if I understood your questions but:

1) If items are spawning at 0,0 it means the "location" they tried to spawn isn't existent (like an object which got deleted). Unless you mean your items keep on spawning randomly even when the object is dead > check your tasks whether you kill them proper.

2) th_dnh.def file inside your root folder can define a path to your package script package.script.main = <path to package script>. You will need to build your game as a package script. Are you familiar with package scripts?

3) Glowing effect in 3D? I am not quite sure whether you can have active glowing on a model. Not sure if ph3 allows animating textures in meshes either. I would personally use a 3D sprite (like a flare) with BillBoard function active and then manipulate that sprite in size / colour / opaque values to give the same effect. You can place the lantern itself as a mesh in the stage and use the 3D sprite for the "glowing"
« Last Edit: June 15, 2015, 08:02:11 PM by Helepolis »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #607 on: June 15, 2015, 08:35:05 PM »
@Helepolis
Big Thanks (^_−)−☆
Yes, I'm familiar with the Package scripts. I' preparing quite big project.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #608 on: June 16, 2015, 02:56:27 AM »
Why is the circle in this task rendering with its center northwest to where it should be, at (sx, sy)?

Code: [Select]
task graphics {
let mirror = ObjPrim_Create(OBJ_PRIMITIVE_2D);
ObjPrim_SetPrimitiveType(mirror, PRIMITIVE_LINESTRIP);
let vc = 64;
let vci = vc + 1;
ObjPrim_SetVertexCount(mirror, vci);
ascent (i in 0 .. vci) {
let t = 360 * i / vc;
ObjPrim_SetVertexPosition(mirror, i, cos(t), sin(t), 0);
ObjPrim_SetVertexColor(mirror, i, 0, 255, 255);
ObjPrim_SetVertexAlpha(mirror, i, 200);
}
Obj_SetRenderPriority(mirror, 0.3);
while (!isDead) {
ObjRender_SetPosition(mirror, sx, sy, 0);
ObjRender_SetScaleXYZ(mirror, sr, sr, 1);
yield;
}
Obj_Delete(mirror);
}
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #609 on: June 16, 2015, 03:20:04 AM »
You're using a Line Strip vertex layout, and not a Triangle Fan, which seems to be what you want.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #610 on: June 16, 2015, 03:23:26 AM »
You're using a Line Strip vertex layout, and not a Triangle Fan, which seems to be what you want.

So?

Elaboration: what about line strips that causes this behavior?

(And using triangle strips - not fans - causes even more problems.)
« Last Edit: June 16, 2015, 04:03:34 AM by Fluffy8x »
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #611 on: June 16, 2015, 04:18:02 AM »
Oh, sorry. I thought you were trying to render an image in triangles but the triangles weren't appearing properly, since you called it "mirror". I also interpreted that you were using Triangle Strips instead, which would obviously render the whole thing incorrectly.

This would be because you're trying to scale the whole object, rather than position the vertices differently. SetScale seems to be doing something strange, but I can't immediately tell what it is. To fix this, just set the vertex positions to cos(t)*sr instead.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #612 on: June 29, 2015, 01:38:52 PM »
Hi everyone !

I need some advices for pogramming my game (again, yes sorry ._.). Okay so I really need to know how making dialogs (like touhou 13,14 and 15 if it's not too horrible to do haha)... I don't really know how Obj_Texts work.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #613 on: June 29, 2015, 01:48:43 PM »
Saying just "I don't know how things work" is in my opinion not the correct attitude to show.

Do you know how to use objects? (Like obj bullets / sprites?)

If yes > text objects are the same. You just use the Text functions to draw/shape the text as you please.

Did you check the Wiki about text functions?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #614 on: June 29, 2015, 02:08:11 PM »
Oh yes of course I know how objects work I just never made dialogs. Yes I checked the wiki but I don't know how to manage the character graphic with the dialog (I just made dialogs with 0.12m version and functions were more precise and easy to use)...that's my main problem.
Do I have to make an object for each sentences?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #615 on: June 29, 2015, 02:44:53 PM »
Oh yes of course I know how objects work I just never made dialogs. Yes I checked the wiki but I don't know how to manage the character graphic with the dialog (I just made dialogs with 0.12m version and functions were more precise and easy to use)...that's my main problem.
Do I have to make an object for each sentences?

To use a line break in ph3, use [r] within a string. That will allow you to span multiple lines with the same text object, unless you want a different color for each word or something. So no, you do not need a separate object for each sentence.

Use ObjRender_SetX/Y/Z/Position functions to change the position of the text object on the screen.

I suggest giving the dialogue box and all dialogue higher render priorities than everything else (but not above .8) so that they always render above, and you can use ObjText_SetText() to change the text displayed using a text object

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #616 on: June 29, 2015, 08:20:51 PM »
The dialogue system itself is non existent Chester low in ph3. So you will need to manually built everything yourself from scratch.

- You need to handle the portrait displays yourself (so when someone is talking, you bring forward that picture etc)
- Meaning you will have to handle the text being put on the screen and "deleted"
- You will need to handle the key pressing (Z) to go to the next text / portrait

It is for unknown people quite a challenge if I might say.

I wish I could help with that but it is impossible to just explain in one post. . . (considering a tutorial.)

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #617 on: June 29, 2015, 08:54:43 PM »
Okay thank you very much everybody ! I managed to make a dialog and it wasn't easy omgg.  I define a valu count = 0 and if count = 1 or 2 etc, display this text... My problem now (I'm so sorry ._.) I don't know how make this kind of thing "if w is pushed, count ++", I tried much things with key functions but it does not work, count stay 0 even if a push the key.
To "solve" the problem i made a loop in mainloop like loop{count++;wait(200);} without key... But it would be better to make a dialog with keys.

(I apologize for my weird english, french dumb here)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #618 on: June 29, 2015, 11:16:34 PM »
Okay thank you very much everybody ! I managed to make a dialog and it wasn't easy omgg.  I define a valu count = 0 and if count = 1 or 2 etc, display this text... My problem now (I'm so sorry ._.) I don't know how make this kind of thing "if w is pushed, count ++", I tried much things with key functions but it does not work, count stay 0 even if a push the key.
To "solve" the problem i made a loop in mainloop like loop{count++;wait(200);} without key... But it would be better to make a dialog with keys.

(I apologize for my weird english, french dumb here)

All you need for a dialogue is to prepare everything, then edit as needed. As in, create all of your objects, then manipulate them (i.e. change the image path or text contents)

As for keys, use virtual keys. For example, one of my dialogue functions is the following:
Code: [Select]
function EventWaitA3(frames){//Original Implementation (skips through dialogue quickly) Sparen
while(GetVirtualKeyState(VK_OK) == KEY_FREE){yield;}
wait(frames);
PlaySFX(pshot);
}

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #619 on: July 08, 2015, 06:29:36 AM »
Hi,

I'm pretty new to this whole danmakufu thing, and while Sparen and Helepolis' tutorials have been massively helpful, I'm still coming across the occasional sticking point, and one such point has just reared its ugly head: casting animations. I've looked all over the forum, but I can't find a single person talking about how to do them. I've been fiddling with my code for ages, trying to create a casting animation, but I can't quite get it to work properly; the animation keeps freezing on me, and nothing I do seems to fix it. If one of you could either tell me your method for casting animations or point out what I could be doing differently with my code, it would be much appreciated. Here's my code: http://pastebin.com/bRYyZtpG. The section I'm trying to iron out the kinks in is task fireB, but I figured I'd paste the whole code in case I messed something up elsewhere that's interfering. I've already checked and doublechecked that the coordinates for the spritesheet are properly aligned, so I know that's not the problem.

Thanks,
Dwyll

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #620 on: July 08, 2015, 06:56:37 AM »
Can you elaborate a bit what you mean with: " Casting animation " ?

Is this like Byakuren's animation where a scroll is unfolded and then glowing?

Edit:
Yea ok I see what you're trying to do and that is not how it should be done. You're correct that nowhere such things are discussed. Not because they are "Expert" stuff but not necessary basic either.

What you need to do is integrate that animation block in fireB into your renderBoss task. Currently, your fireB and renderBoss are conflicting. They are both trying to animate the sprite object but that won't be happening. Remember that tasks are threads which are run simultaneous as long as "they are alive". Since both renderBoss and fireB have 1 frame (yield) delay, they will be rapid executed.

Migrate your fireB into renderBoss as follow (don't migrate sound effects or other effects). Remember that it depends on whether you want to overrule all animations when "Casting" or only when your boss is "idle" I'll give you two methods:

First define a global variable let attack = 0;

Method that will only show casting animation if the boss isn't moving around.
Code: [Select]
if(speed == 0){
if(attack == 0) {
// idle anim
}
if(attack == 1) {
// casting animation
}
}
else if(cos(dir) < 0){}
else if(cos(dir) > 0){}

Method that will overrule all animations when the casting animation is active:
Code: [Select]
if(attack == 0) {
if(speed == 0){
// idle anim
}
else if(cos(dir) < 0){}
else if(cos(dir) > 0){}
}
if(attack == 1) {
// casting anim
}

Notice the difference because it is important for the desired result. Next, anywhere you want, you just type attack = 1; to activate the casting animation and then set it back to 0 again after you're done. An example would be:

Code: [Select]
task fireShot {
attack = 1;
// Sound / visual effects or something to show it happening (concentration effect)
wait(15);
attack = 0;
// rest of your attack pattern
}

This isn't "the best" method, but easy to implement and maintain.
« Last Edit: July 08, 2015, 07:10:04 AM by Helepolis »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #621 on: July 09, 2015, 04:10:10 AM »
Helepolis - thank you so much for your help! That's solved the problem beautifully.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #622 on: July 12, 2015, 01:30:29 PM »
Hii everyone. Okay I wanna made a trial version of my danmakufu project, I made the 3 first stages with bosses and dialogs etc... Now I want to know if it's possible to configure the application to read directly the main script of my project? I didn't used package script (I don't even know how to use that ...).  My main script is a stage script :

http://pastebin.com/7F8NZxMj

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #623 on: July 12, 2015, 01:58:15 PM »
Hii everyone. Okay I wanna made a trial version of my danmakufu project, I made the 3 first stages with bosses and dialogs etc... Now I want to know if it's possible to configure the application to read directly the main script of my project? I didn't used package script (I don't even know how to use that ...).  My main script is a stage script :

http://pastebin.com/7F8NZxMj

You must use a package if you want Danmakufu to load your script upon opening.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #624 on: July 12, 2015, 02:05:40 PM »
Oh okay...but I didn't find any tutorial about package script unfortunately... So can someone help me about that? 

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #625 on: July 12, 2015, 03:22:43 PM »
Oh okay...but I didn't find any tutorial about package script unfortunately... So can someone help me about that?

Look at the sample package that comes with Danmakufu and build it yourself. There probably won't be a tutorial for packages for a while due to the knowledge required prior.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #626 on: July 12, 2015, 08:36:06 PM »
Is there a way to make the same task run using different values at the same time?
For example, I'm making the boss shoot a bullet at the player that stops, shoots out lots of bullets and then disappears.
Now I want it to instead fire bullets at 45 degrees left of where the player is and 45 degrees right of where the player is, but it seems that if i use a while loop it has to execute the entire task first, so this is the best i can do: http://pastebin.com/aqVmC4yj

Is there a way to simplify this code?

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #627 on: July 13, 2015, 06:31:14 AM »
Running one task multiple times at once is half the point. You can just give your task an angle parameter that controls where the initial bullet goes, just as you would a function.

http://pastebin.com/ghHj5y3x

This probably won't work immediately, but this should make it clear what you want to do.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #628 on: July 16, 2015, 08:40:39 AM »
Although I downloaded Reimu and Marisa script by Mr Blue and placed them in script>player, Reimu and Maria do not seem to appear on my player select screen.  The only character that appeared was default Rumia. Can anyone help me? I'm using Danmakufu ph3 and the game script I used was Koishi Hell 2 and Satori's Recollection of Scripter's Past

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #629 on: July 16, 2015, 08:54:35 AM »
If I am not mistaking, those are Danmakufu version 0.12m scripts for the old engine. Old scripts are not compatible with ph3.