Maidens of the Kaleidoscope

~Hakurei Shrine~ => Rika and Nitori's Garage Experiments => Topic started by: Nuclear Cheese on September 07, 2009, 05:03:32 AM

Title: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 07, 2009, 05:03:32 AM
EDIT: I've been too lazy to update this post, so it's gotten rather out-of-date.  Please check the latest posts for up-to-date information.



Okay, so it seems that a few people think I should make a "better version of Danmakufu".  Stuffman is apparently even volunteering to pay me "... TWENTY BUCKS maybe!" (http://www.shrinemaiden.org/forum/index.php?topic=385.msg42414#msg42414) (:V), so I figured I'd sit down and start to think out how it would be done.


Please note:
As of right now I have not started any actual work on this.  Like I said before, I do want to go ahead with this, but I need to make sure I can devote time to it - I wouldn't want to leave you guys with a half-finished program ;).



First Item: Things that could be improved from Danmakufu:
- No power items
- No easy way to modify the game frame (the graphics outside the play area)
- (IMO) Tasks
- Program freezes when a script infinite-loops
- Inability to specify what layer when drawing things
- Difficulty of putting together a stage or full game
- RGB(0,0,0) as transparency causes usability issues
- No easy way to do good looping music
- No easy way to enumerate enemies
- Pause music when game pauses; separate music on gameover/continue screen, resume music on continue
- Make player scripting easier (looking for specifics, if possible)
- Store dialog (and other?) text in a separate file, to facilitate making translations
- No way to change playfield size (low priority issue IMO)
- Compiled format to distribute scripts in (low priority issue IMO)

Feel free to contribute your thoughts to this list - it is one of the main driving lists for the feature set of the proposed new program.



Second Item: Structure:
Unlike Danmakufu, I would want to make this a purely event-oriented setup.  Here's how it would work:

1) We have several object types: player, enemy, enemy bullet, etc.

2) Each object type has several events, with script code for each of them.  These include:

It should be noted that ...

3) With the above setup, each object we create will have an object type assigned to it, and thus will have its behavior scripted by those events.

(do you hate the color yellow yet? :P)




Third Item: Code:
Overall, I like the C-style syntax that Danmakufu has, so the target code structure would probably be similar to that in many ways.  Suggestions for specifics are welcome at this point, since I don't have any finalized vision of how it'll be yet.

One idea I have is to contain the script for each object type in its own file.  This allows a good segmentation of functionality, although with a complicated script it may start to get messy with the number of files.

EDIT: The general consensus seems to be that being able to group together object types in the same file is better.  So that's how I'll make things.

Internally, the script will be converted into a binary code (or something similar) when the file is read in, to simplify execution.  I'm basically picturing this internal code to be much like machine/assembler code - each command is a single action, simple and straightforward.  In other words, if you had a formula "a =  (b + 7) * 3 + c", it would translate to something like:
(Where temp1 and temp2 are internal temporary variables to store intermediate results)

The long-term goal is that script-writers won't have to even know about the internal code, although I may allow access to it in scripts anyways ...


Also, related to the code is what data-types the code will support.  I think we can get away with the following:



Fourth Item: Implementation:

As I mentioned previously, this would be implemented using SDL.NET and OpenGL in C#.  The main advantage of this is that it should be entirely cross-platform portable (without even recompiling!) using Mono.


To note:
As part of the imlpementation of the script parser, I plan on adding a feature to kill infinite loops.  The idea is that, if any single event script executes over, say, a million commands, it's up to no good and we need to kill things.  Exact limit is TBD, of course.



Fifth Item: Program's Name:

I'm thinking 無数の弾幕 ("Musuu no Danmaku" - "Countless Barrages") ... any objections/recommendations?



Sixth Item: An Idea for Bullet Graphics:

Know how right now we have a fixed set of bullet colors in Danmakufu?  And how you need a new image file if you want a different color?  I've got an idea that can simplify this a bit ...

First - by my observation, the (vast majorify of) bullets in Touhou and Danmakufu consist of the bullet's color, white, and shades between these two.  So, my plan is to color-code the image file:
- Use the green channel to indicate how strongly the bullet's color will be used at that pixel
- Use the red channel to indicate how strongly the white color will be used at that pixel
- Perhaps use the blue channel for a second color (do we have any two-color bullets?)

This way, we can use one bullet image and create any color of bullet with that shape!  Of course, to aid with easy operation, values for "regular" colors, such as red, orange, etc., will be included in the program.
Of course, there should still be a way to draw a image file normally for a bullet.

I could also write a quick program to take a normal bullet graphic, along with it's color, and generate a "generic" color-coded graphic like I describe above from it.



Seventh Item: Misc. Notes:

It is important to realize that this program will not be script-compatible with Danmakufu.  IMO, if we try to keep such compatibility, it'll stifle the ability for this program to rise above Danmakufu's limitations and quirks.
Though, it would certainly be possible to create a "script converter" that would be able to, at least in the case of simpler scripts, automatically convert them to this program's script language.  But I doubt it would be able to do anything that gets too complex.

It could be possible to implement a Danmakufu script interpreter within this program.  This would probably have to be implemented as an entire separate branch of execution from the execution engine described above, though, and I doubt it'd be top priority ...



Eighth Item: A Sample of How a Script Could Look:

Here's a sample of how a simple boss script could look - this script would just fire a bullet at the player every 1/2 second.  Please note that, as mentioned above, I don't have the syntax finalized in any way, so this is all speculative.

Code: [Select]
enemy_boss_object_type "Stupid_Boss"
{
   // typical counter variable
   count = 60;

   // holds the image file name for easier reference
   graphic = "teh_boss.png"

   Initialize
   {
      // Initialize necessary stuff
      SetLife(100);
      MoveTo(GetCenterX(), 100);
      SetCollisionSize(24);
      LoadGraphic(graphic);
   }

   Tick
   {
      count = count - 1;
      if (count <= 0)
      {
         count = 30;

         // Fire a blue shot at the player every 1/2 second
         FireShot(GetX(), GetY(), GetAngleToPlayer(), 2.0, Shot_Type_1, Blue);
      }
   }

   Draw
   {
      // Draw the boss
      DrawGraphic(graphic, GetX(), GetY());
   }

   Finalize
   {
      // Create some point items for the player at the end
      i = 0;
      while (i < 10)
      {
         CreateItem(Point_Item, GetX() + rand(-50, 50), GetY() + rand(-20, 20));
         i = i + 1;
      }
   }
}


And here's a speculative custom bullet script, which flies forward for a second, then stops and turns towards the player, then starts moving again:

Code: [Select]
enemy_shot_object_type "Silly_Shot"
{
   // Typical counter variable
   count = 60;

   // set to true once the bullet has stopped, so we won't keep stopping and restarting
   let already_stopped = false;

   Tick
   {
      count = count - 1;
      if (count <= 0)
      {
         if (!already_stopped)
         {
            spd = GetSpeed();
            if (spd > 0.1)
            {
               // We're still decelerating
               SetSpeed(spd - 0.1);
            }
            else
            {
               // We've stopped.
               SetSpeed(0);
               already_stopped = true;
            }
         }
         else if (GetSpeed() == 0)
         {
            // We've stopped, and haven't restarted yet.  Turn towards the player.
            ang_diff = GetAngleToPlayer() - GetAngle();
            if (abs(ang_diff) < 0.1)
            {
               SetAngle(GetAngleToPlayer());
               SetSpeed(2.5);
            }
            else if (ang_diff < 0)
            {
               SetAngle(GetAngle() + 0.1);
            }
            else
            {
               SetAngle(GetAngle() - 0.1);
            }
         }
      }
   }
}

Once again, please don't put too much value on the exact particulars of the scripts.  This is mainly meant to demonstrate what I mean by this whole "event-oriented" business.

The enemy boss script defines all of the necessary functions for our boss - in this case, it lines up exactly with Danmakufu's @Initialize, @MainLoop, @DrawLoop, and @Finalize.  There is no need for any Colliside handlers because the game already knows what to do when the player or a player shot hits the boss, and we're not defining any other interactions.

The bullet script only has a Tick handler - there is no need for Initialize or Finalize handlers, and it is using a default Draw handler that just draws the bullet's assigned graphic at the appropriate angle and position.  And, just like the boss script, there aren't any Collide definitions because we're only using the default collision behavior of the bullet (that is, kill the player on contact).



Ninth Item: Game Script:

One idea brought up is that, in Danmakufu , it is a bit of a pain to create a full game, especially things like menus and such.  So, my idea is to set up a "game script" file, which allows the scripter an easy way to define an entire game.
Here's an example of what I'm thinking of:

Code: [Select]
game "t3h hardest danmakuu evar lulz"
{
   // allow selection of difficulty for the main game
   Main_Game_Difficulty_Select(true);

   // define images for the difficulty selections
   Main_Game_Difficulty_Images("grade_school.png", "normal.png", "hard.png", "wtf.png");

   // enable the extra game
   Extra_Game(true);

   // allow selection of difficulty for the extra game
   Extra_Game_Difficulty_Select(true);

   // define difficulties for the extra game, in increasing order
   Extra_Game_Difficulty_List(["Extra", "Phantasm", "lulz", "OMEGA"]);

   // define images for the difficulty selections in the extra game
   Extra_Game_Difficulty_Images("extra.png", "yukari.png", "⑨.png", "Ω.png");

   // enable the music room
   Music_Room(true);

   // list of music for the music room
   music_files_list = ["01.ogg", "02.ogg", "03.ogg", "04.ogg", "etc.ogg"];
   music_names_list = ["Menu - Stuff Go Boom", "Stage 1 - Your Face", "Stage 2 - WTF Is This Shit?!",
                       "Final Stage - ZOMGWTFBBQ", "Extra Stage - lulz", "Credits - You'll Never Hear This"];
   Music_Room_Info(music_files_list, music_names_list);

   // disable spellcard practice.  Only n00bs use it anyways :V (Cheese: wait what?)
   Spellcard_Practice(false);

   // define the stages for the main game
   main_game_scripts = ["stage1_script.txt", "stage2_script.txt", "stage3_script.txt"];
   Main_Game_Scripts(main_game_scripts);

   // define the stages for the extra game
   Extra_Game_Scripts(["lulz.txt"]);

   // use EoSD-style power-up mechanics
   Power_Style(EOSD_Type);

   // define the in-between stages results screen image
   Mid_Game_Results_Screen("point_totals.png");

   // define the main game post-game script
   Main_Game_Ending("its_ovar.png");

   // define menu background image
   Menu_Background("lulz_title.png");

   // define menu option images
   Menu_Item_Images("new_game.png", "extra_game.png", "", // blank string for spellcard practice, since its disabled
                    "music.png", "highscores.png", "stage practice", "replay.png", "quit.png");
}

The idea with this is that the program will use this script to load the necessary resources for the menu, and then run the menu using its own built-in code, up until the point where it starts the actual game.  This can yield advantages, including:


Update:
A better idea came up - create a separate "menu script" language which defines each menu the game needs.

Each menu can has a set of options, including images for selected/not selected, enabled/disabled, etc.  Each option can lead to either another menu or start up an actual game.





Like I said above, I need to make sure I can devote some time into this before I start.  In the meantime, please comment on what I've spec'd out, make suggestions, etc.



Once again, on an unrelated note, I would like to ask that, if anybody has musical talent they'd like to lend to what might be my last remaining Danmakufu epic, I'd appreciate it.

Holy crap longpost is long.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 07, 2009, 05:10:01 AM
I LOVE YOU

By your description, this sounds much easier to use than Danmakufu, and has less extraordinary limitations. As you're a scripter yourself, I'm sure if someone encountered an unsolvable problem within the program, you could even just program a solution.

The scripts are extremely similar to Danmakufu as well (of course which all look like C which is delicious), and I could probably pick it up in an afternoon.

If you go through with this I will *placeholder* make some music for your epic.
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on September 07, 2009, 05:17:34 AM
Oh boy oh boy oh boy

Your code example looks fine to me; I don't have any issues with Danmakufu's syntax, I think it's pretty clean and works well so no need to reinvent the wheel in that respect, so I appreciate having the same basic layout.

Having bullets being automatically geared towards being objects would be nice. Especially being able to change the size of their hitboxes and whatnot.

I think a big thing the engine needs is the capability to make a full game without having to hack in your own title screen and stage end screens through some obtuse method. Some sort of default title screen function where you can specify the path to the title screen image, paths to scripts you can run, maybe fonts for the text. Nothing too complicated, just enough to select player/difficulty inside the script, select the extra stage, maybe a music room. In-script replays would obviously be on the complicated side so no need to get into that just yet.

By the way, if you manage to go through with this and you've got a Paypal account I will gladly make good on my offer of 20 bucks.

Maybe.
Title: Re: A replacement for Danmakufu?
Post by: Hat on September 07, 2009, 05:21:36 AM
You DO realize I would worship you for the rest of my days if you actually did this. Picking up this new script format shouldn't be too hard for me, but it would definitely undermine all the work that's gone towards people making scripts for Danmakufu... The only way around this would be for there to be a way to boot Danmakufu scripts into this, but I'm not sure anyone would have the patience to DO that.

Making it easier to actually concatenate scripts into a game would probably be a crowning achievement, IMO, since Danmakufu requires so much indirect finagling to actually accomplish this. I'm not sure if anyone else would want this, though...

And Drake, you can make music? =0

EDIT: Argh, I should pay attention to that 'people have posted while you were replying' thing. I agree with Stuffman, though, Danmakufu's scripting works fairly well... maybe I'm still fairly novice with scripting, but I think a couple things could be ironed out. Exactly what... I cannot quite compile this late. =\
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on September 07, 2009, 05:23:01 AM
I would be fully prepared to drop Danmakufu entirely and recode PoSR from scratch if a new better engine was available.

Not having to use Applocale to load it alone is a big improvement. Makes distribution much easier.
Title: Re: A replacement for Danmakufu?
Post by: Hat on September 07, 2009, 05:24:40 AM
Ooh, good point about Applocale. And if this actually went through, I think a title theme for Countless Barrages would be in order. =D I could attempt to write one, but I mostly lack the MIDI-synth programs to do actually produce such a thing.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 07, 2009, 05:31:53 AM
Another thing Danmakufu is missing. Graphic layer settings for objects.

I can even see how Stuffman's suggestions can be brought into play. Like Danmakufu had different script types for enemies and bullet definitions and whatnot, you could define different script types for not only those, but outside-playing-field properties (and tasks such as the enemy marker), title screen/menus, etc. As such you wouldn't have to jumble the different code inside the same script.

and karfloozy hasn't been to cpmc recently (http://www.shrinemaiden.org/forum/index.php?topic=1950.msg82271#msg82271)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 07, 2009, 05:53:57 AM
... I go away for half an hour, and there's already 6 posts ... jeez, you people need to go to sleep or something.  ... wait a sec, then what the hell am I doing still up? :vbang:


Glad to the the incredibly positive response so far. :D

If you go through with this I will *placeholder* make some music for your epic.

I find the irony in this amusing - "I'll make something for your Danmakufu script as soon as you make Danmakufu obsolete".

I just might hold you to this. ;)


I think a big thing the engine needs is the capability to make a full game without having to hack in your own title screen and stage end screens through some obtuse method. Some sort of default title screen function where you can specify the path to the title screen image, paths to scripts you can run, maybe fonts for the text. Nothing too complicated, just enough to select player/difficulty inside the script, select the extra stage, maybe a music room. In-script replays would obviously be on the complicated side so no need to get into that just yet.


I can even see how Stuffman's suggestions can be brought into play. Like Danmakufu had different script types for enemies and bullet definitions and whatnot, you could define different script types for not only those, but outside-playing-field properties (and tasks such as the enemy marker), title screen/menus, etc. As such you wouldn't have to jumble the different code inside the same script.

This is a good idea.  I will make note of it.

We could even give a simple set of flags to enable/disable various items ...

Furthermore, we can have the "game script" file specify images and such, and run the menu as a hard-coded piece of the program itself (rather than as a script), meaning the only thing you'd have to worry about is the images and maybe where on the screen things are placed.

By the way, if you manage to go through with this and you've got a Paypal account I will gladly make good on my offer of 20 bucks.

Maybe.

You just can't drop the "Maybe", can you? :V


Making it easier to actually concatenate scripts into a game would probably be a crowning achievement, IMO, since Danmakufu requires so much indirect finagling to actually accomplish this. I'm not sure if anyone else would want this, though...

This ties in to what Stuffman mentioned above, with the whole "simplify creating a whole game" thing.  It's certainly something to look at in detail, and I think it wouldn't be hard to do something that makes it easy.


Not having to use Applocale to load it alone is a big improvement. Makes distribution much easier.

Cool thing is, the program should (hopefully) be perfectly workable without Applocale regardless of current computer settings, since the .NET framework is, by default, fully Unicode.


And if this actually went through, I think a title theme for Countless Barrages would be in order. =D

This would be awesome. =D


Another thing Danmakufu is missing. Graphic layer settings for objects.

Noted.  Would be a simple addition.




I'll update my first post with this stuff and some related brainstorming (mainly the "game script" idea) ...



EDIT:
First post updated.


While doing so, I realized there may be a slight issue in terms of fonts.  I haven't yet figured out a way to access actual fonts on the system through OpenGL.  This isn't a big deal; the worst case scenario is we use an image-based font - although that is sub-optimal, since the character set usable is limited to what ones you've defined an image for.
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on September 07, 2009, 06:47:05 AM
Regarding the bullets using colours to create the type of colour bullet you want is a good idea, but it will require too much colorcalculating + scripting while looking at the bullet in a sheet and simply using it's ID is easier. What I would like to see is being able to load more than 255 IDs for a bullet.

Also perhaps even the possibility to load ShotData inside tasks ( multiple shotdata ). Like in the same script:

Task Barrage1{ loadshotdata(CtC style);   CreateShot bla bla bla (make danmaku hell) }
Task Barrage2{ loadshotdata(User styles); CreateShot bla bla (fire fire!) }

Or is this already possible ( afaik , not )
Title: Re: A replacement for Danmakufu?
Post by: CK Crash on September 07, 2009, 11:52:20 AM
Personally, now that I've figured out how they work, I like the way tasks are set up. Maybe you could include them with a different name, just for computability reasons. I'm also not sure why you would want to do that RGB thing with bullets, it would be overly complex when you could just change the graphics. A few other issues I have:

-Inability to change a lot of the default graphics and effects. It would be especially great if a full game script could have a few simple functions to completely overhaul the default graphics temporarily.

-Random incompatibility with MP3 files. Many times I have to change my desired BGM just because danmakufu refuses to play it for no visible reason.

-Issues with adding new shot data. There really shouldn't be an ID limit, and you should be able to use multiple files within a shot data file. In addition, you should be able to change the alpha of additive bullets, because the fire bullets from TH9.5+ look really terrible IMO. Perhaps a way to name the bullets beyond their ID, so I don't have to make a separate file with RED12 = 123, and such?

I would be glad to help make some menu graphics, default bullets, and such.
Title: Re: A replacement for Danmakufu?
Post by: Hat on September 07, 2009, 03:16:23 PM
and karfloozy hasn't been to cpmc recently (http://www.shrinemaiden.org/forum/index.php?topic=1950.msg82271#msg82271)
lol, I haven't been to COMPUTER recently, let alone MotK... =\

And any concept of an improvement to Danmakufu would OBVIOUSLY generate a positive response, Nuclear Cheese. XD I think we're all a little tired of "these numbers are too big, I'm going to stop working nao" or "bullet graphics? You mean fun white squares? I think you want fun white squares. Here's some fun white squares." (I refer to danmakufu's stupid alpha rendering... hm)
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 07, 2009, 04:40:17 PM
Oh yes, proper music looping would be great.
Also just because I've had trouble with it in the past, a way to change the base angle of everything in the playable area such as SetShotDirectionType, but more controllable, would be fantastic. Of course this is relatively minor, just putting it out there.
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 07, 2009, 04:59:01 PM
Should this ever see a usable beta version, expect monies.

I'm really curious as to how you plan to handle tasks/micro-threads, since this is primarily how I code using Danmakufu nowadays. I'm a big fan of the "do this, wait x frames, do something else, repeat, etc" method, as opposed to the conditional statements and augmenting values method most people use.

Beyond that concern, everything else I had issues with has been mentioned. I'm really looking forward to seeing this program completed, so please keep us posted on your progress and let us know if you have any issues or requests. I'd like to help in any way possible, though my skillset may not be as diverse as Drake's musical or puremrz's bulletical graphical talents.
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on September 07, 2009, 05:18:58 PM
Microthreading/tasking is seriously the best step I took on field of danmakufu. It makes me build complex scripts much much easier and it was hell of a help during my afro boss and also being hell of a help with my Kisume boss ( which is almost finished )

- Tasking for sure.
- Agreeing on Drake's two points: Music looping + ShotDirectionType handling.
Title: Re: A replacement for Danmakufu?
Post by: Suikama on September 07, 2009, 05:21:50 PM
Should this ever see a usable beta version, expect monies.
Title: Re: A replacement for Danmakufu?
Post by: puremrz on September 07, 2009, 05:46:14 PM
If you make a function that can pick the music's startingpoint, endpoint and loop-beginpoint, you have my approval. :V
I'm used to working with midis in my early days of game-making, and the program I worked with (Zelda Classic) had such functions, so I'm kinda spoiled.

Will it be very hard to remake/modify danmakufu to let it become what you have in mind? At the moment danmakufu's English speaking audience seems rather small. But if you can manage to make it better usable, it'll probably get more crowded in here. I hope.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 07, 2009, 05:49:10 PM
Hell if you finish and douzo it to 2ch you'll be famous and stuff lol, never mind getting more english speakers.
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 07, 2009, 05:55:30 PM
Ah, thought of a new idea:

You should be able to change the size of the game field. The current is 448x480 (vertical style, touhou-like), you should be able to edit it at the start of a script to say, 556x400 (horizontal style, gradius-like shooter). I'd also like if the whole program was ran in a larger window -- instead of 640x480, it could be 800x600, which I think is still compatible with most computers and allows more room to work with.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 07, 2009, 06:05:02 PM
Actually, Danmakufu's screen is too big, believe it or not. Touhou has always (Windows) been 384x448.
Either way the concept's practicality holds true.
Title: Re: A replacement for Danmakufu?
Post by: Primula on September 07, 2009, 06:39:00 PM
I've been thinking, adding new cutins like Kaiedzuka(?), Fuujinroku, and Subtarranean Animism( Undefined Fantastic Object uses the same as SA).. 0.0 Though I'm not much of a expert coder.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 07, 2009, 06:54:05 PM
But you'd think that the community would be able to do that ourselves. MoF's is just bottom-right to center, then up and fade, SA's is just center-right to center, and exit left, and UFO's is nearly the same, just starting higher and reaching lower.

There's no need to force just small things that we could do ourselves, right?
Title: Re: A replacement for Danmakufu?
Post by: Primula on September 07, 2009, 07:46:17 PM
Well, I guess so...*stares at the DollTrial's scripts*
Title: Re: A replacement for Danmakufu?
Post by: MCXD on September 07, 2009, 07:46:54 PM
Totally supporting this project 100% (Not sure about being able to chip in money though...)

I will echo other people's opinions of tasks though. I think the way Danmakufu handles them is fine, and a much easier way to use Danmakufu on a whole than the traditional method. Be careful when adding them into your replacement, as it's tough to improve them without really just adding lazy functions for people (inbuilt Wait, etc).

Also if there is one thing that I demand be changed, it's the handling of transparency. Do NOT make (0, 0, 0) the transparent color like the Danmakufu developers did. It's stupid, and causes problems.

EDIT: Also seriously? Separate files for every type of bullet in the game? I think you should make it so you can have multiple scripts inside one .txt, and import them into a spell script via some sort of #include, because there is no way in heck you can expect people to have 200 .txts lying around just for the bullets the bosses will be firing.
Title: Re: A replacement for Danmakufu?
Post by: CK Crash on September 07, 2009, 08:12:39 PM
Also seriously? Separate files for every type of bullet in the game? I think you should make it so you can have multiple scripts inside one .txt, and import them into a spell script via some sort of #include, because there is no way in heck you can expect people to have 200 .txts lying around just for the bullets the bosses will be firing.
Yeah, like the way you can have an enemy script within a boss script, to be used as a familiar. In fact, every type of "GetBlahFromFile" function ought to have a "GetBlahFromScript" counterpart, because if I want to use an enemy/bullet/whatever only once, why have it in a separate file?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 08, 2009, 12:16:05 AM
Regarding the bullets using colours to create the type of colour bullet you want is a good idea, but it will require too much colorcalculating + scripting while looking at the bullet in a sheet and simply using it's ID is easier. What I would like to see is being able to load more than 255 IDs for a bullet.

I'm also not sure why you would want to do that RGB thing with bullets, it would be overly complex when you could just change the graphics.

The idea is that, you "look at the bullet sheet" to pick the bullet's shape, and then pick it's color in the script itself.  The scripter won't need to worry about the details of how it works - that'll be handled entirely in the program's code itself (probably with a simple GLSL fragment shader).

The only time any work would need to be done is if you're creating a new bullet shape, and, like I mentioned above, I could create a utility that takes a "normal" bullet image and creates the "coded" version automatically, so I think it would be pretty trivial effort on the scripter's end either way.

Of course, I will still include a way to draw a bullet as an image directly, rather than with the whole color-coded business, for when it is needed.


Also perhaps even the possibility to load ShotData inside tasks ( multiple shotdata ). Like in the same script:

Task Barrage1{ loadshotdata(CtC style);   CreateShot bla bla bla (make danmaku hell) }
Task Barrage2{ loadshotdata(User styles); CreateShot bla bla (fire fire!) }

Or is this already possible ( afaik , not )

-Issues with adding new shot data. There really shouldn't be an ID limit, and you should be able to use multiple files within a shot data file. In addition, you should be able to change the alpha of additive bullets, because the fire bullets from TH9.5+ look really terrible IMO. Perhaps a way to name the bullets beyond their ID, so I don't have to make a separate file with RED12 = 123, and such?


My idea was to have the "ShotData" loaded more on-the-fly - all you'd need to do is reference what type of bullet is needed when you fire it, and it'll load it up when that comes along.  If I have them defined as names, you won't even need to worry about overlapping ID numbers.  (For instance, if we make a CtC bullet pack, their names could all start with "CtC_".  That way, to use a CtC-style bullet, just tell it to fire a shot of type, say, "CtC_01").

The most you'll have to do have a quick pointer to where the data is defined - a simple command to say "Load the shot images defined at ___".

EDIT:
To clarify -
Each bullet needs at least the following info:
- image
- collision size

... so, I'm suggesting we have some way of defining that for each bullet.  The main difference between my approach and Danmakufu's approach is, rather than using numeric IDs, we'll using strings to name them.  This allows us to combine bullet packs more easily (as long as names don't overlap), and also gives us a much larger amount of possible IDs to work with.


Personally, now that I've figured out how they work, I like the way tasks are set up. Maybe you could include them with a different name, just for computability reasons.

I'm really curious as to how you plan to handle tasks/micro-threads, since this is primarily how I code using Danmakufu nowadays. I'm a big fan of the "do this, wait x frames, do something else, repeat, etc" method, as opposed to the conditional statements and augmenting values method most people use.

Microthreading/tasking is seriously the best step I took on field of danmakufu. It makes me build complex scripts much much easier and it was hell of a help during my afro boss and also being hell of a help with my Kisume boss ( which is almost finished )

- Tasking for sure.

I will echo other people's opinions of tasks though. I think the way Danmakufu handles them is fine, and a much easier way to use Danmakufu on a whole than the traditional method. Be careful when adding them into your replacement, as it's tough to improve them without really just adding lazy functions for people (inbuilt Wait, etc).

IMO, the event-oriented model I've set up above pretty much obsoletes tasks as I've seen them used around here.
For instance, tasks that control object shots are no longer needed, since now an "object shot" is defined as its own object type, and given its own code that is automatically run every frame.

I could add in a function called, say, Wait that will stop the object's Tick event from being called for X frames, to facilitate adding delays.

If you guys see an application for which tasks make sense, though, I can put such functionality in.


A few other issues I have:

-Inability to change a lot of the default graphics and effects. It would be especially great if a full game script could have a few simple functions to completely overhaul the default graphics temporarily.

This would likely be handled by the "Game Script" idea I threw out late last night.


-Random incompatibility with MP3 files. Many times I have to change my desired BGM just because danmakufu refuses to play it for no visible reason.

I doubt that SDL.net has any compatibility issues like this.  Unfortunately, this is one thing that would be a bit beyond my control.


I would be glad to help make some menu graphics, default bullets, and such.

Beyond that concern, everything else I had issues with has been mentioned. I'm really looking forward to seeing this program completed, so please keep us posted on your progress and let us know if you have any issues or requests. I'd like to help in any way possible, though my skillset may not be as diverse as Drake's musical or puremrz's bulletical graphical talents.

Cooltimes! :D


And any concept of an improvement to Danmakufu would OBVIOUSLY generate a positive response, Nuclear Cheese. XD I think we're all a little tired of "these numbers are too big, I'm going to stop working nao" or "bullet graphics? You mean fun white squares? I think you want fun white squares. Here's some fun white squares." (I refer to danmakufu's stupid alpha rendering... hm)

... "fun white squares"?  I've ... actually never heard of that problem.  Mind describing it a bit, so I can be sure to not make the same mistake?


Oh yes, proper music looping would be great.

- Agreeing on Drake's two points: Music looping + ShotDirectionType handling.

If you make a function that can pick the music's startingpoint, endpoint and loop-beginpoint, you have my approval. :V
I'm used to working with midis in my early days of game-making, and the program I worked with (Zelda Classic) had such functions, so I'm kinda spoiled.

I can't 100% guarentee that I can do that, but, failing that, I do have a plan B:

Split the music file into two parts: "intro" and "loop".  The intro part plays once, then the program automatically switches to the loop part and loops that indefinitely.  Would be written in as something like:
PlayMusicLoop("intro.ogg", "loop.ogg");

Opinions on this?


Also just because I've had trouble with it in the past, a way to change the base angle of everything in the playable area such as SetShotDirectionType, but more controllable, would be fantastic. Of course this is relatively minor, just putting it out there.

Currently, I'm not sure if I'm going to include a command like SetShotDirectionType, but you'll be able to get the angle to the player from any object (while you're in that object's Tick event script, at least), so adjusting the angle towards the player (or some other base) shouldn't be difficult either way.


Should this ever see a usable beta version, expect monies.

Should this ever see a usable beta version, expect monies.

Totally supporting this project 100% (Not sure about being able to chip in money though...)

Umm ... okay? :V


Will it be very hard to remake/modify danmakufu to let it become what you have in mind? At the moment danmakufu's English speaking audience seems rather small. But if you can manage to make it better usable, it'll probably get more crowded in here. I hope.

I can't really modify Danmakufu as it is, since I don't have access to the source code.  The program I'm talking about would be built from the ground up.  The hardest part would be interpreting the scripts, and I've found a way to do that so it's just a matter of finding time to push through all of it.

And my intention is to make usability a top priority - many of the complaints about Danmakufu seem to stem from odd limitations and random quirks.


Hell if you finish and douzo it to 2ch you'll be famous and stuff lol, never mind getting more english speakers.

... wait, you mean I could be famous to the Japanese for more than my "Burn Everything" script?  Whoa ... O_O


Ah, thought of a new idea:

You should be able to change the size of the game field. The current is 448x480 (vertical style, touhou-like), you should be able to edit it at the start of a script to say, 556x400 (horizontal style, gradius-like shooter). I'd also like if the whole program was ran in a larger window -- instead of 640x480, it could be 800x600, which I think is still compatible with most computers and allows more room to work with.

Actually, Danmakufu's screen is too big, believe it or not. Touhou has always (Windows) been 384x448.
Either way the concept's practicality holds true.

My plan was to have the program's resolution changable - the user can select a resolution to run the game at and it would scale the graphics accordingly (no effect on gameplay).  800x600 is a good default in my mind.
The actual playfield size will need to be determined at some point; any particular preferences?

As far as switching to a different-sized gameplay field, I could add in a "horizontal mode", although at the moment I think that would be a lower priority.


I've been thinking, adding new cutins like Kaiedzuka(?), Fuujinroku, and Subtarranean Animism( Undefined Fantastic Object uses the same as SA).. 0.0 Though I'm not much of a expert coder.

Certainly could be done, although I'm no magician with graphical effects so I might not be able to duplicate it exactly.

... on that note - I need to actually get said games at some point :-\


Also if there is one thing that I demand be changed, it's the handling of transparency. Do NOT make (0, 0, 0) the transparent color like the Danmakufu developers did. It's stupid, and causes problems.

Does this also apply to image formats which do not support transparency, or images that have no transparency channel?  Perhaps an alternative to use for such image formats is instead to use "magic magenta" (255, 0, 255) - it's a kinda odd color to begin with, so it might be "safer" to use as a transparency key.


EDIT: Also seriously? Separate files for every type of bullet in the game? I think you should make it so you can have multiple scripts inside one .txt, and import them into a spell script via some sort of #include, because there is no way in heck you can expect people to have 200 .txts lying around just for the bullets the bosses will be firing.

Yeah, like the way you can have an enemy script within a boss script, to be used as a familiar. In fact, every type of "GetBlahFromFile" function ought to have a "GetBlahFromScript" counterpart, because if I want to use an enemy/bullet/whatever only once, why have it in a separate file?

It's not a definite idea, and I could certainly see the problem you're mentioning.  Keep in mind, though, a couple things about bullet object types:


Onthenet - the whole GetBlahFromScript idea could very well end up being redundant.  If I have a command that imports all bullet types from a script file, it would most like work even if said script file is actually an enemy script that includes some shot types with it.




... this thread is moving at the speed of light already, and I haven't even done any real work yet.  Wow. :o

I have some real-life things starting up soon, but I should be able to find a chunk of time to sit some and crank out some work on this in the near future.
Title: Re: A replacement for Danmakufu?
Post by: Zengar Zombolt on September 08, 2009, 12:23:32 AM
... "fun white squares"?  I've ... actually never heard of that problem.  Mind describing it a bit, so I can be sure to not make the same mistake?
Instead of rendering the bullet, shit happens and you get a mass of squares chucked at you. Think on Drake's black squares of death mods.
Also,
You just can't drop the "Maybe", can you? :V
I will beat that.
I'll pay you 20 bucks!
Someday!
Title: Re: A replacement for Danmakufu?
Post by: Primula on September 08, 2009, 01:15:35 AM
*whistle* I did not make the following...

Code: [Select]
let CUT_KOUMA = 0;
let CUT_YOUMU = 1;
let CUT_EIYA = 2;
let CUT_KAEI = 3;
let CUT_FUZIN = 4;
let CUT_TIREI = 5;

task SPELLCARD(let spell_type, let cutin_img, let l, let t, let r, let b, let arg_angle) {
let wait_time = 40;
cutin;
task cutin {
let cut = cutin_img;
// LoadGraphic(cut);
let obj = Obj_Create(OBJ_EFFECT);
ObjEffect_SetTexture(obj, cut);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj, 5);
let wh = [l ,t, r, b];
let xy = [-(wh[2] - wh[0]) / 2, (wh[2] - wh[0]) / 2, (wh[2] - wh[0]) / 2, -(wh[2] - wh[0]) / 2, -(wh[3] - wh[1]) / 2, -(wh[3] - wh[1]) / 2, (wh[3] - wh[1]) / 2, (wh[3] - wh[1]) / 2];
let uv = [wh[0], wh[2], wh[2], wh[0], wh[1], wh[1], wh[3], wh[3]];
ascent (i in 0..4) {
ObjEffect_SetVertexXY(obj, i, xy[i], xy[i + 4]);
ObjEffect_SetVertexUV(obj, i, uv[i], uv[i + 4]);
}
if (spell_type == CUT_KOUMA) {
let start_x = GetClipMaxX + (absolute(r - l) / 2);
let end_x = GetClipMaxX - (absolute(r - l) / 2) - 15;
let move_x = (end_x - start_x) / wait_time;
Obj_SetPosition(obj, start_x, GetCenterY);
ObjEffect_SetScale(obj, 1.3, 1.3);
let al = 255 / wait_time;
ascent (i in 0..wait_time) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, i * al, 255, 255, 255);
}
Obj_SetPosition(obj, start_x + move_x * i, GetCenterY);
wait(1);
}
wait(wait_time * 1.5);
ascent (i in 0..wait_time) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, 255 - (i * al), 255, 255, 255);
}
ObjEffect_SetScale(obj, 1.3 + i * (2 / wait_time), 1.3 + i * (2 / wait_time));
wait(1);
}
}
if (spell_type == CUT_YOUMU) {
let x = absolute(r - l) / 2;
let start_y = GetCenterY - 125;
let end_y = GetCenterY + 125;
let move_y = (end_y - start_y) / (wait_time * 3);
let get_y;
Obj_SetPosition(obj, GetClipMaxX - 5 - x, start_y);
ObjEffect_SetScale(obj, 1.3, 1.3);
let al = 255 / wait_time;
ascent (i in 0..wait_time * 1.5) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, i * al, 255, 255, 255);
}
Obj_SetPosition(obj, GetClipMaxX - 5 - x, start_y + move_y * (i * 0.75));
wait(1);
}
get_y = Obj_GetY(obj);
ascent(i in 0..wait_time * 1.5) {
Obj_SetPosition(obj, GetClipMaxX - 5 - x, get_y + move_y * (i * 0.75));
wait(1);
}
get_y = Obj_GetY(obj);
ascent (i in 0..wait_time * 1.5) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, 255 - (i * al), 255, 255, 255);
}
Obj_SetPosition(obj, GetClipMaxX - 5 - x, get_y + move_y * (i * 0.75));
wait(1);
}
}
if (spell_type == CUT_EIYA) {
let start_y = GetCenterY - 50;
let end_y = GetCenterY + 50;
let move_y = (end_y - start_y) / (wait_time * 3);
let get_y;
Obj_SetPosition(obj, GetCenterX, start_y);
ObjEffect_SetScale(obj, 1.3, 1.3);
let al = 255 / (wait_time * 1.5);
ascent (i in 0..wait_time * 1.5) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, i * al, 255, 255, 255);
}
Obj_SetPosition(obj, GetCenterX, start_y + move_y * i);
wait(1);
}
get_y = Obj_GetY(obj);
ascent(i in 0..wait_time * 1.5) {
Obj_SetPosition(obj, GetCenterX, get_y + move_y * i);
wait(1);
}
get_y = Obj_GetY(obj);
ascent (i in 0..wait_time * 1.5) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, 255 - (i * al), 255, 255, 255);
}
Obj_SetPosition(obj, GetCenterX, get_y + move_y * i);
wait(1);
}
}
if (spell_type == CUT_KAEI) {
let x = absolute((r - l) / 2);
let y = absolute((b - t) / 2);
xy = [-x, x, x, -x, -y, -y, y, y];
uv = [wh[0], wh[2], wh[2], wh[0], wh[1], wh[1], wh[3], wh[3]];
ascent (i in 0..4) {
ObjEffect_SetVertexXY(obj, i, xy[i], xy[i + 4]);
ObjEffect_SetVertexUV(obj, i, uv[i], uv[i + 4]);
}
Obj_SetPosition(obj, GetCenterX, GetClipMinY + 50 + y);
ObjEffect_SetScale(obj, 1.3, 0);
let change_scale = 1.3 / (wait_time * 0.22);
ascent(i in 0..wait_time * 0.25) {
ObjEffect_SetScale(obj, 1.3, 0 + change_scale * i);
wait(1);
}
loop (wait_time * 2.5) {
wait(1);
}
descent(i in 0..wait_time * 0.25) {
ObjEffect_SetScale(obj, 1.3, 0 + change_scale * i);
wait(1);
}
}
if (spell_type == CUT_FUZIN) {
let start_y = GetCenterY + 150;
let end_y = GetCenterY - 50;
let move_y = (end_y - start_y) / (wait_time * 3);
let get_y;
Obj_SetPosition(obj, GetCenterX + 50, start_y);
ObjEffect_SetScale(obj, 1.3, 1.3);
let al = 255 / wait_time;
ascent (i in 0..wait_time) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, i * al, 255, 255, 255);
}
if (i < wait_time / 2) {
Obj_SetPosition(obj, GetCenterX + 50, Obj_GetY(obj) + move_y * 0.5);
} else {
Obj_SetPosition(obj, GetCenterX + 50, Obj_GetY(obj) + move_y * 1.5);
}
wait(1);
}
get_y = Obj_GetY(obj);
ascent(i in 0..wait_time) {
Obj_SetPosition(obj, GetCenterX + 50, get_y + move_y * (i * 1.5));
wait(1);
}
get_y = Obj_GetY(obj);
ascent (i in 0..wait_time) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, 255 - (i * al), 255, 255, 255);
}
if (i < wait_time / 4) {
Obj_SetPosition(obj, GetCenterX + 50, Obj_GetY(obj) + move_y * 1.5);
} else {
Obj_SetPosition(obj, GetCenterX + 50, Obj_GetY(obj) + move_y * 0.5);
}
wait(1);
}
}
if (spell_type == CUT_TIREI) {
let set_x = GetClipMaxX + ((r - l) / 2);
let set_y = GetClipMinY - ((b - t) / 2);
let set_radius = (absolute(GetCenterX - set_x) ^ 2 + absolute(GetCenterY - set_y) ^ 2) ^ 0.5;
let start_x = GetCenterX + set_radius * cos(arg_angle);
let start_y = GetCenterY + set_radius * sin(arg_angle);
Obj_SetPosition(obj, start_x, start_y);
ObjEffect_SetScale(obj, 1.3, 1.3);
Obj_SetAngle(obj, atan2(GetCenterY - start_y, GetCenterX - start_x));
Obj_SetSpeed(obj, ((absolute(GetCenterX - start_x) ^ 2 + absolute(GetCenterY - start_y) ^ 2) ^ 0.5) / wait_time);
let al = 255 / (wait_time * 0.95);
ascent (i in 0..wait_time * 0.95) {;
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, i * al, 255, 255, 255);
}
wait(1);
}
ascent(i in 0..wait_time * 1.5) {
Obj_SetSpeed(obj, 0.5);
wait(1);
}
ascent(i in 0..wait_time) {
Obj_SetSpeed(obj, 0 + i * 0.5);
ascent(j in 0..4) {
ObjEffect_SetVertexColor(obj, j, 355 - (i * al), 255, 255, 255);
}
wait(1);
}
}
Obj_Delete(obj);
}
}
Title: Re: A replacement for Danmakufu?
Post by: Nimono on September 08, 2009, 03:15:47 AM
I have a suggestion on something you might want to code in...maybe. Just...player homing. I'd honestly like an easier way than just factoring everything in and putting in a huge script. Like, I'd rather just have something like IsHoming(true); in the script, with, say, HomingType(REIMU_AMULET); or something to define how it'd home in. (Such that you could have different types of homing, such as true homing that follows until it hits, like Reimu's amulets, homing within a certain range, such as Sakuya's, except still true homing, etc. Maybe allow people to then code in their own homing styles, too?) At least have a homing function that picks the target itself without us having to make a lot of code to do so, and also stop the homing when there's nothing to hit, especially when a boss is dying. Just a thought, though I'm sure a few people might say that they'd rather script the homing themselves, but it'd be nice to NOT have to go through all of that.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 08, 2009, 03:24:03 AM
I have a suggestion on something you might want to code in...maybe. Just...player homing. I'd honestly like an easier way than just factoring everything in and putting in a huge script. Like, I'd rather just have something like IsHoming(true); in the script, with, say, HomingType(REIMU_AMULET); or something to define how it'd home in. (Such that you could have different types of homing, such as true homing that follows until it hits, like Reimu's amulets, homing within a certain range, such as Sakuya's, except still true homing, etc. Maybe allow people to then code in their own homing styles, too?) At least have a homing function that picks the target itself without us having to make a lot of code to do so, and also stop the homing when there's nothing to hit, especially when a boss is dying. Just a thought, though I'm sure a few people might say that they'd rather script the homing themselves, but it'd be nice to NOT have to go through all of that.
Or at the very least keep the enemy enumeration easy.
As everything is done in objects, it would be easy enough to create your own homing shots with just that.
Title: Re: A replacement for Danmakufu?
Post by: Hat on September 08, 2009, 03:26:11 AM
I agree with the enemy enumeration thing. Once you actually get a good homing code down, there's not really that much use for it aside from one or two things. It took me nine million years to actually GET a good homing code down, but I did it, and it works perfectly. =D
Title: Re: A replacement for Danmakufu?
Post by: Angry Fox on September 08, 2009, 08:00:01 AM
I had to check twice the date of posting to consider this much goodness.
A program designed to be an improvement and refinement over danmakufu.
I look forward to seeing this develop and being able to 'play test' it.

And as earlier mentioned, yes the applocale dependancy is a pain, only one system will run the program because of it...
Title: Re: A replacement for Danmakufu?
Post by: anonl on September 08, 2009, 01:43:52 PM
Consider using an existing scripting language -- creating your own is a crapload of work. Calling the C# functions from any other .NET language shouldn't be too hard.

Alternatively, you can omit the scripting language altogether. Just make Shot/Enemy/Player classes and turn Initialize/Tick/Finalize blocks into methods.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 08, 2009, 04:38:46 PM
On the subject of looping music (a subject I hold dear to my heart):

The way ZUN seems to do it is, he stores the BGMs as individual WAV files along with two numbers representing memory addresses in the WAV files. The first represents the memory address of the start of the loop, and the second represents the address of the end of the loop. So in PCB, for instance, the title screen BGM's loop begins at 0x00129300 (1217280 bytes into the WAV file), and ends at 0x00e9e420 (15328288 bytes in). I'm not entirely sure how useful this information will be; I'm also not sure how ZUN handles pausing the music when you pause the game (nor why this concept seems to have escaped Tasofro, but that's neither here no there), but just chipping in my two cents since I can't actually afford $20.

One thing to look into: being able to pause a BGM, play a different BGM, and then stopping the second BGM and resuming the first one where it left off. I suspect not bothering with this, now that the "continue" screen has its own BGM, is a good chunk of why ZUN has made continuing = "start over entire stage."

On the subject of menus:

I think the best way of handling menus (and also probably the most complicated) would be creating a secondary scripting language for how the title-menu should behave. That way, you aren't limited to making Touhou-style games; for instance, you could also make a Suguri-style game ("story mode": you select stages individually and unlock them as you beat them; "arcade mode": you play all the stages continuously; and you can also unlock and select weapons before playing, a mode where you select a boss to fight and then you only fight them, and so forth), or your own entirely different thing.

I think the best way to handle that would involve a sort of "menu screen" class with its own backgrounds, positioning of each item (absolutely or relatively) and/or a list, whether a menu-item is locked or unlocked, the appearance of the menu item if locked (i.e. the image is at 50% alpha for Extra on the title screen, "-------" instead of the name on the music room, etc), and a smattering of things that the menu-items actually do. This could also handle the pause-menu as well.

... okay, this is getting closer to 50 cents, but two more questions: 1. will it stay "scripted," or will you be able to "compile" the scripts to make it harder for someone to hax into your stuff and say, "Hey! There's a wacky unlockable-thing/ending sequence/whatever in this script!" (or just steal it, whatever)? 2. Will this project be open-source?
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on September 08, 2009, 11:24:44 PM
Consider using an existing scripting language -- creating your own is a crapload of work. Calling the C# functions from any other .NET language shouldn't be too hard.

Well, a lot of the work can be taken out if you just use a lexer (http://en.wikipedia.org/wiki/Lexical_analysis) to write the language (that's what I plan on doing with my javascript danmakufu interpreter (http://www.shrinemaiden.org/forum/index.php?topic=1628.0)). Either way, I think it would be nice if there was some sort of plugin structure that would allow for several different scripting languages. Bonus points if it's cross-platform. Just my two cents.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 09, 2009, 03:08:01 AM
I have a suggestion on something you might want to code in...maybe. Just...player homing. I'd honestly like an easier way than just factoring everything in and putting in a huge script. Like, I'd rather just have something like IsHoming(true); in the script, with, say, HomingType(REIMU_AMULET); or something to define how it'd home in. (Such that you could have different types of homing, such as true homing that follows until it hits, like Reimu's amulets, homing within a certain range, such as Sakuya's, except still true homing, etc. Maybe allow people to then code in their own homing styles, too?) At least have a homing function that picks the target itself without us having to make a lot of code to do so, and also stop the homing when there's nothing to hit, especially when a boss is dying. Just a thought, though I'm sure a few people might say that they'd rather script the homing themselves, but it'd be nice to NOT have to go through all of that.

I agree with the enemy enumeration thing. Once you actually get a good homing code down, there's not really that much use for it aside from one or two things. It took me nine million years to actually GET a good homing code down, but I did it, and it works perfectly. =D

Enemy enumeration ... noted.


As far as prescripted homing -
I think that, between the people we have around here and the relatively limited scope of different types of homing, I think we can have the different types of homing pretty well covered easily, without me screwing up a shitty built-in implementation :V



Consider using an existing scripting language -- creating your own is a crapload of work. Calling the C# functions from any other .NET language shouldn't be too hard.

Alternatively, you can omit the scripting language altogether. Just make Shot/Enemy/Player classes and turn Initialize/Tick/Finalize blocks into methods.

Well, a lot of the work can be taken out if you just use a lexer (http://en.wikipedia.org/wiki/Lexical_analysis) to write the language (that's what I plan on doing with my javascript danmakufu interpreter (http://www.shrinemaiden.org/forum/index.php?topic=1628.0)).

If you can find me a scripting language that meets the needs, I'll look at using it.

On the topic of using a .NET language itself to script things - I've considered that.  I do have a couple concerns with the approach, but if they can be solved I'll consider it.

arcane - do you know of a good lexer for .NET languages, or perhaps even a full parser generator?  I can write a lexer/parser mself, but why reinvent the wheel?



On the subject of looping music (a subject I hold dear to my heart):

The way ZUN seems to do it is, he stores the BGMs as individual WAV files along with two numbers representing memory addresses in the WAV files. The first represents the memory address of the start of the loop, and the second represents the address of the end of the loop. So in PCB, for instance, the title screen BGM's loop begins at 0x00129300 (1217280 bytes into the WAV file), and ends at 0x00e9e420 (15328288 bytes in). I'm not entirely sure how useful this information will be; I'm also not sure how ZUN handles pausing the music when you pause the game (nor why this concept seems to have escaped Tasofro, but that's neither here no there), but just chipping in my two cents since I can't actually afford $20.

One thing to look into: being able to pause a BGM, play a different BGM, and then stopping the second BGM and resuming the first one where it left off. I suspect not bothering with this, now that the "continue" screen has its own BGM, is a good chunk of why ZUN has made continuing = "start over entire stage."

Hopefully I can set up a music looping like you describe.  Right now, though, I can't guarentee it - I've only done looping whole songs thusfar.
Like I mentioned above, though, it'd be simple enough to break your music file into two pieces to use my "Plan B" approach.

For simply pausing the music - that should be simple enough.  I'm pretty sure there's a "Pause"/"Resume" feature in the SDL.NET music functions.

As far as the "pause BGM1, play BGM2, resume BGM1" thing, I'm pretty sure it's possible.  The only thing I'd need to be able to do is get where the music is when I pause it, and then restart it at that point - both of which I'm confident are perfectly feasable with SDL.NET's music routines.



On the subject of menus:

I think the best way of handling menus (and also probably the most complicated) would be creating a secondary scripting language for how the title-menu should behave. That way, you aren't limited to making Touhou-style games; for instance, you could also make a Suguri-style game ("story mode": you select stages individually and unlock them as you beat them; "arcade mode": you play all the stages continuously; and you can also unlock and select weapons before playing, a mode where you select a boss to fight and then you only fight them, and so forth), or your own entirely different thing.

I think the best way to handle that would involve a sort of "menu screen" class with its own backgrounds, positioning of each item (absolutely or relatively) and/or a list, whether a menu-item is locked or unlocked, the appearance of the menu item if locked (i.e. the image is at 50% alpha for Extra on the title screen, "-------" instead of the name on the music room, etc), and a smattering of things that the menu-items actually do. This could also handle the pause-menu as well.

This sounds like an extension of my idea of a "Game script" ... a separate menu scripting language could certainly be in order.  Perhaps script each menu as a separate "menu object" of sorts, where each menu item can lead to a new menu or start up a game session.

Hmm ... the possibilities!



... okay, this is getting closer to 50 cents, but two more questions: 1. will it stay "scripted," or will you be able to "compile" the scripts to make it harder for someone to hax into your stuff and say, "Hey! There's a wacky unlockable-thing/ending sequence/whatever in this script!" (or just steal it, whatever)? 2. Will this project be open-source?

1) My plan is to have support for regular script files to be readable directly into the program.  If there is demand for a compiled format (so you can keep the ending hidden/stop Suikama from stealing shit*), I can add it in.

2) Currently my intention is not to open-source it ... not that I don't like open source stuff, but I'm not too comfortable with just throwing my code out there.  If there's heavy demand, I may change my mind though.



Either way, I think it would be nice if there was some sort of plugin structure that would allow for several different scripting languages. Bonus points if it's cross-platform. Just my two cents.

Supporting multiple different scripting languages is certainly possible, and an idea that I've been thinking about myself a bit.  Making it plugin-based (by .dll's, I'm assuming) would be a slight bit tricky, but certainly feasible.


* Suikama - don't take offense.  I'm just joking around ^__^
Title: Re: A replacement for Danmakufu?
Post by: Suikama on September 09, 2009, 03:30:54 AM
1) My plan is to have support for regular script files to be readable directly into the program.  If there is demand for a compiled format (so you can keep the ending hidden/stop Suikama from stealing shit*), I can add it in.
You'll never stop me! :V
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on September 09, 2009, 03:36:30 AM
arcane - do you know of a good lexer for .NET languages, or perhaps even a full parser generator?  I can write a lexer/parser mself, but why reinvent the wheel?

Yeah, there's a bunch for .NET: http://en.wikipedia.org/wiki/List_of_parser_generators

I can't give you any specific one over the other, due to the fact that I don't know much about .NET.

It would be great if this was open source, that way I could transcribe your parser into my engine; I can't do that very easily with danmakufu, it would probably cut the time I'd need to spend on it in half.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 09, 2009, 05:00:26 AM
Well, then, I demand that you make it open-source and include a "compiled" format! ;)

Seriously, though: open-sourcing it would make it a lot easier for people to find and fix bugs, make their own versions, add in "compiled" support if you never make it, pick up the project if you suddenly suffer a fatal heart attack or just lose interest, etc ... ;3
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 10, 2009, 02:49:35 AM
arcane - do you know of a good lexer for .NET languages, or perhaps even a full parser generator?  I can write a lexer/parser mself, but why reinvent the wheel?

Yeah, there's a bunch for .NET: http://en.wikipedia.org/wiki/List_of_parser_generators

I can't give you any specific one over the other, due to the fact that I don't know much about .NET.

Whoa, awesome find.  This could help significantly.  I shall have to investigate.
How the hell did I not think to check for such a page?


It would be great if this was open source, that way I could transcribe your parser into my engine; I can't do that very easily with danmakufu, it would probably cut the time I'd need to spend on it in half.

Well, then, I demand that you make it open-source and include a "compiled" format! ;)

Seriously, though: open-sourcing it would make it a lot easier for people to find and fix bugs, make their own versions, add in "compiled" support if you never make it, pick up the project if you suddenly suffer a fatal heart attack or just lose interest, etc ... ;3

Jeez, you people and your demands :V

I'll think about the open source thing - probably can set it up once the codebase gets to a decent, stable point.  Never set up such a thing before, though, so when that point comes around, I'll be looking for advice/support on setting it up.

And I'll add a compiled format to the list of features, although please keep in mind that I think it'll be a low-priority feature for the time being.



1) My plan is to have support for regular script files to be readable directly into the program.  If there is demand for a compiled format (so you can keep the ending hidden/stop Suikama from stealing shit*), I can add it in.
You'll never stop me! :V

Is this a challenge?  >:D
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 10, 2009, 04:34:20 AM
Well, then, I demand that you make it open-source and include a "compiled" format! ;)

Seriously, though: open-sourcing it would make it a lot easier for people to find and fix bugs, make their own versions, add in "compiled" support if you never make it, pick up the project if you suddenly suffer a fatal heart attack or just lose interest, etc ... ;3

Jeez, you people and your demands :V

I'll think about the open source thing - probably can set it up once the codebase gets to a decent, stable point.  Never set up such a thing before, though, so when that point comes around, I'll be looking for advice/support on setting it up.

And I'll add a compiled format to the list of features, although please keep in mind that I think it'll be a low-priority feature for the time being.
Fair enough. If "getting started on it" is part of the source of the problem with open-source, I can certainly sympathize. ;)
Title: Re: A replacement for Danmakufu?
Post by: Lawence Codye on September 10, 2009, 08:06:12 AM
I'd definitely like to see power items/power system put in there somewhere & for the player/character scripts to be easier to put together(?)...suggestions on how to go about this, I got nothing...
Title: Re: A replacement for Danmakufu?
Post by: Infy♫ on September 10, 2009, 05:58:13 PM
I had the idea of making some sort of rules.ini file like with the game red alert 2 (if you know how to mod it)
the point here would be that you can modify many things outside of the actual game, such as:
title screen music, define if there is an extra stage and whats required to unlock it, the stage script list, a song title list, and such things.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 10, 2009, 07:22:10 PM
The initialization file just points the code towards the files you want. Useful fr expansions and the like, but considering you'll be doing all the coding and inputting files in the script itself which can be edited, there's not much point, imo.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 10, 2009, 08:24:52 PM
Random idea: put things like dialogue etc. in a specific separate file, for the purposes of making it easier to translate the game into other languages.
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on September 10, 2009, 09:07:02 PM
Jeez, you people and your demands :V

I'll think about the open source thing - probably can set it up once the codebase gets to a decent, stable point.  Never set up such a thing before, though, so when that point comes around, I'll be looking for advice/support on setting it up.

I'd be willing to help you out there, I know a lot about open source. PM me if you want.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 11, 2009, 01:28:08 AM
I'd definitely like to see power items/power system put in there somewhere ...

I already have a note for power items.




... & for the player/character scripts to be easier to put together(?)...suggestions on how to go about this, I got nothing...

I'm not too familiar with Danmakufu's player scripting; any particular points that people felt were bad?



I had the idea of making some sort of rules.ini file like with the game red alert 2 (if you know how to mod it)
the point here would be that you can modify many things outside of the actual game, such as:
title screen music, define if there is an extra stage and whats required to unlock it, the stage script list, a song title list, and such things.

This falls in line with the idea of a "game script" - a script which gives an overall definition of the game, sets up menus, etc.



Random idea: put things like dialogue etc. in a specific separate file, for the purposes of making it easier to translate the game into other languages.

Good idea.  Noted.

... perhaps, we could even take it a step further, and format these files some way so that the player could select their preferred language, and have it use that when possible.  What do you people think?



I'd be willing to help you out there, I know a lot about open source. PM me if you want.

Thanks for the support.  (If/)When the time comes, I'll ping you about it.




This week has seen me pretty busy between work and family stuff.  Hopefully I'll get a chance to sit down on the weekend and perhaps start cranking some stuff out.  I'll keep you all posted, of course.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 11, 2009, 03:19:27 AM
... perhaps, we could even take it a step further, and format these files some way so that the player could select their preferred language, and have it use that when possible.  What do you people think?
Even better!

Suggestion: rather than hardcoding things like power, bosses' health-meters, dying, etc., you include a bunch of "default scripts" which handle things like that, so that if someone doesn't want to use it or wants to use something different (i.e. an Imperishable Night-style game where one type of item is a powerup and another is a point-item for the human-character, and it's the other way around for the youkai-character; PCB-style "this boss has X number of health-meters" versus MoF-style versus EoSD-style; a health-meter for the player instead of a number of lives), they don't have to use scripts to fight an uphill battle against the hardcode.
Title: Re: A replacement for Danmakufu?
Post by: Darkblizer on September 13, 2009, 03:58:40 AM
I'm ditching danmakufu the instant you finish this.

Also, it'd be nice if you could compile the scripts into an exe.
Title: Re: A replacement for Danmakufu?
Post by: Momiji on September 13, 2009, 10:58:07 AM
Fourth Item: Implementation:

As I mentioned previously, this would be implemented using SDL.NET and OpenGL in C#.  The main advantage of this is that it should be entirely cross-platform portable (without even recompiling!) using Mono.
EW .NET! >_<  Er, uh... I mean, thanks for thinking about us Linux users.  Might actually give this a try if you work on it. =]  Lemme know if you need a Linux tester.
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on September 13, 2009, 02:00:57 PM
Fourth Item: Implementation:

As I mentioned previously, this would be implemented using SDL.NET and OpenGL in C#.  The main advantage of this is that it should be entirely cross-platform portable (without even recompiling!) using Mono.
EW .NET! >_<  Er, uh... I mean, thanks for thinking about us Linux users.  Might actually give this a try if you work on it. =]  Lemme know if you need a Linux tester.

Meh, a lot of Linux apps are written in C#... Banshee, tomboy, and countless others. It's actually a pretty nice language, from what I can tell.
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on September 13, 2009, 02:53:15 PM
Awesome idea and something I never got around to doing, Nuclear Cheese.

How are you going about programming this, anyway? I have a lot of experience in SDL.NET, but I understand it's not the most efficient way to do things - unfortunately, I don't know how to use OpenGL in C#. Someone in #c76 mentioned they always just initialize the window with SDL.NET and then do everything else in openGL.

Along those lines, any websites you can point me towards regarding doing just that?
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 13, 2009, 06:03:02 PM
Just had another thought about localization: instead of just one text file, have a .ZIP file or whatever which would also contain any images with text on them.

And as I was typing that it occurred to me that you wouldn't just need to use that for languages: if you put in levels and menus, you could have things like mods and expansion packs ... the possibilities are endless.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 14, 2009, 01:00:56 AM
I'm ditching danmakufu the instant you finish this.

Also, it'd be nice if you could compile the scripts into an exe.

Glad to have support.


Compiling scripts into an executable would be rather tricky, I think.  Not sure if I want to go down that path anytime soon. :-\
On the bright side, there have already been requests for a 'compiled' script format, which would covert your (text) script file into a binary one - this could be close to what you're looking for.



EW .NET! >_<  Er, uh... I mean, thanks for thinking about us Linux users.  Might actually give this a try if you work on it. =]  Lemme know if you need a Linux tester.

Honestly, .NET is one of the things that Microsoft did right, if you ask me.  And I'm usually on the frontlines of the MS-bashing. :V

As far as testing is concerned - when this gets to the point where I think some widespread testing* can occur, I'll put up a quick download for people to try.  Feel free to give it a go and post your results/etc then.

* In other words, when it doesn't look like total shit.



Awesome idea and something I never got around to doing, Nuclear Cheese.

How are you going about programming this, anyway? I have a lot of experience in SDL.NET, but I understand it's not the most efficient way to do things - unfortunately, I don't know how to use OpenGL in C#. Someone in #c76 mentioned they always just initialize the window with SDL.NET and then do everything else in openGL.

Along those lines, any websites you can point me towards regarding doing just that?

SDL.NET isn't that bad efficiency-wise, but using direct OpenGL calls is faster.  Basically, SDL.NET manages all of the resources, but for video output you use the Tao Framework OpenGL mapping to call OpenGL commands directly.  I still am going to use SDL.NET to manage audio and input processing.

Also, I've found that SDL.NET's graphics functions are a lot more limited - scaling or rotating an Surface requires you to create another Surface entirely for the result, for instance.  In OpenGL, theses are nothing more than a couple matrix operations at most.

As far as tutorials ... I learned OpenGL in a class at college (mostly), so I'm not sure what's good.  I hear the Nehe tutorials are good, though, and I think they've translated a couple for use with SDL.NET on SDL.NET's tutorial page.



Just had another thought about localization: instead of just one text file, have a .ZIP file or whatever which would also contain any images with text on them.

And as I was typing that it occurred to me that you wouldn't just need to use that for languages: if you put in levels and menus, you could have things like mods and expansion packs ... the possibilities are endless.

.zip files with all localization assets would be good; not sure if I have any easy way of reading into a .zip though, so worst case would be to extract the info into a subfolder or something.

And the idea for using them for mods and expansions could be cool.






And, finally, an update: CODING HAS STARTED

If I remember, I'll update with more details later, after working on it a bit more.  Very unlikely I'll have a testing release tonight, but I'd say so far the progress is pretty good.


To note, however - between work and family crap, I won't be able to much/any work on this during most weekdays.  I'll still have my laptop, so I can keep up with the folks here, but coding is unlikely at best, and downright impossible at worst, during the week. :-\
Title: Re: A replacement for Danmakufu?
Post by: Suikama on September 14, 2009, 01:02:46 AM
And, finally, an update: CODING HAS STARTED
YEAAAAHH ಥ_____ಥ!!!
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 14, 2009, 01:30:19 AM
Very unlikely I'll have a testing release tonight, but I'd say so far the progress is pretty good.

Jesus dude, I wasn't expecting a working beta for weeks, at this rate I'm actually going to have to script something in Danmakufu before it becomes obsolete!
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 14, 2009, 02:33:35 AM
Very unlikely I'll have a testing release tonight, but I'd say so far the progress is pretty good.

Jesus dude, I wasn't expecting a working beta for weeks ...

Well, I don't want you guys to expect something too soon ... like I said before I only really have time for this on the weekends (and that's only after I get more important weekend activities out of the way, like sleep).

Here's a summary of the progress so far:


Basically, it's a lot of back-end work that needs to be done, but ultimately isn't worth showing off. :V


Note that, when I say "Execution Engine", I'm referring to the code that actually executes scripts.  This does not include parsing script files - at this point the script has already been converted into a simple, almost assembler-like code that is very straightforward to execute in realtime.  Right now the only instruction it knows is add, and it can only do it with numbers right now (plan is to use that same function for string concatenation and boolean OR, and well as to convert an int/bool to a string to concatenate to another string).  So, here's the 'script' the program has hard-coded into it right now:

Initialize:
add global["a"], 1.0, 1.5

Tick:
add global["a"], 0.1, global["a"]

(This isn't what it actually looks like - really it's coded in by directly assigning the pieces of the script instruction array - really ugly to read and completely temporary for testing purposes)

In other words, it starts by setting the global-scope variable a to 1.0 + 1.5.  Then, each frame, the tick function adds 0.1 to it.  Currently, the game spawns two objects, so thats a total of +0.2 per frame.  Combine that with a temporary display of the value on the title bar to make sure it's working.  Wheee~

If it were an actual script language, it would probably look something like:
Code: [Select]
Musuu
Script[ScriptType]

// 'a' is a global variable
global a;

// Define an enemy boss object type
Boss "A Boss"
{
   // Define the initialization script
   Initialize
   {
      a = 1.0 + 1.5;
   }

   // Define the tick (per-frame) script
   Tick
   {
      a = a + 0.1;
   }
}

Of course, this is purely speculative syntax at this point.  The first line indicates that it is a Musuu no Danmaku script file, which the second line indicates the script file's type (as in, what syntax the file will have); this will allow multiple different script formats to be supported easily.


For the angle/speed movement thing - All Objects have an angle and speed parameter, which can be set to give them simple movement.  More movement options will, of course, be added, but this was simple enough to throw in there right away.



There's still a ton of things to get in before any sort of testing release ... notably:

... did I miss anything critical?





... at this rate I'm actually going to have to script something in Danmakufu before it becomes obsolete!

Going by Drake's offer, obsoleting Danmakufu is going to be necessary if I ever want to finish my biggest Danmakufu script ever, so, despite leading this effort, I'll probably be one of the last ones here to fully switch over. :V
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 14, 2009, 02:41:42 AM
(http://i174.photobucket.com/albums/w88/KimikoMuffin/rejoicing-yeah.jpg)
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on September 14, 2009, 03:01:16 AM
Don't forget the input handling. :p

Anyway, I'll look up some information on the Tao framework's openGL stuff, I guess, and play around with it a little. Hopefully I'll be in a position to help you out a little if you put the source code online... or something. 8D

EDIT -- Well, I taught myself openGL for a school group project(physics simulator, whoo) but that was using glut -- though it used enough openGL for the code to be recognizable to me. What I'm confused about, and what I can't find, is an example of using SDL.NET to create the window and then using openGL the rest of the way... The examples on Nehe have an insane amount of DLL and function imports all over the place >_<
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 14, 2009, 04:51:13 AM
Don't forget the input handling. :p

What're you talking about?  It was on the list the whole time! *shifty eyes*

Anyway, I'll look up some information on the Tao framework's openGL stuff, I guess, and play around with it a little. Hopefully I'll be in a position to help you out a little if you put the source code online... or something. 8D

EDIT -- Well, I taught myself openGL for a school group project(physics simulator, whoo) but that was using glut -- though it used enough openGL for the code to be recognizable to me. What I'm confused about, and what I can't find, is an example of using SDL.NET to create the window and then using openGL the rest of the way... The examples on Nehe have an insane amount of DLL and function imports all over the place >_<

Perhaps this will help: http://cs-sdl.sourceforge.net/index.php/NeHe_1_OpenGL_Tutorial (http://cs-sdl.sourceforge.net/index.php/NeHe_1_OpenGL_Tutorial)
Title: Re: A replacement for Danmakufu?
Post by: Momiji on September 14, 2009, 10:53:38 AM
Honestly, .NET is one of the things that Microsoft did right, if you ask me.  And I'm usually on the frontlines of the MS-bashing. :V

As far as testing is concerned - when this gets to the point where I think some widespread testing* can occur, I'll put up a quick download for people to try.  Feel free to give it a go and post your results/etc then.

* In other words, when it doesn't look like total shit.
Yep yep.  I guess I'll prefetch Mono, so I can install it when you have some code ready.
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on September 14, 2009, 02:28:11 PM
Perhaps this will help: http://cs-sdl.sourceforge.net/index.php/NeHe_1_OpenGL_Tutorial (http://cs-sdl.sourceforge.net/index.php/NeHe_1_OpenGL_Tutorial)

Ah, thanks muchly. ^^;
Title: Re: A replacement for Danmakufu?
Post by: Gc on September 14, 2009, 08:56:43 PM
I don't know if this has been suggested before but: a way to auto-run a script. It could be useful for people who make whole games. I admit full games are pretty rare so this probably isn't really an important addition, but some people would probably like it.

Also, English documentation :D (Not a request. I'm only happy that I'll understand)
And English error messages :D (yeah... I guess it would be kind of normal to get error messages we can actually understand instead of having to use the wiki to finally not find what the error was, totally rebuild your code from scratch, not fixing the error and causing a Faildows crashing error or that kind of tihs...)
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 15, 2009, 12:50:02 AM
I don't know if this has been suggested before but: a way to auto-run a script. It could be useful for people who make whole games. I admit full games are pretty rare so this probably isn't really an important addition, but some people would probably like it.
Methinks this would go hand-in-hand with "compiling" scripts. Maybe a "create a custom EXE with the icon of your choice which automatically runs the specified script" too ...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 15, 2009, 01:22:15 AM
I don't know if this has been suggested before but: a way to auto-run a script. It could be useful for people who make whole games. I admit full games are pretty rare so this probably isn't really an important addition, but some people would probably like it.

Methinks this would go hand-in-hand with "compiling" scripts. Maybe a "create a custom EXE with the icon of your choice which automatically runs the specified script" too ...

As I mentioned before, I think that generating a custom .EXE off of a compiled set of scripts might be a bit much.  The autorun idea, though, sounds like a pretty good idea.  If nothing else, I could design the program so that you could pass it a script filename on the command line as you run it, and it would bypass script selection menus and go straight into the game itself.
You could have your icon pointing to the game by simply creating a link/shortcut to the program and giving it the appropriate script file in the arguments.

Although, this might get tricky when passing it to others ...



Also, English documentation :D (Not a request. I'm only happy that I'll understand)
And English error messages :D (yeah... I guess it would be kind of normal to get error messages we can actually understand instead of having to use the wiki to finally not find what the error was, totally rebuild your code from scratch, not fixing the error and causing a Faildows crashing error or that kind of tihs...)

Actually, I'm sure you all will be pleased to hear that, in order to expedite development and to shift the crappy documentation tasks and such off of me, I've contracted a bunch of Japanese college students to handle the documentation and error message texts. :D
(lies)
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 15, 2009, 08:31:21 PM
First of all, Nuclear Cheese, let me say I have been a fan of your Danmakufu scripts for a while now.

Now, with that out of the way, I would like to hereby declare that I joined this site solely out of interest in this project. I know a few people who go here, but this is my first time posting.

Anyhow, I'll be sure to submit my own suggestions (although frankly, it seems like you've really covered the bases already), as well as offer any (limited) support that I am able to.

And like Stuffman, I shall happily pay you several dollars if you go through with the project / if it will help expedite development of the project.

Maybe.
Title: Re: A replacement for Danmakufu?
Post by: Primula on September 16, 2009, 12:22:22 AM
For some reason, I feel like designing the default "STG_Frame" for this replacement.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 16, 2009, 12:42:07 AM
I'm working on the center picture, just so you know.
Title: Re: A replacement for Danmakufu?
Post by: Primula on September 16, 2009, 01:17:11 AM
Ohz
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 16, 2009, 02:33:55 AM
So, what's the actual name of this project going to be? "A Replacement For Danmakufu" feels, I 'unno, kind of awkward as far as this goes ...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 16, 2009, 02:41:37 AM
First of all, Nuclear Cheese, let me say I have been a fan of your Danmakufu scripts for a while now.

Now, with that out of the way, I would like to hereby declare that I joined this site solely out of interest in this project. I know a few people who go here, but this is my first time posting.

Anyhow, I'll be sure to submit my own suggestions (although frankly, it seems like you've really covered the bases already), as well as offer any (limited) support that I am able to.

And like Stuffman, I shall happily pay you several dollars if you go through with the project / if it will help expedite development of the project.

Maybe.

... wow, that's pretty crazy.  I knew I'd stir up a bit of a storm (in a good way) by starting this up, but I didn't think people would join solely because of it!  Welcome aboard!

Feel free to give whatever suggestions/comments/etc you think should be made - I'm trying to make this easy to use for the people here, so your thought and opinions are helpful.


And, about the whole "donations" thing - to be honest, I don't really need any financial incentive.  My main limitation is that I have a full, 40hour/week job and family crap to tend to during the week, so my time is somewhat limited.  Most of the posts I made about it were sarcastically commenting on certain members' tendancy to attach 'words of uncertainty' to their offers. :V
I appreciate the offer, though.  It shows that I'm doing something that people are really interested in :D



For some reason, I feel like designing the default "STG_Frame" for this replacement.

I'm working on the center picture, just so you know.

Ohz

Oooh graphics sound good.

Please don't get too violent over who gets to do what, though. ;)



So, what's the actual name of this project going to be? "A Replacement For Danmakufu" feels, I 'unno, kind of awkward as far as this goes ...


Fifth Item: Program's Name:

I'm thinking 無数の弾幕 ("Musuu no Danmaku" - "Countless Barrages") ... any objections/recommendations?

;D
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 16, 2009, 03:42:43 PM
Ohright!

Hmm. I dunno, something about that title just doesn't resonate with me, or something. I think it has to do with the fact that it's Japanese, with no intrinsic English component, and since this is going to be targetted primarily at English-speakers ... yeah. (At least you could have someone who knows Japanese check your grammar, I guess ...)
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 16, 2009, 07:00:21 PM
Lol, just trying to show my support, Cheese. xD Although it's a relief to hear that you don't need finances, heheh.

And yeah, Time Devotion is always a bit of a troublesome issue. That's part of the reason why I'm interested in this - I'm working on my own game, and I started progression of it on Danmakufu. But frankly, that program is anything but User Friendly.

Thankfully, my Computer Crashed, and development has been on hold, which meant that I didn't get too far in before finding out about this - after reading everything on the first post, and taking a gander at your example scripting, I've decided I'd much rather redevelop the game using your program, once it's completed, rather than continue with Danmakufu, as it would be much less time-consuming from the looks of things.

Of course, that's all assuming you can indeed find the time for this project.

Regarding the name, I think I could come up with a few other suggestions - I have a thing for naming things. So I'll be sure and get back to you on that, as I gotta run at the moment for class.

Toodles~
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 17, 2009, 01:48:55 AM
Ohright!

Hmm. I dunno, something about that title just doesn't resonate with me, or something. I think it has to do with the fact that it's Japanese, with no intrinsic English component, and since this is going to be targetted primarily at English-speakers ... yeah. (At least you could have someone who knows Japanese check your grammar, I guess ...)

Four semesters of Japanese classes, I would hope I'd be able to piece together a two-word phrase without screwing up the grammar :V


As far as the name, I'm open to suggestions.



Lol, just trying to show my support, Cheese. xD Although it's a relief to hear that you don't need finances, heheh.

And yeah, Time Devotion is always a bit of a troublesome issue. That's part of the reason why I'm interested in this - I'm working on my own game, and I started progression of it on Danmakufu. But frankly, that program is anything but User Friendly.

Thankfully, my Computer Crashed, and development has been on hold, which meant that I didn't get too far in before finding out about this - after reading everything on the first post, and taking a gander at your example scripting, I've decided I'd much rather redevelop the game using your program, once it's completed, rather than continue with Danmakufu, as it would be much less time-consuming from the looks of things.

Of course, that's all assuming you can indeed find the time for this project.

Regarding the name, I think I could come up with a few other suggestions - I have a thing for naming things. So I'll be sure and get back to you on that, as I gotta run at the moment for class.

Toodles~

Yeah, that's a thing with Danmakufu - it gets pretty ugly when you start trying to do something larger.  One thing that (hopefully) won't be an issue with my program.

As far as finding time, I should be able to allocate some time each weekend to this, so hopefully we can see a steady progression (even if it is slow).
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 17, 2009, 02:41:08 AM
Ohright!

Hmm. I dunno, something about that title just doesn't resonate with me, or something. I think it has to do with the fact that it's Japanese, with no intrinsic English component, and since this is going to be targetted primarily at English-speakers ... yeah. (At least you could have someone who knows Japanese check your grammar, I guess ...)

Four semesters of Japanese classes, I would hope I'd be able to piece together a two-word phrase without screwing up the grammar :V
Um, screw me in the spleen, then ... |3

Hm. ... Endless Danmaku, maybe?
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 17, 2009, 06:28:32 AM
Also, a thought occurred to me today to ask about this:

Now, I have several games in-planning. One of them, which I have yet to begin production on, features a Team feature similar to that of Imperishable Night.

I never bothered to look up weather or not that it is even possible to do that on Danmakufu, so I was wondering - would your program offer support for focus/unfocus Team Formations? If you have not thought of this, would it be a possibility to include it?

Also, while not a necessity, it would be really neet if there was a way to include special abilities a la Subterranean Animism. However, due to the extreme level of open-ended-ness in the vaguely descriptive "Special Abilities", I doubt that this would be quite so possible.
Title: Re: A replacement for Danmakufu?
Post by: CK Crash on September 17, 2009, 10:43:28 AM
Now, I have several games in-planning. One of them, which I have yet to begin production on, features a Team feature similar to that of Imperishable Night.
This is already very possible in Danmakufu. (http://onthenet9999.googlepages.com/ReimuYukari.zip) I'm not sure if we need specific functions for it in Countless Barrages. It's just a matter of If statements to check which character is currently being used.

(to switch my player, you have to use C though)
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on September 17, 2009, 10:49:26 AM
^ Both of those points you mention would be a matter of implementing player scripts with the features in question. I hear Danmakufu had problems with its player scripts, but since I never tried working with it, I don't know exactly what could be improved. "Team" implementation would be a simple matter of swapping out sprites, and I'd be greatly surprised if it took any considerable effort, regardless of how well the scripting works. As for special abilities, you could implement, say, Yukari's teleportation thing rather simply:

Quote
If ((Shot button not depressed) && (playerX = minClipX) && (check for tap left)) {
    freeze controls
    manipulate player X to acheive teleportation
    unfreeze controls
}

And the same for the other direction. It's all a matter of how creative you get with the scripting.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 17, 2009, 11:01:12 AM
Well, it's good to know that. Again, I never really looked into those aspects before, so I was unsure.

Also, I thought of a (somewhat lame) name suggestion.

????????? ~ Maiden's Bullet Storm

The Japanese part translates to "Violent Stormy Rain of the East". And the English can be acronymed to MBS, which my mind, in its occasional immaturity, took as a double-meaning for "My Bull****".

Cuz, y'know, some user-generated scripts can be total BS.
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on September 17, 2009, 05:00:49 PM
Ehhh for a name I would prefer something more straightforward, like Custom Danmaku Engine. Calling it something like "Countless Barrages" or with Japanese in the title or whatever makes it sound like it's supposed to be its own game, when it's just an engine for running them.
Title: Re: A replacement for Danmakufu?
Post by: Iryan on September 17, 2009, 08:11:09 PM
In honour of another favorite tool of mine, what about Danmaku World Editor?
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 17, 2009, 09:36:32 PM
Danmaku Maker? marishrug.jpg
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 18, 2009, 12:08:29 AM
LetsDoSomeFuckingDanmaku.exe
Title: Re: A replacement for Danmakufu?
Post by: P♂ zeal on September 18, 2009, 12:10:58 AM
LetsDoSomeFuckingDanmaku.exe
YES.
Title: Re: A replacement for Danmakufu?
Post by: Suikama on September 18, 2009, 12:37:10 AM
LetsDoSomeFuckingDanmaku.exe
This is the right idea
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 18, 2009, 01:12:14 AM
LetsDoSomeFuckingDanmaku.exe

Execution = Very Yes
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 18, 2009, 04:03:18 AM
Um, screw me in the spleen, then ... |3

Umm ... I think I'll pass on that offer.  No offense. :V



????????? ~ Maiden's Bullet Storm

Wow, I knew kanji could get complicated, but I never thought they'd start looking like full-color forum emoticons! :P



Hm. ... Endless Danmaku, maybe?

Well, it's good to know that. Again, I never really looked into those aspects before, so I was unsure.

Also, I thought of a (somewhat lame) name suggestion.

????????? ~ Maiden's Bullet Storm

The Japanese part translates to "Violent Stormy Rain of the East". And the English can be acronymed to MBS, which my mind, in its occasional immaturity, took as a double-meaning for "My Bull****".

Cuz, y'know, some user-generated scripts can be total BS.

Ehhh for a name I would prefer something more straightforward, like Custom Danmaku Engine. Calling it something like "Countless Barrages" or with Japanese in the title or whatever makes it sound like it's supposed to be its own game, when it's just an engine for running them.

In honour of another favorite tool of mine, what about Danmaku World Editor?

Danmaku Maker? marishrug.jpg

Wow, lots of name discussion pretty quickly.  I'm pretty open as to the name, so feel free to come up with a good one.  One thing, though ...

LetsDoSomeFuckingDanmaku.exe

As much as this would be the most epic name ever, I'd prefer to keep it relatively 'kid-friendly'.  Not that I have anything in particular about curse words; it just strikes me as unprofessional (and not very Touhou-ish) to use such a name. :-\



Also, a thought occurred to me today to ask about this:

Now, I have several games in-planning. One of them, which I have yet to begin production on, features a Team feature similar to that of Imperishable Night.

I never bothered to look up weather or not that it is even possible to do that on Danmakufu, so I was wondering - would your program offer support for focus/unfocus Team Formations? If you have not thought of this, would it be a possibility to include it?

Also, while not a necessity, it would be really neet if there was a way to include special abilities a la Subterranean Animism. However, due to the extreme level of open-ended-ness in the vaguely descriptive "Special Abilities", I doubt that this would be quite so possible.

This is already very possible in Danmakufu. (http://onthenet9999.googlepages.com/ReimuYukari.zip) I'm not sure if we need specific functions for it in Countless Barrages. It's just a matter of If statements to check which character is currently being used.

(to switch my player, you have to use C though)

^ Both of those points you mention would be a matter of implementing player scripts with the features in question. I hear Danmakufu had problems with its player scripts, but since I never tried working with it, I don't know exactly what could be improved. "Team" implementation would be a simple matter of swapping out sprites, and I'd be greatly surprised if it took any considerable effort, regardless of how well the scripting works. As for special abilities, you could implement, say, Yukari's teleportation thing rather simply:

t3h codes

And the same for the other direction. It's all a matter of how creative you get with the scripting.

IN-style teams are perfectly possible in Danmakufu (even the part about switiching with focus), and should be just as feasible in my program as well, once it gets going.  Special abilities are, as Blue_Wolf points out, a very ambiguous category, but should be doable as long as you know what you're doing in the code.

I don't have muchany experience with coding player scripts in Danmakufu, so (I might have asked this already ... my brain is slightly fried at the moment) it would be helpful if people point out any particular issues they've had in Danmakufu.





I was just writing up some new code*, and I thought I'd share a few things:

Infinite loop protection has been added to the Execution Engine.
If a single event script runs for more than 100,000,000 commands (value subject to change), it will be aborted under the assumption that an infinite loop has occurred.  By my test run on my not-so-new (3-4 years) desktop, this took about 50 seconds or so to hit.
(Please keep in mind - 'command' here refers to the low-level commands that the program uses internally.  A single line of script code could reduce to multiple commands, depending on complexity.)

Added two more commands to the Execution Engine - sub and jmp.
sub is subtraction.  jmp jumps to another part of the current event script.  Wheeeee~.

Image loading is done.
Currently, unlike Danmakufu, you can specify an image file without loading it first - the program will just-in-time load it when it goes to draw it on the screen.  I should probably still include a function to load an image ahead of time, so that JIT image loading won't bog things down a bit on slower computers.
... still need to code image unloading, though :V

Objects have images.
Every object in the game now has the option of specifying an image.  If specified, that image will automatically be drawn at the object's location each frame.  You can also determine whether or not the image gets rotated with the object's angle - you'd probably want a bullet to rotate as such, but you'd rarely want an enemy boss to rotate as such.
The advantage to this approach is that, for graphically simple objects, you won't even need to define a Draw event - you just assign the image and the program does the work for you!


Also, if I didn't mention it last time -
If you specify an object's speed and angle, it will automatically move at that speed and angle.  This will work for all objects (I think Danmakufu only allows it for shots), and can be a simple way to create movement.  There will be other movement functions as necessary, of course.
I currently have angle zero set as straight up (contrast Danmakufu, where zero is straight right).  Like Danmakufu, increasing angle is rotating clockwise.



* 9/80 work week is probably the most awesome thing ever, if only because I get every other Friday off for FREE.
Title: Re: A replacement for Danmakufu?
Post by: Zengar Zombolt on September 18, 2009, 04:11:54 AM
jmp jumps to another part of the current event script.
Oh god YES.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 18, 2009, 04:17:46 AM
Ugh, this always happens - >_> whenever I paste Kanji from the PS3, it always comes up as jibberish or Question Marks.

Oh well, doesn't really matter, as Stuffman did point out that that kind of name was more suited for ana ctual game than a game-maker.

Moving on~

Excellent, excellent, and more excellent. ^_^ Already making progress, and I'm liking what I'm seeing.

My experience with player scripting was...shaky, at best, since as stated before, I had only just barely started production on my game, so I don't have much to offer by way of personal grievances with Danmakufu's player scripting.

Keep up the good work, Cheese. ^^;; I'll keep on brainstorming name ideas. Also, I'll see what I can do about running through the scripting I had so far with danmakufu so as to report any suggestions I can make.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on September 18, 2009, 05:09:15 AM
Hey. If I had a credit card, I'd donate you 40$ for this project!
You rock!!!


Anyways, I have a name suggestion that may be kid friendly and touhou-life.
How about something as basic as "Danmaku Infinite"?
Inspired by how MUGEN(Which means infinite, for those that don't know) is a literal game of infinite content, Danmaku Infinite is a shmup of infinite stages and bosses!
Alternatively, you can call it Touhou Infinite. But people not interested in spell cards wont touch spell cards, there for making "Touhou" redundant.


I think the name is basic enough to remember, but cool enough to not be boring either.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 18, 2009, 06:21:09 AM
jmp jumps to another part of the current event script.
Oh god YES.

When you boil it down, just about every control structure in programming comes down to a conditional jump.  It's just that, usually, they don't use them directly, 'cause when used recklessly they cause problems.  Plus it's harder to get good-looking code with a bunch of goto's spattered about.

In a high level language, arbitrary jumps like that are rarely, if ever, needed; many consider their use in any context to be the programming equivalent of a cardinal sin (for the record, I don't subscribe to that line of thought).  My current plan does not include a goto-like statement in the higher-level scripting.  If there's enough demand, I can add it in though.



Anyways, I have a name suggestion that may be kid friendly and touhou-life.
How about something as basic as "Danmaku Infinite"?
Inspired by how MUGEN(Which means infinite, for those that don't know) is a literal game of infinite content, Danmaku Infinite is a shmup of infinite stages and bosses!
Alternatively, you can call it Touhou Infinite. But people not interested in spell cards wont touch spell cards, there for making "Touhou" redundant.


I think the name is basic enough to remember, but cool enough to not be boring either.

This is actually the train of thought that landed me on 無数の弾幕 (Musuu no Danmaku).  I decided to avoid the direct reference to MUGEN, since there's quite a lot of people (especially in the fighting game community) who view it as the deepest shitpit of failure ever to exist.

Infact, Musuu no Danmaku could be pretty much read as "Infinite Danmaku".
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 18, 2009, 06:30:55 AM
I think I kinda like "Infinite Danmaku" itself. It could grow on me. ``
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on September 18, 2009, 11:20:16 AM
MUGEN is indeed horrible NC. Bad reputation :V though still funny to play now and then.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 18, 2009, 01:19:31 PM
Just keep it as Musuu no Danmaku and be on with it lol.
Title: Re: A replacement for Danmakufu?
Post by: Garlyle on September 18, 2009, 06:06:58 PM
Quote
I don't have muchany experience with coding player scripts in Danmakufu, so (I might have asked this already ... my brain is slightly fried at the moment) it would be helpful if people point out any particular issues they've had in Danmakufu.

Easier bomb coding dear lord that was my least favourite part.  Also, optional to disable/not disable regular shots during bomb.  (Alternatively, potential custom bomb system, should we opt for MoF/SA setup)

Also, homing code aides.
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on September 18, 2009, 09:01:42 PM
Quote
I don't have muchany experience with coding player scripts in Danmakufu, so (I might have asked this already ... my brain is slightly fried at the moment) it would be helpful if people point out any particular issues they've had in Danmakufu.

Easier bomb coding dear lord that was my least favourite part.  Also, optional to disable/not disable regular shots during bomb.  (Alternatively, potential custom bomb system, should we opt for MoF/SA setup)

Also, homing code aides.

Unfortunately, if we want any sort of flexibility with bombs, it has to be complex. It seems that more flexibility = more complexity, and vice versa.
Title: Re: A replacement for Danmakufu?
Post by: CK Crash on September 18, 2009, 10:53:00 PM
Also, optional to disable/not disable regular shots during bomb.  (Alternatively, potential custom bomb system, should we opt for MoF/SA setup)
ForbidShot(true/false); The bomb coding in Danmakufu is a bit difficult, especially with bombs technically being separate scripts, with you having to redeclare all the variables for your image paths and such. However, it's also very flexible once you understand how it works.

I do agree with you on post-IN stuff being available. 1-up and bomb pieces, and maybe even a power system. The player would have something like EnablePower(6/10/11/12);. 6 (EoSD) would make it a value from 0 to 128, 10 (MoF) would make it 0.00 to 5.00 and attach the bomb system to it, 11 (SA) would be the same but only go up to 4.00, and 12 (UFO) would go from 1.00 to 4.00 and make the bombs separate again. The CreateItem function would ignore spawning power items if the player didn't have power enabled, and bomb items if MoF or SA settings.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 19, 2009, 12:41:28 AM
I do agree with you on post-IN stuff being available. 1-up and bomb pieces, and maybe even a power system. The player would have something like EnablePower(6/10/11/12)
Methinks you should go the "complexity" route of allowing the users to script that kind of thing themselves, so that e.g. we don't have to rework the EnablePower function and whatnot every time a new Touhou game is released. Much better to do a generic "item" superclass, and make the code flexible enough to do whatever you want when you collect a given instantiation.
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on September 19, 2009, 12:45:30 AM
*digs through back pages* On the subject of power/bombs, this needs to be rementioned:

Suggestion: rather than hardcoding things like power, bosses' health-meters, dying, etc., you include a bunch of "default scripts" which handle things like that, so that if someone doesn't want to use it or wants to use something different (i.e. an Imperishable Night-style game where one type of item is a powerup and another is a point-item for the human-character, and it's the other way around for the youkai-character; PCB-style "this boss has X number of health-meters" versus MoF-style versus EoSD-style; a health-meter for the player instead of a number of lives), they don't have to use scripts to fight an uphill battle against the hardcode.

The existing systems are great as a base, but it really should be flexible enough to handle just about anything you could think up. I say default scripts for 6/10/12 style, but paramaterize them so you can go from 10-style to 11-style as simply as "setMaxPower(400);", tweak power thresholds for 6-style and whatnot. And then if you wanna do something wacky, you can do a custom script and everyone's happy.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 19, 2009, 01:04:38 AM
MUGEN is indeed horrible NC. Bad reputation :V though still funny to play now and then.

In theory its an awesome idea.  It tends to get ruined, though, by people (a) not putting effort into their creations, and (b) going for the arms race of who can create the most broken shit ever to exist.



I think I kinda like "Infinite Danmaku" itself. It could grow on me. ``

Just keep it as Musuu no Danmaku and be on with it lol.

無数の弾幕 ~ Infinite Danmaku

?



Easier bomb coding dear lord that was my least favourite part.  Also, optional to disable/not disable regular shots during bomb.  (Alternatively, potential custom bomb system, should we opt for MoF/SA setup)

Also, homing code aides.

Unfortunately, if we want any sort of flexibility with bombs, it has to be complex. It seems that more flexibility = more complexity, and vice versa.

Darkslime is right.  Due to the wide variety of what a 'bomb' can entail (homing orbs of colorful doom, giant freakin' laser beams, time-freezing all shots on screen, etc), it's hard to simplify bomb creation without limiting functionality unnecessarily.

The way I envision bombs working right now does involve scripting an object type for the bomb attack objects - I think it'd be hard to get away without doing so (at least without making your player script unnecesasrily complicated).

Again, this is one of the areas I don't have much knowledge from Danmakufu in, so I'm trying to evaluate the options.



I do agree with you on post-IN stuff being available. 1-up and bomb pieces, and maybe even a power system. The player would have something like EnablePower(6/10/11/12);. 6 (EoSD) would make it a value from 0 to 128, 10 (MoF) would make it 0.00 to 5.00 and attach the bomb system to it, 11 (SA) would be the same but only go up to 4.00, and 12 (UFO) would go from 1.00 to 4.00 and make the bombs separate again. The CreateItem function would ignore spawning power items if the player didn't have power enabled, and bomb items if MoF or SA settings.

Methinks you should go the "complexity" route of allowing the users to script that kind of thing themselves, so that e.g. we don't have to rework the EnablePower function and whatnot every time a new Touhou game is released. Much better to do a generic "item" superclass, and make the code flexible enough to do whatever you want when you collect a given instantiation.

*digs through back pages* On the subject of power/bombs, this needs to be rementioned:

The existing systems are great as a base, but it really should be flexible enough to handle just about anything you could think up. I say default scripts for 6/10/12 style, but paramaterize them so you can go from 10-style to 11-style as simply as "setMaxPower(400);", tweak power thresholds for 6-style and whatnot. And then if you wanna do something wacky, you can do a custom script and everyone's happy.

I can forsee some issues with just about any approach we take on this - here's some of my thoughts:

Power system is defined by the script being played
+ (Hopefully) Ensures better balance for all player types
- Will probably run into issues if a player type doesn't support the selected power system properly.  Can be mitigated to an extent.
- Will require program updates to add in new systems

Power system is defined by the player script (Onthenet's version)
+ Some handling of power system will be greatly simplified on the script side, since it will be built into the program
- Balance issues, especially if a boss/stage/game is specifically tailored to a particular power system
- Will require program updates to add in new systems

Power system is defined by the player script (KimikoMuffin's version)
+ Highly flexible, can add in new types without program updates
- Balance issues, especially if a boss/stage/game is specifically tailored to a particular power system
- Scripters will have to handle everything in their player scripts


... opinions?
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on September 19, 2009, 01:39:31 AM
May I suggest more capabilities for dialogue? Maybe a way to implement cut scenes as well?
As it is, working with text is really annoying in danmakufu since it is so limited and shows so little at once.
People like me who're story whores really have trouble writing for danmakufu because we have to chop up dialogue so much. So something to help with storytelling is HIGHLY appreciated. Even if it is a selfish request of mine.

Also, easier 3d. Danmakufu's 3d fails.

Perhaps even an Hp system to. A good thing to remember is we should aim to make this tool universal for danmaku and not just touhou. Touhou will probably be the biggest use, but options to disable is preferred.

As for a power system, I'll suggest Onthenet's. If we can manage to get the updates simple, it's worth it.
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on September 19, 2009, 01:44:10 AM
Brain wave: What if we have the player scripts define some arbitrary number of power levels (I'm thinking 0-7, for 8 levels total; I can't imagine anybody realistically needing more than that) and have the enemy/stage script track power however it wants to, and tells the player which power level to execute?

Bonus: not all 8 power levels need be defined by player scripts. You could define, say 0/1/3/5/7, and if a script goes looking for 4, it defaults to the next one down that is defined, 3. (0, of course, would have to be required)

EDIT: Elaborating on this a bit...

Internally, power is just an integer, so all we need is a section of stage scripts to define the thresholds for each power level, and optionally a custom display method (If we leave bombs, score, and whatever else to stage scripts, too, we could lump this all into some kind of "resource management" section). Player scripts can also include their own version of this in case the stage script doesn't really care and omits this part. If neither of them has a power definition, it can default to "always max (7) power" like DMF does now.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 19, 2009, 02:49:10 AM
Eh, I'm biased in favor of being able to make a complete game, with everything made specifically to fit with everything else.

That said, I think my suggestion could actually work for "script being played" or "player script." And why would the former require you make a program update to add new systems? :o
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 19, 2009, 06:15:00 AM
May I suggest more capabilities for dialogue? Maybe a way to implement cut scenes as well?
As it is, working with text is really annoying in danmakufu since it is so limited and shows so little at once.
People like me who're story whores really have trouble writing for danmakufu because we have to chop up dialogue so much. So something to help with storytelling is HIGHLY appreciated. Even if it is a selfish request of mine.

... anything in particular?  Ability to show larger text boxes would probably help with your high volume of text, I think.



Also, easier 3d. Danmakufu's 3d fails.

Personally, I don't think there's any real "easy" way to do 3D.  The simplest way would be to just give the scripter the ability to throw down triangles directly to the renderer, but even that's not particularly easy to use.

Any wants in this area?



Perhaps even an Hp system to. A good thing to remember is we should aim to make this tool universal for danmaku and not just touhou. Touhou will probably be the biggest use, but options to disable is preferred.

An HP system could most likely be handled by this - the main question (just like with the power system debate) is where and how to handle it.

Do we code it into a player script file?  Should it be handled in the program itself, and specified by the stage?  etc ...



Brain wave: What if we have the player scripts define some arbitrary number of power levels (I'm thinking 0-7, for 8 levels total; I can't imagine anybody realistically needing more than that) and have the enemy/stage script track power however it wants to, and tells the player which power level to execute?

Bonus: not all 8 power levels need be defined by player scripts. You could define, say 0/1/3/5/7, and if a script goes looking for 4, it defaults to the next one down that is defined, 3. (0, of course, would have to be required)

EDIT: Elaborating on this a bit...

Internally, power is just an integer, so all we need is a section of stage scripts to define the thresholds for each power level, and optionally a custom display method (If we leave bombs, score, and whatever else to stage scripts, too, we could lump this all into some kind of "resource management" section). Player scripts can also include their own version of this in case the stage script doesn't really care and omits this part. If neither of them has a power definition, it can default to "always max (7) power" like DMF does now.

Ooooh, I like this idea.  With this, a stage/game script could define how to display the power meter, how much power each item gives, etc.  It could look something like this:

(EoSD style)
Code: [Select]
Power_Meter_Max(128); // max power = 128
Power_Meter_Display(Integer); // display power as an integer
Small_Power_Item_Value(1); // small power item gives 1 unit
Large_Power_Item_Value(8); // large power item gives 8 units
Bomb_Cost(0, 1); // Bomb uses 0 power and 1 bomb
Miss_Cost(24); // power lost of miss
Power_Threshold(1, 8); // Set power thresholds
// ...
Power_Threshold(8, 128);
Start_Power(0); // start at zero

(MoF style)
Code: [Select]
Power_Meter_Max(5); // max power = 5
Power_Meter_Display(Decimal); // display as a decimal number
Small_Power_Item_Value(0.05); // small power item gives 0.05
Large_Power_Item_Value(1); // large power item gives 1.00
Bomb_Cost(1, 0); // bomb costs 1.0 power and 0 bombs
Miss_Cost(2);
Power_Threshold(2, 1.0); // Set power thresholds
Power_Threshold(4, 2.0);
Power_Threshold(6, 3.0);
Power_Threshold(8, 4.0);
Start_Power(0); // start at zero

(numbers may not be exact)

.. of course, the details would need to be refined, but this would allow us to quickly and easily define many different power systems while maintaining player scripts compatibility.  Although, having MoF-style bombs (simple little ring thing) vs. EoSD-style bombs (taste the rainbow, t3h sparkz, etc) would still be left up to the player script.

btw - the zero threshold would always be the lowest value, right?  I think we can get away without defining that one at all.



And why would the former require you make a program update to add new systems? :o

I think I slightly misinterpreted it, thinking of it as the script selecting one of multiple pre-defined types. :-\



EDIT: forgot to mention - a bit more progress.

Collision Detection
Objects can now trigger scripts when they collide with other objects.

Each object has two sizes to it - labeled size_1 and size_2 (how original :V).  Generally, size_2 will be larger than size_1.

All objects, for collision purposes, are circular (same as it is in Danmakufu, and probably official Touhou too), and the size values give the radius of collision.

Every object type can define two types of collision scripts - Collide and Collide2

Collide is for when two objects are within the sum of their size_1 apart.
Collide2 is for when two objects are within the sum of their size_2 apart, and no corresponding Collide triggers.

For the most part, we can stick to just using Collide functions, but there are a couple legit uses for Collide2, including

Furthermore, unlike other event scripts, Collide and Collide2 scripts can be defined for collisions with certain other object types or base types.
For instance, you could define, in one object type script:

Let me know what you guys think about this setup.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 19, 2009, 08:10:07 AM
And why would the former require you make a program update to add new systems? :o

I think I slightly misinterpreted it, thinking of it as the script selecting one of multiple pre-defined types. :-\
That's what Onthenet was suggesting, but it's not intrinsic to "the level/pattern script handles it."

I think that anything which doesn't directly affect what the player is able to do (HP, maximum bomb capacity, etc) should be handled by the "level" script. While it's true that you won't be able to do things like giving different players different HP or whatever, I'd say this is a relatively small price to pay for being able to use any player script.

As for 3D ... hmm. Feel free to count this as one cent instead of two, since I have almost no experience working directly with the nitty-gritty details of how 3D stuff actually works (nor have I used Danmakufu's before), but ... I'm thinking, using polygons (rectangles?) in 3D space. Give each polygon width, height, texture, (tint, maybe?), X Y Z coordinates of the center, pitch/yaw/roll rotation, and ... that should handle a lot of things. Script camera-control, "fog" (i.e. the way things fade into a blank color in the distance), background image/color ...

I think that bombs are best served with, "When player uses a bomb, run player's bomb-script" and let the bomb script do anything any other script can.
Title: Re: A replacement for Danmakufu?
Post by: Garlyle on September 19, 2009, 02:21:01 PM
I'll clarify what I found complex about bomb scripts: You have to use effect objects to create any visible effects during the bombs.  Offering a much simpler method that can use normal draw routines or standard bullet graphics drawing would be wonderful.  Yeah, keeping complexity is nice, but... srsly.

Also, I remember testing on Danmakufu and finding that although you could shoot as normal, damage added from the shots was auto-reduced... but I may have come upon an error there.
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 19, 2009, 02:40:57 PM
I think that bombs are best served with, "When player uses a bomb, run player's bomb-script" and let the bomb script do anything any other script can.

Always nice to see people who haven't used Danmakufu's Player Scripting functions... My my.

I'll clarify what I found complex about bomb scripts: You have to use effect objects to create any visible effects during the bombs.  Offering a much simpler method that can use normal draw routines or standard bullet graphics drawing would be wonderful.  Yeah, keeping complexity is nice, but... srsly.

Once you know how to use effect objects you'll they are infinately better than the shitty "draw from the center" style DrawGraphic functions, despite the steep learning curve.


Aaaand NC mentioned the coordinate system... Why do we have 0 pointing up? Why are we screwing up the degree system even further? Do you know how often I have to change my work on math exams because I keep using clockwise rotation...? Just keep it like it should be, I have no problem using 270 as down. It's how everybody is taught. Also, (0,0) -> bottom left. Why was this ever changed...

In addition to that, before you try to handle the program's player scripting functions, you might want to go through Stuffman's Player Script tutorial and see how it's done for yourself. There's not real easy way to explain how batshit player scripting is other than actually seeing for yourself.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 19, 2009, 03:54:43 PM
I think that bombs are best served with, "When player uses a bomb, run player's bomb-script" and let the bomb script do anything any other script can.

Always nice to see people who haven't used Danmakufu's Player Scripting functions... My my.
I haven't used Danmakufu at all. Care to elaborate, since you'd apparently rather taunt me for my ignorance than try to correct it? ;P

As for the "draw-vs-effects," I submit that, again, having it do whatever you want and not requiring that the player do anything.

Also, I realized a problem with my Brilliant Plan for 3D: it would be extremely difficult to make, say, an octagonal pillar, because rotating a rectangle 45 degrees, to fit with anything else you'd need use the Pythagorean theorem to give it a helpful width. So, instead, how about, um, a "triangle" function where you specify the X,Y,Z coordinates of each corner (and the texture and all details about that), and a "rectangle/rhombus" function that where you specify the X,Y,Z coordinates of three of the coordinates, and extrapolate the fourth from that. Really, I think that no matter what we do, unless Nuclear Cheese is prepared to code an entire 3D GUI, there is no easy way of doing 3D.
Title: Re: A replacement for Danmakufu?
Post by: Garlyle on September 19, 2009, 04:52:57 PM
Quote
Once you know how to use effect objects you'll they are infinately better than the shitty "draw from the center" style DrawGraphic functions, despite the steep learning curve.

Yeah, but you don't have the choice.  And that's where the problem lies - what commands you could use were limited by script 'type' in Danmakufu.
Title: Re: A replacement for Danmakufu?
Post by: Darkblizer on September 19, 2009, 07:59:16 PM
Personally, I don't think there's any real "easy" way to do 3D.  The simplest way would be to just give the scripter the ability to throw down triangles directly to the renderer, but even that's not particularly easy to use.

Any wants in this area?

That distorted area around the bosses of SA/UFO would be nice, if you could do that.
Title: Re: A replacement for Danmakufu?
Post by: Cabble on September 19, 2009, 09:46:11 PM
This sounds simply amazing. Have you already started?

If so, then what language are you using to program it?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 20, 2009, 12:32:55 AM
I think that anything which doesn't directly affect what the player is able to do (HP, maximum bomb capacity, etc) should be handled by the "level" script. While it's true that you won't be able to do things like giving different players different HP or whatever, I'd say this is a relatively small price to pay for being able to use any player script.

That is pretty much what I was suggesting, based on Blue_Wolf's suggestion.  The player scripts define how the player behaves, while the stage/game scripts define the power system, bombs/lives setup, etc. (Of course, with default settings for when the script doesn't define them).



As for 3D ... hmm. Feel free to count this as one cent instead of two, since I have almost no experience working directly with the nitty-gritty details of how 3D stuff actually works (nor have I used Danmakufu's before), but ... I'm thinking, using polygons (rectangles?) in 3D space. Give each polygon width, height, texture, (tint, maybe?), X Y Z coordinates of the center, pitch/yaw/roll rotation, and ... that should handle a lot of things. Script camera-control, "fog" (i.e. the way things fade into a blank color in the distance), background image/color ...

Also, I realized a problem with my Brilliant Plan for 3D: it would be extremely difficult to make, say, an octagonal pillar, because rotating a rectangle 45 degrees, to fit with anything else you'd need use the Pythagorean theorem to give it a helpful width. So, instead, how about, um, a "triangle" function where you specify the X,Y,Z coordinates of each corner (and the texture and all details about that), and a "rectangle/rhombus" function that where you specify the X,Y,Z coordinates of three of the coordinates, and extrapolate the fourth from that. Really, I think that no matter what we do, unless Nuclear Cheese is prepared to code an entire 3D GUI, there is no easy way of doing 3D.

All shapes in 3D are composed of triangles (in most realtime computer rendering, anyways) - your rectangle functions are basically drawing two triangles, for instance.  I could certainly add support for throwing in triangles and such, from which more complex shapes can be made.  The whole "position + pitch/yaw/roll" rectangle setup, though, is one of the things that I don't like in Danmakufu, and unless there's strong demand I don't see a reason to include it.



I think that bombs are best served with, "When player uses a bomb, run player's bomb-script" and let the bomb script do anything any other script can.

I'll clarify what I found complex about bomb scripts: You have to use effect objects to create any visible effects during the bombs.  Offering a much simpler method that can use normal draw routines or standard bullet graphics drawing would be wonderful.  Yeah, keeping complexity is nice, but... srsly.

Also, I remember testing on Danmakufu and finding that although you could shoot as normal, damage added from the shots was auto-reduced... but I may have come upon an error there.

I think that bombs are best served with, "When player uses a bomb, run player's bomb-script" and let the bomb script do anything any other script can.

Always nice to see people who haven't used Danmakufu's Player Scripting functions... My my.

My plan for bombs was basically to have a bomb script that would run for the player when the bomb button was pressed.  The main difference here would be that, rather than handling all of the objects and such itself, the bomb script's main purpose would be to spawn 'player shot' objects for the bomb.  These could be defined as custom object types to define the behavior.
Is there a better way to do this?  Of course, I wouldn't unnecessarily limit what can be done in said script.

And, Naut - play nice ;)



I'll clarify what I found complex about bomb scripts: You have to use effect objects to create any visible effects during the bombs.  Offering a much simpler method that can use normal draw routines or standard bullet graphics drawing would be wonderful.  Yeah, keeping complexity is nice, but... srsly.

Once you know how to use effect objects you'll they are infinately better than the shitty "draw from the center" style DrawGraphic functions, despite the steep learning curve.

Yeah, but you don't have the choice.  And that's where the problem lies - what commands you could use were limited by script 'type' in Danmakufu.

Shouldn't be an issue with my setup - like I said above, I intend to have no unnecessary limitations.



Aaaand NC mentioned the coordinate system... Why do we have 0 pointing up? Why are we screwing up the degree system even further? Do you know how often I have to change my work on math exams because I keep using clockwise rotation...? Just keep it like it should be, I have no problem using 270 as down. It's how everybody is taught. Also, (0,0) -> bottom left. Why was this ever changed...

In addition to that, before you try to handle the program's player scripting functions, you might want to go through Stuffman's Player Script tutorial and see how it's done for yourself. There's not real easy way to explain how batshit player scripting is other than actually seeing for yourself.

A few points, my friend -


Not trying to be condecending or anything here; I'm just explaining my reasoning.



Personally, I don't think there's any real "easy" way to do 3D.  The simplest way would be to just give the scripter the ability to throw down triangles directly to the renderer, but even that's not particularly easy to use.

Any wants in this area?

That distorted area around the bosses of SA/UFO would be nice, if you could do that.

Haven't played those two games yet (save for the SA demo once some time ago).  We'd need to figure out what, exactly, the effect is doing.  If we're lucky, it's simple enough that we won't need shaders and such.



This sounds simply amazing. Have you already started?

If so, then what language are you using to program it?

Yes, I have started programming.  As I mentioned above, I'm using C#, with SDL.NET and OpenGL for the input/output.



No new coding progress today; I did get a chance to start fooling around with ANTLR, which is a program that generates parsers - once I get the hang of using this I can get a parser up and running for actual script files (hopefully) in little time.
Translation: t3h program will read actual script files and run them OMG! O_O
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 20, 2009, 01:42:13 AM
[/pirate]

Besides, just tack on "+90" for any angle if you want to calculate it starting at the right ? la unitary.

I like this coordinates setup too, so :P



Just about the effects that surround the boss, it's obvious what the spell circle does, first of all.

(http://img198.imageshack.us/img198/2162/eff01.png)
The ones surrounding the boss are in here. Slightly different in each game, but the middle one kind of blurbs around the middle of the character and the top four bits start off big, then shrink towards the center, creating some sort of weird effect. A red version of the left thing starts flat and grows upwards. All this together makes the aura thing.

Upon analysis of the distorting space, it comes down as an asymmetrical pattern. I'm fairly sure it's a near-perfect circle. The "Border of Spell" circle that surrounds it is just the same graphic but rotating. It's not affected by the distortion. In fact, the only thing affected is the background. Although considering I don't know how the effect works, I don't know if he has a graphic associated with it.

Also, upon more analysis Hele's cut-in script still needs some work :V

Also, the collision detection sounds great.

[pirate]
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 20, 2009, 01:50:56 AM
Hmm. "0 degrees = up" may make more sense for this if you've never used either system before, but "0 = right" seems to be what most people are actually used to. I know it might confuse me a bit in some cases ... um, no matter which version you ultimately use.

As for 3D, let's say the "triangle" method. And the texture should have its own X/Y coordinates, such that 0,0 is the upper-left corner of the triangle's total area (i.e. the leftmost point is the triangle's local "X = 0", and the uppermost point is the triangle's "Y = 0"). Also textures should probably have a "rotation" setting, too. This way, you could make a seamless rectangular shape with one triangle at (let's say) "0,0,0"/"0,5,0"/"5,0,0" and the other at "5,5,0"/"0,5,0"/"5,0,0" and give them identical texture settings.

Also: if you even consider the possibility of being able to animate the 3D elements beyond simply moving the camera past them, I recommend putting it way on the backburner for now, because can you say "WAY too much complexity all at once"?
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 20, 2009, 01:56:05 AM
Yes, 3D should be one of the last things done. Just stop worrying about it until later.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on September 20, 2009, 02:31:29 AM
Sorry for my newbiness. I'm not the most experienced danmakufu user.

Anyways, the ability to show more dialogue would be fine.
However, maybe a way to activate a cutscene similar to the opening of IaMP and SWR could be useful for storytelling.
I imagine this could be done by temporarily disabling movement and having a layer of images+text ontop of everything.  Also being able to support cutins during those. Of course, music wouldn't take much to support either.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 20, 2009, 02:45:32 AM
As he's adding a type of script for menus and such, that would be introduced there. You would just call a task at a certain point that cycles through images. Not that hard to pull off. (The intro for the two games use only images, not text, as well. They're cut into the image and text portion, though.) As you said, music would be just as easy as during a boss.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on September 20, 2009, 02:51:20 AM
As he's adding a type of script for menus and such, that would be introduced there. You would just call a task at a certain point that cycles through images. Not that hard to pull off. (The intro for the two games use only images, not text, as well. They're cut into the image and text portion, though.) As you said, music would be just as easy as during a boss.
Thank you very much for explaining it properly for a newby like myself  ;D
And sorry for making such uninformed posts..
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 20, 2009, 02:55:23 AM
Garrr, e'ery good pirate starts by cleanin' the barnacles off the hull.
Title: Re: A replacement for Danmakufu?
Post by: anonl on September 20, 2009, 03:43:20 AM
That distorted area around the bosses of SA/UFO would be nice, if you could do that.

Haven't played those two games yet (save for the SA demo once some time ago).  We'd need to figure out what, exactly, the effect is doing.  If we're lucky, it's simple enough that we won't need shaders and such.

As far as I can tell it's simply offsetting vertices using a sinusoid. (Think of it like pushing a sphere through molten plastic).

Code: [Select]
pos: v3, vertex position
normal: v3, vertex normal
radius: float
amplitude: float, should be negative to mimic TH11/12

pos += amplitude * normal * (1 + cos(min(PI, PI * dist(vertex, boss) / range)))

Or something like that :V
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 20, 2009, 06:45:52 PM
I think that bombs are best served with, "When player uses a bomb, run player's bomb-script" and let the bomb script do anything any other script can.

Always nice to see people who haven't used Danmakufu's Player Scripting functions... My my.
I haven't used Danmakufu at all. Care to elaborate, since you'd apparently rather taunt me for my ignorance than try to correct it? ;P

I love taunting people. That's how bomb scripts are handled in Danmakufu. Press x -> run separate bomb script. Sorry I sounded like an ass.

And, Naut - play nice ;)

Mnuh.

Aaaand NC mentioned the coordinate system... Why do we have 0 pointing up? Why are we screwing up the degree system even further? Do you know how often I have to change my work on math exams because I keep using clockwise rotation...? Just keep it like it should be, I have no problem using 270 as down. It's how everybody is taught. Also, (0,0) -> bottom left. Why was this ever changed...

In addition to that, before you try to handle the program's player scripting functions, you might want to go through Stuffman's Player Script tutorial and see how it's done for yourself. There's not real easy way to explain how batshit player scripting is other than actually seeing for yourself.

A few points, my friend -

  • Computer graphics pretty much always have (0,0) in the upper left.  It's how the screen buffer is addressed.  Location 0 is the upper left, incrementing are you increase X.  When you hit the end of the row, the next location is the leftmost pixel one row down.
  • With the Y inverted from how it usually is in math class, rotation is going to be inverted too.
  • I set up as zero because, to me, it makes more sense to have a vertical angle as zero (thinking like 0 = forward).  I can change this if people want.

Not trying to be condecending or anything here; I'm just explaining my reasoning.

Sounds good, I just wanted to know why we chose to mess it up further. <3
Title: Re: A replacement for Danmakufu?
Post by: MCXD on September 20, 2009, 09:02:43 PM
Y should NOT be inverted. As it then contradicts the system which every programming language uses, which is the inverse to that used in math.

We are using a programming language here, so...

How about we have an option in the game config file, or the system config file, which allows the toggling of Y and Rotational inverting?
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 20, 2009, 09:38:16 PM
Mmm, bad idea. It might turn out to be the wrong one depending on what script you're using to run it.
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on September 20, 2009, 11:16:41 PM
There's no need to accommodate every single preference when it comes to scripting syntax. Consistency is better because it won't lead to confusion down the line.

Up as 0 is fine as it feels right to me, and right as 0 is also fine because I'm used to it in Danmakufu.  Just pick one or the other.

Y should definitely go from top to bottom though, I can't think of any programming language that doesn't do it that way.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 21, 2009, 02:37:13 AM
Y should NOT be inverted. As it then contradicts the system which every programming language uses, which is the inverse to that used in math.

We are using a programming language here, so...

To clarify - Y isn't inverted from what is normally seen in programming.  Increase in Y is downward on the screen.

The zero angle, as I have defined it, is simply the vector (0, -1).  +angle being clockwise comes from the fact that angle vectors are calculated using the sine and cosine.



There's no need to accommodate every single preference when it comes to scripting syntax. Consistency is better because it won't lead to confusion down the line.

Up as 0 is fine as it feels right to me, and right as 0 is also fine because I'm used to it in Danmakufu.  Just pick one or the other.

Y should definitely go from top to bottom though, I can't think of any programming language that doesn't do it that way.

Thus spoketh the man of stuff, and thus defined how things shall be.

If there aren't any major objections, I'd like to stick with angle 0 = up, since that makes the most sense to me.  But if most people want the zero angle to be right, like in Danmakufu, (or perhaps, maybe downwards even), I can set it to that.  I agree with Stuffman, however, that we should have one consistent baseline to keep things from getting confusing (and to keep an unnecessary source of complication out of the program).



Like I mentioned in my other thread, I've been away from my desktop all day today (and will most likely continue to be so for most of the week), so I'll be returning to crack out some code later in the week.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 21, 2009, 02:55:56 AM
Hmm. Now that I look at spriterips from Touhou games, "0 degrees = up" seems to be the way ZUN does things.

And I throw in my vote for (0,0) being upper-left.
Title: Re: A replacement for Danmakufu?
Post by: Kylesky on September 21, 2009, 06:40:10 AM
Can you also fix the replay function? in danmakufu, when you speed up using the space bar while watching the replay, it won't show the exact replay anymore... usually it'll desync or something... example... there was once where I only wanted to see the latter part of a replay I saved, I sped up the replay using the space bar, but when it was speeding the player died... when I watched it without speeding, it went on normally without the player dying...
Title: Re: A replacement for Danmakufu?
Post by: Lawence Codye on September 21, 2009, 08:04:53 AM
If there aren't any major objections, I'd like to stick with angle 0 = up, since that makes the most sense to me.

No objections here...makes more sense to me as well...
& I'm also for (0,0) being upper-left...oh, & the progress on this project is sounding great so far, Nuclear Cheese...
I joined this forum at a good time...
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 21, 2009, 04:01:27 PM
Can you also fix the replay function?
I don't think "fix" is exactly the right word, given that he's creating his own entirely new program, he isn't directly basing anything much on Danmakufu besides the basic purpose of the program.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on September 21, 2009, 09:11:20 PM
One last uninformed suggestion by yours truly:
Could players be more flexible so that you would be able to switch them after a script/game has been activated? Say you want it to switch to a specific player when you reach a boss.
As it stands, in danmakufu you would have to add the code to the player you select when you load a script. Things get a little messy from there...

To sum it up: Being able to switch shot types.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on September 21, 2009, 10:04:37 PM
I suggest implementing that history thing ZUN uses in spell cards. With Danmakufu, there's no such thing, except through the use of common data functions...  :'(
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 22, 2009, 01:26:34 AM
I suggest implementing that history thing ZUN uses in spell cards. With Danmakufu, there's no such thing, except through the use of common data functions...  :'(
I suspect the reason Danmakufu doesn't have it is that it would be a logistical nightmare. Where would you store it? How would it handle two identical scripts with different filenames (i.e. for the spellcard Hax Sign "Burn Everything", "haxsign.txt" versus "hax sign burn everything.txt")? How would it handle different versions of the same script which noticeably alter the gameplay? What about two different versions where all that's changed is one line that only changes the background color?

And if that wasn't enough, ZUN has a separate history-counter for every character and shot-type. The issue is therefore multiplied by what player script you're using.
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 22, 2009, 02:13:34 AM
It's actually not that hard (comparitively), but it does involve saving common data.

And nobody really cares enough to have it.

In Danmakufu, all saved files are saved in xxxx_save.dat, where xxxx = filename of the script. The .dat file is stored in the same folder as the corresponding script. Two different versions of the script could cause desyncing replays or unintended results (depending on what kind of information you're getting). Changing background colour or other useless information that only pretties up cards will never desync a replay or mess up saved data, since it isn't information that is saved in a replay file (I've tested this).
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 22, 2009, 02:34:46 AM
Can you also fix the replay function? in danmakufu, when you speed up using the space bar while watching the replay, it won't show the exact replay anymore... usually it'll desync or something... example... there was once where I only wanted to see the latter part of a replay I saved, I sped up the replay using the space bar, but when it was speeding the player died... when I watched it without speeding, it went on normally without the player dying...

... wait, you can speed up the replays with whatnowhow? ???

This is one area that I intend to handle better than Danmakufu.  I don't think it'll be a top-priority feature, but I do intend to get replay functionality in there, and working consistently (so that replays don't desync and such).



One last uninformed suggestion by yours truly:
Could players be more flexible so that you would be able to switch them after a script/game has been activated? Say you want it to switch to a specific player when you reach a boss.
As it stands, in danmakufu you would have to add the code to the player you select when you load a script. Things get a little messy from there...

To sum it up: Being able to switch shot types.

This could be an interesting secondary feature, although it could easily break player balance by letting you keep switching to the 'optimal' shot type for the occasion.



I suggest implementing that history thing ZUN uses in spell cards. With Danmakufu, there's no such thing, except through the use of common data functions...  :'(
I suspect the reason Danmakufu doesn't have it is that it would be a logistical nightmare. Where would you store it? How would it handle two identical scripts with different filenames (i.e. for the spellcard Hax Sign "Burn Everything", "haxsign.txt" versus "hax sign burn everything.txt")? How would it handle different versions of the same script which noticeably alter the gameplay? What about two different versions where all that's changed is one line that only changes the background color?

And if that wasn't enough, ZUN has a separate history-counter for every character and shot-type. The issue is therefore multiplied by what player script you're using.

This generalized score history idea is certainly doable, even with all of the "logistical nightmare" crap that would make it rough.  Basically, I'd think to store a score file alongside each script file, holding score records for each player script that has played it.  Perhaps, in the case of the compiled script format that has been mentioned, the score data could even be included right in the compiled file itself.  To curb "cheesing" the scorelist, we could also add in checksums of the scripts in use (player, enemy, etc), so if the checksums don't match it creates a different score file/entry or such.

Just a bit of brainstorming ...
Title: Re: A replacement for Danmakufu?
Post by: Suikama on September 22, 2009, 03:26:01 AM
fyi danmakufu as a whole can be sped up using the spacebar of Page Up buttons.
Title: Re: A replacement for Danmakufu?
Post by: helvetica on September 22, 2009, 05:41:09 AM
Couple of suggestions, sorry if it's a bit late as I just noticed this thread as I was perusing around the board.  I know this has been attempted in the past (RIP OpenDMF) so godspeed to you for working on a new replacement.

1) I wouldn't use C# for this mostly because although Mono is great, I wouldn't rely on it for graphical programs.  WinForms and other GUI things work DRASTICALLY different on Mono than on Windows .net to the point that you might as well use a third party toolkit, negating the whole point of using .net in the first place.  Also SDL is pretty crappy on all platforms, only really useful for having a single target to hook a window to for OpenGL (which after reading is all you're using it for anyways).  I would honestly look into using an existing crossplatform 2D/3D engine like Irrlicht or CrystalSpaces (definitely recommend CrystalSpaces) and just focus on coding the actual danmaku and hitbox framework.

I know you already got some code down but honestly maintainability in the long run will be MUCH easier if you stick to a preestablished engine and just code in C the object logic/patterning and hitboxing.  Especially for crossplatform compatibility and just future compatibility even in Windows (look how many issues DMF has :|)

2) Yes use an existing scripting engine/language rather than invent your own parser/lexer.  Lua was designed specifically for this, and it's stupid easy to embed it or something like Python or Ruby.  It's infinitely easier to just use an existing language and have people learn to use it rather than invent and maintain your own parser and lexer.  Maintainability comes back into play here, as you won't have to worry about making code binds for every little thing.  You just have to code key functions you want to expose to the scripts, and let the language handle the flow and logic.

Plus with older DMF scripts you can just build a conversion tool and then just hand-fix any oddities rather than trying to match DMF's syntax and usage word for word.

Basically what I'm trying to say is, it's great you're doing it, but you really don't have to reinvent the wheel.  Using already built stuff like the game engine and script language will let you focus more on what actually matters, coding the danmaku framework and script bindings, and will be much easier to maintain and complete and make crossplatform.  Good luck, and if you'd like some help I'd definitely be willing to throw a few programming hours into it, although I don't really have much time right now to devote to it.  I'd be willing to setup Mercurial repository and bugtracker for the project so people can collectively work on the source and contribute as necessary rather than forcing the load just onto you.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on September 22, 2009, 06:07:07 PM
One last uninformed suggestion by yours truly:
Could players be more flexible so that you would be able to switch them after a script/game has been activated? Say you want it to switch to a specific player when you reach a boss.
As it stands, in danmakufu you would have to add the code to the player you select when you load a script. Things get a little messy from there...

To sum it up: Being able to switch shot types.

This could be an interesting secondary feature, although it could easily break player balance by letting you keep switching to the 'optimal' shot type for the occasion.
It wouldn't really be a problem of balance. It's a problem of danmakufu being so dependent on the character you've selected.
From what I could understand so far, it seems like the problem is that danmakufu is so dependent on the character you chose if, for lets say you unlocked the extra stage in your game.
By switching characters, I mean support to do so after a game/script has been activated. To perhaps even choose the characters ingame from the story mode menu rather than prior.
This could require completely recoding how the program treats players though, but it would allow much more possibilities.

Again, sorry if I said anything incorrect and sorry for my lack of "advanced" knowledge >_<
Title: Re: A replacement for Danmakufu?
Post by: MCXD on September 22, 2009, 07:02:07 PM
Quote
This could be an interesting secondary feature, although it could easily break player balance by letting you keep switching to the 'optimal' shot type for the occasion.

Have it switchable or lockable with a function like Expert
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on September 22, 2009, 08:07:48 PM
<Quoted stuff>

It wouldn't really be a problem of balance. It's a problem of danmakufu being so dependent on the character you've selected.
From what I could understand so far, it seems like the problem is that danmakufu is so dependent on the character you chose if, for lets say you unlocked the extra stage in your game.
By switching characters, I mean support to do so after a game/script has been activated. To perhaps even choose the characters ingame from the story mode menu rather than prior.
This could require completely recoding how the program treats players though, but it would allow much more possibilities.

Again, sorry if I said anything incorrect and sorry for my lack of "advanced" knowledge >_<

...I'm sorry, but I'm having a little trouble following you. Do you mean switching out characters in the middle of a plural script? Like, between spellcards and such? 'cuz, quite frankly, I think that's a horrible, horrible idea.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 22, 2009, 11:04:21 PM
=o Wows. The Stupid One made some very excellent points.


Also, and this isn't any kind of important issue, but was there any specific font style you had in mind for any in-game text? I know a few Touhou games had their own custom-style font sets, and was just wondering if you had any ideas on that thus far.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 23, 2009, 12:56:10 AM
Couple of suggestions, sorry if it's a bit late as I just noticed this thread as I was perusing around the board.  I know this has been attempted in the past (RIP OpenDMF) so godspeed to you for working on a new replacement.

FYI - I had been tossing the idea around for literally weeks before I even posted about it.  I wanted to make sure I had the available time in the long-term to be able to support this the best I can.

1) I wouldn't use C# for this mostly because although Mono is great, I wouldn't rely on it for graphical programs.  WinForms and other GUI things work DRASTICALLY different on Mono than on Windows .net to the point that you might as well use a third party toolkit, negating the whole point of using .net in the first place.  Also SDL is pretty crappy on all platforms, only really useful for having a single target to hook a window to for OpenGL (which after reading is all you're using it for anyways).  I would honestly look into using an existing crossplatform 2D/3D engine like Irrlicht or CrystalSpaces (definitely recommend CrystalSpaces) and just focus on coding the actual danmaku and hitbox framework.

I know you already got some code down but honestly maintainability in the long run will be MUCH easier if you stick to a preestablished engine and just code in C the object logic/patterning and hitboxing.  Especially for crossplatform compatibility and just future compatibility even in Windows (look how many issues DMF has :|)

As far as using C#, WinForms and such don't even come into play in my code here; I already knew they don't work (at all, if I remember correctly) on Mono, so I don't touch them.

SDL is pretty limited for graphics itself, which is why I'm using it just to set up an OpenGL window like you say.  But at the same time, it makes dealing with input and audio a lot easier than anything else I know of.

As far as preexisting engines, keep in mind that it would create significant lag-time in startup, and likely at several points mid-development, due to learning how to work with the engine and such.  For that amount of time, I think it's easier for me to throw together my own code, which gives the advantages of not being limited by what's "under the hood" (since, if it's not there already, someone can just put it in) and having the engine custom-tailored to our needs.
Also, I get the impression that most game engines are optimized to deliver a set game speed, regardless of framerate.  This is rather unlike what I think we want in a game like this (the official games, for instance, play at the frame rate) because, usually, varying frame rates gives rise to inconsistencies in how the game behaves each time - due to, for instance, one time the frame landing on timestamp 5.443 and another time the frame landing on timestamp 5.445.
And, of course, there's always licensing concerns.  While most things are probably fine, we do need to keep an eye on things, so we don't go pissing people off.

As far as C vs. C#, I've done similar things in C++ before (for intance, my currently-on-hold-due-to-lack-of-ideas STG SphereTide Gunner), and it was a royal bitch keeping things organized.  C# is a much cleaner language in this regard.  Plus, automatic garbage collection = no worries of memory leaks.



2) Yes use an existing scripting engine/language rather than invent your own parser/lexer.  Lua was designed specifically for this, and it's stupid easy to embed it or something like Python or Ruby.  It's infinitely easier to just use an existing language and have people learn to use it rather than invent and maintain your own parser and lexer.  Maintainability comes back into play here, as you won't have to worry about making code binds for every little thing.  You just have to code key functions you want to expose to the scripts, and let the language handle the flow and logic.

I don't really have much knowledge of Lua and such.  I should probably look into it.
Main concerns would be syntax of the script file, with the ability to keep related scripts together in an organized fashion.

By the way, I hate Python.  Indentation as syntax is a horrible idea, in my opinion. >:(
Ruby, on the other hand, I have no experience with.



Plus with older DMF scripts you can just build a conversion tool and then just hand-fix any oddities rather than trying to match DMF's syntax and usage word for word.

Certainly doable, but would be hell and a half to implement.  Especially with some of the differences in how things are structured. (Which were restructured as such to simplify scripting and eliminate some of the unnecessary limitations in Danmakufu)



Basically what I'm trying to say is, it's great you're doing it, but you really don't have to reinvent the wheel.  Using already built stuff like the game engine and script language will let you focus more on what actually matters, coding the danmaku framework and script bindings, and will be much easier to maintain and complete and make crossplatform.

The thing is, I already know a good amount of OpenGL/SDL and C# development, and the entire engine structure came together mentally in maybe a day or two of mostly idle thinking about it.  On the other hand, like I said before, I generally have little to no idea about interfaces, APIs, etc. regarding already-built engines and such.


btw - please don't think I'm trying to be disagreeable here.  I'm just stating my side of things.  Feel free to counter-point and such, as you see fit.



Good luck, and if you'd like some help I'd definitely be willing to throw a few programming hours into it, although I don't really have much time right now to devote to it.  I'd be willing to setup Mercurial repository and bugtracker for the project so people can collectively work on the source and contribute as necessary rather than forcing the load just onto you.

Thanks.  While it might seems a bit selfish/arrogant, I'd like to at least get this thing to a working, stable point before I start posting code/builds.  Right now it still needs some stuff added in, notably:




It wouldn't really be a problem of balance.

Actually, I would argue that balance is the primary concern with this idea.  Most player/shot types have specific strengths and weaknesses:

By allowing the player to switch out characters/shot types at will (which is how I understand your idea), it would allow players to easily break this pro/con setup by swapping to characters whose disadvantages aren't a concern at the moment.

Implementation-wise, though, I doubt it'd be too hard to do.  Just swap the current player object with a new one for the new player type.



Also, and this isn't any kind of important issue, but was there any specific font style you had in mind for any in-game text? I know a few Touhou games had their own custom-style font sets, and was just wondering if you had any ideas on that thus far.

I don't really have any ideas in this regard yet.  My biggest concern is actually getting font support in order, for which we may have to rely on an image-mapped font.  This is the only significant disadvantage of the OpenGL/SDL setup that I know of, since OpenGL doesn't have good/any font support.

However, I might be able to abuse SDL.Net's font class to generate an image map font on-the-fly ... I should look into this.





EDIT:
Due to an unscheduled lack of commitments and other crap, I'm actually at my desktop, and I just got in a mini-update to the program - it now reads inputs.
Currently it's limited to the default keyboard inputs we all know and love/hate/feel indifferent about; configurable controls can be added in later (it's already half setup for that - just need to add in storage to hold the control configuration and processing for controllers).

I'm also spending a bit of time looking at scripting languages, font support, and such.

Please note that this is an exception to the rule - most weekdays I'll be too bogged down with stuff to do much more than stopping by here on my laptop.  Weekends should yield more positive results.
Title: Re: A replacement for Danmakufu?
Post by: ghost333 on September 23, 2009, 11:12:46 AM
try to add a different colision type for lasers.... using circles (if i read right) would be bad  i think
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on September 23, 2009, 04:28:50 PM
Lishy isn't really properly communicating why he wants the change-players function, he talked to me about it earlier.

He doesn't mean having the Player Select screen come up in the middle of scripts, he means being able to change the active player script in the middle of the game.

For instance, it might be a part of your game that you play a different character on a certain stage, or maybe your character unlocks their hidden powers and is different for the last couple stages or something like that. The trouble is that there's no way to change to a different player file mid-script in Danmakufu. You have to work around it by putting all that stuff in the same player file and making it work with common data, which is kind of clumsy.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 24, 2009, 02:03:30 AM
try to add a different colision type for lasers.... using circles (if i read right) would be bad  i think

Certainly makes sense.  Would most likely do something like an ellipse ...



Lishy isn't really properly communicating why he wants the change-players function, he talked to me about it earlier.

He doesn't mean having the Player Select screen come up in the middle of scripts, he means being able to change the active player script in the middle of the game.

For instance, it might be a part of your game that you play a different character on a certain stage, or maybe your character unlocks their hidden powers and is different for the last couple stages or something like that. The trouble is that there's no way to change to a different player file mid-script in Danmakufu. You have to work around it by putting all that stuff in the same player file and making it work with common data, which is kind of clumsy.

Ah, this is slightly different than what I originally interpreted it as.

This is certainly possible in player scripts already, but built-in support may not be a bad idea.
Title: Re: A replacement for Danmakufu?
Post by: anonl on September 24, 2009, 04:53:53 AM
try to add a different colision type for lasers.... using circles (if i read right) would be bad  i think
Certainly makes sense.  Would most likely do something like an ellipse ...
Circle <-> line-segment+radius is probably easier to implement than circle <-> rotated ellipse.
(http://i33.tinypic.com/16m7yfr.png)
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 26, 2009, 02:32:29 AM
I was playing MoF earlier and was reminded by doing so to ask about something. xD

For Stage Progression, are you planning on making it like Danmakufu/EoSD/PCB/IN, where after completing a stage, the screen shrinks and your score page pops up before moving on?

Or are you going to do it like MoF/SA/UFO, where your score briefly pops up and then automatically shifts into the next stage without any transition screen?
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 26, 2009, 03:21:58 AM
That's more up to the player, I'd think.
Title: Re: A replacement for Danmakufu?
Post by: MCXD on September 26, 2009, 03:33:34 AM
Make it something completely different to both.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 26, 2009, 04:23:19 AM
Make it specifiable in the level-script.

Or, better yet, the level-transition script.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on September 26, 2009, 04:26:53 AM
I was playing MoF earlier and was reminded by doing so to ask about something. xD

For Stage Progression, are you planning on making it like Danmakufu/EoSD/PCB/IN, where after completing a stage, the screen shrinks and your score page pops up before moving on?

Or are you going to do it like MoF/SA/UFO, where your score briefly pops up and then automatically shifts into the next stage without any transition screen?
LevelTransition();

How about YOUMU or FUJIN?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 26, 2009, 07:35:27 AM
try to add a different colision type for lasers.... using circles (if i read right) would be bad  i think
Certainly makes sense.  Would most likely do something like an ellipse ...
Circle <-> line-segment+radius is probably easier to implement than circle <-> rotated ellipse.
(http://i33.tinypic.com/16m7yfr.png)

Good point.  That would be a lot easier.
Any objections or other suggestions?

Although, come to think of it, what about the case of two colliding lasers?  I'm sure it's doable, but I don't know the algorithm off the top of my head.



I was playing MoF earlier and was reminded by doing so to ask about something. xD

For Stage Progression, are you planning on making it like Danmakufu/EoSD/PCB/IN, where after completing a stage, the screen shrinks and your score page pops up before moving on?

Or are you going to do it like MoF/SA/UFO, where your score briefly pops up and then automatically shifts into the next stage without any transition screen?

Good question.  The MoF-style one would be a bit easier, I think.  But in the end I think we'd want both ...

LevelTransition();

How about YOUMU or FUJIN?

... like this.



Some more progress tonight:



And, I figured I'd give you guys a glimpse of what it looks like in the current build.  Warning: I'm no artist, so it's not particularly impressive visually.

(http://www.stephenware.com/albums/touhou/sample_1_2009_09_26.png)
(If this doesn't display, try this link (http://www.stephenware.com/gallery/view_photo.php?set_albumName=touhou&id=sample_1_2009_09_26))

The white text was added in afterwards (over ⑨000ms in MSPaint :V).

Object 1 is simply moving at a down-right angle.  Note that its sprite is rotated to match its movement vector (the red corner is up on the image)
Object 2 (Pyro-Reimu) is moving straight left.  This time, the sprite is not rotated with the object's movement.
Object 3 is player-controlled.

The number in the title bar is a temporary debugging output - the value is a global variable that each object's Tick and Collision scripts modify each frame.  This lets me know what's going on with the objects as they move about in realtime.


I know, probably not very impressive, but please keep in mind that most of the work I've been doing is foundation - the engine itself is actually pretty usable right now, save for some details:

To-Do List of Doom:
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on September 26, 2009, 07:47:04 AM
I'm always ambivalent about higher resolutions because it means I need to make bigger sprites :V

But whatever, 800x600 is a resolution for true bros, so I'm cool with the current setup.
Title: Re: A replacement for Danmakufu?
Post by: anonl on September 26, 2009, 09:51:01 AM
Although, come to think of it, what about the case of two colliding lasers?  I'm sure it's doable, but I don't know the algorithm off the top of my head.
Reduces to the problem of finding the minimum distance between two line segments.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 26, 2009, 07:57:45 PM
I'm always ambivalent about higher resolutions because it means I need to make bigger sprites :V

But whatever, 800x600 is a resolution for true bros, so I'm cool with the current setup.

Well, 800x600 isn't too much bigger than Danmakufu's screen (640x480), so you could use the same sprites you use now; they're just be a bit smaller on-screen.

Or, if you're worried about the ability to change the screen size - that's purely for the end user.  The program scales all graphics to match the screen resolution the user picks.



Although, come to think of it, what about the case of two colliding lasers?  I'm sure it's doable, but I don't know the algorithm off the top of my head.
Reduces to the problem of finding the minimum distance between two line segments.


... I need to stop posting at 3am ... it's making me look like an idiot. :-\

Yeah, that's how it'd be done.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 26, 2009, 08:52:24 PM
I'd prefer some level of control over the resolution on the back-end, too, but ah well.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on September 26, 2009, 11:27:22 PM
Wow. Color me impressed at how quickly this is progressing.

=/ It'd take me forever to get something like this going.

Anyhow, I very much like how it's coming along, and it seems like despite your limited amount of time, you're really staying on top of it. =P Kudos, cheese. ...Or would you prefer Cheese? Kudos are kinda nasty-tasting. >_>
Title: Re: A replacement for Danmakufu?
Post by: Nimono on September 27, 2009, 12:07:43 AM
Oh hey, sorry if this sounds dumb or anything, but are you going to make shots have some selectability on what they go behind or in front of no matter what? My line of thinking is player shots. Currently, in Danmakufu, they ALWAYS go IN FRONT of the player. This is annoying, because it is EXTREMELY distracting to the hitbox for me. I do my best to avoid allowing player shots to cross into the player's graphics if they're not spawned from the player's location itself, because otherwise, the shots cloud up my vision of my location, and it becomes much harder for me to avoid bullets because it feels like my hitbox is somewhere other than the location it's truly at... So basically, I just want to know if you plan on putting in a simple way to allow player shots to go below the player graphics. That's all.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 27, 2009, 01:06:12 AM
Oh hey, sorry if this sounds dumb or anything, but are you going to make shots have some selectability on what they go behind or in front of no matter what? My line of thinking is player shots. Currently, in Danmakufu, they ALWAYS go IN FRONT of the player. This is annoying, because it is EXTREMELY distracting to the hitbox for me. I do my best to avoid allowing player shots to cross into the player's graphics if they're not spawned from the player's location itself, because otherwise, the shots cloud up my vision of my location, and it becomes much harder for me to avoid bullets because it feels like my hitbox is somewhere other than the location it's truly at... So basically, I just want to know if you plan on putting in a simple way to allow player shots to go below the player graphics. That's all.
Quote
Another thing Danmakufu is missing. Graphic layer settings for objects.
It was like the third thing suggested.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 27, 2009, 05:10:45 AM
I'd prefer some level of control over the resolution on the back-end, too, but ah well.

Could be added in later on; I don't think it'd be hard to add into the engine as it is shaping up.

I'd place it lower in the list of features to add, though.  No offense. ;)



Wow. Color me impressed at how quickly this is progressing.

=/ It'd take me forever to get something like this going.

Well, what else am I going to do on weekends?  Video games?  Sleep?  I mean, come on, seriously? :V



Anyhow, I very much like how it's coming along, and it seems like despite your limited amount of time, you're really staying on top of it. =P

I try. :)



Kudos, cheese. ...Or would you prefer Cheese? Kudos are kinda nasty-tasting. >_>

You will address me as "Lord Cheese the Magnificent, Supreme Commander of The Code and Final Arbitrator of All that is Awesome".  Anything else will simply not be sufficient.
(just kidding :P)

And I don't think I've ever had Kudos, so I can't give an opinion on their taste. <_<



Oh hey, sorry if this sounds dumb or anything, but are you going to make shots have some selectability on what they go behind or in front of no matter what? My line of thinking is player shots. Currently, in Danmakufu, they ALWAYS go IN FRONT of the player. This is annoying, because it is EXTREMELY distracting to the hitbox for me. I do my best to avoid allowing player shots to cross into the player's graphics if they're not spawned from the player's location itself, because otherwise, the shots cloud up my vision of my location, and it becomes much harder for me to avoid bullets because it feels like my hitbox is somewhere other than the location it's truly at... So basically, I just want to know if you plan on putting in a simple way to allow player shots to go below the player graphics. That's all.
Quote
Another thing Danmakufu is missing. Graphic layer settings for objects.
It was like the third thing suggested.

This is a good thing to address - what order do we want objects to draw by default?  My thoughts would be something like (highest = draw over everything else):


This is just an off-the-top-of-my-mind list, and probably doesn't include everything.  My reasoning here, basically, is to prioritize the most important items first - dodging is the most important part of danmaku, right?  Feel free to discuss.





Just got done with a bit more coding, by the way.  Not much spectacular; I just added in support for selecting what 'layer' each object is on, which gives way to support what was just mentioned above.

Each object is given a layer value, which is an integer representing how high of a priority, visually, it is given.  Higher values mean higher priority.  Scripts will be able to change these values on a per-object basis.

Currently, there are no bounds to these values; we'll have to decide default layer values.  For example, using my list above:


... would set the items to be visually prioritized in the same order as I listed, and allow nine layers in-between each "official" layer where scripters could throw things in-between.

I also started some optimization work on things, with a couple optimizations in the already-existing code, and planning for how to redo the current collision code to be more efficient (right now, it just blindly checks for collision between every object pair; I'm going to make it more intelligent).
Title: Re: A replacement for Danmakufu?
Post by: Naut on September 27, 2009, 05:16:32 AM
Hitbox over enemy shots, it's just better that way. Everything else looks good.
Title: Re: A replacement for Danmakufu?
Post by: Drake on September 27, 2009, 05:54:41 AM
Hitbox over enemy shots, it's just better that way. Everything else looks good.
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on September 27, 2009, 10:10:14 AM
Confirming and agreeing above two gentlemen. All the latter touhou games have hitbox over enemy shots. The only ones I remember having shots over player hitbox is PoFV and older.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 27, 2009, 03:44:35 PM
Yeah, I still fondly remember a moment in PCB -- I forget whether it was on Youmu or the Prismrivers -- when three different bullets completely obscured my hitbox, and none of them hit me. (This was before my haxcheatin' days ...)
Title: Re: A replacement for Danmakufu?
Post by: Nimono on September 27, 2009, 03:51:39 PM
I think Enemy/Boss should be the LOWEST object order, on the basis that even the player and player shots go above them in MoF. (I can't check against SA and UFO, as my current laptop won't run them fast enough to truly be able to play them...) However, I'm sure you'll allow a function to manually override a default layer order for a specific object, am I right?
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 27, 2009, 10:44:20 PM
I'm sure someone somewhere will want better reasons for doing things that way than "because ZUN did it" (read: "I wanna do it my way!"), how about have that as the default, and then making object-order customizable in the script. Possibly changing mid-script, too, with getters and setters and "bring forward" and "send backward" ...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 28, 2009, 02:21:53 AM
Hitbox over enemy shots, it's just better that way. Everything else looks good.

Hitbox over enemy shots, it's just better that way. Everything else looks good.

Confirming and agreeing above two gentlemen. All the latter touhou games have hitbox over enemy shots. The only ones I remember having shots over player hitbox is PoFV and older.

Yeah, I still fondly remember a moment in PCB -- I forget whether it was on Youmu or the Prismrivers -- when three different bullets completely obscured my hitbox, and none of them hit me. (This was before my haxcheatin' days ...)

I think Enemy/Boss should be the LOWEST object order, on the basis that even the player and player shots go above them in MoF. (I can't check against SA and UFO, as my current laptop won't run them fast enough to truly be able to play them...) However, I'm sure you'll allow a function to manually override a default layer order for a specific object, am I right?

Jeez, it's almost as if you guys are trying to tell me something. :V

The default order isn't even in the code yet.



I'm sure someone somewhere will want better reasons for doing things that way than "because ZUN did it" (read: "I wanna do it my way!"), how about have that as the default, and then making object-order customizable in the script. Possibly changing mid-script, too, with getters and setters and "bring forward" and "send backward" ...

Scripts will be able to change these values on a per-object basis.

;D



Not much to show today, mostly coded some optimizations to the engine.  Collision still isn't quite as optimal as I can get it, but it's much better now than it was (it only checks for collisions when it actually will do something).  Also optimized some parts of the drawing code.

Current performance - I added a circle of 360 Pyro-Reimus spreading out from the center, and it still holds a straight 60fps just fine currently.  Haven't gone into more stressful cases yet, but I think it looks good so far.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on September 28, 2009, 05:12:11 AM
Yeah, I skim stuff over, sue me ... |3
Title: Re: A replacement for Danmakufu?
Post by: Be Pok U (1998 burst style) on September 28, 2009, 06:08:09 AM
*after skimming*

what about items/power ups handling ?

For the sake of making scoring systems will stuff like UFO's system be handled else where or directly within the stage ?
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on September 29, 2009, 08:17:08 AM
Something that came to mind about that LevelTransition() function, how do we want to handle putting score text on that? Should we bother trying to allow itemizing stuff like in earlier Windows Touhous (level bonus, graze bonus, difficulty modifier, etc) or should we just have a singular argument for Stage Bonus that we calculate everything into?

The latter is probably the most feasible, I'm just curious how in-depth we plan to go with this.

There's also the issue of figuring out how to change how point items calculate their value...perhaps it would be a good idea to just have an "item" object type?
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on September 29, 2009, 06:20:14 PM
Here is another suggestion came to my mind after having a discussion with CaSercan on IRC about the sounds in Touhou (as they are not the same ingame as they are as wavfiles).

So the script should be able to mutate the : pitch, volume and "noise" ( don't know exact sound but the volume remains the same but it sounds like the sound is being dimmed / distorted. In dutch we call it 'dof' )

An idea about the code would be:  PlaySE(soundsfx.wav,<volume>,<pitch>,<"noise">);  Same could be applied for music I guess.
Title: Re: A replacement for Danmakufu?
Post by: anonl on September 29, 2009, 07:33:08 PM
So the script should be able to mutate the : pitch, volume and "noise" ( don't know exact sound but the volume remains the same but it sounds like the sound is being dimmed / distorted. In dutch we call it 'dof' )
In this context:
"dof" (NL) = "dull" (EN)

I think a low-pass filter would do what you want...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on September 30, 2009, 03:08:13 AM
*after skimming*

what about items/power ups handling ?

For the sake of making scoring systems will stuff like UFO's system be handled else where or directly within the stage ?

For powerups, the current plan was discussed a page or two back.  Basically, a player script will have "power levels", which are discrete levels of shot power.
On the other side, the stage/game script will define the value of the power items and at what power thresholds we trigger what power levels in the player scripts.

For other items and the related scoring system, I don't recall any in-depth discussion about how to go about them, but we can probably follow a similar philosophy in that the stage/game script will define the values of items.

Of course, this is open for discussion.  (As if anything isn't :V)



Something that came to mind about that LevelTransition() function, how do we want to handle putting score text on that? Should we bother trying to allow itemizing stuff like in earlier Windows Touhous (level bonus, graze bonus, difficulty modifier, etc) or should we just have a singular argument for Stage Bonus that we calculate everything into?

The latter is probably the most feasible, I'm just curious how in-depth we plan to go with this.

There's also the issue of figuring out how to change how point items calculate their value...perhaps it would be a good idea to just have an "item" object type?

If we wanted to be masochisticthorough, we could have our level transition function take an array of items to show on the results screen.  Perhaps, something like this:

End_Level_Transition([["Point Items", num_points], ["Graze", num_graze], ["Bombs", num_bombs], ["Stage Bonus", bonus], ["Total Score", Get_Score()]]);

... just an idea.



Here is another suggestion came to my mind after having a discussion with CaSercan on IRC about the sounds in Touhou (as they are not the same ingame as they are as wavfiles).

So the script should be able to mutate the : pitch, volume and "noise" ( don't know exact sound but the volume remains the same but it sounds like the sound is being dimmed / distorted. In dutch we call it 'dof' )

An idea about the code would be:  PlaySE(soundsfx.wav,<volume>,<pitch>,<"noise">);  Same could be applied for music I guess.

This should be possible with manipulation of sound buffers.  Something we'd have to look into, and I don't think it should be top priority, but I don't see why it wouldn't be doable.

Of course, for simplicity, we could keep the simple "just play the damn sound" function, too.
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on September 30, 2009, 10:05:07 PM
I know I said earlier that I couldn't imagine anybody wanting more than 8 power levels, but I suddenly have the desire to make a player script with an utterly broken level 10 power definition.

"Hey Blue, what's the script say about her power level?"
Me: IT'S OVER 9!
"WHAT, 9!"

>.>
<.<

Aaaaand, this is why I shouldn't post when I'm tired. >.< Still, not having a harcoded power limit is probably a good idea.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on September 30, 2009, 11:26:05 PM
This should be possible with manipulation of sound buffers.  Something we'd have to look into, and I don't think it should be top priority, but I don't see why it wouldn't be doable.

Of course, for simplicity, we could keep the simple "just play the damn sound" function, too.
[/quote]

I dunno, PlaySEex(<parameters>)?
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 01, 2009, 12:04:52 AM
I motion to change that function from PlaySEex to PlaySex. All in favor?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 01, 2009, 01:57:53 AM
I know I said earlier that I couldn't imagine anybody wanting more than 8 power levels, but I suddenly have the desire to make a player script with an utterly broken level 10 power definition.

"Hey Blue, what's the script say about her power level?"
Me: IT'S OVER 9!
"WHAT, 9!"

>.>
<.<

Aaaaand, this is why I shouldn't post when I'm tired. >.< Still, not having a harcoded power limit is probably a good idea.

Whatever the limit, I think it's best to have a fixed range of values for power levels, so that all player scripts will have the right range to use.



I motion to change that function from PlaySEex to PlaySex. All in favor?

What am I to do with you silly people. :V
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 01, 2009, 02:20:54 AM
Here's a thought: instead of a mandatory specific number of levels, have the player-script specify a "max power" and (maybe/optionally) a "minimum power" like how UFO has 1.00 as its minimum, and when the stage-script calls for a power-level change, round it to the nearest available fraction-of-the-max-level in the player-script. So, let's say, if a stage-script was expecting 0-7, and the player-script had 1-4, then:

When the stage-script asks for:01234567
... the player-script returns:11223344

Also, maybe some sort of multiplier for how much point-items are worth, like how in SA, Marisa-Alice gains a level for every 12 point-items, but everyone else gains a level every 20 point-items.
Title: Re: A replacement for Danmakufu?
Post by: Be Pok U (1998 burst style) on October 01, 2009, 05:24:44 AM
Here's a thought: instead of a mandatory specific number of levels, have the player-script specify a "max power" and (maybe/optionally) a "minimum power" like how UFO has 1.00 as its minimum, and when the stage-script calls for a power-level change, round it to the nearest available fraction-of-the-max-level in the player-script. So, let's say, if a stage-script was expecting 0-7, and the player-script had 1-4, then:

When the stage-script asks for:01234567
... the player-script returns:11223344

Also, maybe some sort of multiplier for how much point-items are worth, like how in SA, Marisa-Alice gains a level for every 12 point-items, but everyone else gains a level every 20 point-items.

In a way you don't really need a min power; Its probably better to just keep power as a variable unsigned byte int (considering UFO). I think its easier to just to set a game var "number of power items to max" and player script to assign "X number of levels" so all the game needs to do is "game p items to max" divided by "X levels per player" to find how many  items it takes to level up. The whole thing with 1.00 starting power, or decimals for that matter is pure aesthetics, it can be probably be handled in the game ui ? taking "x powerups to level up" divided by say ... 20. and you'll have MoF style output. divided by 100 + 1.00 and you got UFO.

Its still problematic should someone want to create a non straight forward power up system though; like if you use different item power up items that does different things.  The assumption on that I guess is if someone is going to use a very unique power up system for their game, its going to be restricted to their own custom player scripts anyway. Leaving default power up handling like so, for the one shot stage creations.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 01, 2009, 09:43:53 PM
Supporting 2+ cutins on each side of a talk event.

(Lyrica's scenario in Touhou Kaeidzuka)
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on October 02, 2009, 12:02:25 AM
Whatever the limit, I think it's best to have a fixed range of values for power levels, so that all player scripts will have the right range to use.

v.v If you must. Though I'd still like to see the hard max a notch or two above the conventional max.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on October 02, 2009, 11:30:02 PM
Supporting 2+ cutins on each side of a talk event.

(Lyrica's scenario in Touhou Kaeidzuka)

This. It's pretty necessary for one of my games. =o
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 03, 2009, 04:58:07 AM
Here's a thought: instead of a mandatory specific number of levels, have the player-script specify a "max power" and (maybe/optionally) a "minimum power" like how UFO has 1.00 as its minimum, and when the stage-script calls for a power-level change, round it to the nearest available fraction-of-the-max-level in the player-script. So, let's say, if a stage-script was expecting 0-7, and the player-script had 1-4, then:

When the stage-script asks for:01234567
... the player-script returns:11223344

Also, maybe some sort of multiplier for how much point-items are worth, like how in SA, Marisa-Alice gains a level for every 12 point-items, but everyone else gains a level every 20 point-items.

In a way you don't really need a min power; Its probably better to just keep power as a variable unsigned byte int (considering UFO). I think its easier to just to set a game var "number of power items to max" and player script to assign "X number of levels" so all the game needs to do is "game p items to max" divided by "X levels per player" to find how many  items it takes to level up. The whole thing with 1.00 starting power, or decimals for that matter is pure aesthetics, it can be probably be handled in the game ui ? taking "x powerups to level up" divided by say ... 20. and you'll have MoF style output. divided by 100 + 1.00 and you got UFO.

Its still problematic should someone want to create a non straight forward power up system though; like if you use different item power up items that does different things.  The assumption on that I guess is if someone is going to use a very unique power up system for their game, its going to be restricted to their own custom player scripts anyway. Leaving default power up handling like so, for the one shot stage creations.

The way we were discussing before is that we'd set a "max power" value, as well as the amount each power item gives.

MoF, for instance:
Max = 5
Small_Item = 0.05
Large_Item = 1;


Then, you'd set the thresholds for each of a set number of "power levels" - each level corresponding to a possible level that the player script can use.

MoF again:
Level_2_Threshold = 1
Level_4_Threshold = 2
Level_6_Threshold = 3
Level_8_Threshold = 4


(assuming level 8 is the highest - remember that MoF your firepower maxes out at 4.0 ... unless I'm remembering wrong).
With this, you're player script would be at power level 0 for [0,1), power level 2 for [1,2), power level 4 for [2, 3), power level 6 for [3, 4), and power level 8 (max) for [4, 5].

As far as displaying integers vs. decimals, we could just have a command that lets the script set how many decimal places to show; same with starting power amount.


This is basically what Muffin describes, except it sounds to me like Muffin was saying to define it in the player script, while my approach defines it in the stage script (save for the part of actually deciding on and firing player shots, which need to be in the player script).  I think this is better, since then a game script will have a consistent power system for all player types.

(... please let me know if I'm misinterpreting what you're saying ;) )


The powerup multiplier idea is good, though.  Didn't know about that myself, haven't played anything beyon MoF to date (work, fighting game tournaments, laziness, etc >__> ).



Supporting 2+ cutins on each side of a talk event.

(Lyrica's scenario in Touhou Kaeidzuka)

I'll make a note of that.



v.v If you must. Though I'd still like to see the hard max a notch or two above the conventional max.

Well, we don't have any max defined currently.  Not sure what you were considering the "conventional max".  I just chose 8 for giving examples 'cause it's a nice, round number (in binary, anyways :V).



A bit of code progress tonight, mainly focusing on scripts:

I've started to add the base framework for reading in script files.  Right now, it's limited to reading in a language that I call mdBase, which is basically a text transliteration of the Execution Engine commands - it looks much like assembly code and, in general, isn't intended for large-scale usable, but rather to test things in the Engine.

As a sample, here's the script file the program is currently set to read in:

Code: [Select]
Musuu
Script[mdBase]


/ A thing
Object_Type Effect A thing

/ initialize script
Script initialize

/ Initialize the global a
add #a, 1.0, 1.5

/ Set our size
obj_get_id !tmp
obj_set_size !tmp, 100, 150


/ tick script
Script tick

/ change the value of the global a
sub #a, #a, 0.1


/ collide1
Script collide Effect

/ change the value of the global a
add #a, #a, 100000


/ collide2
Script collide2 A thing

/ change the value of the global a
add #a, #a, 100



/ Player type
Object_Type Player   A player

Script initialize
obj_get_id !tmp
obj_set_size !tmp, 5.0, 7.0
obj_set_image !tmp, "test1.png"


/ Pyro-Reimu :V
Object_Type Enemy Pyro Reimu

/ initialize script
Script initialize
obj_get_id !tmp
obj_set_size !tmp, 5, 8
obj_set_image !tmp, "reimu1.png"

(Emphasis added for those of you skimming:) This is not what script file code will look like
While you could write script files in this, there will be a much better way of doing it once I get the script parser in place.

While it probably isn't important to dwell on the details of these scripts (since they're not really 'complete' anyways - there's still several things in the program code), there are a few things to note about the file:



For the curious
A crash-course in mdBase:


Start the definition of an Object Type with a line that reads:
Object_Type <base type> <name>

... where <base type> is one of the object base types (Effect, Enemy, Player, etc.) and <name> is the name of the new object type


Start the definition of a script for the current object type with a line:
Script <script type>

... where <script type> is the type of script, such as initialize or tick.  For collide and collide2 scripts, put the name of the object type or object base type that the collision script is for

For each command in a script, have a line as follows:
<command> <args>
... where <command> is the command mnemonic for the command to execute, and <args> is a comma separated list of arguments, in the following format:

Local variables are only for the currently-running function.  Object variables persist for each object, and can be accessed by all functions running for that object.  Global variables are defined globally, and can be accessed anywhere.

Commands seen in the above sample:



Once again, mdBase isn't intended for writing full scripts, but rather for testing the functionality of the Execution Engine.
(of course, if you're crazy enough, you can write full scripts in this.  Emphasis on crazy.)


One thing to note is that, depending on how my adventures in learning ANTLR go, the parser for the real (better) scripting language(s) may end up just converting those scripts to mdBase internally, rather than going straight to the internal script data structures.  I still need to figure a few things out with ANTLR, so we'll have to see how that goes; anyone here know about using ANTLR already?


EDIT:
Yay page seven :D
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 03, 2009, 07:48:59 AM
My idea was actually more of a sort of hybrid: you'd define how many levels the player can handle in the player script, and the stage-script would define how many levels we're supporting in this game. If the stage-script has more levels, it doesn't level the player up until it's reached a level that does correspond with a player's level; it the player-script has more levels, it skips levels. The advantage is that, in this respect at least, all player-scripts will be compatible with all stage-scripts. The disadvantage is that the increase would be somewhat uneven if the player's number of levels and the stage's number of levels don't factor well with each other.

Regardless, I still say this should be part of a "default script which comes with the game" rather than making any of it hardcoded, since "hardcoded" by definition means "someone would have to do all sorts of unnecessarily-complex juggling with the scripts if they didn't want to do it the hardcoded way."
Title: Re: A replacement for Danmakufu?
Post by: anonl on October 03, 2009, 08:23:18 AM
  • Boolean literal: true or false
  • Numeric literal: just the number - 5.0, 65536
  • String literal: string in doublequotes - "A string"
  • Local variable reference: !variable_name
  • Object variable reference: @variable_name
  • Global variable reference: #variable_name
Never seen a language where you have to specify the scoping in your references. Variable shadowing is generally a good thing.

Also:
Code: [Select]
!a = true
!b = !!a
Or will there be no '!' operator?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 03, 2009, 09:36:06 AM
... I should really be asleep right now, shouldn't I? :-\

My idea was actually more of a sort of hybrid: you'd define how many levels the player can handle in the player script, and the stage-script would define how many levels we're supporting in this game. If the stage-script has more levels, it doesn't level the player up until it's reached a level that does correspond with a player's level; it the player-script has more levels, it skips levels. The advantage is that, in this respect at least, all player-scripts will be compatible with all stage-scripts. The disadvantage is that the increase would be somewhat uneven if the player's number of levels and the stage's number of levels don't factor well with each other.

Regardless, I still say this should be part of a "default script which comes with the game" rather than making any of it hardcoded, since "hardcoded" by definition means "someone would have to do all sorts of unnecessarily-complex juggling with the scripts if they didn't want to do it the hardcoded way."

In a way, this is pretty much what I was saying, albeit with a couple different details.  The way I suggested above also leaves all player scripts usable with all stage scripts - stage scripts controls how where player's power level is within a scale, and the player scripts then uses that value to determine how strong of an attack to fire.

As far as hardcoding things is concerned - if you don't want to use the hard-coded power system, just don't enable it and don't use the default, provided-by-the-program power items.  I do think, though, this system would be flexible enough to handle many variations on the Touhou-style power systems, at least; also, if there is demand other power system templates could be coded/scripted as well.



Never seen a language where you have to specify the scoping in your references. Variable shadowing is generally a good thing.

This is not what script file code will look like

As I mentioned before, mdBase is basically a direct translation of the internal structures used to hold code internally for the Execution Engine.  By the time the script reaches this point, all variable scoping has already been determined, so that the Engine can quickly know where to look for the value.

'Real' scripting languages, for which support will be added in, will not have this oddity.  At least the main one I have in mind won't - if someone else wants to create a higher level script language with this in it, they can, limited only on what structure we have for allowing add-on script languages (Not really sure why they'd want to do that, though).

For reference, in the 'real' scripting language that I have in mind, I'd declare variables something like this:

Code: [Select]
Musuu
Script[mdScript]

// Declare "difficulty" as a global variable - accessible everywhere
global difficulty;

Object_Type Enemy "Pyro-Reimu"
{
   // Declare "counter" as an object variable - accessible from all scripts on this object
   define counter;

   tick
   {
      // "temp" is a local variable - will be only accessible in this tick script
      let temp;
   }   
}

Note: If you want, you can even share global variables between scripts files by giving them the same name - in this way, they function much like Danmakufu's SetCommonData/GetCommonData functions.



Also:
Code: [Select]
!a = true
!b = !!a
Or will there be no '!' operator?


'!' can be whatever the hell the language syntax calls it out for.  You're associating it with the boolean NOT operator, which is what it is in several common languages (C, Java, Danmakufu, and the planned main scripting language for this program, at least).  However, this is not what it is used for in mdBase; rather, it is used (as described above) to declare variable scoping.
Side Note: in BASIC, ! is put at the end of a variable to denote that it is a single-precision floating point value.

Or, if you're asking whether boolean inversion will be included in the capabilities of the engine - of course it will be.



Also, quick little hint for you mdBase crazies (all zero of you, I'm sure :V):
add not only adds numbers, but will also concatenate strings and perform a boolean OR on a pair of booleans.  Furthermore, it's not implemented yet, but add will also be able to add strings with numbers or booleans, which will convert the latter to their string representation and then concatenate the strings.
Similarly, once implemented, mul will not only multiply numbers, but do a boolean AND operation on a pair of booleans.

... as far as higher level languages are concerned, the + operator will probably see some extra functionality out of this with the string concatenation parts, but I still think we'll have the || and && operators for OR and AND (even though they might end up translating down to the same add operation in the end).
Title: Re: A replacement for Danmakufu?
Post by: anonl on October 03, 2009, 12:03:38 PM
As I mentioned before, mdBase is basically a direct translation of the internal structures used to hold code internally for the Execution Engine.  By the time the script reaches this point, all variable scoping has already been determined, so that the Engine can quickly know where to look for the value.

So:
Code: [Select]
script --[compiles_to]--> mdBase --[lex,parse]--> interpreter

That still leaves the question of shadowing
Code: [Select]
var a;
var b;
if (blah) {
    var a; //Is this decl allowed?
    b = a; //How would you compile this line to mdBase?
}
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 03, 2009, 03:31:53 PM
In a way, this is pretty much what I was saying, albeit with a couple different details.  The way I suggested above also leaves all player scripts usable with all stage scripts - stage scripts controls how where player's power level is within a scale, and the player scripts then uses that value to determine how strong of an attack to fire.
Hmm. If I'm interpreting this right, this actually works better than the way I had it in some ways.

As far as hardcoding things is concerned - if you don't want to use the hard-coded power system, just don't enable it and don't use the default, provided-by-the-program power items.  I do think, though, this system would be flexible enough to handle many variations on the Touhou-style power systems, at least; also, if there is demand other power system templates could be coded/scripted as well.
Well, one of the things I had a problem with was hardcoding the number of power levels, which would restrict things.

And by "not wanting to use it" I meant "not wanting to use a Touhou-style power system." Granted, with only a few minor adaptations you can make it into ... well, just about any other power system. I mean, you couldn't really do a Suguri-style energy-system with it, but ...
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on October 03, 2009, 05:02:31 PM
[/pirate]
Just about the effects that surround the boss, it's obvious what the spell circle does, first of all.

(http://img198.imageshack.us/img198/2162/eff01.png)
The ones surrounding the boss are in here. Slightly different in each game, but the middle one kind of blurbs around the middle of the character and the top four bits start off big, then shrink towards the center, creating some sort of weird effect. A red version of the left thing starts flat and grows upwards. All this together makes the aura thing.

Upon analysis of the distorting space, it comes down as an asymmetrical pattern. I'm fairly sure it's a near-perfect circle. The "Border of Spell" circle that surrounds it is just the same graphic but rotating. It's not affected by the distortion. In fact, the only thing affected is the background. Although considering I don't know how the effect works, I don't know if he has a graphic associated with it.

Also, upon more analysis Hele's cut-in script still needs some work :V

Also, the collision detection sounds great.

[pirate]

The distortion/bending/blurring of the background is caused by the middle sprite texture? Though I still don't get how a texture covering the background can cause the background to distort. Or am I being an super idiot here in understanding english.

And you are a bit wrong about the distortion. The red spellcircle causeses the entire distortion. The outer two border circles shrink as the timer goes down. Even when these circles enter the red circle dimension they get distorted.

Title: Re: A replacement for Danmakufu?
Post by: Drake on October 03, 2009, 05:43:25 PM
Quote
The ones surrounding the boss are in [image]. Slightly different in each game, but the middle graphic kind of blurbs around the middle of the character and the top four bits start off big and outside the character, then shrink towards the center. The left thing starts flat and grows upwards. All this together makes the aura thing.
Sorry, this was the only part that you needed to pay attention to. I wasn't sure on anything about the distortion.
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on October 03, 2009, 06:36:33 PM
Yes I noticed the aura textures you mentioned. My guess is the following by analysing your story and given textures:

ZUN seems to spawn multiple sprites behind the enemy having a  Y-scaling stretching the texture making it "burn". If you do this with an additive blend and fast sprite spawning it will look like the burning effect ingame I guess.

But I don't want STOP HELEPOLIS so I made my own sprite with a particle flare and mass spawn it in different X-offset.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 04, 2009, 06:12:30 AM
So:
Code: [Select]
script --[compiles_to]--> mdBase --[lex,parse]--> interpreter

Well, I'd put it more like:

high-level script --[lex,parse,compile,etc]--> mdBase --[translate]--> internal format for interpreter
... but the basic idea is there.

Depending on how things go, though, the high-level script parsing/etc might go straight to the internal format instead.



That still leaves the question of shadowing
Code: [Select]
var a;
var b;
if (blah) {
    var a; //Is this decl allowed?
    b = a; //How would you compile this line to mdBase?
}

mdBase will have no problem handling shadowing between globals, object vars, and locals, since they are stored separately; I will probably disallow this in the high-level scripting language, though, since it leads to code ambiguity.

Is far as shadowing a local with another local, I don't really like that myself, but it could be done if people want.  Internally, the variable name for at least one of them would need to be changed - this would make the parser a bit more complicated, I believe.
What do people think?



Well, one of the things I had a problem with was hardcoding the number of power levels, which would restrict things.

Well, how many levels do you really think you'd need?  We could set a larger number of levels.

Only downside with setting lots of levels is that, say the limit is 65535.  Stage script defines first power items sets level to 255, but the first player script level-up threshold is 256 - player gets screwed out of the first level-up on the first item.
(bit of an over-the-top example, but I think you'll get my point)



And by "not wanting to use it" I meant "not wanting to use a Touhou-style power system." Granted, with only a few minor adaptations you can make it into ... well, just about any other power system. I mean, you couldn't really do a Suguri-style energy-system with it, but ...

Having never played Suguri, I'm not sure what the power system is like there.

Any suggestions for further generalizing the current model we have?




Some quick progress with the Execution Engine tonight; got a bunch more operations implemented, including the rest of basic math and some get/set operations for object properties (angle, speed, sizes, image, player movement).

Honestly, once I add in object creation/deletion commands and get some of the default behaviors implemented, we could have some basic danmaku patterns flying about in the engine.  Main limitation on that, of course, is that we don't yet have a scripting language to write the fun stuff in.  I mean, we have mdBase, but seriously, I wouldn't want to write anything big in it. :V



Oh, and does anyone have experience with ANTLR or a similar program?  I may have asked this before ... it'd be better if someone already knows how to handle it, rather than me beating it with a binary polearm until it follows my instructions.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 04, 2009, 07:13:44 AM
Well, the way Suguri's "power" system works is more like a fighting game: as you attack enemies, a gauge fills up, and you can use it to do super-moves, but your actual attack-power doesn't change or increase. This also replaces bombing.

I've also played an R-Type (I think) fangame in which, depending on what powerup you collected, your actual shot-type changed, but this would probably be best saved for collaboration between player-script and stage-script ...

As for the level-skipping issues, I don't particularly mind that much. So it skips straight from level 0 to level 2. Or, indeed, if the stage's max is 4, it skips from 0 to 64. I think that's a relatively small price to pay for complete-compatibility here ...
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on October 04, 2009, 07:50:32 AM
Well, the way Suguri's "power" system works is more like a fighting game: as you attack enemies, a gauge fills up, and you can use it to do super-moves, but your actual attack-power doesn't change or increase. This also replaces bombing.

That would actually be pretty simple to implement. The stage could use a default "always max power" setting, so that it can play around with the power variable without changing your attack level, then have its bomb system tied into power like MoF/SA-style. As for getting power by attacking, well, you usually get score when you destroy shit, why not power, too?

As for the power issue, I haven't seen anything that I like better than how we originally had it. (recap for those that don't want to read back:) The player script has some finite number of level definitions between 0 and whatever we decide for the maximum (I chose 7 arbitrarily, if we want to go to 8 or 10 or whatever, it still works) and the stage script tracks its numbers however the hell it wants to, and calls up the power levels as defined in the player script; if the stage calls a power level that doesn't exist in the player script, it falls down the the next lowest one that is defined.

Also, I haven't worked with DMF's player scripting, so I dunno if it does anything like this, but I'd like to suggest having a whole bunch of optional identifier tags so the stages can do cool things like
Code: [Select]
If (PlayerName == "Reimu") {
<load Satori boss graphic>
} Else {
<load Reimu boss graphic>
}
or
Code: [Select]
If (PlayerShoelaceIsUntied) { blahblahblah } Or whatever. (Also, this way, we could have a tag like "PlayerHasSuperPower" that identifies power definitions above whatever we decide as a max. :V No ulterior motives here! >.>;; )
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 04, 2009, 08:52:14 AM
I'm trying to think of a system for handling power levels that's going to allow us to standardize our player scripts and have them function correctly despite having different numbers of power levels.

Perhaps power levels should be tracked by percent? i.e. the stage script defines the maximum amount of power you can have, and the player script bases its current power level on how much of a percentage of that maximum they have. Like for instance the player script will say,
if(PowerRatio()>=0.5 && PowerRatio()<0.75){PowerLevel=2;}
where PowerRatio represents the percentage (0.5 being 50%).

Like, say a given stage script has a maximum of 400 power.
PCB-style Reimu has 8 power levels past 0, broken up into 12.5% increments.
SA-style Reimu has 4 power levels past 0, broken into 25% increments.

That way when they're at 200 power, PCB-Reimu will have her level 4 shot and SA-Reimu will have her level 2 shot, which are supposedly equal in effectiveness despite different numbers of levels.
Title: Re: A replacement for Danmakufu?
Post by: Byakuren Hijiri on October 04, 2009, 03:41:39 PM
I just want to say this looks pretty much awesome, I have some problems with Danmakufu so this could be really good.
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on October 04, 2009, 04:27:00 PM
For the sake of Danmakufu and Touhou and everything that is holy, don't make SA system a default. Either make it PCB/IN or UFO.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on October 04, 2009, 04:55:02 PM
Hey, any chance we may see support for menu scripts?
So far in danmakufu, I know there are different typrs. But none specifically for menus (Is there?)
So I figure, why not a menu type for scripts that will allow us to select character, difficulty, etc.?
In other words, to tweak variables and to load up stage scripts, as well as allowing activation of other scripts once a requirement has been met (Such as extra/phantasm stages)

If I didn't put this in the right words, could a moderator please help? Because custom menus in danmakufu is currently hard as heck to make, and this could really take away from the stress if support is pre-built  :V
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 04, 2009, 05:40:32 PM
It'll be all included by default.
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on October 04, 2009, 08:58:19 PM
>.< Blargh. Yet more proof that I shouldn't be allowed to post at 4 AM. Lemme try this again:

I think player scripts should be allowed to define a slew of tags that stage and menu scripts can tweak on. For example, a player script might have a section that looks something like this:
Code: [Select]
AddTag("Reimu")
AddTag("Homing")
AddTag("Human")
AddTag("Solo")
AddTag("Superpower")
And then menu scripts can filter the player lists based on tags that are/aren't included, stages can have different things happen depending on what properties the player has, and generally there's a lot more room for creativity.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 04, 2009, 10:09:49 PM
>.< Blargh. Yet more proof that I shouldn't be allowed to post at 4 AM. Lemme try this again:

I think player scripts should be allowed to define a slew of tags that stage and menu scripts can tweak on. For example, a player script might have a section that looks something like this:
Code: [Select]
AddTag("Reimu")
AddTag("Homing")
AddTag("Human")
AddTag("Solo")
AddTag("Superpower")
And then menu scripts can filter the player lists based on tags that are/aren't included, stages can have different things happen depending on what properties the player has, and generally there's a lot more room for creativity.
... now that would be badass.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 04, 2009, 10:31:06 PM
Quote
I'm trying to think of a system for handling power levels that's going to allow us to standardize our player scripts and have them function correctly despite having different numbers of power levels.

Perhaps power levels should be tracked by percent? i.e. the stage script defines the maximum amount of power you can have, and the player script bases its current power level on how much of a percentage of that maximum they have. Like for instance the player script will say,
if(PowerRatio()>=0.5 && PowerRatio()<0.75){PowerLevel=2;}
where PowerRatio represents the percentage (0.5 being 50%).

Like, say a given stage script has a maximum of 400 power.
PCB-style Reimu has 8 power levels past 0, broken up into 12.5% increments.
SA-style Reimu has 4 power levels past 0, broken into 25% increments.

That way when they're at 200 power, PCB-Reimu will have her level 4 shot and SA-Reimu will have her level 2 shot, which are supposedly equal in effectiveness despite different numbers of levels.

Am I missing something?  This sounds pretty much like the idea we've been throwing around, except you're using a percentage rather than a set of numbers.

Quote
Hey, any chance we may see support for menu scripts?
So far in danmakufu, I know there are different typrs. But none specifically for menus (Is there?)
So I figure, why not a menu type for scripts that will allow us to select character, difficulty, etc.?
In other words, to tweak variables and to load up stage scripts, as well as allowing activation of other scripts once a requirement has been met (Such as extra/phantasm stages)

If I didn't put this in the right words, could a moderator please help? Because custom menus in danmakufu is currently hard as heck to make, and this could really take away from the stress if support is pre-built 

As was discussed some number of pages back, there is a plan to have game scripts, which allow custom menus and such to be scripted, allowing selection of game type, difficulty, etc.

To be fair, though, while I agree that it's more complicated than it needs to be, I don't really think custom menus in Danmakufu are that hard to code.  Just a bit tiring, because of how much script is needed.
(Then again, my opinion might be a bit biased <__<)

Quote
>.< Blargh. Yet more proof that I shouldn't be allowed to post at 4 AM. Lemme try this again:

I think player scripts should be allowed to define a slew of tags that stage and menu scripts can tweak on. For example, a player script might have a section that looks something like this:
Code: [Select]
AddTag("Reimu")
AddTag("Homing")
AddTag("Human")
AddTag("Solo")
AddTag("Superpower")
And then menu scripts can filter the player lists based on tags that are/aren't included, stages can have different things happen depending on what properties the player has, and generally there's a lot more room for creativity.

This person is thinking.  I like it.

Must. Stop. Hitting modify instead of reply. - Stuffman
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 05, 2009, 12:24:13 AM
Hmmmmmm...
Life piece enabling/disabling, like in Chireiden/Seirensen (enabling) or in Koumakyou/Youyoumu/Eiyashou (disabling)
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 05, 2009, 12:37:38 AM
Hmmmmmm...
Life piece enabling/disabling, like in Chireiden/Seirensen (enabling) or in Koumakyou/Youyoumu/Eiyashou (disabling)
Could you be a bit clearer about what you mean? :o
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 05, 2009, 01:30:37 AM
Quote
Am I missing something?  This sounds pretty much like the idea we've been throwing around, except you're using a percentage rather than a set of numbers.

Maybe I'm misunderstanding, but it sounded like people were suggesting the stage script would track power thresholds and tell the player script what power level they were supposed to be at? I'm saying the stage script should just tell the player how much of the maximum power they have and the player script should figure out its own power level.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 05, 2009, 01:53:46 AM
Could you be a bit clearer about what you mean? :o
Um, you know about those purple stars that the enemy characters drop (and even that one fairy in SA stage 4)?
Title: Re: A replacement for Danmakufu?
Post by: Kylesky on October 05, 2009, 02:13:54 AM
Could you be a bit clearer about what you mean? :o

I think he means the life parts that the SA bosses drop whenever you finish a non-spell or spell card without dying or the ones that the red UFO drops in UFO...
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 05, 2009, 02:33:29 AM
I think he means the life parts that the SA bosses drop whenever you finish a non-spell or spell card without dying or the ones that the red UFO drops in UFO...
Yeah, what Kyle said. Also, I don't think it appears in MoF.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 05, 2009, 02:41:53 AM
Ah, I see, yeah.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 05, 2009, 03:23:51 AM
Ah, I see, yeah.
Hmmmm... thanks for reminding me, I just finished an experiment with common data, and this thing that works ALMOST like the life pieces.
Title: Re: A replacement for Danmakufu?
Post by: ChaoStar on October 05, 2009, 10:57:40 PM
Honestly, something that would make me super, super, happy... would be that this version be compatible with Mac OS X, and Linux.
Title: Re: A replacement for Danmakufu?
Post by: MCXD on October 05, 2009, 11:35:28 PM
Honestly, something that would make me super, super, happy... would be that this version be compatible with Mac OS X, and Linux.

Fourth Item: Implementation:

As I mentioned previously, this would be implemented using SDL.NET and OpenGL in C#.  The main advantage of this is that it should be entirely cross-platform portable (without even recompiling!) using Mono.
Title: Re: A replacement for Danmakufu?
Post by: ChaoStar on October 06, 2009, 08:30:21 PM


 :-X I did not see that. Now I feel stupid...
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on October 06, 2009, 11:24:35 PM
>.< Blargh. Yet more proof that I shouldn't be allowed to post at 4 AM. Lemme try this again:

I think player scripts should be allowed to define a slew of tags that stage and menu scripts can tweak on. For example, a player script might have a section that looks something like this:
Code: [Select]
AddTag("Reimu")
AddTag("Homing")
AddTag("Human")
AddTag("Solo")
AddTag("Superpower")
And then menu scripts can filter the player lists based on tags that are/aren't included, stages can have different things happen depending on what properties the player has, and generally there's a lot more room for creativity.
This person is thinking.  I like it.

So do I. I can see oodles of possibilities with that system in place. =D PROPS
Title: Re: A replacement for Danmakufu?
Post by: G_gglypuff on October 06, 2009, 11:29:34 PM
What about system requirements? Do you think this will use more or less power when compared to Danmakufu?

Btw, I like how this project is so serious. We really need a better engine to work with...

PS: I don't know how to code anything, but I'm never looking forward to use danmakufu if I have anything else to spend time on.
Title: Re: A replacement for Danmakufu?
Post by: Be Pok U (1998 burst style) on October 07, 2009, 05:11:33 AM
What about system requirements? Do you think this will use more or less power when compared to Danmakufu?

Btw, I like how this project is so serious. We really need a better engine to work with...

PS: I don't know how to code anything, but I'm never looking forward to use danmakufu if I have anything else to spend time on.

This is being built from the ground up to replace danmakufu isn't it? I'd assume its suppose to be faster...

So is this going to have multicore support ?  :V

I noticed the plan is to use a single "numbers" data type for all numbers; I can see the simplicity in that, but feels kinda memory expensive if you were to like use doubles for all numbers.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 08, 2009, 12:51:59 AM
So is this going to have multicore support ?  :V

Danmakufu runs on multiple cores, so I hope to God on high that this will as well.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 08, 2009, 02:23:08 AM
What about system requirements? Do you think this will use more or less power when compared to Danmakufu?

Hard to give any real numbers at the moment.  My desktop, where I do my development, is (if I remember correctly):
AMD Sempron 3000 or so
1GB ram
WinXP
a good five(-ish) years old

The program, as-is, runs perfectly smooth with 363 objects (minimal collision scripts at the moment, though).  And that's with my habit of leaving ten or so multi-tab Firefox windows open at a time.

At the end of the day, though, how much power is needed will all come down to the scripts being run.  A script that says "lol fier bullat" is probably going to need less processor than "go here and draw the crazy effect while firing an ellipsis of bullets that slowly home in on each other while moving towards the ... etc" :V



This is being built from the ground up to replace danmakufu isn't it? I'd assume its suppose to be faster...

Being more efficient than Danmakufu is certainly a goal, although it might not be quite there at first.  Implement, then optimize - that's how I tend to do things.  Although, if I see optimizations I can do right off the bat, of course I'll throw them in.



So is this going to have multicore support ?  :V

Danmakufu runs on multiple cores, so I hope to God on high that this will as well.

Danmakufu does what now? o_O

... shit, now I need to look up how to do this.  And perhaps note to get a multicore processor when I finally decide to update my semi-piece of shit desktop. :V

Good thing you brought this up, though.  A lot of the things done in this engine are stupid easy to work into parallel processing, so it should be able to take advantage of multiple cores quite easily.
Only real issue you'd come across is that, if you're parallelizing things like running the tick scripts of each object, you could run into situations where the different scripts may not always run in the exact same order; if this becomes an issue there are ways to work around this, though.



I noticed the plan is to use a single "numbers" data type for all numbers; I can see the simplicity in that, but feels kinda memory expensive if you were to like use doubles for all numbers.

Are you seriously going to be storing so much data that this will even be a concern?

double = 8 bytes, if I remember correctly.

Even NTSD, which goes hell-crazy with arrays of arrays of arrays of numbers (no joke!) probably only stores at most maybe a hundred or so numbers for its own use, so that's only going to be maybe 1K or so of RAM used there.

The list of objects will be a bit more, with each object having at the least X, Y, angle, and speed as numbers, so (for now) 32 bytes in numbers per object.  Times, say, a few hundred objects on screen at once, you get around 10K of RAM used in numbers.  Still not that much, considering the average computer these days easily has at least a half gig or more of RAM.

For reference, Windows has a virtual memory page size of 4K (I just google'd it) - this means that Windows swaps memory in and out of RAM in 4K chunks.  So we're talking about maybe a few pages of RAM here ... I don't think this should become a big issue that easily.

Of course, feel free to disagree if you have some reasoning against what I said.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on October 08, 2009, 05:13:06 AM
I've got another possibly nooby question.

As far as I know, Danmakufu couldn't make games with a Phantasmagoria (versus type) set-up.

Seeing as how this seems to be based on the standard setup of a standard Touhou game, I doubt it will be the case here either, but just ofr the sake of asking, will it be possible to set-up a game to follow a Versus shooter set-up?


Also, going back to the Suguri thing that was mentioned previously - implementing the "Power up for Super Move" thing would be as simple as setting the script so that the Player gains a Bomb after collecting a certain number of items (of your choosing).

The Power Graphic can be represented with a little bar on the screen, and your actual player-shot will never change power. Since Suguri gains Power by destroying enemies, you can just set all enemies to drop a specific item, which you can then set to auto-collect upon appearance, which will then boost your "Power", which will then modify the graphic you set on the screen.

...did that make sense?
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 08, 2009, 05:17:51 AM
The only thing Danmakufu is missing for TSS style is the giant screen.

And if I'm interpreting it correctly you can change the size of the game window, so that shouldn't be a problem.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 09, 2009, 02:48:04 AM
I've got another possibly nooby question.

As far as I know, Danmakufu couldn't make games with a Phantasmagoria (versus type) set-up.

Seeing as how this seems to be based on the standard setup of a standard Touhou game, I doubt it will be the case here either, but just ofr the sake of asking, will it be possible to set-up a game to follow a Versus shooter set-up?

Adding support for TSS/PoDD/PoFV-style versus mode is certainly possible.
Given how different that type of game is though, it might be wiser to make a separate executable based of the same engine that would do this type of game.



Also, going back to the Suguri thing that was mentioned previously - implementing the "Power up for Super Move" thing would be as simple as setting the script so that the Player gains a Bomb after collecting a certain number of items (of your choosing).

The Power Graphic can be represented with a little bar on the screen, and your actual player-shot will never change power. Since Suguri gains Power by destroying enemies, you can just set all enemies to drop a specific item, which you can then set to auto-collect upon appearance, which will then boost your "Power", which will then modify the graphic you set on the screen.

...did that make sense?

Sounds like a perfectly viable way to do it.





Looked at a bit of stuff on using multiple cores late last night, and it comes down to multithreading the program, plain and simple.  That's good, because I already know what the hell I'm doing with that shit.

From a quick brainstorming session, here's a few places where I see possibility of spliting the program up into multiple threads:

Warning
The big post is approaching at full bandwidth.
According to the data, it is identified as Technical Details.
NO REFUGE


... whew, that's quite a bunch of detail.  Anyone have any thoughts?
I think that the separate rendering thread wouldn't be hard to do at all.  Of the other two, the separate collision detection thread is the easier of the two, but both could get tricky.
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on October 09, 2009, 04:28:53 AM
Rendering generally shouldn't be an issue, but if splitting the collision detection into a different thread is feasible for you, go for that. I think it might be actually slower(check me on this), especially if you're using non-rectangular shapes for collision masks.

A possibility is just to have a separate thread running that will check if anything on the screen is colliding(important things - player with enemy bullet, enemy with player bullet) and updating some kind of data structure with that information, so all the main thread has to do is go through and deal with them appropriately(using a mutex, waiting for the lock). I don't think you should put that in another thread because of desyncing problems and I only have two cores.

But then again, I'm not too experienced with threads. ><; Just thought I'd throw that out there.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on October 09, 2009, 06:26:37 AM
I can't imagine POFV vs type gameplay in danmakufu replacement (Does it have an official name yet?)
I just don't think it would work out with netplay and all that.

My suggestion is to best save it to as a different project altogether.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on October 09, 2009, 08:54:52 AM
I see what y
Adding support for TSS/PoDD/PoFV-style versus mode is certainly possible.
Given how different that type of game is though, it might be wiser to make a separate executable based of the same engine that would do this type of game.


I thought as much. Ah well, I suppose in a few years when I actually get to MAKING such a thing (it's on the far reaches of the to-do list), THEN I'll worry about what program to use for it. xD


As for your wall of text of Thread-Splitting, I'm nowhere near advanced enough in scripting programs to give any meaningful opinion on it. But I can at least say that I kinda like the idea, and as for that first risk on minor FPS loss, I could honestly care less about a split second xD
Title: Re: A replacement for Danmakufu?
Post by: Be Pok U (1998 burst style) on October 09, 2009, 10:39:14 AM
Rendering on its own thread should be fine for the most part; rendering of bullets (maybe player/hitbox) I might be concerned about though, given that's what facilitates the dodging but that shouldn't be a problem as long as drawing delays is minimal. Rendering for backgrounds and effects otherwise should have the least of problems right ?

Collision I'm worried about it being messed up if a bullet happens to be flying stupidly high speeds,it might worsen the desync problem. Timing is everything. Are there speed limits for bullets?  :V

Mutlithreading scripts looks a bit nasty to me though; Depending on the person writing the script, bloated scripts might just out right crash the engine for instance, unless, you can really make the scripting idiot proof somehow...  :V
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on October 09, 2009, 02:12:04 PM
That kind of collision problem is going to be a problem in its own right, regardless of whether threads are used. Fortunately, at 60 FPS, it shouldn't be too bad as long as you don't have bullets going at absolutely ridiculous speeds. XD
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on October 09, 2009, 08:25:49 PM
Collision I'm worried about it being messed up if a bullet happens to be flying stupidly high speeds,it might worsen the desync problem. Timing is everything. Are there speed limits for bullets?  :V

I don't think you're quite understanding the concern here; suppose you have a collision script that moves bullet A 10 frames in some direction. And suppose that causes a collision between that bullet and another (bullet B), resulting in another collision script being run. If, when this scene is replayed, the collision between bullet A and bullet B is checked before the first collision script moves bullet A, then it will fail, and the second collision script will not be run: hence, a desync. However, this all happens within a single frame, while the speed of a bullet only matters between frames.

But yeah, discretion is advised when weilding high-speed bullets.

The rendering thing would, at most, introduce a 1-frame lag, which would really only matter in cases where you have massive slowdown anyway (and possibly disrupt some TASers. Sounds win-win to me. =P)

As for threading scripts... well, it sounds like a phenomenally bad idea to me. I'll just leave it at that.
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 09, 2009, 10:00:23 PM
Generally you shouldn't be firing bullets more than 8px/f anyways.

Although honestly, a 1 frame lag is more of an issue for playing at 60fps. A TAS with this might be tougher to get used to initially, but after a short awkwardness it would be easier at frame-frame than deathbombing a frame too late at normal speed.

I say split rendering. Higher level scripts usually take tons of data just in rendering and effects, it's likely that splitting it between cores would improve performance more than script splicing and splitting the collision functions.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 10, 2009, 04:04:39 AM
Rendering generally shouldn't be an issue, but if splitting the collision detection into a different thread is feasible for you, go for that. I think it might be actually slower(check me on this), especially if you're using non-rectangular shapes for collision masks.

At the moment, all collision is done with circles.

Only time something different will need to be done is when lasers are added in.



A possibility is just to have a separate thread running that will check if anything on the screen is colliding(important things - player with enemy bullet, enemy with player bullet) and updating some kind of data structure with that information, so all the main thread has to do is go through and deal with them appropriately(using a mutex, waiting for the lock). I don't think you should put that in another thread because of desyncing problems and I only have two cores.

But then again, I'm not too experienced with threads. ><; Just thought I'd throw that out there.

The way you're suggesting collision be separated to its own thread is basically what I was saying above. ;)



I see what y

"... ou did there?" ???


 :V



Collision I'm worried about it being messed up if a bullet happens to be flying stupidly high speeds,it might worsen the desync problem. Timing is everything. Are there speed limits for bullets?  :V

Fast-moving bullets won't cause collision to break in-and-of-themselves.  Worst that happens is a bullet "hax" through the player because of how fast it is going.  This can happen in Danmakufu and even official Touhou in some places.



Mutlithreading scripts looks a bit nasty to me though; Depending on the person writing the script, bloated scripts might just out right crash the engine for instance, unless, you can really make the scripting idiot proof somehow...  :V

What I was referring to was not multithreading at the script level, but rather multithreading in the program itself to take advantage of multiple-core CPUs.  Of course, this would be made in such a way as to avoid any risk of problems.



I say split rendering. Higher level scripts usually take tons of data just in rendering and effects, it's likely that splitting it between cores would improve performance more than script splicing and splitting the collision functions.

That was my basic thought on the matter, at least.  I may go ahead and try splitting off collision detection into its own thread too, although that does get a bit more involved.

But that's something for further down the road, anyways.  Get it working, then get it working better. :D





A couple small updates to the code tonight.  First off, I found and fixed a stupid error in the collision code which made it end up only collision-checking against other objects of the same type.  Yeah, that was a stupid one. :-\

Other than that, I added a few new commands to the Execution Engine, including obj_create.  May not sound like much, but it's now enough for me to do this:

(http://www.stephenware.com/albums/touhou/sample_2_2009_10_09.png)
(if you can't see the image - click here (http://www.stephenware.com/gallery/view_photo.php?set_albumName=touhou&id=sample_2_2009_10_09))

Yes, folks.  You are now looking at the very first danmaku in the program, coded from scratch using mdBase.  Here's the script, for anyone who's interested:

Code: [Select]
Musuu
Script[mdBase]


/ Effect object - Starter
/ Should be spawned once when the game starts
/ Creates all necessary objects, then deletes itself
Object_Type Effect Starter

Script initialize

obj_create !id, "ThePlayer", 213, 400
obj_create !id, "TheEnemy", 213, 100
obj_get_id !id
obj_destroy !id



/ Player ThePlayer
/ object for the player
Object_Type Player ThePlayer

Script initialize
obj_get_id !tmp
obj_set_angle !tmp, 0
obj_set_speed !tmp, 0
obj_set_image !tmp, "test1.png"
obj_img_rotate !tmp, false
obj_set_pmove !tmp, 5.4, 3.2
obj_set_size !tmp, 2.2, 5
obj_set_layer !tmp, 20

/ Right now, we need to have the collision scripts here,
/ since we can't get the object ID of the other object
/ collided with yet.  This will, of course, change later.
Script collide Boss
obj_get_id !tmp
obj_destroy !tmp

Script collide Enemy_Shot
obj_get_id !tmp
obj_destroy !tmp



/ Boss TheEnemy
/ boss object
Object_Type Boss TheEnemy

Script initialize
obj_get_id !tmp
obj_img_rotate !tmp, false
obj_set_size !tmp, 16, 20
obj_set_image !tmp, "reimu1.png"
obj_set_layer !tmp, 30
add @count, 60, 0

Script tick
sub @count, @count, 1
less !tmp, 0, @count
jmp !tmp, 12

add @count, @count, 20
div !inc, 1.5707963267948966192313216916398, 20
add !ang, 3.9269908169872415480783042290994, 0

/ loop to create a spread of shots
obj_create !id, "AShot", 213, 100
obj_set_angle !id, !ang
obj_set_speed !id, 2.5
sub !ang, !ang, !inc
less !res, 2.3, !ang
jmp !res, 6




/ Enemy_Shot AShot
/ basic shot type.  Won't be needed in the long run, since
/ a default type will be supplied by the program.
Object_Type Enemy_Shot AShot

Script initialize
obj_get_id !tmp
obj_set_image !tmp, "shot1.png"
obj_set_size !tmp, 5.5, 7.5
obj_set_layer !tmp, 40

Remember: the final scripting language will not look like this!

The script defines four object types:

The way it is set up right now, the game simply lets you move around the player object while the boss shoots out danmaku.  If you collide with a shot or the boss, your player object dissapears.  Simple, but it's certainly progress!



The numbers in the title bar, by the way, are as follows:



Still quite a ways to go, but I think it's shaping up nicely so far.
What do you guys think?
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 10, 2009, 04:07:53 AM
Looks awwwwwright

Oh, how does it determine drawing priority for bullets? The shot overlap looks really odd.
Title: Re: A replacement for Danmakufu?
Post by: Rinnosuke Morichika on October 10, 2009, 04:16:23 AM
This looks brilliant. The script syntax you made is strangely similar that of an MMOG programming language I code in frequently, so I feel like I already know how to script it.

Looking forward to its completion, I'll definitely be using it once its released.  ;D
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 10, 2009, 04:19:50 AM
Looks awwwwwright

Oh, how does it determine drawing priority for bullets? The shot overlap looks really odd.

Right now, the drawing order on the bullets isn't explicitly defined, since they all have the same drawing layer.  Later on, I should probably tweak the code so that it looks a bit better.



This looks brilliant. The script syntax you made is strangely similar that of an MMOG programming language I code in frequently, so I feel like I already know how to script it.

Looking forward to its completion, I'll definitely be using it once its released.  ;D

To be honest, while you can use mdBase to write scripts, like I did above, it's a real bitch to do so.  There's going to be a higher-level scripting language, with syntax somewhat similar to C or a variant thereof - that will probably be a much better choice for anything complex.






EDIT:

Wow, a whole day without a new post?  That's new ...

Bit of code work today:

I also started to look at implementing the separate thread for rendering.  I don't think I'm gonna go ahead and implement it soon, but I do think it'll be a good thing to throw in there eventually.
Title: Re: A replacement for Danmakufu?
Post by: Hat on October 12, 2009, 04:10:40 PM
Oh wow, I hope the final scripting language doesn't look like that... it hurts my brain to see. I'm sure it's more intuitive than I'm giving it credit for, but still... ouch. What will I do without my precious brackets?!
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 12, 2009, 06:05:47 PM
It's directly below the script block and you still don't read it? C'mon. Seriously.
Title: Re: A replacement for Danmakufu?
Post by: Hat on October 12, 2009, 06:29:01 PM
I meant to say 'nothing like that'. I read the part below the script box, Naut. I just phrased it badly. \=| Perhaps now you'll understand?

I can't wait to see the finished product... I think the most important part of this project won't be that Danmakufu will be reimagined, but that we'll also have the source code available, should we wish to make improvements to the program itself.
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 12, 2009, 06:46:04 PM
Have you ever programmed in C? Have you ever programmed in Danmakufu? It'll look like that. The end.

The colliding_with_id variable actually looks pretty useful.
Title: Re: A replacement for Danmakufu?
Post by: Hat on October 12, 2009, 06:49:54 PM
I know, I know, I saw the examples.

Frankly, while an easier collision detection mechanism would be better, I'd much prefer a freer graphical system, especially regarding the sidebar. Danmakufu requires too many workarounds to get at that.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 16, 2009, 01:19:37 AM
Anything new to report, NC?
Title: Re: A replacement for Danmakufu?
Post by: Ragnikarth on October 16, 2009, 02:33:56 AM
I know, I know, I saw the examples.

Frankly, while an easier collision detection mechanism would be better, I'd much prefer a freer graphical system, especially regarding the sidebar. Danmakufu requires too many workarounds to get at that.

A custom GUI system would be awesome, with changeable fonts and all because the font Danmakufu uses isn't SUPERFLASHY.
Title: Re: A replacement for Danmakufu?
Post by: G_gglypuff on October 16, 2009, 03:08:38 AM
Nice to know this is more affordable. Danmakufu lags even without any script being run here.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 16, 2009, 03:21:07 AM
You are aware that you're not actually supposed to plug a monitor in to the back of a microwave, aren't you?
Title: Re: A replacement for Danmakufu?
Post by: Suikama on October 16, 2009, 03:24:27 AM
You are aware that you're not actually supposed to plug a monitor in to the back of a microwave, aren't you?
But it's cool

:cool:
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 16, 2009, 04:23:29 AM
EDIT: Page (9) YEAH! :toot:

Frankly, while an easier collision detection mechanism would be better, I'd much prefer a freer graphical system, especially regarding the sidebar. Danmakufu requires too many workarounds to get at that.

As far as the collision model is concerned - is there anything in particular you think should be improved?  The way it is here, you basically define "When we collide with <type of object>, run <script>".  I think it's a rather simple design, myself.

Hmm ... now I'm wondering - do you people think it'd be useful to have a function to check for collisions between two objects, given their IDs?


As far as the graphics - I plan to add in support to draw graphics wherever the hell you want, even outside the game frame, in addition to the current model which draws an image for each object in the game.  I do intend to keep the current model as well, though, since it simplifies a lot of the simpler graphics tasks.



Anything new to report, NC?

It is the weekend for me*, so yes.  See below. :3



A custom GUI system would be awesome, with changeable fonts and all because the font Danmakufu uses isn't SUPERFLASHY.

I need to get font support in there first to begin with. :V

I still need to evaluate options, although the worst-case is that we'll have to create an image file with the graphics for each text character.  I think I can get around that, though, if I hook into SDL's font structures to build up text images.



Nice to know this is more affordable. Danmakufu lags even without any script being run here.

Well, at the moment we can't say too much about the performance, since nobody has hit it with crazy-intense scripts yet.  But, suffice to say, I do plan to make things more efficient, overall, than Danmakufu.

What's your system spec, by the way?  It might be good to get a baseline of what people are using, at least in a general sense.



You are aware that you're not actually supposed to plug a monitor in to the back of a microwave, aren't you?


But it's cool

:cool:

... ... ... what the hell did I miss here? o_O





Today's progress report:




I really need to get into ANTLR more and figure out how exactly to get it to do what I want it to, so that we can get a real scripting language in here already.  That would really kick ass.

... unless someone else wants to take up that end of things?  Any volunteers?  If we could at least get a grammar in place for the script language (mdScript?), it'd make things easier.  DoublyTriply so if it outputs mdBase, since that would trivialize the part of then getting it into the engine itself.



* 9/80 work week kicks ass.
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on October 16, 2009, 01:44:14 PM
Nuclear Cheese,

Can you put on the same hat as Remilia, same outfit and some wings?











So I can love you just like the ojousama for your work.



Aside the ass licking:
Forgive me for following this thread at a bad pace ( I should be ashamed for being one of the danmakufu scripters who pushes their work till the limits ).

I will try to catch up from page 6 (where I was last left) and see if I got anything useful to add. ( Imo you should also have some kind of blog/webpage where you can write progress easier and faster ) but I guess a forum is more personal and nice.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 16, 2009, 03:59:58 PM
Hmm. I don't mean to push you back a few steps, but wouldn't it be better to have a general "item" class and determine what each type of item does by scripts? Or am I taking the name too literally?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 17, 2009, 01:27:27 AM
Nuclear Cheese,

Can you put on the same hat as Remilia, same outfit and some wings ...

HELEPOLIS, STOP.

... er, sorry, I'm not really into that sort of thing. :-\



Aside the ass licking:
Forgive me for following this thread at a bad pace ( I should be ashamed for being one of the danmakufu scripters who pushes their work till the limits ).

I will try to catch up from page 6 (where I was last left) and see if I got anything useful to add. ( Imo you should also have some kind of blog/webpage where you can write progress easier and faster ) but I guess a forum is more personal and nice.

I could put up a dev blog of sorts on my website, although I don't know if there's really any need at this point ... this place works well enough, and we can discuss things without jumping back and forth between two places.

One things get to the "omg release etc" phase, I'm sure there'll be a site for this project anyways - especially since (due to popular demand, at least) the source code is most likely gonna be put out there for people to mess with at some point.



Hmm. I don't mean to push you back a few steps, but wouldn't it be better to have a general "item" class and determine what each type of item does by scripts? Or am I taking the name too literally?

Not sure if I explained this one yet or not, but each object type is given a base type, including Enemy, Player, etc., which decided what default scripts to give it.

In the case of the Item base type, it'll give the object a tick script which will handle movement; right now the initialize and collide Player scripts are point-item specific (init sets point item image, collision gives points).







EDIT of Magic, Progress and Awesome

Okay, so remember this?
I really need to get into ANTLR more and figure out how exactly to get it to do what I want it to, so that we can get a real scripting language in here already.  That would really kick ass.

... unless someone else wants to take up that end of things?  Any volunteers?  If we could at least get a grammar in place for the script language (mdScript?), it'd make things easier.  DoublyTriply so if it outputs mdBase, since that would trivialize the part of then getting it into the engine itself.

... forget about that whole "unless someone else wants to do it part".  I just figured the thing out.  Behold the magic, as I transform a sample script:

Code: [Select]
global stuff;

enemy "A thing"
{
   define my_stuff;

   initialize
   {
      my_stuff = 5 + Get_ID();
      Set_Stuff(my_stuff, 1);
   }

   tick
   {
      my_stuff = my_stuff * 2 + 1;
      New_Stuff(my_stuff, 2+1/3, More_Stuff(my_stuff + 1));
   }

   collide "Super Shot"
   {
      Obj_Destroy(Get_Collided_ID());
   }

   collide_2 "A thing"
   {
      my_stuff = my_stuff + 1;
   }
}

enemy_shot "Super Shot"
{
   define lol;

   tick
   {
      Obj_Set_Angle(Get_My_ID(), Get_Angle_To_Player());
   }
}

... into its mdBase equivalent:

Code: [Select]
Object_Type enemy A thing
Script initialize
callret "Get_ID", !0
add !1, 5, !0
set @my_stuff, !1
call "Set_Stuff", @my_stuff, 1
Script tick
mul !0, @my_stuff, 2
add !1, !0, 1
set @my_stuff, !1
div !0, 1, 3
add !1, 2, !0
add !2, @my_stuff, 1
callret "More_Stuff", !3, !2
call "New_Stuff", @my_stuff, !1, !3
Script collide Super Shot
callret "Get_Collided_ID", !0
call "Obj_Destroy", !0
Script collide_2 A thing
add !0, @my_stuff, 1
set @my_stuff, !0
Object_Type enemy_shot Super Shot
Script tick
callret "Get_My_ID", !0
callret "Get_Angle_To_Player", !1
call "Obj_Set_Angle", !0, !1

(note - the global, stuff, isn't referenced anywhere in the mdBase because it was never referenced outside the initial declaration)

It's still a bit basic, with a bunch more progress to go through:

But, still, it's a pretty awesome piece of progress, I think.


Also, some quick updates to the program itself:
Code: [Select]
Loop_Start:
/ some loop stuff
/ .
/ .
/ .
/ If !continue_looping is true, we'll jump back to the label above.
jmp !continue_looping, "Loop_Start"

When reading in the script, the program translates the label into the correct script index to jump to.

These labels will be necessary when higher structures, like if and while are implemented in mdScript, because otherwise it would be a disaster and a half trying to get it to calculate the correct indices to jump to for each of them.




;D
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 17, 2009, 05:30:56 AM
So very exciting!
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 17, 2009, 05:58:56 AM
Holy yes.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 17, 2009, 06:06:02 AM
Yes, while-loop is good. Also for-loop. And for-each would be splendid, too, I spose ...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 18, 2009, 02:58:27 AM
Yes, while-loop is good. Also for-loop. And for-each would be splendid, too, I spose ...

for loop is basically a different syntax for a while loop of sorts, so it's kinda low-priority in my mind right now.  As for foreach ... I'm assuming you want an easy way to iterate over an array?  That could be useful, once I actually put support for arrays in.



New progress tonight:



Also, I rewrote the current test script in mdScript (save for file headers), and successfully used the parser to translate it into working mdBase.

Code: (mdScript) [Select]
// Starter object
// Temporary object used to spawn the boss and the player
// Will be unnecessary once the program can figure out what to spawn on its own.
Effect "Starter"
{
   initialize
   {
      Create_Object("ThePlayer", 213, 400);
      Create_Object("TheEnemy", 213, 100);
      my_id = Get_My_ID();
      Destroy_Object(my_id);
   }
}

// ThePlayer
// Player object
Player "ThePlayer"
{
   initialize
   {
      Set_Image("test1.png", false, 20);
      Set_Player_Movement(5.4, 3.2);
      Set_Size (3.2, 16);
   }
}

// TheEnemy
// Enemy boss that makes some fucking danmaku.
Boss "TheEnemy"
{
   define count;

   initialize
   {
      Set_Image("reimu1.png", false, 30);
      Set_Size(24, 30);
      count = 60;
   }

   tick
   {
      count = count - 1;

      // When count reaches zero, we fire a spread of bullets, and spawn a point item.
      if (count <= 0)
      {
         // Adjust the "20" here to change the frequency of firing spreads.
         count = count + 20;

         // Adjust the "20" here to change the density of spreads.
         increment = 1.5707963267948966192313216916398 / 20;
         angle = 3.9269908169872415480783042290994;
         while (angle > 2.3)
         {
            Fire_Shot_01(213, 100, angle, 2.5, "shot1.png");
            angle = angle - increment;
         };
         Create_Object("Point_Item", 213, 100);
      };
   }
}

Code: (mdBase) [Select]
Musuu
Script[mdBase]

Object_Type Effect Starter
Script initialize
call "Create_Object", "ThePlayer", 213, 400
call "Create_Object", "TheEnemy", 213, 100
callret "Get_My_ID", !0
set !my_id, !0
call "Destroy_Object", !my_id
Object_Type Player ThePlayer
Script initialize
call "Set_Image", "test1.png", false, 20
call "Set_Player_Movement", 5.4, 3.2
call "Set_Size", 3.2, 16
Object_Type Boss TheEnemy
Script initialize
call "Set_Image", "reimu1.png", false, 30
call "Set_Size", 24, 30
set @count, 60
Script tick
sub !0, @count, 1
set @count, !0
less !0, @count, 0
equ !1, @count, 0
add !2, !0, !1
not !3, !2
jmp !3, "Label0"
add !0, @count, 20
set @count, !0
div !0, 1.5707963267948966192313216916398, 20
set !increment, !0
set !angle, 3.9269908169872415480783042290994
Label1:
less !0, 2.3, !angle
not !1, !0
jmp !1, "Label2"
call "Fire_Shot_01", 213, 100, !angle, 2.5, "shot1.png"
sub !0, !angle, !increment
set !angle, !0
jmp true, "Label1"
Label2:
call "Create_Object", "Point_Item", 213, 100
Label0:

(I copied the mdBase into a file and added the headers manually, but other than that it all works)

What do you guys think of the mdScript syntax?  Any suggestions so far?

(EDIT: just realized that I could skip the local var my_id in Starter.initialize entirely ... could instead just say Destroy_Object(Get_My_ID()); :V )



Also, memo to self:
Add to the list of functions a count of how many args they take, and fail a call or callret if the wrong number of args are given.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 18, 2009, 04:50:22 PM
I'm assuming you want an easy way to iterate over an array?  That could be useful, once I actually put support for arrays in.
Just so!

Also, I have a bad feeling about trying to make focus hardcoded, since not all games would necessarily use Focus. (Or they might do it differently -- just look at StB. And in Suguri, instead of "focus", it has dashing, which makes you invincible to bullets (but not collisions or missiles).) Not saying you shouldn't do something like that (we've already had this discussion with Power), but just throwing out comments. Can you tell I'm prejudiced in favor of making it more flexible as opposed to true-to-Touhou?
Title: Re: A replacement for Danmakufu?
Post by: Cabble on October 18, 2009, 05:23:33 PM
I have something I would LOVE for you to add!

The ability to convert a pile of scripts into a .exe for everyone to play regardless of having danmakufu.

Oh and those floaty things around the boss are annoying IMO
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on October 18, 2009, 05:38:19 PM
I have something I would LOVE for you to add!

The ability to convert a pile of scripts into a .exe for everyone to play regardless of having danmakufu.

Oh and those floaty things around the boss are annoying IMO
Yes.
And it may even help stop ripping, avoiding the "HELEPOLIS, STOP"


I'll be honest and say that if I were to make my own original characters, I don't want people to steal them without permission or until I make them open-source.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 18, 2009, 10:01:17 PM
Oh and those floaty things around the boss are annoying IMO
Maybe give enemies an "effects surrounding sprite" part of their script, and the default-scripts for the boss would have an "effects surrounding boss" which you could turn off, maybe ...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 19, 2009, 02:34:13 AM
Just so!

Also, I have a bad feeling about trying to make focus hardcoded, since not all games would necessarily use Focus. (Or they might do it differently -- just look at StB. And in Suguri, instead of "focus", it has dashing, which makes you invincible to bullets (but not collisions or missiles).) Not saying you shouldn't do something like that (we've already had this discussion with Power), but just throwing out comments. Can you tell I'm prejudiced in favor of making it more flexible as opposed to true-to-Touhou?

Perhaps a function for the game script that will disallow holding the focus key from slowing the player down?

AllowFocusedMovement(false);



I have something I would LOVE for you to add!

The ability to convert a pile of scripts into a .exe for everyone to play regardless of having danmakufu.

While converting things into a standalone .exe would be a real bitch (and that's if it's "easy"), there is a plan to have a "compiled" script format, whereby you could just distribute the one big file with everything in it, along side the Musuu no Danmaku executable (possibly with other files that it needs and can't be packed easily).

No guarentees on it being unbreakable or anything, but it would at least curb stealing/modifying/etc (I'm looking at you, Suikama >:() and provide a single, condensed file to package everything in.





Just a quick bit of progress tonight, I made the main program able to read in mdScript files.  You can take the mdScript code I posted previously, add the header lines to it, and throw it at Musuu no Danmaku directly, rather than what I had to do yesterday (run a program to convert to mdBase, manually save it and add headers, then run it).  Wheee.



Also, a heads up, I might get as much as usual done next week, due to being busy getting hype at ACT XII (http://www.dustloop.com/forums/showthread.php?t=7247).
Title: Re: A replacement for Danmakufu?
Post by: Fujiwara no Mokou on October 19, 2009, 02:35:41 AM
  • Set_Image - parameters: image, rotate, layer
    rotate is a boolean that determines if the image will rotate with the object's angle or not.
    layer is the graphic layer to draw the image on.

object
rotate

Is that object rotation I'm hearing?  How splendid!  Now I won't have to make and delete objects in a loop while auto-setting a new Z parameter for a rotation angle.  I also had to manually set the new X and Y positions for movement, and a direction angle, and speed, just to get the object to move from one point to another at an angle I want while rotating.  Because SetSpeed doesn't work if the object will be deleted a frame after it's fired.

Keep doing whatever you're doing. I love the sound of this.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 19, 2009, 02:40:53 AM
Is that object rotation I'm hearing?  How splendid!  Now I won't have to make and delete objects in a loop while auto-setting a new Z parameter for a rotation angle.  I also had to manually set the new X and Y positions for movement, and a direction angle, and speed, just to get the object to move from one point to another at an angle I want while rotating.  Because SetSpeed doesn't work if the object will be deleted a frame after it's fired.

Keep doing whatever you're doing. I love the sound of this.

Umm ... right now, this rotation is the same as the object's facing angle, which is the direction it will move when its speed is greater than zero.  Just like in Danmakufu.

I'm pretty sure there's a way to make rotating shots in Danmakufu, though, and it'll get added into Musuu no Danmaku as well at some point.



... and please tell me you aren't really deleting and recreating objects every frame.  That's rediculous! :vbang:
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 19, 2009, 02:58:24 AM
Quote
Now I won't have to make and delete objects in a loop

Holy inefficient code, Batman!

We'll have to take a look at this later.
Title: Re: A replacement for Danmakufu?
Post by: Fujiwara no Mokou on October 19, 2009, 02:59:32 AM
Umm ... right now, this rotation is the same as the object's facing angle, which is the direction it will move when its speed is greater than zero.  Just like in Danmakufu.

I'm pretty sure there's a way to make rotating shots in Danmakufu, though, and it'll get added into Musuu no Danmaku as well at some point.



... and please tell me you aren't really deleting and recreating objects every frame.  That's rediculous! :vbang:







Indeed I have.  Like so.  I'm sure you can guess what I use it for.
Code: [Select]
#TouhouDanmakufu[Stage]
 #Title[Object loop]
 #Text[rotation&movement]
 #Player[FREE]
 #ScriptVersion[2]
 
 script_stage_main{
   
    let imagefile = GetCurrentScriptDirectory ~ "leaf.png";
    let resurrectionframe=0;
    @Initialize{

       LoadGraphic(imagefile);
       blowingup;

    }
 
    @MainLoop{

     yield;


    }
 
    @DrawLoop{
    }
 
    @BackGround{
    }
 
    @Finalize{

       // clear the loaded image file from memory

    }


         task blowingup{  yield;

                  fireshot(80,60);
                      }



          task fireshot(shots,time){   yield;

        let total=0; let angleused=0; let angle=0;

         loop(time){       
                                total+=(shots/time);
                                while(total>=1){firstobjecteffect(angleused);  angleused+=500/70; total--;}
                                yield;
                       }
                                 

       }














 task firstobjecteffect(angle){
                            ///first and second row, rotation, movement, speed, and angle
                            ///third for, scaling
                            ///fourth row, colors and alpha value
                            let rotatez=0;    let X=rand(-1,1);  let Y=rand(-1,1); let AddX=0;   let AddY=0;
                            let speed=rand(1,5);  let Z=rand(0,360);  let rotate=0;   let rotation=rand(-2,2);
                            let addtoscale=0;  let AddWhatToScale=-0.04; let Spawnscale=rand(2.5,5);
                            let red=rand(100,255);  let blue=rand(100,255);  let green=rand(100,255); let alpha=255;



         loop{      let totalscale=Spawnscale+addtoscale; if(totalscale<0){totalscale=0;}

          let objid = Obj_Create(OBJ_EFFECT);
          Obj_SetPosition(objid,GetCenterX+X,GetCenterY+Y);


          ObjEffect_SetRenderState(objid,ADD);
          ObjEffect_SetTexture(objid, imagefile);

          ObjEffect_SetAngle(objid,0,0,Z+rotate);
          ObjEffect_SetScale(objid,totalscale,totalscale);

 
          ObjEffect_SetPrimitiveType(objid, PRIMITIVE_TRIANGLESTRIP);
 
          ObjEffect_CreateVertex(objid, 4);
 

          ObjEffect_SetVertexXY(objid, 0, -17, 17);
          ObjEffect_SetVertexUV(objid, 0, 0, 34);
          ObjEffect_SetVertexColor(objid, 0, alpha, red, blue, green);



          ObjEffect_SetVertexXY(objid, 1, -17, -17);
          ObjEffect_SetVertexUV(objid, 1, 0, 0);     
          ObjEffect_SetVertexColor(objid, 1, alpha, red, blue, green);


          ObjEffect_SetVertexXY(objid, 2, 17, 17);
          ObjEffect_SetVertexUV(objid, 2, 32, 34);
          ObjEffect_SetVertexColor(objid, 2, alpha, red, blue, green);


          ObjEffect_SetVertexXY(objid, 3, 17, -17);
          ObjEffect_SetVertexUV(objid, 3, 32, 0);
          ObjEffect_SetVertexColor(objid, 3, alpha, red, blue, green);


          yield; Obj_Delete(objid);
          X+=cos(angle)*speed;  Y+=sin(angle)*speed;

          rotate+=rotation;

          addtoscale+=AddWhatToScale;
          if(totalscale<Spawnscale/3.5){alpha+=-17;}
                       }
             




     }


 }
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 19, 2009, 03:34:49 PM
Take out all underscores in all functions, they are completely unnecessary. In addition to that, I'm still pretty sure it's completely unnecessary to add opening and closing bracks to functions that have no parameters (GetCenterX();, Main();, etc. versus GetCenterX;, Main;, etc.).

How do you plan to handle micro-threads? Helepolis is teaching all the new recruits to program everything in tasks, so something similar would be preferred, if possible. Especially given the reason people have to learn using Helepolis' videos instead of the tutorials. I know you hate tasks, but I feel this will at least get rid of a lot of bitching in the near future.
Title: Re: A replacement for Danmakufu?
Post by: Cabble on October 19, 2009, 09:49:57 PM
While converting things into a standalone .exe would be a real bitch (and that's if it's "easy"), there is a plan to have a "compiled" script format, whereby you could just distribute the one big file with everything in it, along side the Musuu no Danmaku executable (possibly with other files that it needs and can't be packed easily).
Well at least where you don't have to go through a menu screen like danmakufu, doesn't need AppLocale, and actually looks like a touhou game when you run it(Low priority IMO)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 20, 2009, 01:32:10 AM
Take out all underscores in all functions, they are completely unnecessary. In addition to that, I'm still pretty sure it's completely unnecessary to add opening and closing bracks to functions that have no parameters (GetCenterX();, Main();, etc. versus GetCenterX;, Main;, etc.).

The underscores are the way I usually type identifiers; if people would prefer underscoreless function names that can be arranged with ease.

As far as pulling the parentheses (brackets are {} ;) ) off of argumentless function calls, I don't like that, honestly - it makes the syntax ambiguous.  There's nothing stopping you from defining a variable named GetSpeed (well, aside from good programming practice, but you don't design something like this assuming the user will never do something stupid ...), so if you write code such as:

Code: [Select]
Enemy_Shot "Lol I'm a Bullet"
{
   define GetSpeed;

   initialize
   {
      GetSpeed = 5.0;
      SetSpeed(3.0);
   }

   tick
   {
      temp = GetSpeed; // now what?
   }
}

By requiring the parentheses, we guarantee a lack of syntactic ambiguity in the script - that is, the parser can immediately be sure how something should be interpreted.

Besides, C/C++/C#/Java(if I remember correctly) all have it like this. :V



How do you plan to handle micro-threads? Helepolis is teaching all the new recruits to program everything in tasks, so something similar would be preferred, if possible. Especially given the reason people have to learn using Helepolis' videos instead of the tutorials. I know you hate tasks, but I feel this will at least get rid of a lot of bitching in the near future.

Well, correct me if I'm wrong, but isn't the usual way of using tasks is to create a separate task to control, say, an object bullet as it moves about the screen?  This would instead be done using code for such a bullet directly, by defining a custom bullet object type.  The structure would, by my understanding, be quite similar:

Code: [Select]
// ... other stuff ...

Enemy_Shot "LolShot"
{
   define count;

   initialize
   {
      count = 0;

      // Call the original shot init script, since
      // it's overridden here.
      EnemyShotInit();
   }

   tick
   {
      count = count + 1;
      if (count = 60)
      {
         count = count - 120;
         SetAngle(GetAngleToPlayer());
      }
   }
}

(Note - I may add support to, by default, call the default initialize/etc scripts automatically even when they're overridden like this, with an option to turn this off when desired.)

Correct me if I'm mistaken, but isn't this much like the typical use of tasks to handle object bullets?


Also - aren't tasks a more advanced topic to begin with?  Shouldn't the new recruits be taught simple stuff first, like "how I shot bullet?" and such ???



Well at least where you don't have to go through a menu screen like danmakufu, doesn't need AppLocale, and actually looks like a touhou game when you run it(Low priority IMO)

The program can be designed to skip the menu screen in such cases.  Applocale shouldn't even be an issue, since .NET is completely Unicode by default.  Actually looking like a Touhou game will be up to people with actual art skills (read: not me :/).
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 20, 2009, 02:09:50 AM
The underscores are the way I usually type identifiers; if people would prefer underscoreless function names that can be arranged with ease.

The underscore is completely unnecessary to type considering you're capitolizing the next word in the function anyway. Just seems like a needless use of two hands when typing, as well as affecting overall typing speed. I hate typing underscores, it's the slowest thing on the keyboard. Oh God.


As far as pulling the parentheses (brackets are {} ;) ) off of argumentless function calls, I don't like that, honestly - it makes the syntax ambiguous.  There's nothing stopping you from defining a variable named GetSpeed (well, aside from good programming practice, but you don't design something like this assuming the user will never do something stupid ...), so if you write code such as:

Code: [Select]
...
By requiring the parentheses, we guarantee a lack of syntactic ambiguity in the script - that is, the parser can immediately be sure how something should be interpreted.

Most programming languages do not allow you to name variables the same as built-in functions.


Besides, C/C++/C#/Java(if I remember correctly) all have it like this. :V

Danmakufu doesn't require you to do that, isn't it C-based (dipping in to territory I do not understand)?


Well, correct me if I'm wrong, but isn't the usual way of using tasks is to create a separate task to control, say, an object bullet as it moves about the screen?
...
Correct me if I'm mistaken, but isn't this much like the typical use of tasks to handle object bullets?

That is a way to use tasks, yes. It is nowhere near the only way and is now not even the usual way to use tasks. I was referring to the ambigiuty between jumping between tasks using yield; (you once said something like "not knowing which task is run before another," or something similar, forgive me if I incorrectly paraphrase considering we actually know which tasks are prioritized before others), as well as them running alongside the @MainLoop as their own thread. Are you going to follow the same idea or what?


Also - aren't tasks a more advanced topic to begin with?  Shouldn't the new recruits be taught simple stuff first, like "how I shot bullet?" and such ???

Take a gander. (http://www.youtube.com/watch?v=OYpwkQWGFbk)
Title: Re: A replacement for Danmakufu?
Post by: Hat on October 20, 2009, 04:54:32 PM
Since it apparently wasn't addressed, object-object collision is absolutely ESSENTIAL. Some of the most creative danmaku of ever used object-object collision. Also, I don't mean to nag, but don't forget about common data files.

I'll stop bugging you now. =\ You're the strongest, NC.
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 20, 2009, 05:10:05 PM
Since it apparently wasn't addressed, object-object collision is absolutely ESSENTIAL. Some of the most creative danmaku of ever used object-object collision.
Not addressed? It's already been implemented.
Title: Re: A replacement for Danmakufu?
Post by: Ragnikarth on October 20, 2009, 10:12:50 PM
Random question time!

Can individual scripts be made into standalone .exe files? Saves the trouble of "you must download this, then this, then put this in lib, then uncomment line 9, then..."
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 21, 2009, 02:28:59 AM
The underscore is completely unnecessary to type considering you're capitolizing the next word in the function anyway. Just seems like a needless use of two hands when typing, as well as affecting overall typing speed. I hate typing underscores, it's the slowest thing on the keyboard. Oh God.

Well, I can take them out - it's just a naming issue.  Does anyone else here have an opinion?
I find it a bit easier to read the names when they're spaced out more, but I do agree that it's a bit slower to type the underscores. I dunno about that being the slowest thing to type on the keyboard, though.  Depends on the keyboard, too.



Most programming languages do not allow you to name variables the same as built-in functions.

Right now, the main problem is scope.  Unlike actual programming languages, the scripts we're making here can be broken up quite a bit, and the program may not have a full list of all functions that are defined by the time it hits a possible reference - the function could be defined later in the script file, or even in another file entirely (this is once we get custom-definable functions in place) - hell, it might be written in a different scripting language even!  The way it works with the parser currently is that it needs to make a decision when it hits the reference, either determining it's a variable or a function call, so we need a way to unambiguously determine this without necessarily knowing all of the available functions at that point.

In my opinion, the parenthesis is the simplest solution.  It clearly marks that it's a function call (consistently with calls that do have arguments), while variable references will be obvious from their lack of parenthesis.

An alternative would be to, instead, require all local variables to be explicitly declared.  This would remove the ambiguity in a different way, although I feel it's not as clean of a solution.  On average, you probably wouldn't save any typing by omitting the parentheses, since you'd have to type out variable declarations and you'd still need parentheses on functions calls with args.  Also, I think it makes the script a bit less clear to read, since you'll need to determine whether something is a variable reference or a arg-less function call, rather than the parentheses making it instantly clear.
Finally, while I might be able to work around this, if you forget to declare a local var under this system, it might start throwing "unknown function" errors at you, which might make it more confusing to debug.

To summarize, we can't take out the parens without adding in explicit local var declaration because a global function could be defined in another file, and the parser wouldn't know if you want a local var or a function call.

I'm not trying to force my way here, but I think we need to consider the pros and cons before switching things like this.


What do people think about this?  Thoughts and suggestions?



Danmakufu doesn't require you to do that, isn't it C-based (dipping in to territory I do not understand)?

C-based programming languages all require parentheses on all function calls.  Omitting the parens gets you a reference to the function itself (useful for some tricky things).

Danmakufu isn't really "C-based", it's more of a "C-look-alike".  It imitates many of the syntax features of C, but there are several discrepancies.

mdScript isn't much different in that regard, really.



That is a way to use tasks, yes. It is nowhere near the only way and is now not even the usual way to use tasks. I was referring to the ambigiuty between jumping between tasks using yield; (you once said something like "not knowing which task is run before another," or something similar, forgive me if I incorrectly paraphrase considering we actually know which tasks are prioritized before others), as well as them running alongside the @MainLoop as their own thread. Are you going to follow the same idea or what?

By the nature of multitasking, you generally aren't ever given a specific order that tasks/threads are run.  This can lead to ambiguity of order, but this usually isn't a problem as long as each thread keeps to itself.

My main gripe with Danmakufu's task setup is that it is, in my opinion, horribly designed.  Using tasks changes the semantics of @MainLoop from a "run this once per frame" script to a "loop here, and don't forget to yield" script, for instance.

I have been considering adding a command similar to yield into Musuu no Danmaku.  The main difference here being that it would only affect the script using it - other scripts will continue on as normal, while the yielding script will resume execution next frame.
The biggest obstacle there is saving off the call stack (which right now is done intrinsically by using recursive calls to Script.Run()*) and other necessary information so that it can be resumed later, while still allowing other scripts as well as other instances of the same script to run without interference.

* Script class, in Script.cs - contains necessary information for a script.  Gets instantiated for each script of each object type, as well as for each function defined.  Run runs the script defined in the object.



Take a gander. (http://www.youtube.com/watch?v=OYpwkQWGFbk)

Internet is being a pain right now, so I'll have to look at this another time.



Since it apparently wasn't addressed, object-object collision is absolutely ESSENTIAL. Some of the most creative danmaku of ever used object-object collision. Also, I don't mean to nag, but don't forget about common data files.

I'll stop bugging you now. =\ You're the strongest, NC.

Not addressed? It's already been implemented.

This.  ;D

For any object type, you can define a collision script for a collision with an object of any other object type or base type, and can also define a script for collisions with any object that isn't covered by the more specific collision scripts.

If there is demand, I can also add in a function to check if a particular pair of objects is colliding at the moment.


Important performance note for people planning ahead: collision-checking lots of things takes lots of processor.  The "collide with anything" script should be wielded very carefully, and definitely shouldn't be used for types that you'll be spawning several objects of at once.  It will be much better to narrow down what your object will need to check for collision with, and specify that.
For instance, an Enemy_Shot will collide with the base type Player (to determine when the player is hit or when a shot is grazed), and, for fancy patterns, may also collide with another specific type of enemy shot.  But chances are you'll have no need to collision check an Enemy_Shot with a Boss or Item (you can, but in most cases you'd have no need to).



Random question time!

Can individual scripts be made into standalone .exe files? Saves the trouble of "you must download this, then this, then put this in lib, then uncomment line 9, then..."

This has been covered before, but the current plan is that, while there will not be a "build into .exe file" option, there will be the option to "compile" a set of scripts into a single, condensed file to simplify distribution.  Also, I plan on having a way of setting up the program to automatically run a script, to allow people to distribute a finished game/scriptpack/brofist extravaganza with the program together in a directory, and have it auto-run the packed script when launched.  Details on this are TBD at the moment.



Oh, and I had this crazy idea that would be for way, way, waaaay~ down the line -
An integrated content distribution system that would allow people to upload and download scripts from the program itself to a server.  Add in things like rantings, sorting by author/genre/etc, automated checking for updates, etc., and it could become some crazy-awesome setup.

Of course, this would be at the bottom of the feature list. :V
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 21, 2009, 02:37:56 AM
Oh, and I had this crazy idea that would be for way, way, waaaay~ down the line -
An integrated content distribution system that would allow people to upload and download scripts from the program itself to a server.  Add in things like rantings, sorting by author/genre/etc, automated checking for updates, etc., and it could become some crazy-awesome setup.

Of course, this would be at the bottom of the feature list. :V
Please don't. It really isn't needed and will be nothing but trouble.

Y'know, I think the EXE thing is starting to get popular enough that you should at least consider it. If nothing else, just an "EXE which has its own specified icon and automatically loads a given compiled script/set of scripts, possibly with no other functionality for selecting other scripts" ...
Title: Re: A replacement for Danmakufu?
Post by: anonl on October 21, 2009, 06:09:58 AM
Well, I can take them [underscores] out - it's just a naming issue.  Does anyone else here have an opinion?[/size]
Underscore naming has been out of fashion since the mid-nineties.

Most programming languages do not allow you to name variables the same as built-in functions.
Actually, most languages -do- allow you to name variables the same as functions. The only exception I can think of right now is some functional languages.

By the nature of multitasking, you generally aren't ever given a specific order that tasks/threads are run.
Depends on your thread scheduler. It's certainly possible to activate each task once a frame in the same order.

The biggest obstacle there is saving off the call stack (which right now is done intrinsically by using recursive calls to Script.Run()*) and other necessary information so that it can be resumed later, while still allowing other scripts as well as other instances of the same script to run without interference
Implement tasks scheduling as iterating over a list of generators (http://en.wikipedia.org/wiki/Generator_%28computer_science%29) and implementing the script yield using C# yield?
Title: Re: A replacement for Danmakufu?
Post by: Hat on October 21, 2009, 04:24:10 PM
Not addressed? It's already been implemented.

This is why I tend not to post in this thread, lol. The water level is more than a couple inches above my head, so to speak. One last thing: will we ever see a song looping function or two? =\
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 22, 2009, 02:16:15 AM
Please don't. It really isn't needed and will be nothing but trouble.

I was just throwing the idea out there; no plans to do anything with it currently.
Not sure why you say it'd be "nothing but trouble", though - it's a fairly straightforward thing to implement, in my opinion.



Y'know, I think the EXE thing is starting to get popular enough that you should at least consider it.

Of course I'll consider it at some point.  I honestly don't know what it'll take, though.



If nothing else, just an "EXE which has its own specified icon and automatically loads a given compiled script/set of scripts, possibly with no other functionality for selecting other scripts" ...

This is basically what I was talking about before, save for possibly not being able to customize the icon.



Underscore naming has been out of fashion since the mid-nineties.

I disagree.  It's the standard where I work.

But whatever you people want can be arranged for this.  Well, within reason; I refuse to name all of the built in functions a, b, etc. ;)



Depends on your thread scheduler. It's certainly possible to activate each task once a frame in the same order.

Point.  Since we'd have our own scheduling here, the issue of tasks having ambiguously interleaved processing is mitigated.  So scratch that concern.



Implement tasks scheduling as iterating over a list of generators (http://en.wikipedia.org/wiki/Generator_%28computer_science%29) and implementing the script yield using C# yield?

Oh wow.  I've never seen this before.

I can see how you could use it to solve the issue of saving off the stack and such, although I'd need a bit of planning to get it implemented in a way that doesn't look and run like total crap.

This still leaves the issue of tracking what objects have scripts running and such.  Entirely feasible to deal with, but again requires some planning to implement well.


To be honest, I think that, while thinking about it and starting to plan things out is a good idea, I think implementation of threads/tasks should be delayed until we have the main (single-thread) execution engine proven to work solidly, since such an addition will surely complicate things.


As far as syntax is concerned, I think a simple yield statement would work.  Or, perhaps, we could even extend it to take an (optional?) argument, indicating the number of frames to delay.
Thinking about it, having separate tasks that can delay, while retaining the "once-per-frame" semantics of the tick and such script, would simplify the above complications a bit.  In other words, it would be easier, in my opinion, to disallow yield in the main scripts, instead requiring a separate task to be launched.

As far as syntax, how's this for a quick design sample?

Code: [Select]
Musuu
Script[mdScript]

Enemy "ImaBoss"
{
   // A task to control movement
   task movement_task
   {
      while (true)
      {
         yield 31;
         MoveToSomeOtherRandomPosition();
      }
   }

   // A task to control shots
   task shot_task
   {
      while (true)
      {
         yield 23;
         FireSomeFuckingDanmaku();
      }
   }

   initialize
   {
      // Run the two tasks
      movement_task();
      shot_task();

      // Other initialization stuff
      SetLife(100);
      SetScore(9);
   }
}

(of course, this could just as easily be implemented without tasks, but I wanted to give a simple example for syntax.)

This is much like Danmakufu's task syntax, right?  (serious question - I honestly don't remember at the moment.)

As you can probably figure out, both tasks each run their own stuff independently, resulting in the boss firing every 23 frames and moving every 31 frames.  The function-call-like syntax in the initialize script initiates an instance of each task (Perhaps it may be beneficial to have some different marker here, to clarify that we're launching a task instead of calling a function?).

Running multiple instances of a single task shouldn't be a problem, although we may want to define some sort of upper limit so that we don't get some joker breaking things with something stupid like:

task lol
{
   while (true)
   {
      lol();
      yield;
   }
}


Another related question would be scope of tasks - should we have tasks both definable per object type and globally, or would just one of the two suffice?



One last thing: will we ever see a song looping function or two? =\

Once I implement music, there will be some sort of music looping.  I'm not sure if I can get true music looping to work well - that is, defining a loop start and end point within a single music file, something like this:

PlayMusic("omgbestsongevar.ogg", 40.2, 92); // Loop from 40.2 sec to 92 sec

Failing that, I have a backup plan which will require a small bit of work on the scripter's side - split the song into two files: one for the intro (before the loop) and one for the loop.  What will then happen is the intro file will be played once, and when that finishes the loop file will start playing and loop repeatedly.  Syntax would be something like this:

PlayMusic("omgbestsongevar_intro.ogg", "omgbestsongevar_loop.ogg");

Of course, a simple version will also be available, which just loops a single audio file in its entirety.  Something like ...

PlayMusicSimple("omgbestsongevar.ogg");


Also, FYI - pulled straight from the SDL.NET wiki (http://cs-sdl.sourceforge.net/index.php/Audio), audio formats that are supported:

No MP3 support, unfortunately.  That's a proprietary format, so the code to read it needs to be licensed (wouldn't be on our end, but rather the library that actually reads and decodes the file).
Fortunately, though, it is pretty easy to convert from MP3 to Ogg Vorbis - I'd recommend using Audacity (http://audacity.sourceforge.net/).
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 22, 2009, 03:48:31 AM
I think you'd do well to deal with infinite-loops by having it somehow check for them in a check-for-problems stage that it does before actually executing the script.
Title: Re: A replacement for Danmakufu?
Post by: Ragnikarth on October 22, 2009, 10:02:39 PM
Failing that, I have a backup plan which will require a small bit of work on the scripter's side - split the song into two files: one for the intro (before the loop) and one for the loop.  What will then happen is the intro file will be played once, and when that finishes the loop file will start playing and loop repeatedly.  Syntax would be something like this:

PlayMusic("omgbestsongevar_intro.ogg", "omgbestsongevar_loop.ogg");

THAT WORKS.

Just need to confirm something, if we use:

PlayMusic("song",A,B);

will it start from 0:00, then play to B, then go back to A?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 23, 2009, 12:12:52 AM
I think you'd do well to deal with infinite-loops by having it somehow check for them in a check-for-problems stage that it does before actually executing the script.

... are you asking me to solve the Halting Problem (http://en.wikipedia.org/wiki/Halting_problem)? o_O

Pre-execution analysis of a piece of code to determine whether or not it will infinite-loop is a rediculously hard problem, even when simplified down from the (as far as I know) literally unsolvable general case.


As far as "infinite protection", right now I have a limit to the number of commands that can be executed in a single script execution (currently one million, but might be pushed higher), so any single script can't run infinitely.
But this wouldn't catch infinitely-spawning tasks like I mentioned above.  However, I really can't think of anything practical that a single object would need, say, a thousand different tasks simultaneously running to accomplish.

The idea here is to keep the program from locking up permanently (like Danmakufu does) by saying "Hey, this script is going way beyond what anything that would be reasonable.  Something is very likely wrong."



THAT WORKS.

Just need to confirm something, if we use:

PlayMusic("song",A,B);

will it start from 0:00, then play to B, then go back to A?

If I can get that approach to work, then yes, music will start at 0, run to B, then start looping from A to B.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 23, 2009, 01:12:49 AM
While on the subject of lol fun musics:

PlayMusic(music.wav, loop point A, loop point B, time taken to fade in [if 0 then no fade in will occur]);

FadeMusic(music.wav, number of frames to take to fade out music);

As you can see, if there is someway to control the volume of music over time then I think a fade in and out option should be implimented. This is particularly useful when transitioning between songs -- instead of the song ending abruptly and the new one starting immediately, you can have one fade out and the other fade in. This would be even better if you could play more than one song at a time. I seperated the functions because you may need to fade out depending on user inputs. Is something like this possible?
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 23, 2009, 01:40:46 AM
i want a music function that will make echo effects and reverse the clip and have it normalize the decibel peaks and add change the instruments in the song
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on October 23, 2009, 02:03:08 AM
No support for MP3....

HERE'S THE KNIFE CHEESE. PLUNGE IT INTO MY HEART.

Over-Drama aside, I'm loving your updates. xD I've missed quite a bit, so it's lovely catching up on it all and seeing how quickly it continues to progress.

That EXE option is very appealing, so I'll toss my opinion in on the consideration side - if you can manage it, it'd be awesome.

I have no real preference one way or another with how you choose to implement the scripting (underscores or nor, brackets, whatever and whatnot). As long as it's functional and I can work it, I don't care what it looks like.

xD Of course, I'm not being overly picky for the primary reason that CHEESE IS DOING US A GRAND FAVOR BY BUILDING THIS PROGRAM SO WE WILL ACCEPT WHAT HE GIVES US AND WE WILL LIKE IT.

Not an attempt to kiss up, I'm serious. =/ Seems like some people are being far too picky considering you don't HAVE to do this for us at all.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 23, 2009, 02:07:17 AM
i want a music function that will make echo effects and reverse the clip and have it normalize the decibel peaks and add change the instruments in the song

Cause adjusting volume is totally on tier with that right
Title: Re: A replacement for Danmakufu?
Post by: Suikama on October 23, 2009, 02:13:40 AM
Cause adjusting volume is totally on tier with that right
You could just, you know, use audacity :V
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 23, 2009, 02:30:45 AM
You could just, you know, use audacity :V
That was my point
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 23, 2009, 02:31:11 AM
THANKS BROS DIDNT THINK OF THAT

The idea was so that you could fade in a second song when you make the transition from stage to boss, which will not always happen at the same time due to fps lagging and any points where you need to rely on input from the player. Adjusting volume in a song is pretty hurr, I just wanted to know if we could make the song transitions a little smoother by adjusting it in any given script.
Title: Re: A replacement for Danmakufu?
Post by: Gc on October 23, 2009, 01:25:07 PM
How about a way to set parents ? you know ? movement relative to another bullet ? EASILY ?

But what am I saying... nothing can be easy in danmaku. except some ⑨ stuff.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 23, 2009, 11:34:48 PM
While on the subject of lol fun musics:

PlayMusic(music.wav, loop point A, loop point B, time taken to fade in [if 0 then no fade in will occur]);

FadeMusic(music.wav, number of frames to take to fade out music);

As you can see, if there is someway to control the volume of music over time then I think a fade in and out option should be implimented. This is particularly useful when transitioning between songs -- instead of the song ending abruptly and the new one starting immediately, you can have one fade out and the other fade in. This would be even better if you could play more than one song at a time. I seperated the functions because you may need to fade out depending on user inputs. Is something like this possible?

The idea was so that you could fade in a second song when you make the transition from stage to boss, which will not always happen at the same time due to fps lagging and any points where you need to rely on input from the player. Adjusting volume in a song is pretty hurr, I just wanted to know if we could make the song transitions a little smoother by adjusting it in any given script.

Basic fadeout/fadein I can do, pretty much 100% certain of it.

Cross-fading from one song to another might not be as simple, unfortunately.  I think SDL's music functionality explicitly stops one music when you start another.  I might be able to just use the sound effect channels for it instead, but I think that'd be a bit of a kludge.



i want a music function that will make echo effects and reverse the clip and have it normalize the decibel peaks and add change the instruments in the song

...
...
...
... no.



No support for MP3....

HERE'S THE KNIFE CHEESE. PLUNGE IT INTO MY HEART.

Well, if you insist ...


Seriously, though, MP3 is a proprietary format, which means the SDL devs would need to fork out a licensing fee to have code in there to use it.  Lame, but that's how shit rolls.  Ogg Vorbis works just as well, and it's not hard to convert between the two, though, so not all is lost.



Over-Drama aside, I'm loving your updates. xD I've missed quite a bit, so it's lovely catching up on it all and seeing how quickly it continues to progress.

That EXE option is very appealing, so I'll toss my opinion in on the consideration side - if you can manage it, it'd be awesome.

I have no real preference one way or another with how you choose to implement the scripting (underscores or nor, brackets, whatever and whatnot). As long as it's functional and I can work it, I don't care what it looks like.

xD Of course, I'm not being overly picky for the primary reason that CHEESE IS DOING US A GRAND FAVOR BY BUILDING THIS PROGRAM SO WE WILL ACCEPT WHAT HE GIVES US AND WE WILL LIKE IT.

Not an attempt to kiss up, I'm serious. =/ Seems like some people are being far too picky considering you don't HAVE to do this for us at all.

Glad to hear you like what I've shown so far.  It still has quite a way to go, but I've been trying to keep updates steadily going*.

And, as long as it doesn't get out of hand, I don't really mind people being a little picky.  After all, one of the main things we're aiming for is to make this easier to use than Danmakufu, and I think the input of those who've used Danmakufu a bunch would go a long way towards that goal.



How about a way to set parents ? you know ? movement relative to another bullet ? EASILY ?

But what am I saying... nothing can be easy in danmaku. except some ⑨ stuff.

Ooh, good idea.  Actually, this wouldn't be that hard to do in the code - basically, we'd just need to determine how much the parent object has moved, and move the child objects as well.  It could also adjust child object angles and/or rotate child objects around the parent, based on the parent object's angle.

With the code in place, the script would be really simple.  I'd say just put in a couple easy commands to determine it:

Adopt(id) - makes the object refereneced by the given ID number a child of the current object.
Disown(id) - makes the object referenced by the given ID no longer a child of the current object.

One question here is - if two different objects try to adopt the same child object, what happens?  Either the first one wins, and we disallow reassignments until the child object is disowned or orphaned (parent object is despawned), or the second one wins, and we allow objects to steal other objects' children.

Another possible problem is circular references - If A adopts B, B adopts C, and C then adopts A, we have a problem, since we'll get in an infinite loop saying "A moved, update B!  B moved, update C!  C moved, update A! etc ...".  My recommendation here would be to, when something tries to adopt another object, check for a circular reference, and disallow it if it would cause such a problem.

Finally, if a child object is orphaned (parent object is depawned), do we just reset it to parentless, or do we set it to the original parent's parent, if any?



* Exception - Like I mentioned previously, I have a tournament tomorrow, so this weekend will probably be light on updates.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 24, 2009, 12:10:03 AM
Basic fadeout/fadein I can do, pretty much 100% certain of it.

This is very important, glad to hear it.


Cross-fading from one song to another might not be as simple, unfortunately.  I think SDL's music functionality explicitly stops one music when you start another.  I might be able to just use the sound effect channels for it instead, but I think that'd be a bit of a kludge.

This is not so worrisome. As long as I can fade out songs whenever I feel like it (for example, if user input changes when a song is likely to end), then I'm not worried about crossfading. I can just fade out one song then immediately fade in another, which is fine too.


...
...
...
... no.

He was just making fun of my request because he didn't actually think about how it could be applied. Such faith nowadays, it's hurtful :(


Seriously, though, MP3 is a proprietary format, which means the SDL devs would need to fork out a licensing fee to have code in there to use it. Lame, but that's how shit rolls.

o u


One question here is - if two different objects try to adopt the same child object, what happens?  Either the first one wins, and we disallow reassignments until the child object is disowned or orphaned (parent object is despawned), or the second one wins, and we allow objects to steal other objects' children.

First one wins, so says my coin flip.


My recommendation here would be to, when something tries to adopt another object, check for a circular reference, and disallow it if it would cause such a problem.

Yes.


Finally, if a child object is orphaned (parent object is depawned), do we just reset it to parentless, or do we set it to the original parent's parent, if any?

Parentless.


* Exception - Like I mentioned previously, I have a tournament tomorrow, so this weekend will probably be light on updates.

Take all the time you need.
Title: Re: A replacement for Danmakufu?
Post by: Cabble on October 24, 2009, 07:28:28 PM
Two questions

1. How far are you into creating this, if you are creating it?

2.

PoFV AND PoDD TYPE STAGES

(At least easier to make.)
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on October 24, 2009, 07:31:20 PM
How would PODD stages even work?
How would one be able to code all the random fairies and the enemy AI?
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 24, 2009, 07:38:55 PM
Quote
One question here is - if two different objects try to adopt the same child object, what happens?  Either the first one wins, and we disallow reassignments until the child object is disowned or orphaned (parent object is despawned), or the second one wins, and we allow objects to steal other objects' children.

Quote
First one wins, so says my coin flip.

No, I'd much prefer the latter as it would allow more freedom in how objects are controlled. If we want to make sure we're not grabbing children that have parents, there can be a function that checks that.
Title: Re: A replacement for Danmakufu?
Post by: Cabble on October 24, 2009, 07:42:55 PM
How would PODD stages even work?
How would one be able to code all the random fairies and the enemy AI?

Possibly the AI is prewritten, however you can change it also?


Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 24, 2009, 07:46:34 PM
PoDDanmakufu should be a seperate project.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 25, 2009, 12:22:35 AM
No, I'd much prefer the latter as it would allow more freedom in how objects are controlled. If we want to make sure we're not grabbing children that have parents, there can be a function that checks that.

Sir Stuff hath spoken, and thus it shall be.
Title: Re: A replacement for Danmakufu?
Post by: Suikama on October 25, 2009, 12:24:33 AM
If we want to make sure we're not grabbing children that have parents, there can be a function that checks that.
STRANGER DANGER!
STRANGER DANGER!
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on October 25, 2009, 04:57:23 AM
PoDDanmakufu should be a seperate project.
I agree with this post. Having it in the same program could complicate things.

That said, a PoDDMugen-type of game could be very fun if the community can keep it balanced.
Then again, I would kill to play as the Gay Tuna Primeus and shoot Peter Griffon danmaku
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 25, 2009, 06:52:08 AM
He was just making fun of my request because he didn't actually think about how it could be applied. Such faith nowadays, it's hurtful :(

I knew he wasn't serious; that's exactly why I gave such a short, blunt reply. :P



o u

Wow.  I didn't even think of that when I made the post.



Two questions

1. How far are you into creating this, if you are creating it?

Well, here's a quick summary off the top of my head.  Should be pretty accurate, but I might make a mistake:



2.

PoFV AND PoDD TYPE STAGES

(At least easier to make.)

We discussed this earlier in the thread, and the conclusion we came to was that this would be better off as its own, separate program.  It could end up being made as an offshoot of the Musuu no Danmaku code, though.




EDIT: Just a quick bit of progress so I don't feel like a completely lazy jackass:


The base testing script is now three files:

Code: (script2.txt) [Select]
Musuu
Script[mdScript]

include("ThePlayer.txt");
include("TheEnemy.txt");


Code: (ThePlayer.txt) [Select]
Musuu
Script[mdScript]

// ThePlayer
// Player object
Player "ThePlayer"
{
   initialize
   {
      Set_Image("test1.png", false, 20);
      Set_Player_Movement(5.4, 3.2);
      Set_Size (3.2, 16);
   }
}


Code: (TheEnemy.txt) [Select]
Musuu
Script[mdScript]

// TheEnemy
// Enemy boss that makes some fucking danmaku.
Boss "TheEnemy"
{
   define count;

   initialize
   {
      Set_Image("reimu1.png", false, 30);
      Set_Size(24, 30);
      count = 60;
   }

   tick
   {
      count = count - 1;

      // When count reaches zero, we fire a spread of bullets, and spawn a point item.
      if (count <= 0)
      {
         // Adjust the "20" here to change the frequency of firing spreads.
         count = count + 20;

         // Adjust the "20" here to change the density of spreads.
         increment = 1.5707963267948966192313216916398 / 20;
         angle = 3.9269908169872415480783042290994;
         while (angle > 2.3)
         {
            Fire_Shot_01(213, 100, angle, 2.5, "shot1.png");
            angle = angle - increment;
         };
         Create_Object("Point_Item", 213, 100);
      };
   }
}

You could run the program without any args, and (by the way it's hard-coded for now) it will default to reading script2.txt, which in turn will signal the program to read the two other files.

You could also just have the program read the two files directly with a command line like this:
"Musuu no Danmaku.exe" ThePlayer.txt TheEnemy.txt


Of course, this command line stuff won't be necessary in the long run, as you'll have a menu to pick script files.



Another question to ponder on - how much "completeness" do you people want in here before I start releasing test builds?  I mean, do you guys want to start playing around with it while it's still in the "Well, it works, I think" phase, or do you want to wait until it gets more into the "Shiny, complete program" phase?
Advantage of the former would be that we could hopefully get bugs and such ironed out faster, but keep in mind it would require you guys to put up with a really incomplete program (and the possibility of script incompatibility with the real release version).
Choice is yours; I could probably have a functional download of it next weekend if you guys want (no promises, though.  Who the hell knows what could come up).
Similar question with the code, although I'd prefer to have the code to myself as far as actually programming things is concerned until the program reaches more of the "Shiny, complete program" phase.  Maybe that's just me being a jerk, though.

At this point, the program is still pretty limited in functionality, but it should be pretty stable.  Things on my to-do list* at the moment:


* this isn't everything that needs to be done - this is just the "near future" of things.  Let me know if you think other things are important and should be there.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 26, 2009, 05:59:06 PM
I think releasing it sooner would be better. That way you can catch any "OH GOD WHAT"s in the current stuff while there isn't much else, for one thing.
Title: Re: A replacement for Danmakufu?
Post by: MCXD on October 26, 2009, 06:06:01 PM
I'd say release it sooner, but once you add some more of that 'basic functionality' that you mentioned in your most recent to-do list. Soon enough that we can catch bugs, but not so soon that we can only make about 3 things with the program to test bugs with!
Title: Re: A replacement for Danmakufu?
Post by: Ragnikarth on October 26, 2009, 10:03:19 PM
Release it to a small team of testers who are willing to do really weird things to check for bugs.

I may or may not be the first to make a full game out of this. (right now it's "Should I use danmakufu or wait for this")

Also, are you going to release a tutorial, or at least a help file defining functions?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 27, 2009, 02:31:43 AM
Looks like sooner for a testing version it is.  Hopefully I can get something together this coming weekend, so we can start seeing how much needs to be unbroken. :V



Also, are you going to release a tutorial, or at least a help file defining functions?

Documentation will, of course, be necessary at some point.  I should, at least, post up a basic list of what you can do (functions available, syntax, etc) with the testing release.

The Danmakufu wiki might end up being a good place for actual documentation ... perhaps we could start thinking about using that?


Also, I forgot in my last list - trig functions, and functions to get info on the player.  I'll edit it into the list there for consolidation.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 27, 2009, 02:41:50 AM
The Danmakufu wiki might end up being a good place for actual documentation ... perhaps we could start thinking about using that?

Yes.

Also, I forgot in my last list - trig functions

Very, very, very, important. Don't worry about ancillary trig functions, just sin and cos is needed for now (it's really all you ever need, so yeah).
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 27, 2009, 03:33:52 AM
Don't worry about ancillary trig functions, just sin and cos is needed for now (it's really all you ever need, so yeah).

But what about arctangent? :-\
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 27, 2009, 03:38:19 AM
But what about arctangent? :-
Seems there's atan in Danmakufu...
Title: Re: A replacement for Danmakufu?
Post by: Zengar Zombolt on October 27, 2009, 03:41:39 AM
But what about arctangent? :-
Cos / Sin
Title: Re: A replacement for Danmakufu?
Post by: Drake on October 27, 2009, 03:47:18 AM
Every trig function comes from sin and cos somehow so yeah
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 27, 2009, 03:58:11 AM
Cos / Sin

Every trig function comes from sin and cos somehow so yeah

These men know their Trig
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 27, 2009, 04:43:19 AM
Needs atai() |3
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 27, 2009, 04:51:18 AM
Needs atai() |3
atai(9)
Title: Re: A replacement for Danmakufu?
Post by: Ragnikarth on October 27, 2009, 06:33:37 AM
That can be an easter egg :V
It'd...do something Cirno related.
Title: Re: A replacement for Danmakufu?
Post by: anonl on October 27, 2009, 10:51:21 AM
But what about arctangent? :-
Don't forget atan2
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on October 27, 2009, 03:34:53 PM
Needs atai() |3

Is it bad that I read that as "atoi()" the first time

FUCK YOU C++

Anyway, what about MOD/XM files, Cheese? They're pretty fucking awesome. You can save the trouble of defining loop points and doing it in the song itself. It's pretty much the shit.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 28, 2009, 01:46:25 AM
Cos / Sin

umm ... no.  That's tan.

arctan is the reverse - goes from the result of tan back to the source (which can be used to get the angle).

Have fun. (http://en.wikipedia.org/wiki/Inverse_trigonometric_functions)



Don't forget atan2

atan2 is a quite useful function (even if it is just a shortcut'd form of arctan), so of course it should be there.



FUCK YOU C++

Umm ... perhaps tone down the hostility towards one of the most prolific programming languages in existence? :V



Anyway, what about MOD/XM files, Cheese? They're pretty fucking awesome. You can save the trouble of defining loop points and doing it in the song itself. It's pretty much the shit.

Also, FYI - pulled straight from the SDL.NET wiki (http://cs-sdl.sourceforge.net/index.php/Audio), audio formats that are supported:
  • WAVE files (.wav)
  • VOC files (.voc, I believe)
  • MIDI files (.mid, .midi)
  • MikMod (.mod, .s3m, .it, .xm)
  • Ogg Vorbis (.ogg)

According to the list SDL.NET's documentation gives, MOD/XM files are supported.





Also, quick brainstorm while I was at work.  I thought it would be quite empowering to allow the scripters to override the default, built-in scripts if they so desire.

Take, for example, the idea of coding an Ikaruga-type game.  With this functionality in place, all you would need to do is override the default bullet collision functions (so that they check player/bullet color, etc), and then every bullet you fire (even ones of the default bullet type) will behave accordingly*!

What do you guys think?  It sounds useful to me.

* (except if you make a custom bullte type that declares its own collision functions with the player, and doesn't call back to the built-in ones)


PS - internet fucking sucks here.
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 28, 2009, 01:54:24 AM
umm ... no.  That's tan.

It's actually cotangent. Tangent is sin/cos. Arctan is it's reverse though, yes.

Still on the topic of trig, make it so we can use radians. Far more useful, even if confusing to some.

Also, quick brainstorm while I was at work.  I thought it would be quite empowering to allow the scripters to override the default, built-in scripts if they so desire.

Take, for example, the idea of coding an Ikaruga-type game.  With this functionality in place, all you would need to do is override the default bullet collision functions (so that they check player/bullet color, etc), and then every bullet you fire (even ones of the default bullet type) will behave accordingly*!

What do you guys think?  It sounds useful to me.

I was under the impression this was already possible, though it was likely my imagination. So uh, yes! That would be awesome.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on October 28, 2009, 01:59:38 AM
I have an uttermost important request:
Support for more keys
Seriously...  The only extra key we have in danmakufu is C.
Support for a few more keys to activate abilities and such would be nice.
Title: Re: A replacement for Danmakufu?
Post by: Suikama on October 28, 2009, 02:00:14 AM
It's actually cotangent. Tangent is sin/cos. Arctan is it's reverse though, yes.

Still on the topic of trig, make it so we can use radians. Far more useful, even if confusing to some.
Does this mean there will be pi? :p
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 28, 2009, 02:13:02 AM
It's actually cotangent. Tangent is sin/cos. Arctan is it's reverse though, yes.

Er, right.  Stupid me.



Still on the topic of trig, make it so we can use radians. Far more useful, even if confusing to some.

Right now the engine uses radians in its entirety, actually.  Was considering adding the option to switch it to degrees (probably as a per-object flag, so one object switching it doesn't ruin things on another object), but I don't see that as too important at the moment.



Does this mean there will be pi? :p

I could certainly define a constant for pi, so that you can just reference it easily.



I was under the impression this was already possible, though it was likely my imagination. So uh, yes! That would be awesome.

Right now, it is only possible if you create a new object type of base type Enemy_Shot, where you define the custom behavior.

This would allow the scripter to redefine the default behavior, such that it affects all Enemy_Shot object types automatically (again, unless it's re-overridden later).



I have an uttermost important request:
Support for more keys
Seriously...  The only extra key we have in danmakufu is C.
Support for a few more keys to activate abilities and such would be nice.

Would be really easy to add support for.  Just need to add more bits to the input enumeration and define some controls to trigger them.  Would probably take all of a minute to add to the code. :D

Main question is - how many buttons are we talking about?  When I was developing SphereTide gunner, there were a couple people who commented that four buttons (slow, shot, and two bomb-related buttons) was pushing on too much.  Now, that's certainly part opinion, but what I'm getting at is that it might be asking a bit much of the player to expect them to keep track of eight different buttons in addition to movement.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 28, 2009, 02:47:47 AM
Is it bad that I read that as "atoi()" the first time
A TOY. (a truck.)
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 28, 2009, 03:04:24 AM
Would be really easy to add support for.  Just need to add more bits to the input enumeration and define some controls to trigger them.  Would probably take all of a minute to add to the code. :D

Main question is - how many buttons are we talking about?  When I was developing SphereTide gunner, there were a couple people who commented that four buttons (slow, shot, and two bomb-related buttons) was pushing on too much.  Now, that's certainly part opinion, but what I'm getting at is that it might be asking a bit much of the player to expect them to keep track of eight different buttons in addition to movement.

All of them. We're not expecting people to remember every button. Let player script have all the buttons needing definition. Have types like SHOT and BOMB, let the user define them at the beginning like KeyState(Shift, SLOWMOVE); or KeyState(Z, SHOT);, this way if the player wants to map out a completely different control interface, it is possible. Perhaps you can default everything to Touhou style, but let the controls be easily overwritten.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 28, 2009, 03:39:19 AM
All of them. We're not expecting people to remember every button. Let player script have all the buttons needing definition. Have types like SHOT and BOMB, let the user define them at the beginning like KeyState(Shift, SLOWMOVE); or KeyState(Z, SHOT);, this way if the player wants to map out a completely different control interface, it is possible. Perhaps you can default everything to Touhou style, but let the controls be easily overwritten.

I think you're misinterpreting what was said.  Lishy, by my understanding, was asking for more buttons at once for player input (more than Danmakufu's up/down/left/right/shot/focus/bomb/"extra"); you seem to be talking about being able to reconfigure the controls (which, of course, will be allowed in Musuu no Danmaku once I implement it).
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on October 28, 2009, 04:34:51 AM
Here's a thought: Being able to use your freaking keyboard to type in the name for the high score and replay, instead of selecting letters with the arrow keys. And maybe have a key to toggle between arrow keys/keyboard mode too, for good measure.

Actually, while I'm at it, why not extend the number of characters you can use when typing in the name of a replay or high score entry beyond what it is in danmakufu and the official touhou games?
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on October 28, 2009, 08:24:50 AM
Quote from: Ragnikarth
I may or may not be the first to make a full game out of this. (right now it's "Should I use danmakufu or wait for this")

I'm almost certain multiple people are already planning this.

xD Hell, I JOINED this site solely for interest in making a game with this program.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on October 28, 2009, 07:30:17 PM
Still on the topic of trig, make it so we can use radians. Far more useful, even if confusing to some.
Right now the engine uses radians in its entirety, actually.

YESSSSSSSSSSSSSS!

Seriously, this is one thing I don't like in DMF. Accursed 360/6.28 factors when doing crazy angular velocity calculations like circular homing. This will make my life so much easier!

Yes, atan2 is mandatory. Even slightly advanced coding is hard without it.

On topic of mathematical stuff, you do have exponentiation and roots (at least the square one) in? Since the Pythagorean theorem does have it's uses...

And I WILL be making a game with this, at least according to my current plans. It's so far planned that I have a storyline and characters pretty much set in stone and I'm currently making BGMs (I suck at composing, don't expect much), sprites (I'm medicore at spriting, don't expect much) and the bulletsheet (seriously, seeing how medicore my sprites/BGMs are, the danmaku better up the game quality a lot...)

Here's a thought: Being able to use your freaking keyboard to type in the name for the high score and replay, instead of selecting letters with the arrow keys. And maybe have a key to toggle between arrow keys/keyboard mode too, for good measure.

Seriously, why hasn't anyone thought of this before. Such a huge timesaver. Definitely implement once the more important stuff is out of the way (does it even have a scoreboard yet).
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 28, 2009, 07:35:04 PM
On topic of mathematical stuff, you do have exponentiation and roots (at least the square one) in? Since the Pythagorean theorem does have it's uses...

Exponents are included in basic mathematical functions... Even though you can still mimic exponents with multiplication, so it's not like it matters.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 29, 2009, 01:32:26 AM
Here's a thought: Being able to use your freaking keyboard to type in the name for the high score and replay, instead of selecting letters with the arrow keys. And maybe have a key to toggle between arrow keys/keyboard mode too, for good measure.

That's a good idea.  It'll be a bit down the road before this sees implementation, but I do agree that it'd be easier than the current model.  We may want a fallback for Touhou/Danmakufu style entry, though, to facilitate players who are using a controller*.

* Before you say "just put the damn controller on the desk and type" - keep in mind some people have arcade-style controllers that already are sitting on their desk, taking up the whole space where the keyboard usually would be.



Actually, while I'm at it, why not extend the number of characters you can use when typing in the name of a replay or high score entry beyond what it is in danmakufu and the official touhou games?

This is certainly feasible.  Do we want to set a limit, or do we just let the player enter as much as they want (with the risk of it, say, going off the side of the screen)?



YESSSSSSSSSSSSSS!

Seriously, this is one thing I don't like in DMF. Accursed 360/6.28 factors when doing crazy angular velocity calculations like circular homing. This will make my life so much easier!

Got it.  Switch everything to degrees.  No problem. :V
(Of course, I'm joking)



On topic of mathematical stuff, you do have exponentiation and roots (at least the square one) in? Since the Pythagorean theorem does have it's uses...

Exponents are not in there yet, since I forgot to put them in when I was implementing the other math stuff.  Go me.  They will, of course, be implemented pretty soon.



(does it even have a scoreboard yet).

Right now it shows the score as a number in the program's title bar, assuming you give it the -dt command line option (which enables debug info in the title bar).  Actual scoreboard stuff will be added in at some, probably-sooner-than-later point.
Title: Re: A replacement for Danmakufu?
Post by: MCXD on October 29, 2009, 09:21:04 AM
As I am not a trigonometry major and probably younger than a lot of you, I haven't the foggiest idea what all this crazy arcsine junk is, and RADIANS... well lets not even go there.

Point is, I hope you give the option to use radians. Some of the less in-the-know people would much prefer to use degrees.
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 29, 2009, 09:28:12 AM
What the heck is a radian?
Title: Re: A replacement for Danmakufu?
Post by: MCXD on October 29, 2009, 09:30:27 AM
What the heck is a radian?

To the best of my knowledge, radians are basically degrees for people who are TOO COOL FOR SCHOOL.

By that I mean physicists and university professors.

Also: http://en.wikipedia.org/wiki/Radians
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on October 29, 2009, 09:45:56 AM
Fffff

So how would you make a shot circle with radians if a circle can't be broken into an even number of them? 360 can be neatly divided so many ways!
Title: Re: A replacement for Danmakufu?
Post by: MCXD on October 29, 2009, 09:58:17 AM
Coming from someone who knows nothing: 2pi rad is 360 degrees, so 2pi/10 rad or pi/5 rad is 36 degrees, for example.

Thus, in Danmakufu:

Code: [Select]
ascent(i in 0..num)
{
CreateShot01(GetX, GetY, 2, rad(2*pi/num)*i, RED01, 10);
}

If we assume rad(x) makes the program read x as radians, or something.

I bet I'm totally wrong, since I really don't see the advantage over using radians when you can just divide in 360 instead of 2pi. Maybe I'm missing the point because I know nothing about the subject? Also, it doesn't NEED to be broken into an 'even number of them'. You can still divide a ring into 31 bullets in Danmakufu, despite 31 not being a factor of 360.
Title: Re: A replacement for Danmakufu?
Post by: anonl on October 29, 2009, 01:11:44 PM
So how would you make a shot circle with radians if a circle can't be broken into an even number of them? 360 can be neatly divided so many ways!
Which is why some programs use [0,511] since that divides even better.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 29, 2009, 07:33:44 PM
Um, we will be able to use either radians or degrees based on preferance, right? I'm having difficulty wrapping my head around why we have radians, let alone how they'd be more useful than degrees.
Title: Re: A replacement for Danmakufu?
Post by: Hat on October 29, 2009, 08:26:40 PM
I think radians are good for lazy people if you like working with even divisions of 360 and don't want to do some quick mental math. i.e. "Hm, I don't know what 360/46 is, so I'll just make my angle increments equal to pi/23".

I'd like the option, but I like sticking with degrees. What would it default to, NC?
Title: Re: A replacement for Danmakufu?
Post by: CK Crash on October 29, 2009, 11:07:12 PM
Let it default to degrees, and have a simple function switch it to radians for the rest of the script. In the rare event that someone wants to use both degrees and radians for something, it would also be nice to have a conversion function, like "let InRadians = Radian(x);" and "let InDegrees = Degree(x);".
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 30, 2009, 02:22:11 AM
As I am not a trigonometry major and probably younger than a lot of you, I haven't the foggiest idea what all this crazy arcsine junk is, and RADIANS... well lets not even go there.

Point is, I hope you give the option to use radians. Some of the less in-the-know people would much prefer to use degrees.

Um, we will be able to use either radians or degrees based on preferance, right? I'm having difficulty wrapping my head around why we have radians, let alone how they'd be more useful than degrees.

I think radians are good for lazy people if you like working with even divisions of 360 and don't want to do some quick mental math. i.e. "Hm, I don't know what 360/46 is, so I'll just make my angle increments equal to pi/23".

I'd like the option, but I like sticking with degrees. What would it default to, NC?

I do think it would be good to have the option for using either for the trig functions/angle/etc.
As far as a default, it seems most people want degrees as the default, it seems that most people want degrees.  The plan is to have a command to switch it, which will be remembered for each object (so set it once in initialize and you're good to go).

Let it default to degrees, and have a simple function switch it to radians for the rest of the script. In the rare event that someone wants to use both degrees and radians for something, it would also be nice to have a conversion function, like "let InRadians = Radian(x);" and "let InDegrees = Degree(x);".

... something like that.  Not sure of the necessity of the conversion functions; it's a rather simple math:
radians = pi * degrees / 180;
degrees = 180 * radians / pi;

On a related thought - does anyone see any usefulness in having a function that returns whether radians or degrees is currently selected?


All of the internal math functions use radians normally, by the way.  The code will automatically convert the angles if you have degrees selected.



Fffff

So how would you make a shot circle with radians if a circle can't be broken into an even number of them? 360 can be neatly divided so many ways!

Hint - angles don't need to be integers ;)



Coming from someone who knows nothing: 2pi rad is 360 degrees, so 2pi/10 rad or pi/5 rad is 36 degrees, for example.

Thus, in Danmakufu:

Code: [Select]
ascent(i in 0..num)
{
CreateShot01(GetX, GetY, 2, rad(2*pi/num)*i, RED01, 10);
}

If we assume rad(x) makes the program read x as radians, or something.

I bet I'm totally wrong, since I really don't see the advantage over using radians when you can just divide in 360 instead of 2pi. Maybe I'm missing the point because I know nothing about the subject? Also, it doesn't NEED to be broken into an 'even number of them'. You can still divide a ring into 31 bullets in Danmakufu, despite 31 not being a factor of 360.

Your math looks good.

Radians vs degrees is a really academic argument at best.  Only real advantage either way is that, with radians, an arc of x radians on a unit circle has length of x.  That and radians involve pi.  Seriously, how can you go wrong with pi?



Family stuff eating my early weekend time, so no update tonight.  Did give a bit of thought to the details on the implementation of arrays in the execution engine, though.  Hopefully that counts for something. :)
Title: Re: A replacement for Danmakufu?
Post by: Zengar Zombolt on October 30, 2009, 02:41:05 AM
On a related thought - does anyone see any usefulness in having a function that returns whether radians or degrees is currently selected?
Nah, I don't think so, because it would be a bitch to work with both at the same time, and you pick one at the start like you said.
Title: Re: A replacement for Danmakufu?
Post by: Azure Lazuline on October 30, 2009, 03:11:29 AM
It's always better to have extra useless functions than to be missing one that could potentially be useful later on. I say to add it just for the one oddball case way down the road that might require it. (Also, a built-in function to take the highest or lowest of a set of two numbers would be great. It's extremely simple to code your own, but if it's that easy to make you might as well have it built-in.)
Title: Re: A replacement for Danmakufu?
Post by: Naut on October 30, 2009, 03:13:23 AM
It's always better to have extra useless functions than to be missing one that could potentially be useful later on. I say to add it just for the one oddball case way down the road that might require it.

This. Everything that you can set you should be able to get, as a rule. You never know.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 30, 2009, 04:56:29 AM
This. Everything that you can set you should be able to get, as a rule. You never know.
Seconded. And in this case it's just a boolean.

(Furthermore, if we want to be compatible with Everything Else, it should be easy for a script to get at everything someone else's script did ...)
Title: Re: A replacement for Danmakufu?
Post by: anonl on October 30, 2009, 09:05:41 AM
I do think it would be good to have the option for using either for the trig functions/angle/etc.
As far as a default, it seems most people want degrees as the default, it seems that most people want degrees.  The plan is to have a command to switch it, which will be remembered for each object (so set it once in initialize and you're good to go).
Having switches like that can become a bit confusing (think about Object.GetAngle!).

Maybe you can promote angle to a type:
Code: [Select]
angle_t a = degrees(270);
a += radians(PI);
print(a.degrees()); //prints 90 (not 450)
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on October 30, 2009, 04:44:15 PM
Hmm, good idea.

How would the values be stored, though? I have this vision of "dodgeThis.getDegrees()" where the "dodgeThis" angle was set as radians, and getting a result like 44.99999999875 or whatever instead of 45.
Title: Re: A replacement for Danmakufu?
Post by: anonl on October 30, 2009, 06:05:04 PM
How would the values be stored, though? I have this vision of "dodgeThis.getDegrees()" where the "dodgeThis" angle was set as radians, and getting a result like 44.99999999875 or whatever instead of 45.
A difference of 0.00000000125 shouldn't be noticeable.

It might not be exactly 45.00000000000, but you shouldn't compare floating point numbers for equality anyway (http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems).
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 30, 2009, 08:04:42 PM
(Furthermore, if we want to be compatible with Everything Else, it should be easy for a script to get at everything someone else's script did ...)

This will be a non-issue.  The degrees/radians selection will be stored for each individual object independantly, so there's no chance for one object's script to mess up the angle type selection of another object's script.



Maybe you can promote angle to a type:
Code: [Select]
angle_t a = degrees(270);
a += radians(PI);
print(a.degrees()); //prints 90 (not 450)

An interesting idea, but ultimately I think it's unnecessary, since angles are just numbers anyways (and I can easily enough add code to automatically clip it in the range of [0,2pi)/[0,360) anyways ...).  Does anyone see use in this that I'm missing?



As far as internal storage, I think it would be best to store angles internally as radians, and convert them to/from degrees when necessary.  This is because, like I mentioned in my last post, all of the internal trig functions and such use radians, and considering that there are some operations that rely on these functions every frame for every object, it would probably be significantly less efficient to convert from degrees every time.

And, before anyone asks, I don't think it would be a good idea to store the angle as both, since that's pretty much just asking for a code oversight somewhere that would lead to the two values becoming inconsistent.




EDIT: A quick update tonight.  Didn't anticipate my jaw hurting quite this much after some minor dental surgery (I'm an idiot.  What else is new?), so I'm, as they say, "taking it easy." :yukkuri:




For reference, here's the current list of functions available to mdScript scripts:


I'm noticing a bunch of functions defined here (pretty much all of them currently :V) are basically just wrappers for underlying mdBase commands, so I'm wondering if I should save some stack and redefine them to translate directly into said commands rather than using a function call ...
It's a minor implementation detail, but it could certainly shave a few cycles off of execution.



Anyways, I'm off to go teach some zombies that a hurting jaw is no reason for me to be incapable of blasting their heads off with a shotgun - that is, some Left 4 Dead. >:D

EDIT2: No, it's okay guys.  Just stay on the ladder while I get mauled.
Fucking bots. >__<
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on October 31, 2009, 10:27:42 PM
Hey guys, hope you're all having fun.

Did some work today.  Mainly adding in new functions:

Just some simple stuff, but this allows some cool things like shots aimed at the player.

I also updated the enemy in the main testing script:

Code: (TheEnemy.txt) [Select]
Musuu
Script[mdScript]

// TheEnemy
// Enemy boss that makes some fucking danmaku.
Boss "TheEnemy"
{
   define count;
   define move;

   initialize
   {
      SetImage("reimu1.png", false, 30);
      SetSize(24, 30);
      count = 60;
      move = 0.5;
      UseRadians(true);
   }

   tick
   {
      SetX(GetX() + move);

      if (GetX() > 350)
      {
         move = -0.5;
      }
      if (GetX() < 76)
      {
         move = 0.5;
      }

      count = count - 1;

      // When count reaches zero, we fire a spread of bullets, and spawn a point item.
      if (count <= 0)
      {
         // Adjust the "30" here to change the frequency of firing spreads.
         count = count + 30;

         bullets = 11;
         increment = 1.5707963267948966192313216916398 / (bullets - 1);

         angle = 3.1415926535897932384626;

         player_id = GetPlayerID();
         if (player_id > -1)
         {
            ydiff = ObjGetY(player_id) - GetY();
            xdiff = ObjGetX(player_id) - GetX();
            if (xdiff == 0 && ydiff == 0)
            {
               // Just in case ...
               ydiff = 1;
            }
            angle = arctan2(ydiff, xdiff);
         }

         angle = angle - (increment * ((bullets - 1) / 2));
         while (bullets > 0)
         {
            FireShot01(GetX(), GetY(), angle, 2.5, "shot1.png");
            angle = angle + increment;
            bullets = bullets - 1;
         };
         CreateObject("EvilShot", GetX(), GetY());
         CreateObject("PointItem", GetX(), GetY());
      };
   }
}

Enemy_Shot "EvilShot"
{
   define count;
   define next_count;

   initialize
   {
      SetSize(5.5, 7.5);
      SetAngle(180);
      SetSpeed(1.5);
      count = 60;
      next_count = 90;

      // Call the internal bullet init function to ensure standard stuff is setup
      enemy_shot_init();
      SetImage("shot2.png", true, 55);
   }

   tick
   {
      count = count - 1;
      if (count <= 0)
      {
         count = next_count;
         next_count = next_count + 30;

         player_id = GetPlayerID();
         if (player_id > -1)
         {
            ydiff = ObjGetY(player_id) - GetY();
            xdiff = ObjGetX(player_id) - GetX();
            if (ydiff == 0 && xdiff == 0)
            {
               ydiff = 1;
            }
            SetAngle(arctan2(ydiff, xdiff));
         }
      }
   }
}

Important to note (aside from some minor changes and fixes) is the addition of the custom shot type "EvilShot".  This shot will re-aim itself to face the player after 60 frames, then do so again after 90 frames, then 120 frames, etc ...

I also made the main spread of blue bullets aimed at the player.  This is now a lot harder to dodge than the earlier variants. :D



Now, one more thing to address ... *clears throat*

TESTING RELEASE 1 (http://www.stephenware.com/musuu_no_danmaku/Musuu_no_Danmaku_Test_Release_2009_Oct_31.zip)

It is still missing a bunch of stuff, but it's complete-enough to have people start throwing down some custom scripts and seeing how easily they can break it.


Important:

If you're running on a non-Windows platform, you'll need to use Mono (http://www.mono-project.com/Main_Page) to run the program.  Please let me know how that works out, by the way - I don't have any non-Windows machines to try it out on.

You need to install the SDL.NET runtime libraries.  Go here (http://cs-sdl.sourceforge.net/index.php/Main_Page), select the downloads link, and grab the most recent version for your platform.  There are necessary, since they include the SDL.NET function mapping that the program uses.

I included the Tao framework .dlls, but if that doesn't work find an installer here (http://www.taoframework.com/), and then let me know (so I can update the info).



Included in the testing archive:



As this is a testing release, please keep in mind that there is no gaurentee that the program won't randomly shit itself.  In fact, part of what this release is for is to find such situations, so that they can be remedied.
The program is currently written such that, if anything errors, it will simply close itself immediately.  This is the safest thing to do at the moment, in my opinion, so that things don't start getting ugly.


In the event of an error:

If the program is erroring, please do the following:




To run scripts other than the default one, and getting some extra info:

You can specify a set of script files to load instead of the default ("script2.txt") by adding the file names to the command line.

Also, you can add the "-dt" option to the command line to have the program write debugging information in the window's title bar - FPS, # of objects, graze counter, and score.


So, for instance, if you want to run "omgscript.txt" and show debugging info:
"Musuu no Danmaku.exe" omgscript.txt -dt

Note that the program will attempt to spawn one "Boss" and one "Player" object - if none of the specified scripts contain one, than one won't be spawned.  See the provided sample scriptfiles for an example.



This is a temporary way of loading scripts, until a menu is implemented (which requires me to implement fonts).



Controls:

Currently, the controls are fixed.  Control configuration will come later, once there's a menu setup.

Arrow keys - move
Shift - focused movement
Z - shot (currently unusable, since there's nothing triggered off of it)
X - bomb (currently unusable, since there's nothing triggered off of it)

Escape - quits the program immediately - once we get menu stuff going, this will instead bring up the pause menu.



PLEASE KEEP IN MIND - this is an incomplete version, that does not yet have many features to be implemented.  A bit of patience is appreciated, and any bugs that you find will help make this program a better one!  Have fun, people. ;)



(bump, motherfuckers.)
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on October 31, 2009, 11:41:04 PM
  • A sample script, along with images (yes, I know the "point item" image looks too much like another shot.  I'm not an artist. :V)

Anyways, it's pretty great already.
I don't really seem to fit with not being able to have the triangle respawn. You know what I'm saying?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 01, 2009, 01:47:51 AM
Anyways, it's pretty great already.

Good to hear.

The point item looks good.  Certainly better than my "I swear I'm not a shot guys!  Why don't you believe me?!" version. :V



I don't really seem to fit with not being able to have the triangle respawn. You know what I'm saying?

The disappearing thing is temporary, until we get proper "omg I dead" implemented for the player.



In the meantime, perhaps here's a trick you could try:

Spawn another object (probably an Effect object, so that everything leaves it alone) which checks if there is still a player object around and, if not, spawns a new one.
Quick think-though gives me the impression it's entirely possible with the current setup, although you'll have to spawn the extra object from either the player or enemy initialize scripts (and make sure it doesn't keep respawning).

Bonus points for making it look good ... somehow.  Need to get more of the graphics functions in place before we can expect to easily create awesome visual stuff.


... or, you could just modify the player script to remove the hitbox (set size1 to zero), but where's the fun in that?
Title: Re: A replacement for Danmakufu?
Post by: Cabble on November 01, 2009, 03:04:43 AM
For me it just says it has encountered a problem and needs to close :/
Edit: Nevermind I saw I didn't unpack a file.

Works awesome.
Is there a function similair to SetShotDataA?
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on November 01, 2009, 03:21:20 AM
For me it just says it has encountered a problem and needs to close :/
Edit: Nevermind I saw I didn't unpack a file.

Works awesome.
Is there a function similair to SetShotDataA?
Not yet, remember that Nuclear Cheese needs more time to put that in.
Title: Re: A replacement for Danmakufu?
Post by: Cabble on November 01, 2009, 03:40:05 AM
Okay, so main things I see big need of in next update in order of importance:
Respawning (VERY high priority)
Shots (High Priority)
Bombs (low priority)
Live Stock (low priority)
Bomb Stock (low priority)
Point system (low priority)
Graze System (low priority)

Then some things that I would like to see in the long run:
Icon :V
Built-In Graphics
An ability to switch on/off the menu that danmakufu has (It's good for playing others' script, but it would be annoying to go through that process just to get to your script and having to quit and reenter just to see your player edits and this is one of the most annoying things about danmakufu for me :V)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 01, 2009, 04:47:06 AM
Works awesome.
Is there a function similair to SetShotDataA?

Not yet, remember that Nuclear Cheese needs more time to put that in.

True that there is no function like it implemented yet, but you can do something similar by creating a custom bullet type.



Okay, so main things I see big need of in next update in order of importance:
Respawning (VERY high priority)
Shots (High Priority)
Bombs (low priority)
Live Stock (low priority)
Bomb Stock (low priority)
Point system (low priority)
Graze System (low priority)

Then some things that I would like to see in the long run:
Icon :V
Built-In Graphics
An ability to switch on/off the menu that danmakufu has (It's good for playing others' script, but it would be annoying to go through that process just to get to your script and having to quit and reenter just to see your player edits and this is one of the most annoying things about danmakufu for me :V)

FYI - graze & score are there.  Add " -dt" to your shortcut or command line when running the program and you can see the graze & score counters (in the title bar).

Also, lives (and bombs if I remember correctly at the moment) do have counters in the code, but they don't have anything tied to them yet.



For the record - typing while holding an icepack to your face is a bitch. :-\
... just in case you were wondering.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 01, 2009, 08:38:51 AM
It's apparently erroring for me, even though I ran both the SDL.NET runtime and the Tao framework runtime installers. Platform is Windows Vista Home Premium. The scripts being run are the default ones. Here's the log file (my computer is in Finnish, but I have translated the Finnish parts in English. Whenever there's a <.....> surrounding some text, that indicates a translated part):

Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 <march> 01 10:18:02.704 - Initializing engine ...
2009 <march> 01 10:18:02.782 - Error during initialization: <The type initializer of> SdlDotNet.Graphics.Video <caused an exception>.
Stack trace:
   <at> SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   <at> Musuu_no_Danmaku.Graphics.Initialize()
   <at> Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

If there's a known fix for this, or if it's a result of some idiotic mistake I made, please let me know. And if not, then have some merry bugfixing...

EDIT:

I'm now on my second computer (I have to alternate between two computers on a weekly basis for various reasons) and tried running it. This computer has Windows XP Home Edition, and I've installed the SDL.NET runtime (version 6.1.0, same as on the other computer) on it (haven't installed the Tao Framework, but since it didn't help on the other comp and it seemingly hasn't been necessary for others, I don't think it'd help). The program gets further this time, but still manages to error and stop working. (It actually initializes the window this time! Oh well, like we needed any more proof that XP > Vista.)

Default scripts, log (full english this time, no need to translate):

Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 marras 01 17:46:08.703 - Initializing engine ...
2009 marras 01 17:46:09.546 - Loading script objects ...
2009 marras 01 17:46:09.562 - Creating new Game object ...
2009 marras 01 17:46:09.593 - Error during initialization: Input string was not in a correct format.
Stack trace:
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info)
   at Musuu_no_Danmaku.mdBaseReader.Parse_Instruction_Line(String line)
   at Musuu_no_Danmaku.Game..ctor()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

Either I'm doing something horribly wrong or the program is really in need of some bugfixing.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 01, 2009, 08:14:19 PM
It's apparently erroring for me, even though I ran both the SDL.NET runtime and the Tao framework runtime installers. Platform is Windows Vista Home Premium. The scripts being run are the default ones. Here's the log file (my computer is in Finnish, but I have translated the Finnish parts in English. Whenever there's a <.....> surrounding some text, that indicates a translated part):

Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 <march> 01 10:18:02.704 - Initializing engine ...
2009 <march> 01 10:18:02.782 - Error during initialization: <The type initializer of> SdlDotNet.Graphics.Video <caused an exception>.
Stack trace:
   <at> SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   <at> Musuu_no_Danmaku.Graphics.Initialize()
   <at> Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

If there's a known fix for this, or if it's a result of some idiotic mistake I made, please let me know. And if not, then have some merry bugfixing...

hmm ... I only saw this error when testing on my laptop before I installed SDL.NET runtimes.  I was originally going to just include the SDL.NET .dll's, but that didn't seem to work, so I instead point to the installer.

Just to make sure, you did unpack all of the files from the .zip into a folder on your hard drive, right?

I don't know too much about Vista, but you may want to try fiddling with the compatibility mode settings (at least XP compatibility mode).  I also remember hearing about some games needing admin privileges to run; this game shouldn't need them, but it may be worth a shot if you want to try it.

Finally, it may be something with the OpenGL drivers installed on your machine.  Unfortunately, I can't provide any real advice here at the moment; I don't think I've used anything but the stock OpenGL on my system.


This is something that's going wrong in SDL.NET's initialization of the window and OpenGL; unfortunately not code I wrote myself, so I can't offer any immediate code fixes if that is where the problem is.


Also - march?  Is your computer date set eight months back? o_O



EDIT:

I'm now on my second computer (I have to alternate between two computers on a weekly basis for various reasons) and tried running it. This computer has Windows XP Home Edition, and I've installed the SDL.NET runtime (version 6.1.0, same as on the other computer) on it (haven't installed the Tao Framework, but since it didn't help on the other comp and it seemingly hasn't been necessary for others, I don't think it'd help). The program gets further this time, but still manages to error and stop working. (It actually initializes the window this time! Oh well, like we needed any more proof that XP > Vista.)

Default scripts, log (full english this time, no need to translate):

Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 marras 01 17:46:08.703 - Initializing engine ...
2009 marras 01 17:46:09.546 - Loading script objects ...
2009 marras 01 17:46:09.562 - Creating new Game object ...
2009 marras 01 17:46:09.593 - Error during initialization: Input string was not in a correct format.
Stack trace:
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info)
   at Musuu_no_Danmaku.mdBaseReader.Parse_Instruction_Line(String line)
   at Musuu_no_Danmaku.Game..ctor()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

Either I'm doing something horribly wrong or the program is really in need of some bugfixing.

This one bothers me more.  This looks to be where it's initializing the built-in function code - I wrote them as mdBase lines and feed them through the parser to generate the internal structures.


I notice "marras" for the month - what language/region is this system set for?  After a quick bit of research, depending on the region, the function "StringToNumber" will be expecting either a "." or a "," as a decimal point (pi = 3.14159 vs pi = 3,14159).  Is your region one that uses the comma?  That would explain the error if it is.



An oversight on my part; apologies.  I'll have to look at how to fix this, even if it's not what's causing the error.  Unfortunately, I think it'd be rather difficult to support the "," as a decimal point in the script files; it would throw the parser for a loop when it came across something like SetSize(5,7); - it wouldn't be able to determine if it was one parameter (5.7) or two (5 and 7).




Unfortunately, I don't think I'll get any more code done this weekend.  I have a couple things to take care of, and my jaw still hurts like a bitch.
I'll still look at any issues that come up during the week. :yukkuri:
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 02, 2009, 06:02:19 AM
hmm ... I only saw this error when testing on my laptop before I installed SDL.NET runtimes.  I was originally going to just include the SDL.NET .dll's, but that didn't seem to work, so I instead point to the installer.

Just to make sure, you did unpack all of the files from the .zip into a folder on your hard drive, right?

I don't know too much about Vista, but you may want to try fiddling with the compatibility mode settings (at least XP compatibility mode).  I also remember hearing about some games needing admin privileges to run; this game shouldn't need them, but it may be worth a shot if you want to try it.

Finally, it may be something with the OpenGL drivers installed on your machine.  Unfortunately, I can't provide any real advice here at the moment; I don't think I've used anything but the stock OpenGL on my system.

This is something that's going wrong in SDL.NET's initialization of the window and OpenGL; unfortunately not code I wrote myself, so I can't offer any immediate code fixes if that is where the problem is.

I already tried XP compatibility. However, admin priviledges should be worth a shot, or taking a look at the OpenGL installation on the computer. I can't test it until after a week, though, so this is somewhat irrelevant at the moment.

Also - march?  Is your computer date set eight months back? o_O

*FACEPALM*

Apparently I suck at translating and translated "Marraskuu" into "March" subconsciously while it's actually "November", and "Maaliskuu" is "March". Oh well, mistakes do happen...

This one bothers me more.  This looks to be where it's initializing the built-in function code - I wrote them as mdBase lines and feed them through the parser to generate the internal structures.


I notice "marras" for the month - what language/region is this system set for?  After a quick bit of research, depending on the region, the function "StringToNumber" will be expecting either a "." or a "," as a decimal point (pi = 3.14159 vs pi = 3,14159).  Is your region one that uses the comma?  That would explain the error if it is.


My region (Finland) uses the comma, so that might be the problem. Unfortunately, though, I have absolutely no idea how that setting should be changed, so can't really verify it is the problem.

EDIT:

Additional research reveals that according to the documentation source I found (http://msdn.microsoft.com/en-us/library/system.double.parse%28VS.71%29.aspx , I unfortunately have no previous knowledge on C# so I have to go by documentation) the parameter NumberFormatInfo in System.Double.Parse contains the data for the decimal annotation. Thus, you should probably try creating a CultureInfo for the culture the program is coded in, retrieving the NumberFormatInfo and using that as the parameter for the function instead of the current computer's culture. I have no idea will it work, though, since as stated, I have no prior experience about C# and am just referencing whatever documentation I'm finding. Good luck in fixing the problem, though.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 02, 2009, 07:12:08 AM
Quote from: readme
Before running, you must have the SDL.NET runtime installed.  Go to the
website - http://cs-sdl.sourceforge.net/index.php/Main_Page - and select
"Download SDL.NET", and select the newest version for your system.

Right, so I used the sdldotnet-6.1.0-runtime-setup.exe, and now your program doesn't give the "encountered a problem" message... it just doesn't do anything, at all. I'm pretty sure the program just closes down as soon as it opens. I'm running 64-bit windows XP here, is there anything you can tell me about what I could be doing to get this working?
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 02, 2009, 03:12:28 PM
Right, so I used the sdldotnet-6.1.0-runtime-setup.exe, and now your program doesn't give the "encountered a problem" message... it just doesn't do anything, at all. I'm pretty sure the program just closes down as soon as it opens. I'm running 64-bit windows XP here, is there anything you can tell me about what I could be doing to get this working?

This is most probably result of the program closing itself whenever it encounters an error. In order to locate the error, do the following:

Run the program from the command prompt with the additional parameter -l (for example:
"C:\\Path\To\The\Folder\Musuu no Danmaku.exe" -l). Or, if you somehow can't use the command prompt well enough: create a shortcut to the exe, open up the properties of the shortcut, add -l to the end of the path field (outside the quotation marks) and run the shortcut. Now, while it probably won't make the program work, the program should create a "log" file in the folder it's placed in. The contents of the log text file tell exactly where the error occured, so post them here. The log will often tell whether the problem is a bug in the software or whether it's caused by something else, so it's valuable information. And if it's a bug, then locating it is an important step towards fixing it.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 02, 2009, 08:15:36 PM
Quote
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 Nov 02 14:13:19.312 - Initializing engine ...
2009 Nov 02 14:13:20.250 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Video' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

So there's something wrong the the SDL.net installation? Bleh.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 03, 2009, 02:29:53 AM
Apparently I suck at translating and translated "Marraskuu" into "March" subconsciously while it's actually "November", and "Maaliskuu" is "March". Oh well, mistakes do happen...

Oops. ;)



My region (Finland) uses the comma, so that might be the problem. Unfortunately, though, I have absolutely no idea how that setting should be changed, so can't really verify it is the problem.

EDIT:

Additional research reveals that according to the documentation source I found (http://msdn.microsoft.com/en-us/library/system.double.parse%28VS.71%29.aspx , I unfortunately have no previous knowledge on C# so I have to go by documentation) the parameter NumberFormatInfo in System.Double.Parse contains the data for the decimal annotation. Thus, you should probably try creating a CultureInfo for the culture the program is coded in, retrieving the NumberFormatInfo and using that as the parameter for the function instead of the current computer's culture. I have no idea will it work, though, since as stated, I have no prior experience about C# and am just referencing whatever documentation I'm finding. Good luck in fixing the problem, though.

Yeah, it sounds like the region thing is screwing it up.  I have the built-in functions hardwired into the program as mdBase statements; these statements (and the statements from converted mdScript scripts) have numbers with the '.' decimal point, so when the program expects the comma it goes kablooey.

I'll have to take a look at that link you posted, and figure out what I can do.  Unfortunately, I can't get any actual codework done now (family stuff pulls me miles away from my desktop; I'm stuck with my shitty laptop here), so I won't be able to get an updated version out for you to try until at least this coming Friday.



So there's something wrong the the SDL.net installation? Bleh.

That error was the one I saw before installing the SDL.NET runtime on my laptop - the same one you mentioned.
Only major difference is that I'm on a 32-bit XP system, not a 64-bit one.  I hope that's not the issue, though, cause that would suck.



*some research later* http://support.microsoft.com/kb/896456 (http://support.microsoft.com/kb/896456) aha!

Quote from: Microsoft
OpenGL
The x64-based versions of Windows Server 2003 and of Windows XP Professional x64 Edition do not include an OpenGL graphics driver. Contact the manufacturer of the device for a driver that is compatible with the x64-based versions of Windows Server 2003 and of Windows XP Professional x64 Edition.

This could be causing your trouble.  I would recommend looking for updated drivers for your graphics cards - of course, make sure you get 64bit drivers.
As for where to get those - that, of course, depends on your graphics card.

PT8 - this might be similar to the issue you're having on your Vista machine ... is it by any chance also a 64-bit machine?


Good luck!
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 03, 2009, 01:52:38 PM
PT8 - this might be similar to the issue you're having on your Vista machine ... is it by any chance also a 64-bit machine?

Good luck!

Unfortunately I have no way of checking that as of now. I'll be able to check that next sunday, since I'm on this XP machine this whole week.

And good luck for you too in fixing the number parsing problem once you're able to get coding again.
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 03, 2009, 09:11:42 PM
Yes! After a lot of tinkering I finally got Musuu to run in my 64-bit Linux machine. If somebody want to try it in Linux too, here is how I did it:

* Installed Mono runtime.
* Downloaded SDL 6.1.0 tar.gz and extracted everything in bin into Musuu's folder.
* Downloaded Tao framework 2.1.0 tar.gz and extracted Tao.Sdl.dll, Tao.Sdl.dll.config, Tao.OpenGL.dll and Tao.OpenGL.dll.config from the bin folder into Musuu's folder.

I got a few error in the command-line but they seem to have no effect on the application.

Code: [Select]
line 26:6 missing SEMICOLON at 'if'
line 31:6 missing SEMICOLON at 'count'
line 54:12 missing SEMICOLON at 'angle'
line 57:9 missing SEMICOLON at 'angle'
line 105:12 missing SEMICOLON at 'SetAngle'
line 107:6 missing SEMICOLON at '}'
line 108:3 missing SEMICOLON at '}'
(I used the default scripts.)

Also I tried to run Musuu in my Virtual machine with Windows XP (this is where I run Danmakufu) but got the same error as PT8's second computer but that might be because my region also uses the comma as decimal point. (My Linux install is set to English)

(I have been following your project from start, just been to shy to join the forum.)

EDIT: I notified that the FPS sometimes goes over 60 (usually 62-63).
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 04, 2009, 02:43:08 AM
Yes! After a lot of tinkering I finally got Musuu to run in my 64-bit Linux machine. If somebody want to try it in Linux too, here is how I did it:

* Installed Mono runtime.
* Downloaded SDL 6.1.0 tar.gz and extracted everything in bin into Musuu's folder.
* Downloaded Tao framework 2.1.0 tar.gz and extracted Tao.Sdl.dll, Tao.Sdl.dll.config, Tao.OpenGL.dll and Tao.OpenGL.dll.config from the bin folder into Musuu's folder.

Good to know that the idea of cross-platform compatibility wasn't just a pipe-dream.

These instructions should be helpful for others in your situation, too.  Thanks!



I got a few error in the command-line but they seem to have no effect on the application.

Code: [Select]
line 26:6 missing SEMICOLON at 'if'
line 31:6 missing SEMICOLON at 'count'
line 54:12 missing SEMICOLON at 'angle'
line 57:9 missing SEMICOLON at 'angle'
line 105:12 missing SEMICOLON at 'SetAngle'
line 107:6 missing SEMICOLON at '}'
line 108:3 missing SEMICOLON at '}'
(I used the default scripts.)

Hmm ... those are messages from ANTLR.  Is the default danmaku working correctly?  It should fire spreads of round blue bullets aimed at you, and fire individual red arrow bullets which re-aim at you every once in a while.

I wonder if this is something that's happening on my end, even, and I'm not seeing it since it doesn't run from a console on Windows (even if you start it in a console, the console immediately returns and you don't get stdout or anything, from what I've seen).  I know that ANTLR tries to compensate for 'trivial' syntax errors, like "hey dumbass you need a semicolon here", so that's probably what it's doing with these messages.


... actually, I wonder if I accidentally duplicated the semicolon marker on some lines in the grammar ... I should look at that when I can.



Also I tried to run Musuu in my Virtual machine with Windows XP (this is where I run Danmakufu) but got the same error as PT8's second computer but that might be because my region also uses the comma as decimal point. (My Linux install is set to English)

Yeah, I'm pretty certain the whole comma as a decimal point thing is causing problems.  Again, I'll be looking to fix that quickly.

(This is why early test builds are good - we find things like this, which I would've had no friggin' clue about 'cause all my computers are either set as US or Japan.)



EDIT: I notified that the FPS sometimes goes over 60 (usually 62-63).

That's just a hiccup in the framerate.  Computers, especially in a large multiprocess environment like a typical PC, can have trouble keeping an exact framerate for an application such as this.  Minor variations will generally go unnoticed, but they're easier to see with the FPS counter.
As far as it going above 60, it's probably just falling a frame or two behind over time and catching up.

... either that or there's some inaccuracy in SDL.NET's framerate calculations ...
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on November 04, 2009, 06:16:32 PM
Nuclear Cheese, do you need someone to draw some sample sprites for you, much like the ExRumia of danmakufu? I could probably sprite some enemies and bosses for you, if you want.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 04, 2009, 07:57:06 PM
Yeah, it would be good to have a set of default (i.e. "not ripped from ZUN") graphics and sounds ...

I could provide some sounds, if you don't mind them sounding, um, a bit less like the original games ... See also http://www.freesound.org/ for that kind of thing ...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 05, 2009, 02:28:44 AM
Nuclear Cheese, do you need someone to draw some sample sprites for you, much like the ExRumia of danmakufu? I could probably sprite some enemies and bosses for you, if you want.

Yeah, it would be good to have a set of default (i.e. "not ripped from ZUN") graphics and sounds ...

I could provide some sounds, if you don't mind them sounding, um, a bit less like the original games ... See also http://www.freesound.org/ for that kind of thing ...

Yeah, some default, original stuff would be cool.  I just pulled the PyroReimu graphic 'cause it was convenient (straight out of Hax Sign 「Burn Everything」; in turn, straight from the Walfas character creator :V).

You could even swap out the graphics in the sample script to try it out (or, if you're feeling ambitious, try creating a new script even).



Sounds are a good idea as well, although there's no code in place for them, so you can't see how they work in-game yet.

That Freesound site looks useful, too.  Just need to make sure we keep up with the attribution on each sound if we go with that path.
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 05, 2009, 03:16:40 PM
Hmm ... those are messages from ANTLR.  Is the default danmaku working correctly?  It should fire spreads of round blue bullets aimed at you, and fire individual red arrow bullets which re-aim at you every once in a while.

I wonder if this is something that's happening on my end, even, and I'm not seeing it since it doesn't run from a console on Windows (even if you start it in a console, the console immediately returns and you don't get stdout or anything, from what I've seen).  I know that ANTLR tries to compensate for 'trivial' syntax errors, like "hey dumbass you need a semicolon here", so that's probably what it's doing with these messages.


... actually, I wonder if I accidentally duplicated the semicolon marker on some lines in the grammar ... I should look at that when I can.

The script runs perfectly fine, it's doing exactly what the code says. After some inspection, I found out that ANTLR wants you to put a semicolon after every end curly bracket except those for objects, initialize and tick.



Also, I found a bug that crashes the game if you write count = count-1; instead of count = count - 1;

Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 Nov 05 15:48:16.825 - Initializing engine ...
2009 Nov 05 15:48:17.040 - Loading script objects ...
2009 Nov 05 15:48:17.043 - Creating new Game object ...
2009 Nov 05 15:48:17.083 - Loading script file: baka.txt
2009 Nov 05 15:48:17.092 - Loading script file: ThePlayer.txt
2009 Nov 05 15:48:17.101 - Loaded Object_Type - ThePlayer of type Player
2009 Nov 05 15:48:17.101 - Loading script file: TheCirno.txt
2009 Nov 05 15:48:17.112 - Loaded Object_Type - TheEnemy of type Boss
2009 Nov 05 15:48:17.115 - Loaded Object_Type - EvilShot of type Enemy_Shot
2009 Nov 05 15:48:17.115 - Spawning an object of type ThePlayer as the player.
2009 Nov 05 15:48:17.123 - Spawning an object of type TheEnemy as the enemy.
2009 Nov 05 15:48:17.123 - Starting main loop ...
2009 Nov 05 15:48:17.132 - An error occurred: Incorrect # of args for command set
Stack Trace:
  at Musuu_no_Danmaku.Script.Run (Musuu_no_Danmaku.Object o, Musuu_no_Danmaku.Game current_game, System.Collections.Generic.Dictionary`2 locals) [0x00000]
  at Musuu_no_Danmaku.Script.Run (Musuu_no_Danmaku.Object o, Musuu_no_Danmaku.Game current_game) [0x00000]
  at Musuu_no_Danmaku.Object.Tick (Musuu_no_Danmaku.Game current_game) [0x00000]
  at Musuu_no_Danmaku.Game.Tick () [0x00000]
  at Musuu_no_Danmaku.Program.Events_Tick (System.Object sender, SdlDotNet.Core.TickEventArgs e) [0x00000]
2009 Nov 05 15:48:17.132 - Closing the program ...

A similar bug is that if you write CreateObject("PointItem", GetX()-30, GetY()); instead of CreateObject("PointItem", GetX() - 30, GetY()); the object will not be created. However, doing a similar thing with addition will work like it should.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on November 05, 2009, 03:40:39 PM
What characters are sprites needed of?  ???
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 05, 2009, 05:57:33 PM
What characters are sprites needed of?  ???
Presumably, generic Reimu and Marisa ...
Title: Re: A replacement for Danmakufu?
Post by: Ragnikarth on November 05, 2009, 11:47:02 PM
If you're still open to suggestions...

Replaceable Everything. Font, lifebar texture, graze SFX, every little thing for the complete Custom Game experience.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 06, 2009, 12:40:06 AM
Adjustable playfield size would be neat. You know, so you could make a PC-98-ish stage or something.

Also, customizeable keys. I don't mean making the script allow you to use more keys than C for custom stuff, I mean allowing the user to change what key does what... so I could make S focus, D fire, and F bomb if it were my inclination... or any custom trigger that a scripter would set up, for that matter.

This is important because of anti-ghosting on keyboards. I have used keyboards that do not let you use the arrow keys with shift and z before, and the keyboard I use right now doesn't let me focus, fire, and hold C while moving around. This is not something that anyone should ever have to put up with, and you have the opportunity to make a workaround in this new program. So please, add some customizable keys.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 06, 2009, 02:30:46 AM
What characters are sprites needed of?  ???
Presumably, generic Reimu and Marisa ...

For playables, yes.  We'll probably want to script up some default player scripts like the normal Reimu/Marisa A/B styles.

We probably should also pick a character or two for some sample scripts, much like Danmakufu does with ExRumia.



If you're still open to suggestions...

Replaceable Everything. Font, lifebar texture, graze SFX, every little thing for the complete Custom Game experience.

The general idea was to have about as much customizability as possible (within reasonable bounds, at least).



Adjustable playfield size would be neat. You know, so you could make a PC-98-ish stage or something.

This has been discussed previously, and while it isn't a priority feature, it would not be difficult to add in at some point.



Also, customizeable keys. I don't mean making the script allow you to use more keys than C for custom stuff, I mean allowing the user to change what key does what... so I could make S focus, D fire, and F bomb if it were my inclination... or any custom trigger that a scripter would set up, for that matter.

This is important because of anti-ghosting on keyboards. I have used keyboards that do not let you use the arrow keys with shift and z before, and the keyboard I use right now doesn't let me focus, fire, and hold C while moving around. This is not something that anyone should ever have to put up with, and you have the opportunity to make a workaround in this new program. So please, add some customizable keys.

I might not have made it clear previously, but my plan from the get-go was to have the controls be fully customizable, including on the keyboard.  While the controls are currently fixed, the framework is already in the code for customizing the controls.  I just need to actually add said configuration ability.
Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on November 06, 2009, 03:11:54 AM
I would happily draw an ExWriggle and ExUtsuho if you'd like  :V
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on November 06, 2009, 03:39:00 AM
Reminds me, make it so that you can set between PC-98 style dialogue and Windows.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 06, 2009, 04:58:50 AM
Make it EX-Cirno. :3
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 07, 2009, 05:49:50 AM
Reminds me, make it so that you can set between PC-98 style dialogue and Windows.

If you can provide examples of PC-98 style dialogue boxes, I'm sure they can be accomodated.  I haven't played the PC-98 games much/at all, so I'm not sure of the visual difference at the moment ...



Some progress tonight:



I modified the test/sample scripts so that the boss has 100 life, and dissapears when it hits zero (right now the boss checks this manually; automatic code/script for this will be added later, of course).
The player was modified to automatically shoot a five-way spread of shots every 10 frames, each shot doing 0.8 damage.  Once scripts can read input, this will be triggered off of input rather than just being stuck on auto-fire.


I also grabbed Always お⑨'s point item graphic - since you posted it here I'm guessing it's okay, but do you mind me including it in the releases?
Title: Re: A replacement for Danmakufu?
Post by: Naut on November 07, 2009, 06:06:11 AM
Ahh, angle before speed paramters, oh this will haunt me. Also, no penetration on the player bullet type (how many times the bullet can score a hit on the enemy before deleting itself)? Or can we expect more than one player shot function, unlike Danmakufu?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 07, 2009, 06:22:30 AM
Ahh, angle before speed paramters, oh this will haunt me.

Just like everything else, this is adjustable if people want.  Opinions?



Also, no penetration on the player bullet type (how many times the bullet can score a hit on the enemy before deleting itself)? Or can we expect more than one player shot function, unlike Danmakufu?

Failing any implementation of a hard-coded parameter of such, you could always create a custom Player_Shot object type which has this behavior.

Such a thing should be perfectly possible right now even, but you'll need to use mdBase since there's no mdScript function for "damage the enemy" yet.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 07, 2009, 06:23:04 AM
Oh yeah -- after fooling around with SimSynth (http://www.threechords.com/hammerhead/simsynth.shtml) a bit, I have managed to produce an SFX (http://www.mediafire.com/?myrzo2nkzdm) which is almost, but not quite, enturely unlike the Touhou death SFX.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on November 07, 2009, 06:48:19 AM
Snapshotted Mima VS Sara (I'm not too familiar with PC-98 characters).
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 07, 2009, 09:41:53 AM
Snapshotted Mima VS Sara (I'm not too familiar with PC-98 characters).

This screenshot doesn't show that each text box can hold up to 3 separate lines(in Mystic Square, at least)... In addition, the dialogue will sometimes appear letter by letter(usually the first messages appear in this fashion, though the original "both characters say something at the same time before the fight starts" line was also presented this way).

The text boxes varied by game in the PC-98 series, so here are videos of each:

Story of Eastern Wonderland (Touhou 2) (http://www.youtube.com/watch?v=-9CKXoW_Ygk#t=160)
Lotus Land Story (Touhou 4) (http://www.youtube.com/watch?v=pmz_NnQQSIg#t=56)
Mystic Square (Touhou 5) (http://www.youtube.com/watch?v=poeP7pxRkAA#t=150)

There is even some variation among the windows games, most notably in the appearance of the text box, and how the portraits are handled. While I think it would be a good idea to have some presets(SoEW, LLS/MS, EoSD/PCB, IN, MoF/SA/UFO), I think it would be best to allow for the customization of how the dialogue happens, so you could create an entirely new cutscene appearance...and to be able to switch to an image of the textbox instead of the textbox itself for any given line, sorta like what was done in SA Phantasm.


Speaking of dialogue, one thing I noticed with Danmakufu is that there are no dialogue cut-ins for the regular characters, and that in order to have a player cut-in for the dialogue, you have to have ones included in the script.

I think that's stupid. I figure that each character should be able to have a standard set of portraits... for the standard emotes, and a small set of SoEW box portraits. In a given script that has dialogue, the script would first check which character you are using(by looking for a character ID within that character's script file, so you could have a custom Marisa that uses Marisa's dialogue, or a script that has dialogue for an entirely different character), and then would grab the appropriate portrait for each line of dialogue from that character.

And of course, you could insert portraits the old way, too.


I'd like to put forward that, like in Danmakufu, you should be able to replace all of the default sounds and graphics if it is your inclination to do so. Though, for the default players, I think there should be some more frames of animation there to replace, lol.


One last thing for now: I want a way to organize my scripts beyond the single-plural-stage designation. I currently have a separate scripts folder for the stuff from the Halloween contest because that stuff would horribly clutter all my other scripts. I currently switch between them by renaming the folders, but if there was an in-game way to switch between them, that would be sweet.
Title: Re: A replacement for Danmakufu?
Post by: Suikama on November 07, 2009, 04:07:01 PM
Oh yeah -- after fooling around with SimSynth (http://www.threechords.com/hammerhead/simsynth.shtml) a bit, I have managed to produce an SFX (http://www.mediafire.com/?myrzo2nkzdm) which is almost, but not quite, enturely unlike the Touhou death SFX.
Ehh that's more of a 'peewwww' than 'spoooon'
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 07, 2009, 05:03:38 PM
I found another bug that if you run if (1==1 && 0==1 && 2==2) the statement will return true and if you run if (0==1 || 1==1 || 0==2) the statement will return false. The same applies to if (1==1 && 0==1 && 0==2 && 2==2) and so on. A workaround at this moment is to write if (a==1 && (b==1 && c==1)) instead.

Oh, and did you implement the infinite loop protection? Cause it didn't work when I tested it.

After making a script I found that one thing I really miss is arguments for object shots. Other than that Musuu is really good even if it's far from complete. Keep up the good work.


One last thing for now: I want a way to organize my scripts beyond the single-plural-stage designation. I currently have a separate scripts folder for the stuff from the Halloween contest because that stuff would horribly clutter all my other scripts. I currently switch between them by renaming the folders, but if there was an in-game way to switch between them, that would be sweet.

That is one of the things I don't like with Danmakufu, having to many scripts so you can barely find anything. I suggest to only have two menu options for running scripts, Games and Develop. Games would only contain complete projects from others with only one option in the menu instead of one for each difficulty and spellcard. Game-scripts would then be used for showing name, picture and comments in the menu as well as other things. Develop would be used to test scripts. Debug options like invincibility would only be available here. This plus a way to sort your scripts would be awesome.


Another thing is that I think it's best to have character selection within the games' own menu, preferred being able to make your own or at least have your own background.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 07, 2009, 05:41:37 PM
Ehh that's more of a 'peewwww' than 'spoooon'
Yeah, hence the "almost, but not quite, entirely unlike" ...
Title: Re: A replacement for Danmakufu?
Post by: Suikama on November 07, 2009, 05:44:56 PM
Yeah, hence the "almost, but not quite, entirely unlike" ...
How... vague :V
Title: Re: A replacement for Danmakufu?
Post by: 8lue Wizard on November 07, 2009, 10:06:37 PM
Speaking of dialogue, one thing I noticed with Danmakufu is that there are no dialogue cut-ins for the regular characters, and that in order to have a player cut-in for the dialogue, you have to have ones included in the script.

I think that's stupid. I figure that each character should be able to have a standard set of portraits... for the standard emotes, and a small set of SoEW box portraits. In a given script that has dialogue, the script would first check which character you are using(by looking for a character ID within that character's script file, so you could have a custom Marisa that uses Marisa's dialogue, or a script that has dialogue for an entirely different character), and then would grab the appropriate portrait for each line of dialogue from that character.

I approve of this idea. There should definitely be some sort of communal area and naming conventions for dialog portraits. We could even have some default function(s) for "Get me X portrait of Y character", where if X port doesn't exist, it goes to the default port for that character, and if Y char has no ports, it goes to a generic silhouette portrait.

However, I don't think we should spend any great effort creating or maintaining a comprehensive library for distribution with the main package. If certain individuals would like to do so as a separate package, as with the Expanded Shot Data add-ons for DMF, that's their business, but I feel that it would be outside the scope of this project.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 07, 2009, 11:27:11 PM
This screenshot doesn't show that each text box can hold up to 3 separate lines(in Mystic Square, at least)... In addition, the dialogue will sometimes appear letter by letter(usually the first messages appear in this fashion, though the original "both characters say something at the same time before the fight starts" line was also presented this way).

The text boxes varied by game in the PC-98 series, so here are videos of each:

Story of Eastern Wonderland (Touhou 2) (http://www.youtube.com/watch?v=-9CKXoW_Ygk#t=160)
Lotus Land Story (Touhou 4) (http://www.youtube.com/watch?v=pmz_NnQQSIg#t=56)
Mystic Square (Touhou 5) (http://www.youtube.com/watch?v=poeP7pxRkAA#t=150)

There is even some variation among the windows games, most notably in the appearance of the text box, and how the portraits are handled. While I think it would be a good idea to have some presets(SoEW, LLS/MS, EoSD/PCB, IN, MoF/SA/UFO), I think it would be best to allow for the customization of how the dialogue happens, so you could create an entirely new cutscene appearance...and to be able to switch to an image of the textbox instead of the textbox itself for any given line, sorta like what was done in SA Phantasm.

Oh fun.  Sounds like we have some work to do.



Speaking of dialogue, one thing I noticed with Danmakufu is that there are no dialogue cut-ins for the regular characters, and that in order to have a player cut-in for the dialogue, you have to have ones included in the script.

I think that's stupid. I figure that each character should be able to have a standard set of portraits... for the standard emotes, and a small set of SoEW box portraits. In a given script that has dialogue, the script would first check which character you are using(by looking for a character ID within that character's script file, so you could have a custom Marisa that uses Marisa's dialogue, or a script that has dialogue for an entirely different character), and then would grab the appropriate portrait for each line of dialogue from that character.

And of course, you could insert portraits the old way, too.

I approve of this idea. There should definitely be some sort of communal area and naming conventions for dialog portraits. We could even have some default function(s) for "Get me X portrait of Y character", where if X port doesn't exist, it goes to the default port for that character, and if Y char has no ports, it goes to a generic silhouette portrait.

However, I don't think we should spend any great effort creating or maintaining a comprehensive library for distribution with the main package. If certain individuals would like to do so as a separate package, as with the Expanded Shot Data add-ons for DMF, that's their business, but I feel that it would be outside the scope of this project.

Having default cut-ins for the provided characters is definitely a good idea.  I like Blue Wolf's idea of having a function that can get said cut-in graphics automatically, although we should still allow a function to set it to whatever specific graphic you want.



I'd like to put forward that, like in Danmakufu, you should be able to replace all of the default sounds and graphics if it is your inclination to do so. Though, for the default players, I think there should be some more frames of animation there to replace, lol.

I agree about things being replacable like you describe.

As far as the "frames of animation" comment ... is that something with Danmakufu's default players?



One last thing for now: I want a way to organize my scripts beyond the single-plural-stage designation. I currently have a separate scripts folder for the stuff from the Halloween contest because that stuff would horribly clutter all my other scripts. I currently switch between them by renaming the folders, but if there was an in-game way to switch between them, that would be sweet.

That is one of the things I don't like with Danmakufu, having to many scripts so you can barely find anything. I suggest to only have two menu options for running scripts, Games and Develop. Games would only contain complete projects from others with only one option in the menu instead of one for each difficulty and spellcard. Game-scripts would then be used for showing name, picture and comments in the menu as well as other things. Develop would be used to test scripts. Debug options like invincibility would only be available here. This plus a way to sort your scripts would be awesome.

... are you guys using the "Directory" option in Danmakufu's menu?  This lets you browse the scripts folder by directory, and I've found it quite easy to deal with organizing scripts using this otpion.  You just need to set up your organization once, and then browse it as you see fit.  For instance, you could organize things like this:


... and when you select "Directory", you get a simple list of wip, completed, other people - single scripts, and other people - full games.  Select one and you get the next level of stuff.  Really simple, if you ask me. :)

I was going to use this as the default browsing method for Musuu, but if anyone has any better suggestions I'm open to ideas.



I found another bug that if you run if (1==1 && 0==1 && 2==2) the statement will return true and if you run if (0==1 || 1==1 || 0==2) the statement will return false. The same applies to if (1==1 && 0==1 && 0==2 && 2==2) and so on. A workaround at this moment is to write if (a==1 && (b==1 && c==1)) instead.

Lovely. :V

I'll have to look into this as well.

EDIT: Could you please post the script you used to observe this?  I just did a quick test, and it looks like it's translating to the correct mdBase commands, at least ...

EDIT2: fixed.



Oh, and did you implement the infinite loop protection? Cause it didn't work when I tested it.

How did you test it?

Keep in mind it may take a while to come into effect - right now it take 100,000,000 mdBase commands for it to take effect (keep in mind that, depending on complexity, each mdScript command will be broken down into anywhere from 1 to several mdBase commands).
Also keep in mind that this is for each individual script.  You'll still break things by spawning an object in initialize, which in turn does the same, etc., because it'll keep running initialize scripts.

In summary, it's in place, but it isn't complete yet.



After making a script I found that one thing I really miss is arguments for object shots. Other than that Musuu is really good even if it's far from complete. Keep up the good work.

I'll make a note to add the option to pass an argument when creating a new object - that should cover this issue.



Another thing is that I think it's best to have character selection within the games' own menu, preferred being able to make your own or at least have your own background.

I think we were considering allowing this with game scripts.
Title: Re: A replacement for Danmakufu?
Post by: MCXD on November 08, 2009, 12:26:53 AM
Also, may I add, that everyone asking for a PoFV engine should be ashamed.

STB engine is where it's at.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 08, 2009, 02:01:13 AM
Also, may I add, that everyone asking for a PoFV engine should be ashamed.

STB engine is where it's at.

That would certainly be less of a deviation from the normal engine than PoFV-style, at least :V




Have some progress:



Player script now only fires when the shot key is pressed.  Also, firing while focused now fires a tighter spread.
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on November 08, 2009, 03:25:11 AM
Yes! After a lot of tinkering I finally got Musuu to run in my 64-bit Linux machine. If somebody want to try it in Linux too, here is how I did it:

* Installed Mono runtime.
* Downloaded SDL 6.1.0 tar.gz and extracted everything in bin into Musuu's folder.
* Downloaded Tao framework 2.1.0 tar.gz and extracted Tao.Sdl.dll, Tao.Sdl.dll.config, Tao.OpenGL.dll and Tao.OpenGL.dll.config from the bin folder into Musuu's folder.

I got a few error in the command-line but they seem to have no effect on the application.

Code: [Select]
line 26:6 missing SEMICOLON at 'if'
line 31:6 missing SEMICOLON at 'count'
line 54:12 missing SEMICOLON at 'angle'
line 57:9 missing SEMICOLON at 'angle'
line 105:12 missing SEMICOLON at 'SetAngle'
line 107:6 missing SEMICOLON at '}'
line 108:3 missing SEMICOLON at '}'
(I used the default scripts.)

Also I tried to run Musuu in my Virtual machine with Windows XP (this is where I run Danmakufu) but got the same error as PT8's second computer but that might be because my region also uses the comma as decimal point. (My Linux install is set to English)

(I have been following your project from start, just been to shy to join the forum.)

EDIT: I notified that the FPS sometimes goes over 60 (usually 62-63).

Using these instructions on 64-bit Ubuntu 9.04, it crashed. It showed a black window, then died after that.

Log:
Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 Nov 07 22:22:21.566 - Initializing engine ...
2009 Nov 07 22:22:21.742 - Error during initialization: An exception was thrown by the type initializer for SdlDotNet.Graphics.Surface
Stack trace:
  at SdlDotNet.Graphics.Video.SetVideoMode (Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface, Boolean frame) [0x00000]
  at SdlDotNet.Graphics.Video.SetVideoMode (Int32 width, Int32 height, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface) [0x00000]
  at Musuu_no_Danmaku.Graphics.Initialize () [0x00000]
  at Musuu_no_Danmaku.Program.Main (System.String[] args) [0x00000]

The program will close now.

Maybe it's due to the fact that I'm running Compiz?
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 08, 2009, 04:16:58 AM
I had a crazy idea while I was riding my bike: functions for reading text-files. One of my many Brazillion ideas involves storing the dialogue in a separate text file to e.g. facilitate translation, if anyone wanted to do that.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on November 08, 2009, 04:22:58 AM
I had a crazy idea while I was riding my bike: functions for reading text-files. One of my many Brazillion ideas involves storing the dialogue in a separate text file to e.g. facilitate translation, if anyone wanted to do that.

We already got that down.

Quote
Store dialog (and other?) text in a separate file, to facilitate making translations
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 08, 2009, 05:34:05 PM
O rite. |3

Oh, right, I'd also brought that up because I was thinking of text-parsing functions (i.e. for putting "tags" on a given line of dialogue for whatever reason), then realized that most of that could be handled ingame.
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 08, 2009, 10:54:53 PM
How did you test it?

Keep in mind it may take a while to come into effect - right now it take 100,000,000 mdBase commands for it to take effect (keep in mind that, depending on complexity, each mdScript command will be broken down into anywhere from 1 to several mdBase commands).
Also keep in mind that this is for each individual script.  You'll still break things by spawning an object in initialize, which in turn does the same, etc., because it'll keep running initialize scripts.

In summary, it's in place, but it isn't complete yet.

That might explain it, I tested it with a while-loop that fired och shot each loop. Recently I did a new test with a while-loop that only was setting a variable. It took about 30 seconds before it quit, and my computer is not very old. Might consider reducing the number to something like 10,000,000? I highly doubt anyone needs more mdBase commands than that in a single frame.




Using these instructions on 64-bit Ubuntu 9.04, it crashed. It showed a black window, then died after that.

Log:
Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 Nov 07 22:22:21.566 - Initializing engine ...
2009 Nov 07 22:22:21.742 - Error during initialization: An exception was thrown by the type initializer for SdlDotNet.Graphics.Surface
Stack trace:
  at SdlDotNet.Graphics.Video.SetVideoMode (Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface, Boolean frame) [0x00000]
  at SdlDotNet.Graphics.Video.SetVideoMode (Int32 width, Int32 height, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface) [0x00000]
  at Musuu_no_Danmaku.Graphics.Initialize () [0x00000]
  at Musuu_no_Danmaku.Program.Main (System.String[] args) [0x00000]

The program will close now.

Maybe it's due to the fact that I'm running Compiz?

I'm running 64-bit Ubuntu 9.10. When I was using Compiz I could run 3D games at the same time so I don't think that's the case. But I'm not running it nowdays so I can't be sure. Try to turn off Compiz temporary and see if it works.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 09, 2009, 12:41:13 AM
Using these instructions on 64-bit Ubuntu 9.04, it crashed. It showed a black window, then died after that.

Log:
Code: [Select]
Musuu no Danmaku version 0.1.3591.29235
Starting logging file ...
2009 Nov 07 22:22:21.566 - Initializing engine ...
2009 Nov 07 22:22:21.742 - Error during initialization: An exception was thrown by the type initializer for SdlDotNet.Graphics.Surface
Stack trace:
  at SdlDotNet.Graphics.Video.SetVideoMode (Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface, Boolean frame) [0x00000]
  at SdlDotNet.Graphics.Video.SetVideoMode (Int32 width, Int32 height, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface) [0x00000]
  at Musuu_no_Danmaku.Graphics.Initialize () [0x00000]
  at Musuu_no_Danmaku.Program.Main (System.String[] args) [0x00000]

The program will close now.

Maybe it's due to the fact that I'm running Compiz?

It's crapping out during the graphics initialization, as the log indicates.  Not too familiar with the specifics of setting up this stuff on 'nix systems, so I'm not sure what it could be.

Perhaps Furu can help - he/she seems more in tune with this end of things.



I had a crazy idea while I was riding my bike: functions for reading text-files. One of my many Brazillion ideas involves storing the dialogue in a separate text file to e.g. facilitate translation, if anyone wanted to do that.

Muffin, I'd let this go, but, seriously:

Random idea: put things like dialogue etc. in a specific separate file, for the purposes of making it easier to translate the game into other languages.

: V



That might explain it, I tested it with a while-loop that fired och shot each loop. Recently I did a new test with a while-loop that only was setting a variable. It took about 30 seconds before it quit, and my computer is not very old. Might consider reducing the number to something like 10,000,000? I highly doubt anyone needs more mdBase commands than that in a single frame.

... as far as the final limit, it certainly can be adjusted.  It's mainly a tradeoff between how complex things can get in the script vs how long it takes for the program to drop the hammer on rouge scripts.

Also, I just remembered that the counter doesn't transfer for function calls (yet), so if you're calling lots of functions it'll actually take a lot more commands to bomb out currently.
Title: Re: A replacement for Danmakufu?
Post by: Azure Lazuline on November 09, 2009, 12:44:19 AM
Maybe you could make it adjustable? Default to 10,000,000 like you planned, but add a command to raise it (or disable checking completely) for the chance that you might need a script to actually do that much.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 09, 2009, 01:55:28 AM
Maybe you could make it adjustable? Default to 10,000,000 like you planned, but add a command to raise it (or disable checking completely) for the chance that you might need a script to actually do that much.

I thought about that.  Ultimately, it could be useful, but at the same time it could just be a hassle.

If it's script controlled, it would leave it open to jerks who want to annoy you (probably a minor issue, but m'eh).  If it's user-controlled, it might end up confusing some users.

Also, keep in mind that 10,000,000 even takes a couple seconds to chew through on most computers ... I dunno what the hell you'd be doing that takes that long to begin with.

But m'eh.  It's open to discussion, as usual.



No real big changes tonight (just a quick optimization or two), but ...

Testing Release 2 (http://www.stephenware.com/musuu_no_danmaku/Musuu_no_Danmaku_Test_Release_2009_Nov_08.zip)

Includes all of the changes I said I've implemented since the last week's release, including (most importantly) the issue between "," and "." regional differences, and the ability to read inputs.

Also, last time I was an idiot and forgot to include license information for the libraries used.  They're included this time; hope I didn't screw anything up with that, 'cause I kinda rushed to piece that together moments ago. :V
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 09, 2009, 03:51:40 AM
*some research later* http://support.microsoft.com/kb/896456 (http://support.microsoft.com/kb/896456) aha!

This could be causing your trouble.  I would recommend looking for updated drivers for your graphics cards - of course, make sure you get 64bit drivers.
As for where to get those - that, of course, depends on your graphics card.

Good luck!

I updated my drivers, no luck. Also, test release 2 gives the "encountered a problem" message when I open it, and refuses to give a log.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 09, 2009, 04:05:44 AM
I updated my drivers, no luck. Also, test release 2 gives the "encountered a problem" message when I open it, and refuses to give a log.

Dammit.  Forgot to reenable error catching.  I usually disable it so exceptions get thrown to the IDE.

Fixed archive uploaded ... same link as above.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 09, 2009, 04:32:05 AM
Fixed archive uploaded ... same link as above.

You sure about that? While the "encountered a problem" message is gone, it's not creating an error log, even with that shortcut I made to enable the logging.

I'd like to take this opportunity to note that I am able to run other applications that use OpenGL on this computer, and was able to do so before the driver update as well.
Title: Re: A replacement for Danmakufu?
Post by: Chronojet ⚙ Dragon on November 09, 2009, 06:46:22 AM
Oh, yeah. You can use my 点 graphic, I don't mind.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 09, 2009, 06:47:51 AM
Includes all of the changes I said I've implemented since the last week's release, including (most importantly) the issue between "," and "." regional differences, and the ability to read inputs.

That's good and all, but I'm unfortunately now stuck on my other computer (Vista Home Premium), so I'm stuck with my other problem, which obviously hasn't gotten fixed.

Further information:
-Yes, the computer is 64-bit.
-Running as administrator had no effect at all.

Logging does work correctly for me, though. Same output as previously.

Haven't had the time to test whether it can run OpenGL programs yet, though, but I think I can test it later today (now I have to leave my computer, though).
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 10, 2009, 02:38:29 AM
Okay, so here's the summary list of doesn't-boot issues I'm seeing thus far ...


PT8Sceptile

Prime 2.0

arcanesign

Let me know if I missed anything.


Another thing I just thought of - we may need to install libsdl (the main SDL library) as well.  See here (http://www.libsdl.org/download-1.2.php).

Hate to be a pain and keep asking people to try these things, but I've only got two computers to try things on myself, and they're both WinXP 32-bit (and already have some dev crap installed).



Also, Furu - does testing release 2 work in your XP VM?



I know people want me to get the actual code posted up so people can criticize my sucky organization skillshelp out ... the first question is, of course, where do we keep it?  I'm not too familiar with these things, so suggestions are welcome.

Second question is when does it get posted?  I could post it this coming weekend if you guys really want, but be warned that the code is a freaking mess (by my standards, anyways).

Third, call me a jerk or whatnot, but I do want to retain some "control" over the codebase until it gets more complete.  Feel free to argue with me on this one; I might change my mind.

Fourth, Blargel and Blargel's brother - no stealing code! (j/k)
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 10, 2009, 08:45:59 AM
Prime 2.0
  • XP 64-bit
  • Error in SetVideoMode in Graphics.Initialize
  • Test release 2 does not create log files (just to be sure - did you properly unpack the new archive and make sure your shortcut points to the right place?)

How exactly would one go about unpacking it incorrectly? I just made a new folder, and put the contents of the zip in it. And yes, I made sure the shortcut pointed to the right place.

EDIT:

Another thing I just thought of - we may need to install libsdl (the main SDL library) as well.  See here (http://www.libsdl.org/download-1.2.php).

the windows runtine was just a dll and a readme. Put them in the Musuu no Danmaku folder, still doesn't work.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 10, 2009, 04:39:40 PM
Another thing I just thought of - we may need to install libsdl (the main SDL library) as well.  See here (http://www.libsdl.org/download-1.2.php).

Hate to be a pain and keep asking people to try these things, but I've only got two computers to try things on myself, and they're both WinXP 32-bit (and already have some dev crap installed).

This actually provides a question on what counts as "installing" the library. Since there's no clear "installer", I downloaded the win32 runtime library (a bit sceptic about the number in the end, but according to release information it should be 64-bit compatible) but afterwards I don't know exactly what should I try. I tried the following:

1 - Copy the SDL.dll file into Musuu's folder.
2 - Replace the SDL.dll file in SDL.NET's installation with the new one.

Neither of which did any good.

Also, on a side note, my computer is able to run Google Earth, which, according to Wikipedia (http://en.wikipedia.org/wiki/List_of_OpenGL_programs) uses an OpenGL renderer.
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 10, 2009, 09:53:10 PM
Also, Furu - does testing release 2 work in your XP VM?
Yes, it works now. After some more testing with SDL and Tao framework I found out what might be needed to run Musuu. Please test the following for your OS if it's not working.


Ubuntu 9.10 & 9.04
Windows XP
(Note that Windows and Ubuntu need the same dll files but Ubuntu also need the config files.)


Above is confirmed for two Ubuntu computers (both 64-bit) and one XP (32-bit). However, on another XP computer (32-bit) Musuu crashed without a log with the -l command. I will investigate this further when I have the time.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 10, 2009, 10:48:10 PM
Windows XP
  • I needed to install .NET framework 2.0 to be able to run it (I got a message about it)
  • Copy SdlDotNet.dll, Tao.OpenGl.dll and Tao.Sdl.dll to your Musuu folder (Get SDL here (http://sourceforge.net/projects/cs-sdl/files/) and Tao framework here (http://sourceforge.net/projects/taoframework/files/). Download the latest .zip files (or the installers if you want to try that instead but I haven't tested it). They are in the bin folder of the archives.)
Well, I already have .NET framework 3.0, and those DLL files are already in the folder. I tried running the installer for the Tao framework, didn't fix anything.
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on November 11, 2009, 08:22:33 PM
Yes, it works now. After some more testing with SDL and Tao framework I found out what might be needed to run Musuu. Please test the following for your OS if it's not working.


Ubuntu 9.10 & 9.04
  • Install mono-runtime and libmono2.0-cil through Synaptic (9.04 users may need to install mono-jit)
  • Copy SdlDotNet.dll, Tao.OpenGl.dll and Tao.Sdl.dll plus their config files SdlDotNet.dll.config, Tao.OpenGl.dll.config and Tao.Sdl.dll.config to your Musuu folder (Get SDL here (http://sourceforge.net/projects/cs-sdl/files/) and Tao framework here (http://sourceforge.net/projects/taoframework/files/). Download the latest .tar.gz files. They are in the bin folder of the archives.)

Tried this again with the newer Musuu release, but no dice. I'm using an older version of ubuntu (9.04, not 9.10), so that may be the problem. Here's my version of mono:

Code: [Select]
$ mono -V
Mono JIT compiler version 2.0.1 (tarball)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS:           __thread
GC:            Included Boehm (with typed GC)
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 11, 2009, 10:50:20 PM
Tried this again with the newer Musuu release, but no dice. I'm using an older version of ubuntu (9.04, not 9.10), so that may be the problem. Here's my version of mono:

Code: [Select]
$ mono -V
Mono JIT compiler version 2.0.1 (tarball)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS:           __thread
GC:            Included Boehm (with typed GC)
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none

Actually one of the machines I tested it on run 9.04 64-bit so that's not the case. I have also tested running it with Compiz running and that worked without a problem. I was also running the same version of Mono.



After studying the config files I found out that you probably need to have these packages installed:

These will probably be needed later on when fonts and sound are enabled:



In Windows' case, installing libSDL should provide you with the needed dlls which probably are:

...And these graphic dlls will be needed, probably:
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on November 11, 2009, 11:41:27 PM
Well, I ran the SDL installer linked by Nuclear Cheese, so I should already have that stuff... Anyways, I grabbed opengl32.dll and glu32.dll and put it in the program folder, still doesn't work.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 13, 2009, 06:03:19 AM
I just added config file support.  Right now all it has is graphics options, but I figured those would be the priority since that's where it seems people are getting errors.

The configuration is stored in a file "config.txt" in the same directory as the main program.  It looks like this:

Code: (config.txt) [Select]
/ Comment
/ Comment

/ Set screen dimensions
screen_width 800
screen_height  600

/ Determine fullscreen/window
full_screen false

/ Enable/Disable hardware surfaces
hardware_surfaces true

/ Bits per pixel (16 or 32)
bits_per_pixel 32

This covers just about everything that is passed to SdlDotNet.Video.SetVideoMode (where we seem to be getting our errors), so perhaps some tweaking of these parameters may yield results?

To note, though:



Also, my questions from before about putting up the code ...
I know people want me to get the actual code posted up so people can criticize my sucky organization skillshelp out ... the first question is, of course, where do we keep it?  I'm not too familiar with these things, so suggestions are welcome.

Second question is when does it get posted?  I could post it this coming weekend if you guys really want, but be warned that the code is a freaking mess (by my standards, anyways).

Third, call me a jerk or whatnot, but I do want to retain some "control" over the codebase until it gets more complete.  Feel free to argue with me on this one; I might change my mind.

Fourth, Blargel and Blargel's brother - no stealing code! (j/k)
... still up for discussion.

Random statistic: all code files combined, excluding code generated by ANTLR, the program has about 3600 lines of source so far.
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 13, 2009, 04:08:24 PM
Remember that one of my XP machines didn't run Musuu? Guess I missed the log the first time but anyway here it is:

Code: [Select]
Musuu no Danmaku version 0.1.3599.41460
Starting logging file ...
2009 nov 13 15:29:15.906 - Initializing engine ...
2009 nov 13 15:29:16.421 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Surface' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Surface..ctor(IntPtr handle, Boolean isVideoMode)
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface, Boolean frame)
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

After a little searching I found out that sdl_image might be missing. I downloaded it (http://www.libsdl.org/projects/SDL_image/) and moved all dll files to my Musuu folder. After that, Musuu was up and running  ;D
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 14, 2009, 02:54:01 AM
Remember that one of my XP machines didn't run Musuu? Guess I missed the log the first time but anyway here it is:

After a little searching I found out that sdl_image might be missing. I downloaded it (http://www.libsdl.org/projects/SDL_image/) and moved all dll files to my Musuu folder. After that, Musuu was up and running  ;D

Good to know.





Just a bit of progress for now ...



I got a bunch of thinking done about a couple things, though:

For the player miss animation, I think it should be part of the player's scripts.  Specifically, as its own script, which will most likely start a task or set a variable to animate the player's death.  Something like this:

Code: (sample) [Select]
.
.
.

miss
{
   // run death animation task
   death_anim();
}

task death_anim()
{
   while (!death_animation_complete)
   {
      // disable player motion/shooting
      ...
      // check for deathbomb, revert miss if it comes
      ...
      // anime the player character going boom
      ...
      if (death_animation_complete)
      {
         // reset player's location & stock
      }
      // resume processing on the next frame
      wait(1);
   }
}
.
.
.

(remember - sample of what it could look like.  some syntactic liberties.  might be different.  etc etc etc)

Here, the death_anim task would do whatever miss effect we decide to throw down.  The miss event script would be called, obviously, when the player gets hit.
Furthermore, specific character scripts could override this default if, for instance, you want your character to just blow up with no deathbomb chance.

Only real downside here is that you can't really enforce a specific death animation style for your game script (unless you enforce only specific player scripts).




Another idea I just had while doing stuff:
Instead of (or in addition to) having functions to access object information (like ObjGetX), allow a special syntax in mdScript to access object properties directly.  I had a couple ideas:
(id in all examples is an ID number for the object to reference)


id->x

Simple and straightforward; I kinda like this one a lot.


object[id].x

Makes it much like an array.  Might confuse people if they don't know that object is special, but that's a minor issue IMO.


With this in place, you could make some code a bit neater, such as (using the first syntax):
pid = GetPlayerID();
angle = arctan2(pid->y - y, pid->x - x);





Yet another idea I've been tossing about mentally is the idea of "messages" that can be sent to another object.  Effectively, this would be functions on one object that can be called from another object.

Basically, it would work in two parts.

1) In an object's scripts, a "message" is defined.  This would be a simlpe function definition, basically.

Code: (sample) [Select]
.
.
.
message ChangeAngle(new_angle)
{
   SetAngle(new_angle);
}
.
.
.


2) In another object's script, the message can be referenced.  Syntax tbd at the moment, but it would probably be best to give a syntax similar to the above property access syntax.  For example (using the first syntax):

Code: (sample) [Select]
.
.
.
shotid->ChangeAngle(angle_to_player);
.
.
.


There are many advantages this could bring, such as ...




Also looking at some font stuff, and I noticed that the Tao framework includes bindings for FreeType.  I'm considering giving this a try, since it's probably a lot better than my previous idea (get SDL to render the font, then copy it to a texture).  Any opinions?

Also, we'll need to decide on a font to use.  Preferably one that includes both Japanese and English symbols, at least.  We might want to use a public domain one, too, so it can be included with the program itself (meaning it'll be in the same directory so we always know where it is, and we can be reasonable sure it'll always be there).
I saw the Mona font (http://en.wikipedia.org/wiki/Mona_Font), but I'm no expert in this area so I'll let you guys talk over this item.



I might get some more code later, but for now it's zombie killing time. >:D
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on November 14, 2009, 10:00:25 PM
btw, found this today, maybe you'd find this useful: http://arstechnica.com/microsoft/news/2009/11/test-and-package-net-apps-for-linux-with-visual-studio-add-in.ars?utm_source=rss&utm_medium=rss&utm_campaign=rss

Actually one of the machines I tested it on run 9.04 64-bit so that's not the case. I have also tested running it with Compiz running and that worked without a problem. I was also running the same version of Mono.

After studying the config files I found out that you probably need to have these packages installed:
  • libsdl-image1.2
  • libsdl-gfx1.2-4
  • libglu1-mesa

These will probably be needed later on when fonts and sound are enabled:
  • libsdl1.2debian-all
  • libsdl-mixer1.2
  • libsdl-ttf2.0-0
  • libsmpeg0

After doing this, everything worked.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 15, 2009, 02:31:09 AM
btw, found this today, maybe you'd find this useful: http://arstechnica.com/microsoft/news/2009/11/test-and-package-net-apps-for-linux-with-visual-studio-add-in.ars?utm_source=rss&utm_medium=rss&utm_campaign=rss

Looks cool, but it sounds like something I'd need a 'nix box to take advantage of (the remote debugging and such, at least).  Plus, the downloadable version is only a trial, and I don't particularly feel like forking out a hundred bucks for it.  No offense, guys. ;)



After doing this, everything worked.

Good to hear it's working for you!





Some new progress tonight (as opposed to old, recycled progress?  I dunno :V):




Here's the updated TheEnemy.txt in it's current form:

Code: (TheEnemy.txt) [Select]
Musuu
Script[mdScript]

// TheEnemy
// Enemy boss that makes some fucking danmaku.
Boss "TheEnemy"
{
   define count;
   define move;
   define parameters;
   define num_bullets;
   define num_bullets_index;

   initialize
   {
      // image, fire_delay, movement_speed, life, evil shot life threshold
      parameters = ["reimu1.png", 30, 0.5, 150, 90];
      num_bullets = [7, 11, 5, 9, 4, 11, 8];
      num_bullets_index = 0;

      SetImage(parameters[0], false, 30);
      SetSize(18, 24);
      count = 60;
      move = parameters[2];
      UseRadians(true);

      SetLife(parameters[3]);
   }

   tick
   {
     if (GetLife() <= 0)
     {
        // Onoes I dead x__x
        DestroyObject(GetMyID());
     }

      SetX(GetX() + move);

      if (GetX() > 350)
      {
         move = 0 - parameters[2];
      };
      if (GetX() < 76)
      {
         move = parameters[2];
      };

      count = count - 1;

      // When count reaches zero, we fire a spread of bullets, and spawn a point item.
      if (count <= 0)
      {
         count = count + parameters[1];

         bullets = num_bullets[num_bullets_index];

         num_bullets_index = num_bullets_index + 1;
         if (num_bullets_index >= length(num_bullets))
         {
            num_bullets_index = 0;
         }

         increment = (pi / 2) / (bullets - 1);

         angle = 3.1415926535897932384626;

         player_id = GetPlayerID();
         if (player_id > -1)
         {
            ydiff = ObjGetY(player_id) - GetY();
            xdiff = ObjGetX(player_id) - GetX();
            if (xdiff == 0 && ydiff == 0)
            {
               // Just in case ...
               ydiff = 1;
            };
            angle = arctan2(ydiff, xdiff);
         };

         angle = angle - (increment * ((bullets - 1) / 2));
         while (bullets > 0)
         {
            FireShot01(GetX(), GetY(), angle, 2.5, "shot1.png");
            angle = angle + increment;
            bullets = bullets - 1;
         };

         if (GetLife() < parameters[4])
         {
            CreateObject("EvilShot", GetX(), GetY());
         };

         CreateObject("PointItem", GetX(), GetY());
      };
   }
}

Enemy_Shot "EvilShot"
{
   define count;
   define next_count;

   initialize
   {
      SetSize(5.5, 7.5);
      SetAngle(180);
      SetSpeed(1.5);
      count = 60;
      next_count = 90;

      // Call the internal bullet init function to ensure standard stuff is setup
      enemy_shot_init();
      SetImage("shot2.png", true, 55);
   }

   tick
   {
      count = count - 1;
      if (count <= 0)
      {
         count = next_count;
         next_count = next_count + 30;

         player_id = GetPlayerID();
         if (player_id > -1)
         {
            ydiff = ObjGetY(player_id) - GetY();
            xdiff = ObjGetX(player_id) - GetX();
            if (ydiff == 0 && xdiff == 0)
            {
               ydiff = 1;
            };
            SetAngle(arctan2(ydiff, xdiff));
         };
      };
   }
}

The array parameters simply contains some adjustable information for the script.  It's pretty much an unnecessary array, used here just to demonstrate the syntax.

The other array, num_bullets, is used to vary the number of shots fired in each spread in a repeating pattern.



With this array stuff in place, I can get to work on object enumeration - that is, getting a list of objects in the game.

The way I see this working is having a function, say EnumerateObjects, which you give the name of an object type or base type, and it returns an array of all object IDs currently active of the specified type.  For instance:

Code: (sample) [Select]
...
bullet_array = EnumerateObjects("Enemy_Shot");
i = 0;
while (i < length(bullet_array))
{
   DestroyObject(bullet_array[i]);
}
...

This sample would destroy all enemy bullets that currently exist in the game.  Note that, since a base type (Enemy_Shot) is specified, it will find all types of enemy shots, including custom ones defined as a new object type.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 15, 2009, 09:09:37 AM
Some more news from my Vista Home premium which still has been unable to run the program:

-I've added the .dlls for SDL, SdlDotNet, SDL_gfx and SDL_image to Musuu's folder, but it still doesn't work. Also I've had both the SDLDotNet runtime and Tao Framework installed for some time.

However, more importantly:

-I downloaded a C# IDE (namely SharpDevelop) and used it to compile the OpenGL tutorial code (http://cs-sdl.sourceforge.net/index.php/NeHe_1_OpenGL_Tutorial:Code) in SDLDotNet's site (the lower one with C# code, most definitely not the upper one that's in Visual Basic .NET). I changed all SetVideoMode methods to have the same parameters as in Cheese's initial config file (save for window size, since I doubt that's going to cause the error): HardwareSurfaces is true, bpp is 32 and pressing the key defined in the code (originally F1, but I changed it to left ctrl for no reason at all  ::) ) toggles between fullscreen and windowed. I can now say with near absolute certainty that the example code works and creates the resizable window it's supposed to. This concludes the proof that the computer can run both SdlDotNet and OpenGl with no major problems.

If I'm interpreting this correctly, this isolates the error to the following problems:

- Something differing in the references, although this is improbable, since I only added references for the SdlDotNet project and Tao.OpenGl, and I have both of them installed and important .dlls copied to the Musuu directory.
- Something differing in the compilation, which I cannot comment on due to my lack of experience with C# compilers (and lack of experience with C# coding in general, as this was the first C# app I've ever compiled).
- Some absolutely weird situational bug with SDL or OpenGL.

I will be moving to my XP machine that failed running Musuu due to the '.' vs ',' -problems last time soon, and thus cannot access this computer for yet another week, so I can't provide much more input on this during the next week. I'm really hoping this problem gets found and fixed soon, though.

EDIT:

Version 2 works fine on XP.

(http://img69.imageshack.us/img69/7742/someeffingdanmaku.png)

I managed to code player respawning to my player script, but it has a tiny problem: over 50% of the time I respawn into a bullet and, since I have no starting invincibility, I die. Great, just great.

Some other stuff I really miss from DMF and hope to be implemented as defaults in the future:
- The % operator (I tried it but it errored for me, so I assume it's not implemented).
- Defining images by drawing rects (making every bullet a seperate file is frustrating).
- CreateShotA, obviously.
- Visible hitbox. Dodging without one is frustrating.
- Some syntax stuff like ++.
- Effect objects and drawing functions.

However, overall, this is already excellent work. Major props for you, Cheese, and keep up the good work!

Also, another tiny suggestion: Add an additional parameter to the CreateShot functions that allows the player to specify, whether the bullet rotates according to it's angle or not (like you can do with object icons now). ZUN apparently uses this for round bullets to preserve the full graphical quality when rotation is not required, as evidently proven by Drake's BlackSquare mods. It would for example make the round bullets with thin outlines look a lot better without having to make them all objects.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 15, 2009, 09:31:10 PM
Some more news from my Vista Home premium which still has been unable to run the program:

-I've added the .dlls for SDL, SdlDotNet, SDL_gfx and SDL_image to Musuu's folder, but it still doesn't work. Also I've had both the SDLDotNet runtime and Tao Framework installed for some time.

However, more importantly:

-I downloaded a C# IDE (namely SharpDevelop) and used it to compile the OpenGL tutorial code (http://cs-sdl.sourceforge.net/index.php/NeHe_1_OpenGL_Tutorial:Code) in SDLDotNet's site (the lower one with C# code, most definitely not the upper one that's in Visual Basic .NET). I changed all SetVideoMode methods to have the same parameters as in Cheese's initial config file (save for window size, since I doubt that's going to cause the error): HardwareSurfaces is true, bpp is 32 and pressing the key defined in the code (originally F1, but I changed it to left ctrl for no reason at all  ::) ) toggles between fullscreen and windowed. I can now say with near absolute certainty that the example code works and creates the resizable window it's supposed to. This concludes the proof that the computer can run both SdlDotNet and OpenGl with no major problems.

If I'm interpreting this correctly, this isolates the error to the following problems:

- Something differing in the references, although this is improbable, since I only added references for the SdlDotNet project and Tao.OpenGl, and I have both of them installed and important .dlls copied to the Musuu directory.
- Something differing in the compilation, which I cannot comment on due to my lack of experience with C# compilers (and lack of experience with C# coding in general, as this was the first C# app I've ever compiled).
- Some absolutely weird situational bug with SDL or OpenGL.

I will be moving to my XP machine that failed running Musuu due to the '.' vs ',' -problems last time soon, and thus cannot access this computer for yet another week, so I can't provide much more input on this during the next week. I'm really hoping this problem gets found and fixed soon, though.

Good to know.  I'll have to take a look back at that code, and see what I'm doing differently.



EDIT:

Version 2 works fine on XP.

:awesome:

I managed to code player respawning to my player script, but it has a tiny problem: over 50% of the time I respawn into a bullet and, since I have no starting invincibility, I die. Great, just great.

There's no invulnerability function yet, but you could simulate it by setting the player object's size1 (first argument to SetSize) to zero, which will preclude it from collision with enemy bullets, for the duration of invulnerability.

Just like the current "player gets hit = instant dissapear", it's really just a temporary thing until the program matures more, but just letting you know ...



Some other stuff I really miss from DMF and hope to be implemented as defaults in the future:
- The % operator (I tried it but it errored for me, so I assume it's not implemented).

Really?  What was the script you used?  I thought I had it working; I'll have to look back at it.



- Defining images by drawing rects (making every bullet a seperate file is frustrating).

Right.  I'll have to get to that.



- CreateShotA, obviously.

Something similar can be done down the line.  In the meantime, you can get a similar effect by scripting a new enemy_shot object type.



- Visible hitbox. Dodging without one is frustrating.

Will be added.  In the meantime, you can get a similar effect by creating an effect object type which sticks to the player and shows the hitbox (optionally, only have it appear when focus is held - set image to "" to have it not show an image).



- Some syntax stuff like ++.

Of course.  A few things I know need to be added to the syntax:



- Effect objects and drawing functions.

Drawing functions are not in yet, but will be added in.  As far as effect objects - are you referring to actual "effect objects", as in objects used for effects?  You can create an effect object type.  On the other hand, if you're referring to the "give vertices and texture coordinates" method of drawing effects, that will come down the line.



Also, another tiny suggestion: Add an additional parameter to the CreateShot functions that allows the player to specify, whether the bullet rotates according to it's angle or not (like you can do with object icons now). ZUN apparently uses this for round bullets to preserve the full graphical quality when rotation is not required, as evidently proven by Drake's BlackSquare mods. It would for example make the round bullets with thin outlines look a lot better without having to make them all objects.

Huh.  I didn't know ZUN did that.



However, overall, this is already excellent work. Major props for you, Cheese, and keep up the good work!

Thanks for the feedback!
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 16, 2009, 06:37:09 AM
There's no invulnerability function yet, but you could simulate it by setting the player object's size1 (first argument to SetSize) to zero, which will preclude it from collision with enemy bullets, for the duration of invulnerability.

Works! Now at least I don't have to worry about dying on the first second!

Really?  What was the script you used?  I thought I had it working; I'll have to look back at it.

Wait, it's supposed to work? Let me try again...

...D'OH. if(count%5 == 0) errors, BUT if(count % 5 == 0) works! Therefore this goes along with those a-b failing and a - b working problems...



Something similar can be done down the line.  In the meantime, you can get a similar effect by scripting a new enemy_shot object type.

This would be so much more convenient if shot objects accepted parameters other than X and Y (hint hint...)

Huh.  I didn't know ZUN did that.

(http://img43.imageshack.us/img43/6010/th000.png)

Notice that the circular bullet squares aren't rotated at all, even though they all obviously can't be going into the same direction. Nevermind the fact that I'm just getting owned by an invisible bullet in the picture.

And just to prove my point, the difference between rotating (right) and not rotating (left) is the following:

(http://img190.imageshack.us/img190/1986/bullcompare.png)
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on November 16, 2009, 07:47:24 AM
Round bullets ( with ring, without ring and the smaller ones ) quality make me rage in Danmakufu when inserting ZUN original shotsheets. Serious rage.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 17, 2009, 01:03:13 AM
Wait, it's supposed to work? Let me try again...

...D'OH. if(count%5 == 0) errors, BUT if(count % 5 == 0) works! Therefore this goes along with those a-b failing and a - b working problems...

... dammit.

I'll look into this.

EDIT:
I did a quick test, and it looks like the two give identical results:

Code: (test script) [Select]
// TheEnemy
// Enemy boss that makes some fucking danmaku.
Boss "TheEnemy"
{
   define count;
   define move;

   initialize
   {
      if(count%5 == 0)
      {
         count = stuff%50;
      };
   }

   tick
   {
      if(count%5 == 0)
      {
         count = stuff%50;
      };
   }

Code: (generated mdBase) [Select]
Object_Type Boss TheEnemy
Script initialize
mod !0, @count, 5
equ !1, !0, 0
not !2, !1
jmp !2, "Label0"
mod !0, !stuff, 50
set @count, !0
Label0:
Script tick
mod !0, @count, 5
equ !1, !0, 0
not !2, !1
jmp !2, "Label1"
mod !0, !stuff, 50
set @count, !0
Label1:

As seen above, both with and without spaces by the %, the same mdBase is generated.  Could you please provide some more details on the error you saw and, if possible, the full script you were using?



This would be so much more convenient if shot objects accepted parameters other than X and Y (hint hint...)

You're saying you want to pass in additional arguments to an object you're creating, right (in this case, a shot)?  The messages idea I had a few posts back could cover this, and/or I could add a simple functionality to pass an additional arg when creating an object (give it an array if you need multiple parameters).

Finally, there's the idea I had above of accessing object parameters directly.



Notice that the circular bullet squares aren't rotated at all, even though they all obviously can't be going into the same direction.

I see.  Easy addition.



Round bullets ( with ring, without ring and the smaller ones ) quality make me rage in Danmakufu when inserting ZUN original shotsheets. Serious rage.

Hopefully your rage will be unnecessary when working in Musuu no Danmaku. ;)




EDIT:

By the way, did I mention the next few weeks are totally screwball for me?  In a good way, though ... less family crap than usual.  No guarentees for everyday updates, but for today some progress:

Object listing.

Use the new command GetObjectList to get a list of objects of a specified object type or base type.  For instance,
objects = GetObjectList("Enemy_Shot");
will set the variable objects to a list of the ID of every enemy shot that currently exists.

This can be put to use quite easily, such as the following snippet I just added to TheEnemy.txt:

Code: [Select]
      if (GetLife() <= 0)
      {
         // Onoes I dead x__x
         DestroyObject(GetMyID());

         objects = GetObjectList("Enemy_Shot");
         i = 0;
         while (i < length(objects))
         {
            DestroyObject(objects[i]);
            i = i + 1;
         };
      };

What this does is, when the boss runs out of life, no longer does it just destroy itself, it also removes all of the on-screen enemy shots.
Of course, in the long run, this will be included in the built-in default stuff for boss scripts, and it'll spawn those stupid little score items.

This listing can also be used for many other things.  For instance, if you wanted to imitate Cirno's Perfect Freeze, you could, when the time came to freeze everything, just get a list of all of the onscreen bullets and adjust their info as needed (basically doable now, but you'd need to delete and respawn each bullet 'cause there isn't yet an easy way to adjust another object's parameters).

Also, if you need to target an enemy/boss for a homing shot, just get the list and select an ID.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 17, 2009, 06:04:21 AM
As seen above, both with and without spaces by the %, the same mdBase is generated.  Could you please provide some more details on the error you saw and, if possible, the full script you were using?

Okay, just wait while I switch my script back to...

...Wait what the heck! It works?!?! While I was positive it errored yesterday?!?!

Well, apparently you were right after all, unless it was some crazy situational glitch. However, since I apparently can't reproduce my error, forget it :-[.

You're saying you want to pass in additional arguments to an object you're creating, right (in this case, a shot)?  The messages idea I had a few posts back could cover this, and/or I could add a simple functionality to pass an additional arg when creating an object (give it an array if you need multiple parameters).

Finally, there's the idea I had above of accessing object parameters directly.

You're right, messages would solve this quite well.




Object listing.

Another major YESSSSSS addition that I have actually noticed the lack of in Danmakufu before. I was once coding a character whose focused bomb was meant to slow down all bullets within a certain radius around the point where the bomb was used. However, as I intended the char to be used in generic scripts instead of a game I was making, CommonData and object bullets was out of question. This, however, was exactly the function I was looking for: Get a list of bullets, save the location of those within a certain radius and move them backwards a certain portion of the distance they traveled next frame (outright slowing them would risk conflictions if the enemy script changed their speed while they would be in the area). However, due to DMF lacking this, I had to scrap my idea. Therefore, this is already a welcome addition.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on November 17, 2009, 05:06:23 PM
Checking in and happy with what I'm seeing~

I echo the above YESSSSSS at Object Listing. x3

The other updates are fine, too. =P

Keep on keeping on, Cheese.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 19, 2009, 02:47:43 AM
Some more stuff tonight:

Title: Re: A replacement for Danmakufu?
Post by: Lishy1 on November 19, 2009, 02:52:31 AM
Maybe this is a lot to ask, but there's no possibility of a converter from Danmakufu to this.. Right?
Title: Re: A replacement for Danmakufu?
Post by: Helepolis on November 19, 2009, 08:24:50 AM
Object listening is like  OOP right? To modify the object's behaviour once it is spawned. Like

fire object bullet --> modify it's behaviour freely whenever you by   objectbullet.changespeed(3) or something?


I should get my eyes checked.  Object listing  >.<
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 20, 2009, 04:49:47 AM
Maybe this is a lot to ask, but there's no possibility of a converter from Danmakufu to this.. Right?

This was discussed way long ago ... while it's certainly possible, it would be hell and a half to get anything other than very basic scripts converted automatically.



Object listening is like  OOP right? To modify the object's behaviour once it is spawned. Like

fire object bullet --> modify it's behaviour freely whenever you by   objectbullet.changespeed(3) or something?


Funny, you should mention this.  I had a couple ideas that are like this (posted about them a few days ago), and I just finished implementing a major piece:


Object Parameters.

You can now access certain parameters of any object you have the ID of simply by using the new -> operator.  For instance:

Code: (sample) [Select]
pid = GetPlayerID();
angle_to_player = arctan2(pid->y - GetY(), pid->x - GetX());

Right now, there are only four properties available: x, y, angle, and speed, but adding more as needed is relatively simple in the code.


You can also set object properties with this syntax:

Code: [Select]
shot_array = GetObjectList("Enemy_Shot");
let i = 0;
while (i < length(shot_array))
{
   obj_id = shot_array[i];
   obj_id->angle = obj_id->angle + 180;
   i++;
}

This code will make all existing enemy bullets do an instant turn-around.

NOTE:
Currently, in order to assign to a property, you need to have the object's ID stored in a variable directly.  I do want to add in assigning to an ID in an array (for instance, shot_array->speed = 5;), but for now that isn't allowed.

I also need to fine-tune the syntax of -> in expressions as well, since right now you can do stupid things like
what = "I'm a string lol" -> x;

Title: Re: A replacement for Danmakufu?
Post by: Theme97 on November 20, 2009, 08:26:41 AM
Hmm. Ten days late and my first post, but

I know people want me to get the actual code posted up so people can criticize my sucky organization skillshelp out ... the first question is, of course, where do we keep it?  I'm not too familiar with these things, so suggestions are welcome.

Second question is when does it get posted?  I could post it this coming weekend if you guys really want, but be warned that the code is a freaking mess (by my standards, anyways).

Third, call me a jerk or whatnot, but I do want to retain some "control" over the codebase until it gets more complete.  Feel free to argue with me on this one; I might change my mind.

Let me introduce you to revision control systems (one of these is called Subversion (http://en.wikipedia.org/wiki/Subversion_(software)), and I'll be speaking based on experience with SVN, but I think Mercurial (http://en.wikipedia.org/wiki/Mercurial_(software)) is gaining popularity). Revision control manages a repository of files. Every change someone makes gets a unique revision identifier (e.g., initial set is revision 0 and the next change is revision 1). Each revision has metadata such as timestamp, author (if you choose to grant access to a few other people), and comments.

Doing this has several advantages; revisions can be compared, restored, and even merged. You can step back and check which revision introduced a bug, and with a diff you can see exactly what lines were changed. Or perhaps you can have two people work independently on the same program but doing different tasks; when they're done, they can easily merge their changes. Additionally, you can create a simple changelog just by glancing through the comments in the revision log.

Sites such as Google Code (http://code.google.com/projecthosting/) and SourceForge (http://sourceforge.net/) can provide a repository for you while allowing public users read-only access to it. If you choose not to go the version control route, I believe both of these services offer file uploads as well, so distributing the source .zip is a viable alternative.

Anyway, collaborative editing is extremely powerful. Things get done better and faster due to the combined input of several minds; improvements can be made thanks to the individual knowledge and experience each coder has, so if you do share the code with us soon, I hope to contribute some patches and help you out with the project.

... once I learn C#, that is.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 20, 2009, 10:40:40 AM
Hmm. Ten days late and my first post, but

Let me introduce you to revision control systems (one of these is called Subversion (http://en.wikipedia.org/wiki/Subversion_(software)), and I'll be speaking based on experience with SVN, but I think Mercurial (http://en.wikipedia.org/wiki/Mercurial_(software)) is gaining popularity). Revision control manages a repository of files. Every change someone makes gets a unique revision identifier (e.g., initial set is revision 0 and the next change is revision 1). Each revision has metadata such as timestamp, author (if you choose to grant access to a few other people), and comments.

Doing this has several advantages; revisions can be compared, restored, and even merged. You can step back and check which revision introduced a bug, and with a diff you can see exactly what lines were changed. Or perhaps you can have two people work independently on the same program but doing different tasks; when they're done, they can easily merge their changes. Additionally, you can create a simple changelog just by glancing through the comments in the revision log.

Sites such as Google Code (http://code.google.com/projecthosting/) and SourceForge (http://sourceforge.net/) can provide a repository for you while allowing public users read-only access to it. If you choose not to go the version control route, I believe both of these services offer file uploads as well, so distributing the source .zip is a viable alternative.

Anyway, collaborative editing is extremely powerful. Things get done better and faster due to the combined input of several minds; improvements can be made thanks to the individual knowledge and experience each coder has, so if you do share the code with us soon, I hope to contribute some patches and help you out with the project.

Thanks for the info. I'm already pretty familiar with version control and such in general; I was more asking for opinions on which site would be best for this project.  SourceForge and Google Code were two ones I was looking at, but I'm not familiar with the particular features of each, so I was wondering what people thought.

I definitely agree that getting this under version control is a good idea, and I have some experience with SVN so that would probably be my first choice.



... once I learn C#, that is.

That's easy.  Just picture the bastard child of C++ and Java, and you're already 90% of the way there. :V
(serious: it's a piece of cake to pick up if you know either)



What the hell am I still doing up?  It's 0530am!  Stupid insomnia.  At least I took the day off of work.
Title: Re: A replacement for Danmakufu?
Post by: Furu on November 20, 2009, 06:31:52 PM
I suggests using the . (as in id.x) instead of -> because that's used in some object-oriented languages I use so I'm pretty used to it and it's faster to type.
Also, I think it's better to use something like id.GetAngle() instead of id.angle to get the angle and use id.variable to access a local variable instead.

And about using arrays and this, using a Get command with an object list might not work that well but at least Set might work.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 20, 2009, 07:55:49 PM
That's easy.  Just picture the bastard child of C++ and Java, and you're already 90% of the way there. :V
(serious: it's a piece of cake to pick up if you know either)

Excellent. If what you just said holds true I should be able to learn C# easily since I already know Java. I may be of help in programming after all (altough it's still only a possibility, since my code may be quite inefficient at times, and I too suffer from the worldwide problem known as laziness).

Concerning Furu's '.' vs '->' -argument, I'm more used to the '.' but can adapt to either style, really.

However, I'd like to point out something I noticed: Your image rotation method has some problems going with it. The easiest way to point it out is a comparison: Red arrowhead-like bullets that you possibly saw in my previous picture in both Musuu and Danmakufu side by side:

(http://img101.imageshack.us/img101/6250/redshotcomparemusuu.png)(http://img265.imageshack.us/img265/8207/redshotcomparednh.png)

Notice the outlines of the rotated red bullets. While both have some incosistencies due to rotation, Musuu's bullets have a much more broken outline than DMF's. I don't exactly know what would cause this since I have little knowledge on rotation algorithms, but this risks a tremendous drop in visual quality when moving from DMF to Musuu, and therefore I really suggest you to look at the issue at some point of time.
Title: Re: A replacement for Danmakufu?
Post by: Naut on November 20, 2009, 08:13:35 PM
What the hell am I still doing up?  It's 0530am!  Stupid insomnia.  At least I took the day off of work.

Welcome to Rika's Garage, brother.

Notice the outlines of the rotated red bullets. While both have some incosistencies due to rotation, Musuu's bullets have a much more broken outline than DMF's.

The bullets are not blended yet, so they have a solid outline as opposed to a semi-transparent or "blended" outline (which makes the bullet look smoother). I assume this has yet to be added to Musuu.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 20, 2009, 08:45:37 PM
I suggests using the . (as in id.x) instead of -> because that's used in some object-oriented languages I use so I'm pretty used to it and it's faster to type.
Also, I think it's better to use something like id.GetAngle() instead of id.angle to get the angle and use id.variable to access a local variable instead.

And about using arrays and this, using a Get command with an object list might not work that well but at least Set might work.

I used -> because I thought of it more like pointers in C.  Plus I think it's a bit more clear syntax-wise.

As far as accessing object variables (not locals - those are only within the scope of the current function.  Sorry, semantics.) of other objects, I don't really think this is a good idea.  You're relying on the underlying structure of one object from outside that object - not very good practice, generally.  You can pass values as such using global variables, though, and I do plan on allowing object types to define what I refer to as 'messages', which are basically functions that can be called from other objects.  The advantage here is that you can't utterly break another object's script, unless that other object has script issues to begin with, since it's the target object that defines the script to process the data.


As usual, feel free to disagree and say why.  I'm open to debate on the matter.



:image:

... is that a background image?  Also it looks like you gave :awesome: a nose. :V



The bullets are not blended yet, so they have a solid outline as opposed to a semi-transparent or "blended" outline (which makes the bullet look smoother). I assume this has yet to be added to Musuu.

True, right now there isn't any special blending or anything with the graphics.  Not sure what particular effects Danmakufu uses, but it looks like at the very least some antialiasing is going on there.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 20, 2009, 09:01:22 PM
True, right now there isn't any special blending or anything with the graphics.  Not sure what particular effects Danmakufu uses, but it looks like at the very least some antialiasing is going on there.

Okay, good to know that you at least have some idea on how to fix this and are planning on doing so sometime.

... is that a background image?  Also it looks like you gave :awesome: a nose. :V

Yes, it's a spell bg for my currently-in-planning game I'm going to make with Musuu I implemented for the sake of testing and having a background. And it's not a nose, it's a (quickly drawn excuse of a) hitbox.

Oh, and are there any random variable functions implemented yet (such as rand(min,max) or rand_int(min,max)). If not, take this as a some sort of a reminder...
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on November 20, 2009, 11:41:13 PM
I was more asking for opinions on which site would be best for this project.  SourceForge and Google Code were two ones I was looking at, but I'm not familiar with the particular features of each, so I was wondering what people thought.

I definitely agree that getting this under version control is a good idea, and I have some experience with SVN so that would probably be my first choice.

I haven't tried SourceForge yet because it requires your project to be approved before it can be added, but Google Code is pretty easy to set up and it includes a downloads page, Wiki, issue tracking, and public source viewing, any of which can be hidden if you want.

And then there are Atom feeds for several kinds of project stuff. They do require you to select a code license, but BSD, LGPL, and MIT are selectable, so that shouldn't be a problem.

Couldn't hurt to give it a shot?it's Google, after all. Looks like Google and SourceForge are the only popular hosts with unlimited space and a code browser, so...

Just picture the bastard child of C++ and Java, and you're already 90% of the way there. :V
(serious: it's a piece of cake to pick up if you know either)

What the hell am I still doing up?  It's 0530am!  Stupid insomnia.  At least I took the day off of work.

Oh, then hooray!

Now get that code up so I can destroy it.

(Also, midnight coding is <3.)

Oh, and are there any random variable functions implemented yet (such as rand(min,max) or rand_int(min,max)). If not, take this as a some sort of a reminder...

I assume the Mersenne Twister would be implemented, Nuclear Cheese?
Title: Re: A replacement for Danmakufu?
Post by: anonl on November 21, 2009, 12:21:12 AM
True, right now there isn't any special blending or anything with the graphics.  Not sure what particular effects Danmakufu uses, but it looks like at the very least some antialiasing is going on there.

It's just linear filtering:
Code: [Select]
glBindTexture(GL.GL_TEXTURE_2D, texId);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 21, 2009, 02:22:50 AM
Yes, it's a spell bg for my currently-in-planning game I'm going to make with Musuu I implemented for the sake of testing and having a background. And it's not a nose, it's a (quickly drawn excuse of a) hitbox.

Cool with the BG.  In the long run there should be functions that'll make setting up background and such easier ... I'm assuming for now you're using an Effect object with an unusually large image?

And, yeah, I know it's the hitbox.  Just sayin', the position makes it look like a nose. :yukkuri:



Oh, and are there any random variable functions implemented yet (such as rand(min,max) or rand_int(min,max)). If not, take this as a some sort of a reminder...

I scripted NTSD.  Do you seriously think I'd leave out random numbers? :V



I haven't tried SourceForge yet because it requires your project to be approved before it can be added, but Google Code is pretty easy to set up and it includes a downloads page, Wiki, issue tracking, and public source viewing, any of which can be hidden if you want.

And then there are Atom feeds for several kinds of project stuff. They do require you to select a code license, but BSD, LGPL, and MIT are selectable, so that shouldn't be a problem.

Couldn't hurt to give it a shot?it's Google, after all. Looks like Google and SourceForge are the only popular hosts with unlimited space and a code browser, so...

(see below)



Oh, then hooray!

Now get that code up so I can destroy it.

Once you see how much of a mess it is, you'll be running for the hills. >:D
(not really)
(I hope)



(Also, midnight coding is <3.)

Wasn't even coding.  Was just, well, not getting to sleep.
Also, I think 5:30 is a bit late to call 'midnight' ... might just be me, though.



I assume the Mersenne Twister would be implemented, Nuclear Cheese?

You know, most people would probably be satisfied with System.Random (http://msdn.microsoft.com/en-us/library/system.random%28VS.80%29.aspx) ...



It's just linear filtering:
Code: [Select]
glBindTexture(GL.GL_TEXTURE_2D, texId);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);


Ah, well then that makes it easy.  Right now I have it just set to GL_NEAREST.
(and I don't think I set it on each texture, 'cause I'm an idiot)




So people, what's up? (http://code.google.com/p/musuu-no-danmaku/)



Source is viewable from here.  Have fun being horrified at my shitty organization and plethora of "#warning TODO"s. ;)

I'm busy (http://www.dustloop.com/forums/showthread.php?t=7492) tomorrow, so don't expect much.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 21, 2009, 06:06:52 AM
Random thought: how do you think pattern-functions will handle zeroes as an input-value (i.e. if you feed it a variable for the number-of-bullets which evaluates to zero)? I'm imagining something like, a setup for multiple difficulty-levels which uses multipliers for various things so that you only have to make one script per difficulty-level, and you want one particular bit to not appear on Easy, so you set it up with modifiers so that the "number of bullets" is zero when the numbers are that of Easy ...)
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 21, 2009, 10:04:23 AM
Cool with the BG.  In the long run there should be functions that'll make setting up background and such easier ... I'm assuming for now you're using an Effect object with an unusually large image?

It's actually three images (First the main background that rotates at the back, then the gradient from black to transparent that makes the lower portion of the screen darker, and lastly the bubbles that float upwards in a sine-wave like motion), but yes, correct guess.

So people, what's up? (http://code.google.com/p/musuu-no-danmaku/)



Source is viewable from here.  Have fun being horrified at my shitty organization and plethora of "#warning TODO"s. ;)

Actually, compared to what I was expecting it's actually quite readable. The only real problem (aside from not having the necessary skills to read and interpret .g files such as mdScript_to_mdBase.g) I have interpreting it is that I have no idea where you have defined the MDScript functions.

Also, the amount of code really shows how much input you have put into this. Great work!
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 22, 2009, 09:41:13 PM
Random thought: how do you think pattern-functions will handle zeroes as an input-value (i.e. if you feed it a variable for the number-of-bullets which evaluates to zero)? I'm imagining something like, a setup for multiple difficulty-levels which uses multipliers for various things so that you only have to make one script per difficulty-level, and you want one particular bit to not appear on Easy, so you set it up with modifiers so that the "number of bullets" is zero when the numbers are that of Easy ...)

... could you please clarify what you mean with "pattern-functions"?

It sounds like you're expecting functions built-in to the program which will fire off certain, predefined patterns.  I didn't have any plans for such things (yet).



Actually, compared to what I was expecting it's actually quite readable. The only real problem (aside from not having the necessary skills to read and interpret .g files such as mdScript_to_mdBase.g) I have interpreting it is that I have no idea where you have defined the MDScript functions.

The functions that read mdScript are built from the .g file.

Specifically, you use ANTLR3 to 'comple' the .g file into a couple .cs files (a lexer and a parser).  These code files interpret the mdScript scripts and convert them into an mdBase equivalent, which is then read by the mdBase parser code to covert it to the internal script format.
(mdBase is really just a text representation of the internal format, fyi)

I didn't post the code files that ANTLR produces because it would be redundant, and the .g file is the original source for it.


If you want to understand the grammar (.g file) more, you can try looking at this (http://www.antlr.org/wiki/display/ANTLR3/Quick+Starter+on+Parser+Grammars+-+No+Past+Experience+Required) or this (http://www.antlr.org/wiki/display/ANTLR3/Five+minute+introduction+to+ANTLR+3).
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 23, 2009, 12:24:18 AM
Never mind that, then. |3
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 25, 2009, 02:03:53 AM
Quick update tonight:

Title: Re: A replacement for Danmakufu?
Post by: KomeijiKoishi on November 25, 2009, 10:30:31 AM
Two questions:

1. How can I make some buttons not work while using a script (specificly Esc, Ctrl, Alt, F4, Del, Windows)
2. How can I make it look like the final boss in Blue Dream?

EDIT: Just found out that I was posting in the wrong thread. I shouldn't visit this forum while I'm in school.
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on November 25, 2009, 12:23:44 PM
Well, I figured I wouldn't bother with trying to figure out how to write new stuff but I'll settle for dealing with bugs. I think I've got the hang of ANTLR, so I just need to get Mono ready for some testing and see if I can get negatives in the grammar if you're not already working on that.

1. How can I make some buttons not work while using a script (specificly Esc, Ctrl, Alt, F4, Del, Windows)

This sounds rather exploitable?mainly the blocking of Alt+F4 and Ctrl+Alt+Del. Hooking the Windows button makes sense, and I suppose Escape as well, but I don't think preventing the user from killing the program is a good idea. If you feel the need to block those, you might just be griefing the player.

Up to Nuclear Cheese, though.



Well, finally got it to compile and run after tons of trial and error. I think there was something in the latest TheEnemy.txt that would error out with the updated parser.

EDIT: Hooray, got a patch for you. I'll upload it in about half an hour on the issue you started since I think it solves the negation problem.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 26, 2009, 06:22:17 AM
This sounds rather exploitable?mainly the blocking of Alt+F4 and Ctrl+Alt+Del. Hooking the Windows button makes sense, and I suppose Escape as well, but I don't think preventing the user from killing the program is a good idea. If you feel the need to block those, you might just be griefing the player.

Up to Nuclear Cheese, though.

Generally, disabling system keys like that is a bad idea in my book.  You want them enabled so that, should something break in the program (like that would ever happen :V), the user can still access the system to kill the program (especially holds for when running fullscreen).



Well, finally got it to compile and run after tons of trial and error. I think there was something in the latest TheEnemy.txt that would error out with the updated parser.

EDIT: Hooray, got a patch for you. I'll upload it in about half an hour on the issue you started since I think it solves the negation problem.

I saw your patch on Google Code.  The += and -= work great (save for not being applicable to parameters yet).

Your negation fix was a bit off, but I patched it up.

Good job on this, though.



Hmm ... I should probably post up some reference material for mdBase on the wiki over there, so that in the future developers will be able to understand what the hell all that nonsense is.

Also, I'm gonna go post some new issues/enhancements in the list, mainly coming from my own local "todo" list.
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on November 26, 2009, 08:42:56 AM
  • When creating the mdBase command for the negation, you forgot to get a new variable name for the result.  The way you had it, "stuff = -count" would end up storing -count back to count.
  • More of an optimization than anything else, but the mdBase command not will negate numbers.  It should be a bit faster than mul, since it does direct negation rather than a multiplication.
  • The original issue was that "count-1" broke, since the parser was getting confused and thinking we meant "-1" as a number.  With your addition of general negation, though, I could pull the negative sign off of the definition for the number literal.  We end up having an extra operation for negative constants, but it should all work correctly now.

Good job on this, though.

Ah, I see. Thanks for the input; I think I'm starting to get at least the script-parsing part of it so far. I've only done high-level programming so mdBase is pretty new to me.

Hmm ... I should probably post up some reference material for mdBase on the wiki over there, so that in the future developers will be able to understand what the hell all that nonsense is.

Also, I'm gonna go post some new issues/enhancements in the list, mainly coming from my own local "todo" list.

Well, I've got a weekend to kill and it's not worth coding for TF2 when you can't play it so it looks like I'm stuck here.

Can't wait to make your code worse with my own.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 26, 2009, 04:41:55 PM
Oh yeah -- how's the scoreing system going to be handled, as far as difficulty-level goes? I'm thinking of if the scripter wanted to make custom difficulty-levels, multidimensional difficulty, etc. I suggest simply storing the difficulty as a string in the score-file, so that you could, um, do whatever you wanted, really. (In the "multidimensional difficulty" example, you could store it as "Speed:"+speedVariable+" Density:"+densityVariable ... or, um, however you're concatenating strings)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 27, 2009, 07:24:52 AM
Ah, I see. Thanks for the input; I think I'm starting to get at least the script-parsing part of it so far. I've only done high-level programming so mdBase is pretty new to me.

Well, I've got a weekend to kill and it's not worth coding for TF2 when you can't play it so it looks like I'm stuck here.

Can't wait to make your code worse with my own.

Theme ... you appear to have lots of free time.

For those not following the Google Code page, while I was busy eating dead birds with family, Theme has, in the past day or so alone, ...

I made a couple slight changes to your input configuration code.  Mainly, I changed its behavior on an unknown key string, such that it should not reassign the input and instead write a warning to the logfile.


I haven't gotten the chance to look at your other, partial changes yet.



I'll be busy tomorrow too, but tomorrow night or the weekend I should be up for getting more done myself.



Theme, fyi - the "branches" thing ...
When you're making code changes that are going to be reviewed, it expects you to branch the source (so you're not editing the mainline while working on the change).  Once the change is completed and reviewed, the changes made on the branch are merged back into the mainline.

I'm not sure how to branch files in SVN, but I'm sure it's not too hard.  You'll need write access to the repository, though (which I should probably just give you, since you seem to be doing quite well with this.  Pardon my stupid, overly 'protective' personality ... :V).



Oh yeah -- how's the scoreing system going to be handled, as far as difficulty-level goes? I'm thinking of if the scripter wanted to make custom difficulty-levels, multidimensional difficulty, etc. I suggest simply storing the difficulty as a string in the score-file, so that you could, um, do whatever you wanted, really. (In the "multidimensional difficulty" example, you could store it as "Speed:"+speedVariable+" Density:"+densityVariable ... or, um, however you're concatenating strings)

Wouldn't this be handled by the scripts themselves?  Or are you looking to add in some more management to scoring?
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on November 27, 2009, 07:59:44 AM
Theme ... you appear to have lots of free time.

... while I was busy eating dead birds with family, ...

Why yes, yes I do. The bird-eating festivities only during dinner time for us, so that gives me way too much time in the morning.

I'm also really interested in this project, so yeah...

started work on two enhancement issues

I hope you're talking about mdScript and not the collision abstraction because there is no way I'm going to touch that.

I made a couple slight changes to your input configuration code.  Mainly, I changed its behavior on an unknown key string, such that it should not reassign the input and instead write a warning to the logfile.

Makes sense.

Theme, fyi - the "branches" thing ...
When you're making code changes that are going to be reviewed, it expects you to branch the source (so you're not editing the mainline while working on the change).  Once the change is completed and reviewed, the changes made on the branch are merged back into the mainline.

I'm not sure how to branch files in SVN, but I'm sure it's not too hard.  You'll need write access to the repository, though (which I should probably just give you, since you seem to be doing quite well with this.  Pardon my stupid, overly 'protective' personality ... :V).

Pardon my C#/ANTLR noobness.

Anyway, since I haven't worked much with SVN / code repositories and don't know much about branching and tagging, would we just be keeping one branch for me, then I submit it for code review and you make additional changes before merging?

As for how to branch,
Code: [Select]
svn copy trunk branches/theme97


EDIT: For fonts, Mona looked best, so it has my vote.

(http://i48.tinypic.com/28h26vq.png)

Speaking of that, what library are we going to use to render text? I don't think Tao includes font rendering and I'm a bit confused on what we're currently limited to.

EDIT 2: Oh, SDL_ttf?

EDIT 3: Or ... is it possible already? Well, now I'm thoroughly confused, so I guess fonts are your job too.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 27, 2009, 06:33:24 PM
I dunno, you mentioned that scoring would be handled by MnD, and I want to know what it would put for "difficulty level" or whatever.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 29, 2009, 03:01:02 AM
I dunno, you mentioned that scoring would be handled by MnD, and I want to know what it would put for "difficulty level" or whatever.

The game will keep track of the player's score (as in, keep the value), but I don't remember saying the program would handle the specifics of how things were scored - there's way too much room for variety there.

My current understanding was that scripts would be setting score values on things, as well as difficulty levels.  Menu scripts will allow the selection of difficulty levels, with the selection most likely being stored in a global variable that would be read by the individual game entities which would then set their scoring appropriately.

Feel free to suggest other idea, though.



Why yes, yes I do. The bird-eating festivities only during dinner time for us, so that gives me way too much time in the morning.

Morning?  What the hell is that?
(fun fact: I didn't get out of bed until almost 6pm today.  Too bad I need to adjust back to 7am for work days >__>).



EDIT: For fonts, Mona looked best, so it has my vote.

(http://i48.tinypic.com/28h26vq.png)

Speaking of that, what library are we going to use to render text? I don't think Tao includes font rendering and I'm a bit confused on what we're currently limited to.

EDIT 2: Oh, SDL_ttf?

EDIT 3: Or ... is it possible already? Well, now I'm thoroughly confused, so I guess fonts are your job too.

My current plan is to use the Tao Framework's mapping of FreeType.  I still need to actually look into its workings and figure out how to use it, but from a quick glace it does look promising.


Theme -

Looking at your changes for the add enhancements, it looks good for the most part, but there's one part that I think will be an issue.

When you append/whatever to an array, it looks like you're using the List<Value> pointer that is stored for the value itself.  This is a problem since it would be re-modifying the original stored value, as well (since Lists are classes and, thus, kept as pointers).  You should make a copy of the list before adding/removing elements, so that the original is not modified.  In all honesty, I probably missed it in a couple points myself with the initial implementation, now that I think about it.


For your mdScript enhancement issue - it probably does make sense to separate out neg from not.  However, if we do that, then there is no reason to keep the case for numbers on not.  It looks like you're treating Numbers as Booleans (much like bools in C/C++ are actually ints), but that's not how things are in Musuu no Danmaku, and in C#.

Also, please be careful not to go too far out of the original scope of your issues.  While it's fine to fix typos or other small things, putting too much extra content in an issue leads to administrative issues down the line - there's more 'bulk' on the one issue, and the changes made don't line up with the original description, which can make it harder to find when things were done.  If you see another thing that needs to be done, as long as it isn't critical to what you're working, it's usually best to write a new issue for it.  Also, in the first post of an item, please give a description of what will be done in the item.
Speaking of which, I've added an 'enhancement' template for issues.

btw - that note you made about ANTLR errors being off by 2 lines, that's because right now the program reads the header lines from the file, and then passes the remainder of the file to ANTLR.


And, Theme, I am thinking of giving you dev rights on the project.  If I do, though, I will ask that you follow the following guidelines (this applies for anyone else who wants to work actively on the source):

Of course, everyone makes mistakes, so I'm not expecting people to be perfect in regard to these items (not like I am to begin with :V).  But generally following these guidelines will hopefully keep the mainline source clean and working.



Some new stuff in the program:


Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on November 29, 2009, 03:10:26 AM
Well, I was thinking it would be helpful to store more than just "a number" for the score. I mean, okay, if the script did allow multiple difficulty levels, how would the score get stored? Would it store them in separate score-lists somehow, would it display the difficulty and player-character, or what?
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on November 29, 2009, 03:25:37 AM
My current plan is to use the Tao Framework's mapping of FreeType.  I still need to actually look into its workings and figure out how to use it, but from a quick glace it does look promising

But FreeType doesn't render; it's only provides an interface.

It looks like you're treating Numbers as Booleans (much like bools in C/C++ are actually ints), but that's not how things are in Musuu no Danmaku, and in C#.

Oh, crap, I forgot ! works only on bools in C#. I'm too used to using the hackish "if (!counter)" in other languages.

Also, please be careful not to go too far out of the original scope of your issues. [...] If you see another thing that needs to be done, as long as it isn't critical to what you're working, it's usually best to write a new issue for it.  Also, in the first post of an item, please give a description of what will be done in the item.

All right.

btw - that note you made about ANTLR errors being off by 2 lines, that's because right now the program reads the header lines from the file, and then passes the remainder of the file to ANTLR.

Yeah, I was trying to see if I can get it to pretend to read two extra newlines or something but then gave up and decided to leave that to you.

And, Theme, I am thinking of giving you dev rights on the project.  If I do, though, I will ask that you follow the following guidelines:

No problem; I've just been a little lenient with my patches because I figured you could help out since I'm just getting started.

Anyway, I'm getting a much better idea of how everything works, so hopefully my code's going to improve.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on November 29, 2009, 06:26:24 PM
So, after having done a bunch of other stuff I finally had time to see the current situation of the program. After some fiddling around with SharpDevelop and ANTLRWorks I managed to get the source code I checked out from the repository working:

First of all, was the play field size stealth changed while I was away, since I had to scale up my background images? Or does this have something to do with the non-power-of-two textures update?

Secondly:
  • Smooth texturing (PT8 - should make what you pointed out look better)

Excellent! I can already see the difference!

Also, some more points:
- Could you please rename arctan2 as just atan2, or at least add that in as an alternative form for the same function (like in DMF you can use either truncate or trunc). Not having to write two more letters every time you need the angle between two objects should be enough reason.

- Also, I did some testing with the non-rotating-image bullets. Specifically, I added the following function CreateShot01S (S is supposed to stand for stationary, as opposed to rotating, but I'm sure there are better names out there) that's exactly the same as CreateShot01, except the bullets don't rotate. Function code is the following (altough I guess figuring it out would have been a trivial matter, since most of it is direct copypasta from CreateShot01):
Code: [Select]
            function = new Script.Instruction[7];
            function[0] = mdBaseReader.Parse_Instruction_Line("obj_create !id, \"BasicEnemyShot\", !arg1, !arg2");
            function[1] = mdBaseReader.Parse_Instruction_Line("obj_set_angle !id, !arg3");
            function[2] = mdBaseReader.Parse_Instruction_Line("obj_set_speed !id, !arg4");
            function[3] = mdBaseReader.Parse_Instruction_Line("obj_set_size !id, 5.5, 7.5");
            function[4] = mdBaseReader.Parse_Instruction_Line("obj_set_image !id, !arg5");
            function[5] = mdBaseReader.Parse_Instruction_Line("ret !id");
            function[6] = mdBaseReader.Parse_Instruction_Line("obj_img_rotate !id, false");
            function_list.Add("FireShot01S", new Script(function));

I did some testing and was extremely pleased with the results, and therefore suggest the implementation of this or some alternate form of the same functionality.

As an example of the difference, have a comparison. Round bullets are spawned with different functions (I'm unfortunately not stupid enough to not rotate the arrow bullets):
CreateShot01
(http://img30.imageshack.us/img30/3930/musubulletr.png)
CreateShot01S
(http://img30.imageshack.us/img30/5998/musubullets.png)

That's all for now. Hopefully that's enough convincing that this is indeed useful.

EDIT: Actually, concerning the non-rotating image bullets, are you going to implement something similar to how ShotData files work in DMF later on in the project? If yes, then that would probably be the ideal place to define, does a bullet's image rotate along with the angle, since they will probably contain other similar data for shots such as automatic rotation over time, delay color and render type. Also, ShotData files would also be an excellent place for defining bullet hitbox shape and size (things Danmakufu's ShotData files don't support). However, consider the function I posted above as a temporary fix, since I don't see something like ShotData files or any other bulletsheet definition method being implemented anytime soon.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on November 29, 2009, 10:09:48 PM
Well, I was thinking it would be helpful to store more than just "a number" for the score. I mean, okay, if the script did allow multiple difficulty levels, how would the score get stored? Would it store them in separate score-lists somehow, would it display the difficulty and player-character, or what?

I'm open to suggestions.  I'm not sure specifically this would be handled as this is kinda more of a down-the-road type thing.



But FreeType doesn't render; it's only provides an interface.

It provides enough to get a bitmap of characters, which can be used to make texture and render them.  That's the idea I had.

If you've got something better, let me know.



First of all, was the play field size stealth changed while I was away, since I had to scale up my background images? Or does this have something to do with the non-power-of-two textures update?

Yeah, it was adjusted slightly.  Forgot to mention it earlier.  Theme did the math and found it was off from the standard Touhou size (scaled up to match the increased resolution).  The field is now 480x560.



Secondly:
- Could you please rename arctan2 as just atan2, or at least add that in as an alternative form for the same function (like in DMF you can use either truncate or trunc). Not having to write two more letters every time you need the angle between two objects should be enough reason.

This can be done.



Secondly:- Also, I did some testing with the non-rotating-image bullets. Specifically, I added the following function CreateShot01S (S is supposed to stand for stationary, as opposed to rotating, but I'm sure there are better names out there) that's exactly the same as CreateShot01, except the bullets don't rotate. Function code is the following (altough I guess figuring it out would have been a trivial matter, since most of it is direct copypasta from CreateShot01):
Code: [Select]
            function = new Script.Instruction[7];
            function[0] = mdBaseReader.Parse_Instruction_Line("obj_create !id, \"BasicEnemyShot\", !arg1, !arg2");
            function[1] = mdBaseReader.Parse_Instruction_Line("obj_set_angle !id, !arg3");
            function[2] = mdBaseReader.Parse_Instruction_Line("obj_set_speed !id, !arg4");
            function[3] = mdBaseReader.Parse_Instruction_Line("obj_set_size !id, 5.5, 7.5");
            function[4] = mdBaseReader.Parse_Instruction_Line("obj_set_image !id, !arg5");
            function[5] = mdBaseReader.Parse_Instruction_Line("ret !id");
            function[6] = mdBaseReader.Parse_Instruction_Line("obj_img_rotate !id, false");
            function_list.Add("FireShot01S", new Script(function));

I did some testing and was extremely pleased with the results, and therefore suggest the implementation of this or some alternate form of the same functionality.

Can be put in for now ...



EDIT: Actually, concerning the non-rotating image bullets, are you going to implement something similar to how ShotData files work in DMF later on in the project? If yes, then that would probably be the ideal place to define, does a bullet's image rotate along with the angle, since they will probably contain other similar data for shots such as automatic rotation over time, delay color and render type. Also, ShotData files would also be an excellent place for defining bullet hitbox shape and size (things Danmakufu's ShotData files don't support). However, consider the function I posted above as a temporary fix, since I don't see something like ShotData files or any other bulletsheet definition method being implemented anytime soon.

I did start thinking about this a while ago, but it dropped to the proverbial back-burner.  I just did a bit of brainstorming, and here's the syntax I came up with:

Code: [Select]
bullet "name"
{
   image "image.png";
   size 5, 8;
   shape circle; // collision shape (right now, only circle exists)
   rotate_with_angle false; // don't rotate bullet with angle
   spin_speed 5; // auto-rotate image 5 degrees per frame (no code for this exists yet)
}

(put somewhere in your mdScript file, or in a separate file and include it)

This would define a bullet a bullet under the given name, with the specified image and other properties (to determine - a full list of properties that would be used).  Then, you'd use the name, rather than the image, when creating a shot; this might need a different CreateShot function ...
Title: Re: A replacement for Danmakufu?
Post by: AweStriker Nova on November 30, 2009, 02:43:22 AM
I thought of something that I think might be useful:

A safespot tester.

What it would do is force bullets to leave behind non-damaging trails. This would eat at the background, and when the spell card is over...

"I can see the background, there are too many safespots".

That is essentially the point
Title: Re: A replacement for Danmakufu?
Post by: Suikama on November 30, 2009, 02:48:14 AM
I thought of something that I think might be useful:

A safespot tester.

What it would do is force bullets to leave behind non-damaging trails. This would eat at the background, and when the spell card is over...

"I can see the background, there are too many safespots".

That is essentially the point
The trails should only be the size of the hitbox, because often it looks like bullets cover everything but the hitboxes don't (Eirin's card)
Title: Re: A replacement for Danmakufu?
Post by: AweStriker Nova on November 30, 2009, 02:51:37 AM
Oh, whoops. Left that part out.
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on November 30, 2009, 10:28:08 PM
Just popping in to continue to uselessly say I'm loving the progress~

Go useless me~
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 01, 2009, 01:11:25 AM
I thought of something that I think might be useful:

A safespot tester.

What it would do is force bullets to leave behind non-damaging trails. This would eat at the background, and when the spell card is over...

"I can see the background, there are too many safespots".

That is essentially the point

That's an interesting idea.  Certainly something that would be for later in development, though.



Theme -
I took a quick look at your pause code, and it looks good save for one detail - there's no way to quit the program.

Of course this'll be added in when the menu comes around, but that won't be until we have fonts going, at least.


And, keep in mind that we can't rely on the close button in the window's title bar, since you don't get that when you're fullscreen.



EDIT:

Added audio functions.  Now you can play music and make noises.  Music should loop like it does in Danmakufu now; will add nicer looping functionality later on.

PlayMusic("zomg best_song_evar.ogg");
StopMusic();

PlaySfx("I_shot_bullet.wav");



Also, Theme - You're on the dev list now.
... handle your new powers responsibly. ;)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 06, 2009, 02:44:52 AM
Bumping with a bit of update (I feel justified - we're on the second page :V)

Not much code work in the last few days.  I did add in a quick optimization to the collision routines that Theme suggested, but that's really it.

Dunno where Theme is; haven't heard from him all week (probably back to being busy.  stupid real-life commitments).


I have, however, been biting into the huge mess of work that is getting fonts to work.  It's coming along pretty well, but I'm still trying to figure out all of the details of it.

For the curious, I'm using the Tao mapping of FreeType to get each character as a bitmap, and then throwing that bitmap onto the screen.


I think it might be time for another testing release.  We've got a ton of new stuff since the last one, including:
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on December 06, 2009, 03:05:14 AM
Dunno where Theme is; haven't heard from him all week (probably back to being busy.  stupid real-life commitments).

Indeed. There's also some big stuff planned for Touhou Fortress planned for later and members have been dying off, so I've taken over some of the work. Combined with school (finals in two weeks >:() and other such real-life commitments, MsD has been bumped down the list.

For collision stuff, I'll just leave that to you since I don't have any experience with it, but I'll keep an eye out for optimizations since netbooks aren't very good at running things quickly.

Once the font stuff is done I think I can get started on quite a few things (esp. the pause screen). I've also considered adding TATE but I'll wait for the semester to finish before seeing if I'll go through with that.

Tonight I'm going to look through mdScript stuff and commit the for() loop, *= and /= operators, and compound assignments on object parameters once I've got those tested. That's probably the last you'll see of me for the next couple of weeks.

Edit: Also, I had to get some SDL-related .dll files before I could get MsD to run without erroring out (at least SDL_image.dll and SDL_mixer.dll). Might want to figure out a way to make sure users get these in your next release because it was rather difficult to figure out that these were needed. (Or perhaps my SDL download didn't like me.)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 06, 2009, 06:52:46 PM
Once the font stuff is done I think I can get started on quite a few things (esp. the pause screen). I've also considered adding TATE but I'll wait for the semester to finish before seeing if I'll go through with that.

Huh ... TATE mode could be cool.  In theory, it shouldn't be that hard to implement, either.

For fullscreen TATE, just apply a rotation to the entire play area and resize it to fit most/all of the screen, and remove/rework the border display.  Other than that it's just an issue of deciding how the HUD will be laid out in TATE mode.
Also, for everyone's sake - make sure it can rotate both ways!

Only major concern with throwing in TATE mode is that you need to make sure it doesn't break stuff.



Tonight I'm going to look through mdScript stuff and commit the for() loop, *= and /= operators, and compound assignments on object parameters once I've got those tested. That's probably the last you'll see of me for the next couple of weeks.

I just pulled down and checked through your changes.  It all looks fine to me.

Only detail I'd note is that, in C's for, you can leave the first (and third, if I remember correctly) field blank, so it'd look like this:

for (; foo > bar; bar++)

But, that's just minor details.



Edit: Also, I had to get some SDL-related .dll files before I could get MsD to run without erroring out (at least SDL_image.dll and SDL_mixer.dll). Might want to figure out a way to make sure users get these in your next release because it was rather difficult to figure out that these were needed. (Or perhaps my SDL download didn't like me.)

I just pulled the program up in Process Explorer to see what .dll's it's using.  Here's a list of the relevant ones I'm seeing:
Antlr3.Runtime.dll (included in previous testing release package; ANTLR runtime library)
Sdl.dll (not included in previous; SDL basic .dll)
SDL_image.dll (not included in previous; SDL image .dll)
SDL_mixer.dll (not included in previous; SDL audio handler .dll)
SdlDotNet.dll (not included in previous; SDL.NET basic .dll)
Tao.OpenGL.dll (included in previous; Tao Framework OpenGL interface .dll)
Tao.Sdl.dll (included in previous; Tao Framework SDL basic interface .dll)


It is probably a good idea to just include all of these, for the convenience of end users.  I should make a note to do so for the next testing release.
I'm so gonna forget. >__>



Reminder, back to the usual schedule of I'm-busy-with-family-stuff-on-weekdays-so-updates-only-on-weekends for me, at least for the next week or two (who knows what'll happen when the holidays come :V).
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on December 06, 2009, 09:17:08 PM
Only major concern with throwing in TATE mode is that you need to make sure it doesn't break stuff.

Yeah, I'm concerned about TATE interfering with non-gameplay screens. Menus and such might have to be redesigned for a vertical screen and it might get messy.

Only detail I'd note is that, in C's for, you can leave the first (and third, if I remember correctly) field blank

Actually, you can leave all three fields blank and it'll become an infinite loop until you use a break to get out of it.

But then it just gets tricky and we kind of need to implement break first.

Speaking of that, there's also continue.



Edit: Wow, just realized this thread was started 3 months ago and I haven't read anything past page 1.

Anyway, got some TATE and SetImageRect() started but many of the issues are blocked on #11 (http://code.google.com/p/musuu-no-danmaku/issues/detail?id=11) so there's not much for me to do here.

I'm also not doing a good job of "being busy".
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on December 11, 2009, 08:54:25 AM
Couple random ideas I had:
- text-parsing functions, like substring(string, position of first character, length), explode(string-to-be-turned-into-array,delimiter) ... My motive for this was an idea whereby a script-maker could set things up so that you could give each player their own "script" file for e.g. pre-boss dialogue, so you wouldn't have to rewrite the code every time you had to wanted to add a new character/you could add non-default dialogues (say, for instance, if you wanted to do the equivalent of playing Sakuya in UFO). But you'd need string-parsing functions to do that ...
- giving the script read-access to the preferences, so you could e.g. tweak your script's graphics according to the resolution or something, or set up a custom framerate-counter. (Or pull a Psycho Mantis. "YOU'RE PLAYING THE GAME FULLSCREEN AT 1024x768 WITH SOUND DISABLED!")
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 13, 2009, 11:33:47 PM
Couple random ideas I had:
- text-parsing functions, like substring(string, position of first character, length), explode(string-to-be-turned-into-array,delimiter) ... My motive for this was an idea whereby a script-maker could set things up so that you could give each player their own "script" file for e.g. pre-boss dialogue, so you wouldn't have to rewrite the code every time you had to wanted to add a new character/you could add non-default dialogues (say, for instance, if you wanted to do the equivalent of playing Sakuya in UFO). But you'd need string-parsing functions to do that ...

The substring function is something I have plans to implement.  The explode function sounds like a useful thing as well.



- giving the script read-access to the preferences, so you could e.g. tweak your script's graphics according to the resolution or something, or set up a custom framerate-counter. (Or pull a Psycho Mantis. "YOU'RE PLAYING THE GAME FULLSCREEN AT 1024x768 WITH SOUND DISABLED!")

Sounds also useful, albeit a lower-priority feature.




Also, I unfortunately haven't been able to get anything done - been busy with kicking asses in fighting game casuals all weekend, and the remaining time is probably not going to yield anything significant.  Hopefully next weekend will be more productive.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 19, 2009, 11:28:17 PM
Holy shit I actually got some work done here :o





And with that, it's Test Release 3 (http://www.stephenware.com/musuu_no_danmaku/Musuu_no_Danmaku_Test_Release_2009_Dec_19.zip)!

I now included all of the SDL and Tao .dlls that it is using (as far as I could tell, anyways), so that'll lessen the need for searching those out.

Major new features include:


Per usual, if the program errors it'll close on its own.  Run it using the -l argument to get a log, and post information here.
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on December 20, 2009, 12:42:19 AM
I now included all of the SDL and Tao .dlls that it is using (as far as I could tell, anyways), so that'll lessen the need for searching those out.

Code: [Select]
2009 Dec 19 16:06:10.125 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Surface' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Surface..ctor(IntPtr handle, Boolean isVideoMode)
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface, Boolean frame)
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

Adding libpng12-0.dll solves this, and then it asks for zlib1.dll. After adding those two, it runs fine for me.

Finals are over so I can start getting things done again.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on December 20, 2009, 03:30:52 AM
Code: [Select]
Musuu no Danmaku version 0.1.3640.32756
Starting logging file ...
2009 Dec 19 21:26:40.209 - Reading config file ...
2009 Dec 19 21:26:40.224 - Finished reading config file.
2009 Dec 19 21:26:40.224 - Initializing engine ...
2009 Dec 19 21:26:40.240 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2009 Dec 19 21:26:40.256 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Video' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

I can't say I'm surprised. I even added those two DLLs Theme97 mentioned, didn't make a difference. Anyone else here with 64-bit XP having the same problem? I'm pretty sick of this not working. -_-
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on December 20, 2009, 04:43:25 AM
EDIT: Hold up, SetVideoMode()? Looking into this again.



Hmm.

SdlDotNet.Graphics.Video (https://cs-sdl.svn.sourceforge.net/svnroot/cs-sdl/trunk/SdlDotNet/src/Graphics/Video.cs) contains

Code: [Select]
        static bool isInitialized = Initialize();

...

        /// <summary>
        /// Initializes Video subsystem.
        /// </summary>
        public static bool Initialize()
        {
            if ((Sdl.SDL_WasInit(Sdl.SDL_INIT_VIDEO))
                == (int)SdlFlag.FalseValue)
            {
                if (Sdl.SDL_Init(Sdl.SDL_INIT_VIDEO) != (int)SdlFlag.Success)
                {
                    throw SdlException.Generate();
                }
                return false;
            }
            else
            {
                return true;
            }
        }

The two Init functions in the Tao framework (http://taoframework.svn.sourceforge.net/viewvc/taoframework/trunk/src/Tao.Sdl/Sdl.cs?view=markup) are just interfaces to SDL.dll (http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/SDL.c?view=markup), which has:

Code: [Select]
int SDL_Init(Uint32 flags) {
    #if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
    if (!pth_init()) return -1;
    #endif

    SDL_ClearError();

    #if defined(__WIN32__)
    if (SDL_HelperWindowCreate() < 0) return -1;
    #endif

    if (SDL_InitSubSystem(flags) < 0) return (-1);

    if (!(flags & SDL_INIT_NOPARACHUTE)) SDL_InstallParachute();
    return (0);
}

SDL_InitSubSystem calls SDL_VideoInit here (http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/video/SDL_video.c?view=markup), which then does a whole mess of stuff that leads me to believe that I have no idea what is going on.

I'm on 32-bit XP, though, so that might be why it's working for me.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 20, 2009, 04:45:06 AM
Code: [Select]
2009 Dec 19 16:06:10.125 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Surface' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Surface..ctor(IntPtr handle, Boolean isVideoMode)
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface, Boolean frame)
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

Adding libpng12-0.dll solves this, and then it asks for zlib1.dll. After adding those two, it runs fine for me.

Finals are over so I can start getting things done again.

... okay, so I missed a few.  In my defense, neither have 'SDL' or 'Tao' in their name. :V



Code: [Select]
Musuu no Danmaku version 0.1.3640.32756
Starting logging file ...
2009 Dec 19 21:26:40.209 - Reading config file ...
2009 Dec 19 21:26:40.224 - Finished reading config file.
2009 Dec 19 21:26:40.224 - Initializing engine ...
2009 Dec 19 21:26:40.240 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2009 Dec 19 21:26:40.256 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Video' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

I can't say I'm surprised. I even added those two DLLs Theme97 mentioned, didn't make a difference. Anyone else here with 64-bit XP having the same problem? I'm pretty sick of this not working. -_-

Can you do me a favor?

Download this (http://www.stephenware.com/musuu_no_danmaku/2009_Dec_19_test_exe.zip), and repace the executable and try running it with -l.

It should still fail, but I added in a bit more output in regards to the error logging.  Specifically, I just found out that a thrown exception can have this InnerException property which could have more info.  It's a bit of a shot in the dark, but it might give us the solution.


Also, I appreciate that you haven't given up on getting this to work!



Hmm.

SdlDotNet.Graphics.Video (https://cs-sdl.svn.sourceforge.net/svnroot/cs-sdl/trunk/SdlDotNet/src/Graphics/Video.cs) contains

Code: [Select]
        static bool isInitialized = Initialize();

...

        /// <summary>
        /// Initializes Video subsystem.
        /// </summary>
        public static bool Initialize()
        {
            if ((Sdl.SDL_WasInit(Sdl.SDL_INIT_VIDEO))
                == (int)SdlFlag.FalseValue)
            {
                if (Sdl.SDL_Init(Sdl.SDL_INIT_VIDEO) != (int)SdlFlag.Success)
                {
                    throw SdlException.Generate();
                }
                return false;
            }
            else
            {
                return true;
            }
        }

The two Init functions in the Tao framework (http://taoframework.svn.sourceforge.net/viewvc/taoframework/trunk/src/Tao.Sdl/Sdl.cs?view=markup) are just interfaces to SDL.dll (http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/SDL.c?view=markup), which has:

Code: [Select]
int SDL_Init(Uint32 flags) {
    #if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
    if (!pth_init()) return -1;
    #endif

    SDL_ClearError();

    #if defined(__WIN32__)
    if (SDL_HelperWindowCreate() < 0) return -1;
    #endif

    if (SDL_InitSubSystem(flags) < 0) return (-1);

    if (!(flags & SDL_INIT_NOPARACHUTE)) SDL_InstallParachute();
    return (0);
}

SDL_InitSubSystem calls SDL_VideoInit here (http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/video/SDL_video.c?view=markup), which then does a whole mess of stuff that leads me to believe that I have no idea what is going on.

I'm on 32-bit XP, though, so that might be why it's working for me.

Hi Theme, you're posting while I'm posting. :V
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on December 20, 2009, 04:52:14 AM
Hi Theme, you're posting while I'm posting. :V

Sup :V

Leaving this to you again since I can't be bothered to look for SDL_SetVideoMode in the Tao framework. Have fun.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on December 20, 2009, 06:18:14 AM
Tried that test EXE out, error log coughed this stuff up:

Code: [Select]
Musuu no Danmaku version 0.1.3640.42532
Starting logging file ...
2009 Dec 20 00:16:26.021 - Reading config file ...
2009 Dec 20 00:16:26.021 - Finished reading config file.
2009 Dec 20 00:16:26.021 - Initializing engine ...
2009 Dec 20 00:16:26.037 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2009 Dec 20 00:16:26.052 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Video' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.
2009 Dec 20 00:16:26.084 - Inner exception: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Stack trace:
   at Tao.Sdl.Sdl.SDL_WasInit(Int32 flags)
   at SdlDotNet.Graphics.Video.Initialize()
   at SdlDotNet.Graphics.Video..cctor()

The program will close now.

 :V
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 20, 2009, 07:51:47 AM
Tried that test EXE out, error log coughed this stuff up:

Code: [Select]
Musuu no Danmaku version 0.1.3640.42532
Starting logging file ...
2009 Dec 20 00:16:26.021 - Reading config file ...
2009 Dec 20 00:16:26.021 - Finished reading config file.
2009 Dec 20 00:16:26.021 - Initializing engine ...
2009 Dec 20 00:16:26.037 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2009 Dec 20 00:16:26.052 - Error during initialization: The type initializer for 'SdlDotNet.Graphics.Video' threw an exception.
Stack trace:
   at SdlDotNet.Graphics.Video.SetVideoMode(Int32 width, Int32 height, Int32 bitsPerPixel, Boolean resizable, Boolean openGL, Boolean fullScreen, Boolean hardwareSurface)
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.
2009 Dec 20 00:16:26.084 - Inner exception: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Stack trace:
   at Tao.Sdl.Sdl.SDL_WasInit(Int32 flags)
   at SdlDotNet.Graphics.Video.Initialize()
   at SdlDotNet.Graphics.Video..cctor()

The program will close now.

 :V

Huh, now this brings up some interesting points.

From some quick google diving, it seems this means it's attempting to mix 32-bit and 64-bit executables/dlls.  Here's one of the sources I found stating this (http://taoframework.com/node/886) - it's a different line, but it sounds like the same basic problem.

It seems what's likely happening is that your 64bit system is JIT-ing the CLI code to native 64bit, but then it's trying to associate with 32bit dlls (the ones included with the program are 32bit, fyi).


From a quick bit of research, there's a couple possible solutions:


1) find 64bit versions of the SDL dlls.
If you can get the appropriate 64bit dlls, then the 64bit JIT'd code will match up and it should run fine.  I know there were a couple other people who got this running under 64bit Windows, so maybe they can help?


2) adjust compiler options to force 32bit mode
Probably the easier solution in the short term, but it might cause some issues.  It would allow it to use the 32bit dlls, since it'll be running in 32bit mode.  But, at the same time it means it'll be running in a suboptimal processing mode, and there might be some unknown side-effects (although I would hope not).

Plus, it adds to the logistics of distribution a bit, since now we'd have two executables (the standard "do whatever" one, and the "force 32bit" one).


I really need to start thinking about sleep* now, but I'm most likely going to have a bunch of time to look at it this coming week, so hopefully we can get a test fix in order soon!

* More fighting game casuals yesterday.  I didn't get home until 7am!





EDIT:


Prime2.0, try this executable out, if you can please - www.stephenware.com/musuu_no_danmaku/2009_Dec_19_test_exe_x86.zip (http://www.stephenware.com/musuu_no_danmaku/2009_Dec_19_test_exe_x86.zip)

I just recompiled the program with target CPU as x86, which should force it into 32bit mode.  Based on my previous interpretation of the error message, I think it stands a good chance of working.


Once again, I appreciate your patience and persistence with this!
/canned_corporate-style_response
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on December 21, 2009, 09:35:34 AM
It worked!

It was also absolutely nothing like I expected it to be. Test release 3 was supposed to have sound, right?

Anyways, this just occurred to me, but is the Musuu no Danmaku name set in stone? It occurred to me recently that you could maybe name it Bullet Forge, to coincide with that danmaku scripting website that Blargle was making. Well, that and it just sounds a lot cooler. I guess you'd have to ask him first. I feel awkward for even bringing this up. ._.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 22, 2009, 01:36:25 AM
It worked!

It was also absolutely nothing like I expected it to be. Test release 3 was supposed to have sound, right?

Anyways, this just occurred to me, but is the Musuu no Danmaku name set in stone? It occurred to me recently that you could maybe name it Bullet Forge, to coincide with that danmaku scripting website that Blargle was making. Well, that and it just sounds a lot cooler. I guess you'd have to ask him first. I feel awkward for even bringing this up. ._.

Extacy and celebrations! :toot:

Test release 3 has support for sound and music, but the included scripts don't actually use it, since I don't have any sound/music files I can distribute with the game.
For testing, I use an sfx I grabbed from a Danmakufu script and a track from the Guilty Gear Isuka soundtrack (Fille de Vent, to be precise ^_^ ).

In you look in TheEnemy.txt, you'll find that the music and sound effet commands are there, but commented out.  If you add in the appropriate files and uncomment the lines, you should have audio; if not, then it's probably a bug.



As far as the name, there was a bit of discussion a while back, and we ended up sticking with Musuu no Danmaku.  There's still room for suggestions, if you have a good one, but I think at this point the name is set pretty well in place.

And as far as using the same name as Blargel's website, I think that wouldn't make too much sense, since the website will deal with other engines, as well.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on December 22, 2009, 09:40:46 AM
The x86 version worked fine on my Windows Vista that couldn't run the last 2 releases, so I can assume you found the correct cause for the problem. Excellent work!
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 23, 2009, 01:19:07 AM
The x86 version worked fine on my Windows Vista that couldn't run the last 2 releases, so I can assume you found the correct cause for the problem. Excellent work!

Glad to hear you've got it working too!


To sum it up, it was trying to mix together 32bit and 64bit code (you are running Vista64, I assume), which doesn't work.
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on December 26, 2009, 07:25:22 AM
Just reporting in to say I finally got around to trying the demo, and everything is working very smoothly.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 27, 2009, 08:24:22 AM
Just reporting in to say I finally got around to trying the demo, and everything is working very smoothly.

Glad to hear it!



Just poking in to give you guys a bit of an update - font rendering is in!

Took me a bitchandahalf of effort to get FreeType to play along (mostly because I'm an idiot, but what else is new? :V), but you can now draw text from your scripts, using the Mona font.  Syntax is as follows:

DrawText(text, x, y, color, size, layer);



Currently, this is called in your tick script, since we don't yet have a dedicated draw script ... perhaps that should be added in soon? (Although, to note, you'll always be able to use it from wherever, if for some reason you want to do that ...)



It's looking good performance-wise, but I will warn that it is definitely a bigger performance hit than other rendering (Danmakufu has this too - the help warns that the DrawText function is pretty "heavy").


I still need to give it some thorough testing before I commit it to the source repository, but it's there.


PS - sorry for the slow progress recently, but you know, holidays and such.
(and birthday this coming Tuesday :3)
Title: Re: A replacement for Danmakufu?
Post by: Azure Lazuline on December 27, 2009, 07:36:35 PM
I have three suggestions for this - would it be possible to allow a gradient for the color, like DMF? Also, there seems to be lacking an opacity option, which might be problematic in some cases. Third, to cut down on render time, perhaps there could be an option to pre-load the text and convert it into a graphic? This shouldn't be a priority of course, but it would be nice to have.
Title: Re: A replacement for Danmakufu?
Post by: Naut on December 27, 2009, 09:18:20 PM
I dunno if this was asked and/or addressed yet, but will there be 3D? Perhaps I'm getting ahead of the project a little.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 27, 2009, 10:35:17 PM
I have three suggestions for this - would it be possible to allow a gradient for the color, like DMF?

I had thought about this; wasn't sure if people wanted it.  Should be pretty easy to add in.



Also, there seems to be lacking an opacity option, which might be problematic in some cases.

I can add in an alpha value as well, although with the current setup it'll make the rendering a bit slower.



Third, to cut down on render time, perhaps there could be an option to pre-load the text and convert it into a graphic? This shouldn't be a priority of course, but it would be nice to have.

This is a possibility - if your script knows in advance it needs "MY AWESOME SCRIPT" in 60-point bright-red lettering every frame, it could buffer that into a texture and render it more like a normal image.



I dunno if this was asked and/or addressed yet, but will there be 3D? Perhaps I'm getting ahead of the project a little.

This has been brought up once or twice.  There will be 3D graphics commands, but they are low-priority at the moment, so they're probably not going to be added in very soon.
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on December 28, 2009, 12:04:03 AM
Quote
This is a possibility - if your script knows in advance it needs "MY AWESOME SCRIPT" in 60-point bright-red lettering every frame, it could buffer that into a texture and render it more like a normal image.

Actually this reminds me of a feature in some other engines, where you could create a new image (like, image=CreateImage(64,64); and it would give you a transparent image 64x64) and have the ability to draw on that instead of the screen (DrawGraphicOnImage or something); then you could draw that image to the screen after you've modified it. You could also copy an area of the screen and put that in an image.
Title: Re: A replacement for Danmakufu?
Post by: DarkslimeZ on December 28, 2009, 12:29:06 AM
Actually this reminds me of a feature in some other engines, where you could create a new image (like, image=CreateImage(64,64); and it would give you a transparent image 64x64) and have the ability to draw on that instead of the screen (DrawGraphicOnImage or something); then you could draw that image to the screen after you've modified it. You could also copy an area of the screen and put that in an image.

But then again, this is more memory intensive. It's a tradeoff.

Though, with RAM sizes these days... ^^;
Title: Re: A replacement for Danmakufu?
Post by: Azure Lazuline on December 28, 2009, 01:04:25 AM
Yeah, a "copy this section of the screen to an image" function would be fun too, just so you could add PoFV-like screen transitions. (Hey, you can't have a shooter game without at least one pointlessly cool transition effect...)
Title: Re: A replacement for Danmakufu?
Post by: Blargel on December 28, 2009, 03:32:59 PM
Dunno if this has been mentioned already 'cause I'm not gonna read 16 pages of stuff, but Danmakufu has really messed up 3D rotation when you try to rotate on multiple axes at once. I believe this is due to the use of matrix transformations. A better way to handle rotation would be to use quaternions instead. I dunno how either work, but just throwing it out there :P
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 28, 2009, 10:21:43 PM
Actually this reminds me of a feature in some other engines, where you could create a new image (like, image=CreateImage(64,64); and it would give you a transparent image 64x64) and have the ability to draw on that instead of the screen (DrawGraphicOnImage or something); then you could draw that image to the screen after you've modified it. You could also copy an area of the screen and put that in an image.

This could certainly be possible, at least once I figure out where OpenGL's render-to-texture functionality is kept.



But then again, this is more memory intensive. It's a tradeoff.

Though, with RAM sizes these days... ^^;

Take, for instance, Stuffman's 64x64 texture ...

64 * 64 = 4096 pixels
* 4bytes/pixel = 16384 bytes = 16kB

Not really that much by today's standards.  Plus, assuming everything's working as it should that'll get shoved right off to the graphics card's RAM, so it won't even be bogging down the system's memory usage.



Yeah, a "copy this section of the screen to an image" function would be fun too, just so you could add PoFV-like screen transitions. (Hey, you can't have a shooter game without at least one pointlessly cool transition effect...)

This would be a bit trickier.  In order to get all of the layers rendered in the proper order, Musuu no Danmaku does not render any images until after all script processing has completed.  Therefore, if you request a snapshot of the screen, it won't be available until the next frame.

Plus, grabbing such an image won't be "cheap", so I don't think we could cache it every frame in case a script might request it later.



Dunno if this has been mentioned already 'cause I'm not gonna read 16 pages of stuff, but Danmakufu has really messed up 3D rotation when you try to rotate on multiple axes at once. I believe this is due to the use of matrix transformations. A better way to handle rotation would be to use quaternions instead. I dunno how either work, but just throwing it out there :P

1) "I dunno how X works, but I suggest using X." :V
Sorry, I just find this boiled-down version of your statement amusing.

2) Danmakufu's rotation is based on three individual rotations, one about each of the primary axes, applied in sequence.  The only thing I found really strange about it was the order in which they seemed to be applied.

3) Everything in 3D graphics boils down to matrix math.  Even if you give it a quarternion for a rotation, internally it converts it to the appropriate matrix.

4) Quarternions are no joke mathematically - no (http://www.genesis3d.com/~kdtop/Quaternions-UsingToRepresentRotation.htm) joke (http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation).


... with all that said, I do agree that we need a better 3D rotation function than Danmakufu provides.

OpenGL has a function to specify a rotation of t degrees about vector (x, y, z).  Might be a good starting point, but we might have to "stack" rotations in order to get all possible results, and this gets confusing pretty quickly.
Title: Re: A replacement for Danmakufu?
Post by: anonl on December 28, 2009, 10:30:04 PM
This could certainly be possible, at least once I figure out where OpenGL's render-to-texture functionality is kept.
http://en.wikipedia.org/wiki/Framebuffer_Object (http://en.wikipedia.org/wiki/Framebuffer_Object)
FBO's aren't supported on older Intel GPU's though...
Title: Re: A replacement for Danmakufu?
Post by: Theme97 on December 28, 2009, 10:34:11 PM
Danmakufu's rotation is based on three individual rotations, one about each of the primary axes, applied in sequence.

Argh, gimbal lock (http://en.wikipedia.org/wiki/Gimbal_lock) sucks but Euler angles are the easiest to understand.

OpenGL has a function to specify a rotation of t degrees about vector (x, y, z).  Might be a good starting point, but we might have to "stack" rotations in order to get all possible results, and this gets confusing pretty quickly.

Huh, really? I made a plugin for Team Fortress 2 a while back where rockets would gradually turn to home in on a player. It worked by creating a vector from the rocket's position to the player and then getting the up vector. Each frame, it would rotate the rocket's velocity vector around that up vector, and the plugin never had problems with that.
Title: Re: A replacement for Danmakufu?
Post by: Blargel on December 28, 2009, 10:39:35 PM
1) "I dunno how X works, but I suggest using X." :V
Sorry, I just find this boiled-down version of your statement amusing.

2) Danmakufu's rotation is based on three individual rotations, one about each of the primary axes, applied in sequence.  The only thing I found really strange about it was the order in which they seemed to be applied.

3) Everything in 3D graphics boils down to matrix math.  Even if you give it a quarternion for a rotation, internally it converts it to the appropriate matrix.

4) Quarternions are no joke mathematically - no (http://www.genesis3d.com/~kdtop/Quaternions-UsingToRepresentRotation.htm) joke (http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation).


... with all that said, I do agree that we need a better 3D rotation function than Danmakufu provides.

OpenGL has a function to specify a rotation of t degrees about vector (x, y, z).  Might be a good starting point, but we might have to "stack" rotations in order to get all possible results, and this gets confusing pretty quickly.

Okay, well the problem with the way Danmakufu handles multiple axis rotation is that it seems to run into an issue similar to gimbal locking (http://en.wikipedia.org/wiki/Gimbal_lock). I ran into this problem while trying to make a function that draws a texture that is always facing the camera. It worked properly until you rotated the camera to a specific angle. When I tried to test rotation in specific ways to see if it was a problem with my math, it seemed to go crazy and didn't look right. A bit of research indicated that using quaternions to handle rotation circumvented the problem somehow, but again, I don't exactly know how.

As for quaternions being no joke, my brother turned out to be using OpenGL as well and apparently there's a bunch of open source math libraries that include quaternions.

EDIT: Ahahaha, we both posted about gimbal lock at the same time >.<
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on December 29, 2009, 01:19:28 AM
http://en.wikipedia.org/wiki/Framebuffer_Object (http://en.wikipedia.org/wiki/Framebuffer_Object)
FBO's aren't supported on older Intel GPU's though...

This shall be most useful. :3



Argh, gimbal lock (http://en.wikipedia.org/wiki/Gimbal_lock) sucks but Euler angles are the easiest to understand.

Huh, really? I made a plugin for Team Fortress 2 a while back where rockets would gradually turn to home in on a player. It worked by creating a vector from the rocket's position to the player and then getting the up vector. Each frame, it would rotate the rocket's velocity vector around that up vector, and the plugin never had problems with that.

A couple things regarding your TF2 example:
1) It sounds like you're always rotating about the same axis (up), which would greatly simplify the issue.

2) I'm not saying it's going to have problems.  I'm saying it's a pain in the ass to visualize multiple rotations about different axes being applied like that - especially when you're not very experienced with 3D graphics programming to begin with. 



Okay, well the problem with the way Danmakufu handles multiple axis rotation is that it seems to run into an issue similar to gimbal locking (http://en.wikipedia.org/wiki/Gimbal_lock). I ran into this problem while trying to make a function that draws a texture that is always facing the camera. It worked properly until you rotated the camera to a specific angle. When I tried to test rotation in specific ways to see if it was a problem with my math, it seemed to go crazy and didn't look right. A bit of research indicated that using quaternions to handle rotation circumvented the problem somehow, but again, I don't exactly know how.

As for quaternions being no joke, my brother turned out to be using OpenGL as well and apparently there's a bunch of open source math libraries that include quaternions.

EDIT: Ahahaha, we both posted about gimbal lock at the same time >.<

This "gimbal lock" deal certainly sounds like the main issue here.  I've never dealt with it before, though, so I'm open to ideas on how to get around it ...





Quick update today - tested and fleshed out the font code a bit more, and committed it to the code repository.

I also added some color constants.  They are all prefixed by col_, and each represent a 3-element array for a color.  The following colors are avaliable:

This makes it a bit easier to specify a color -
DrawText("Some red text", 50, 50, col_red, 16, 10);
DrawText("Some blue text", 50, 70, col_blue, 16, 10);


Of course, you can use the array notation for it as well -
DrawText("Some other color text", 50, 90, [123, 45, 67], 16, 10);


Gradient and transparency are not in yet, but I've made a note to add them in at some point.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 03, 2010, 04:28:24 AM
Another little update - I just added in a file selection menu.


It's rather simple at the moment, but it gets the job done.


Right now, it simply gives a list of files that have the "Musuu" header line, and allows you to select one or more to load, then start the game.  So, right now, to load up a "proper" game, you'll need to select both the enemy script and the player script (or one file that includes both).

Of course, in the long run we'll need to add some more header info so that we can distinguish between different script file types (player, enemy, game, ...), and then we can rework the menu to be a bit friendlier.  It's a pretty big start, though.



As part of this, I also added in code that, when you quit an in-progress game, returns to the menu and resets all of the internal structures, rather than just quitting (Theme, take note - your pause code should link into this ...).


(Figured I'd bump, since it's been a few days ...)
Title: Re: A replacement for Danmakufu?
Post by: Loki on January 05, 2010, 04:59:34 PM
Sorry for my writing mistakes, English is not my native language.

I think it is better to do without creating a different syntax for various types of files. Over the last couple of days, I created a prototype, based on the V8 javascript engine. This is an example of danmaku-engine, in which almost all operations are stored in the interpreted files. This is what I would like to see in your program.

In addition, you may be interested in using the v8, sdl_ttf and openil libraries.

http://www.mediafire.com/?2mzzjljjrkn (http://www.mediafire.com/?2mzzjljjrkn) -- an executable file with some scripts.
http://www.mediafire.com/?z05wyzwdmhn (http://www.mediafire.com/?z05wyzwdmhn) -- source code and libraries for VC++ 2008
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 06, 2010, 04:22:48 AM
Sorry for my writing mistakes, English is not my native language.

I think it is better to do without creating a different syntax for various types of files.

To clarify, the syntax of the files themselves will not be any different*.  All that will change between, say, a player script file and an enemy script file is one line at the top of the file that says whether it's a player/enemy/etc script.  To illustrate, a player script file may start out like this:

Code: [Select]
Musuu
Script[mdScript]
Type[Player]

... while an enemy script file may start out like this:

Code: [Select]
Musuu
Script[mdScript]
Type[Enemy]


This Type tag would allow the program to distinguish the different script types, and allow it to preset the user with a list of just the appropriate script types the user is looking for at the moment (for instance, the player would most likely select an enemy or game script to face first, then pick a player script to face it with).


Another header option I think we may want to include is Name, which will give the script a name for in the script file selection menu (as opposed to showing just the file name, which is all it can do at the moment).

As part of this, I also have the idea that we should, rather than expecting a fixed number of headers, instead just allowing as many header lines, and requiring a blank line to indicate the end of the header lines (it looks good syntactically, anyways).  This allows headers to appear in any order (except the first line needs to be Musuu), and it also allows headers to be optional.  Leave out the Name header, and it'll default to showing the filename in the menu.  Also, it could be set up so that, if you leave out the Script header, it'll assume you're using mdScript.



* Note that, using a different Script header will select a different scripting language.  The only defined languages at the moment are mdBase, which should never be used for anything serious, and mdScript, which is the "standard" scripting language for Musuu no Danmaku.
One idea is that, in the future, we'll be able to have plugins that define other script languages for Musuu no Danmaku to read in; perhaps someone will even step up to the challenge of writing a Danmakufu interpreter (I feel sorry for whoever pushes that one on themselves :V).



Over the last couple of days, I created a prototype, based on the V8 javascript engine. This is an example of danmaku-engine, in which almost all operations are stored in the interpreted files. This is what I would like to see in your program.

In addition, you may be interested in using the v8, sdl_ttf and openil libraries.

http://www.mediafire.com/?2mzzjljjrkn (http://www.mediafire.com/?2mzzjljjrkn) -- an executable file with some scripts.
http://www.mediafire.com/?z05wyzwdmhn (http://www.mediafire.com/?z05wyzwdmhn) -- source code and libraries for VC++ 2008

I'm not at my main computer right now, so I can't really check these out (plus, mediafire tends to hate me, so I'll probably have a bit of trouble downloading the files anyways >__>).

Looking up the named libraries ...

v8 - a Javascript library.  This project uses its own scripting engine, with its own script file formats, so (at least currently) I don't think there's any place for Javascript.  Blargel's danmaku engine project (which has its own thread somewhere around here, that hasn't been bumped in forever apparently) is using Javascript for scripting, but I think they're using a different Javascript engine.

sdl_ttf - SDL font library.  I think this only works when using SDL's graphics handling methods; Musuu no Danmaku uses OpenGL, and right now it interfaces FreeType to get font data.

openil - image library.  This might come in handy if we can interface with it.  A quick google search shows that it is supported by the Tao Framework (http://www.taoframework.com/project/devil/), which makes it look promising.  If I can figure it out, there's a good chance it'll be more efficient than the current image loader code, which goes through System.Drawing.Bitmap (http://msdn.microsoft.com/en-us/library/system.drawing.bitmap%28VS.80%29.aspx).





I was just thinking about how we would handle scripting the equivalent of Danmakufu's Plural scripts, and here's the idea I came up with - a simple, scripted object which defines the lifebars and scripts to load.  Here's a sample of what I had in mind:

Code: (sample) [Select]
Musuu
Script[mdScript]
Type[Plural]
Name[EX Chen]

Plural "exChen"
{
   initialize
   {
      // set up the lifebars.  This array of arrays is explained below
      SetLifeBars([[80, 20], [80, 20, 20], [20]]);

      // set up the scripts.  Also explained below
      SetScripts([["ex_Chen_nonspell_1.txt",
                   "ex_Chen_spell_1.txt"],
                  ["ex_Chen_nonspell_2.txt",
                   "ex_Chen_spell_2.txt",
                   "ex_Chen_spell_3.txt"],
                  ["ex_Chen_spell_4.txt"]]);
   }
}

The first command, SetLifeBars, defines the number of lifebars, the number of scripts in each lifebar, and the relative size of lifebar for each script.  The second command, SetScripts, defines the scripts for each component of each lifebar.  So, for example, the above script defines the following:



For each lifebar, the bar will be divided based on each script's "share" of the total length.


The advantage to this script format is that it allows the scripter to easily change things based on certain variables.  For instance, you could use your global difficulty variable to determine whether or not to switch out ex_Chen_spell_4.txt for ex_Chen_spell_4_plus_ohmygodwhatisthis.txt if the player is playing on Lunatic, or even cut out ex_Chen_spell_3.txt entirely if they're playing on Easy.


At the same time, I do think a simple format may be useful as well.  We could also define another script "language" which more closely mimics Danmakufu's style of defining Plural scripts, such as with this sample:

Code: [Select]
Musuu
Script[mdPlural]
Type[Plural]
Name[EX Chen]

// First life bar

// The number at the beginning is each script's contribution to the lifebar length
80 ex_Chen_nonspell_1.txt
20 ex_Chen_spell_1.txt

// Next life bar
next

80 ex_Chen_nonspell_2.txt
20 ex_Chen_spell_2.txt
20 ex_Chen_spell_3.txt

// Next life bar
next

20 ex_Chen_spell_4.txt

(Note that the Script header indicates mdPlural rather than the usual mdScript)

This syntax has the advantage of being simpler, while sacrificing some of the potential that the previous idea has.  Of course, both can be implemented side-by-side, but I'm wondering what you people think about them?


We should consider how these ideas would play in with the future idea that we'll be able to customize the lifebars ...


Also, we could have it allow the scripter to specify a color for each lifebar segment.



(PS - in case you guys forgot, I'm back on my usual too-busy-during-the-week schedule :-\)
Title: Re: A replacement for Danmakufu?
Post by: Nimono on January 06, 2010, 04:57:33 AM
Cheese: I actually like the first Plural script idea you had, as it looks neater and friendlier, in my opinion. Can you get it to have a dynamic length, though?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 07, 2010, 03:02:50 AM
Cheese: I actually like the first Plural script idea you had, as it looks neater and friendlier, in my opinion. Can you get it to have a dynamic length, though?

If by "dynamic length" you mean "set up the boss with different amounts of scripts of lifebars based on certain conditions", then the first one can already do that.

If you mean "change the number of scripts or lifebars midway through the boss sequence", that can be done as well.  Probably would end up just adding in a tick function for the Plural script, and if at some point it determines we should change the line-up, call the SetLifeBars and SetScripts commands again with the new info.
Player might find it strange that all of a sudden the boss they're facing has two more lifebars, but whatever. :V



Kind of surprised you consider the first syntax as "neater and friendlier", since I see the second one as much simpler and more accessible (at the cost of being more limited in functionality).  But that's just opinions, of course.
Title: Re: A replacement for Danmakufu?
Post by: Nimono on January 07, 2010, 05:56:36 AM
If by "dynamic length" you mean "set up the boss with different amounts of scripts of lifebars based on certain conditions", then the first one can already do that.

If you mean "change the number of scripts or lifebars midway through the boss sequence", that can be done as well.  Probably would end up just adding in a tick function for the Plural script, and if at some point it determines we should change the line-up, call the SetLifeBars and SetScripts commands again with the new info.
Player might find it strange that all of a sudden the boss they're facing has two more lifebars, but whatever. :V
Curse my wording. I meant "pass any amount of arrays into it and it will know exactly how long it needs to be internally". I don't have any real experience in coding, so I have no idea what I'm talking about.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 08, 2010, 01:15:00 AM
Curse my wording. I meant "pass any amount of arrays into it and it will know exactly how long it needs to be internally". I don't have any real experience in coding, so I have no idea what I'm talking about.

That's basically what I described above.  You could, for instance, have a short stage 1 boss:

Code: [Select]
SetLifeBars([[80, 20], [20]]);
SetScripts([["nonspell1.txt", "spell1.txt"], ["spell2.txt"]]);


You could also have a really long boss:

Code: [Select]
SetLifeBars([[80, 20], [80, 20, 20], [80, 20, 20, 30, 20, 20, 20, 20, 20], [5], [9001], [1, 2, 3], [7, 9]]);
SetScripts([["nonspell1.txt", "spell1.txt"], ["nonspell2.txt", "lol", "wtf"], // etc you get the point :V

Title: Re: A replacement for Danmakufu?
Post by: Nimono on January 08, 2010, 03:34:53 PM
That's basically what I described above.  You could, for instance, have a short stage 1 boss:

Code: [Select]
SetLifeBars([[80, 20], [20]]);
SetScripts([["nonspell1.txt", "spell1.txt"], ["spell2.txt"]]);


You could also have a really long boss:

Code: [Select]
SetLifeBars([[80, 20], [80, 20, 20], [80, 20, 20, 30, 20, 20, 20, 20, 20], [5], [9001], [1, 2, 3], [7, 9]]);
SetScripts([["nonspell1.txt", "spell1.txt"], ["nonspell2.txt", "lol", "wtf"], // etc you get the point :V
I meant internally, in the game's coding, not on the end result. :p Like I said, I don't know much about coding at all, but I didn't know it was possible to make something like that in the coding and have its required length to work dynamically change to fit the amount passed into the function...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 09, 2010, 10:37:53 AM
I meant internally, in the game's coding, not on the end result. :p Like I said, I don't know much about coding at all, but I didn't know it was possible to make something like that in the coding and have its required length to work dynamically change to fit the amount passed into the function...

Dynamic allocation works those types of miracles.

Code: (C++ example) [Select]
int number_list[];

// bunch of stuff

int number_count = get_amount_of_numbers;

number_list = new int[number_count];

// etc ...


Pretty much, as long as it can find the memory to store it in, you'll have no problem with the array length and such.





EDIT: some progress:

I updated the menus like I described above.  It now works similarly to Danmakufu, where you select an enemy script, then you select a player script.



I added two new headers to the file format: Name and Type.

Name is optional, and gives something other than the file name for the menu entry for the script.

Type can be Player, Game, Stage, Plural, or Enemy (probably will get a couple more types later on).  Right now, the only thing it's used for is distinguishing player scripts from non-player scripts, so as to separate them in the menus.


Also, headers are now optional, and there must be a blank line after them.  Default values:
Title: Re: A replacement for Danmakufu?
Post by: SONIC BHOCOLATE STRIKER on January 12, 2010, 06:36:48 AM
Wow. This project looks awesome.
I know C# (I took a class entitled "Graphics Programming" at school; it should've been called "game Programming" and the text book was definitely "XNA Game Studio 3.0 Unleashed").
Hey, I can't wait to try the finished product. When you finish it (or if you need a tester) email me or something (I can't guarantee my presence at the forums all of the time) and I'll be glad to help out.
Also, you should:
a) put the download links to the latest builds on the front page
b) upload those builds to your Google Code page
Just sayin'.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 17, 2010, 02:18:10 AM
Wow. This project looks awesome.
I know C# (I took a class entitled "Graphics Programming" at school; it should've been called "game Programming" and the text book was definitely "XNA Game Studio 3.0 Unleashed").
Hey, I can't wait to try the finished product. When you finish it (or if you need a tester) email me or something (I can't guarantee my presence at the forums all of the time) and I'll be glad to help out.
Also, you should:
a) put the download links to the latest builds on the front page
b) upload those builds to your Google Code page
Just sayin'.

I haven't updated the first post in forever and a half (laziness :V), so I ended up just editing it to put a note saying to check the latest posts for real updates.  Aren't we going to need to make a new thread soon, anyways, since we're approaching 500 posts?  Or do I have the number wrong?

As far as testing, feel free to download the latest test release (the link was posted a page or two back).  It's still pretty incomplete, but you can check out a lot of the basics.

I probably should put the test releases on the Google Code page; I'll try to remember to do that with the next one, at least.  I host them from my own website currently.



Speaking of the next testing release, I'm starting to feel like another one is warrented soon.  Major things have been added:



There's a couple more things I'm thinking about, and I'm wondering what ones people would want to see implemented before the next test release ...



Unfortunately, this weekend is pretty much shot, since I'm busy tomorrow, and I was out yesterday until I got home at 7:30 am, so I'm pretty much fried.  go me. :V


PS - Where has Theme run off to?
Title: Re: A replacement for Danmakufu?
Post by: Stuffman on January 17, 2010, 02:19:54 AM
Quote
Aren't we going to need to make a new thread soon, anyways, since we're approaching 500 posts?

TSO upped it to 1000 posts after some forum upgrade, so we're good for now.
Title: Re: A replacement for Danmakufu?
Post by: SONIC BHOCOLATE STRIKER on January 17, 2010, 03:26:34 AM
I'm looking forward to any new releases you make. I'll be watching the google code page while I'm at school. I'd love to help you if I can (especially with something like writing the documentation; I'm OCD enough to make it all-encompassing)

EDIT: home != school
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on January 17, 2010, 03:14:49 PM
There's a couple more things I'm thinking about, and I'm wondering what ones people would want to see implemented before the next test release ...

  • New script commands
    • test if an object exists by ID
    • random numbers
  • Support for multiple directories (right now it only uses the directory the program is in)

Random numbers shouln't be much of a burden (just a mdbase command linking to System.Random and a corresponding mdscript command linking to the mdbase one) so adding them in shouldn't be much of a problem. All the features are practically necessary to add at some point of time, but aren't in such a hurry.

  • Other things I'm not thinking of at the moment?

Graphic rects I guess. Having to use seperate image files for all the bullets is STILL a pain. Some sort of SetRect() -function for objects would do well for starters. Maybe implement it so that you give the object ID to it alongside with the rect, or just make two versions with one asking object ID and one defaulting at currect object, since my look at the source code tells me that CreateShot01(S) returns the ID of the shot object (how come no-one told me this before?!? It's incredibly useful!), so you could just write:

Code: [Select]
shot = FireShot01(parameter, stuff, here, etc...);
SetRect(shot, 0, 0, 16, 16);

Of course, whenever shot data is implemented (I assume that might take a while), this might become obsolete, so consider whether it is worth it, but at least add such a function for the current object at some point of time.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 18, 2010, 04:36:52 AM
TSO upped it to 1000 posts after some forum upgrade, so we're good for now.

Dammit stop ruining my excuses to be lazy with the front post! >:(



I'm looking forward to any new releases you make. I'll be watching the google code page while I'm at school. I'd love to help you if I can (especially with something like writing the documentation; I'm OCD enough to make it all-encompassing)

EDIT: home != school

If you want to do something with documentation (my least favorite part of most projects), that would be cool.  Any particular points you'd want to look at?



Random numbers shouln't be much of a burden (just a mdbase command linking to System.Random and a corresponding mdscript command linking to the mdbase one) so adding them in shouldn't be much of a problem. All the features are practically necessary to add at some point of time, but aren't in such a hurry.

The trick with random numbers is making sure that they work with replays.  I know how to do that, but it makes it a bit more than just "Call System.Random lol". ;)



Graphic rects I guess. Having to use seperate image files for all the bullets is STILL a pain. Some sort of SetRect() -function for objects would do well for starters. Maybe implement it so that you give the object ID to it alongside with the rect, or just make two versions with one asking object ID and one defaulting at currect object, since my look at the source code tells me that CreateShot01(S) returns the ID of the shot object (how come no-one told me this before?!? It's incredibly useful!), so you could just write:

Code: [Select]
shot = FireShot01(parameter, stuff, here, etc...);
SetRect(shot, 0, 0, 16, 16);

Of course, whenever shot data is implemented (I assume that might take a while), this might become obsolete, so consider whether it is worth it, but at least add such a function for the current object at some point of time.

Yeah, the shot data thing will definitely be all we need to define the use of sub-images for bullets, and I do intend on adding support for using sub-images for the graphics of other objects, as well.  I can see if I have time to look at implementing support for this later this week, possibly for inclusion in the the next testing release (4).


Speaking of the shot data, I don't think it'll be that hard to do, honestly.  The main thing we need is to agree on what information is needed, and a way to present it to the program.  Here's the list of items I think we need for a shot type, just pulling the idea from the top of my head:


We could define an mdScript function that defines bullet types, something such as:

DefineBullet("ChenShot01", "chenshot01.png", [0, 0, 15, 15], 3.5, 7, true, 0);

This would define the shot "ChenShot01", with the given image file; the array indicates the left, top, right, and bottom of the image subarea to use.  3.5 and 7 define the size and size2 of the hitbox, true indicates that it rotates with the shot's angle, and 0 means it does not spin.


Like with plural scripts, we could also define a custom scriptfile type to make loading these definitions simpler.  For example,

Code: (Sample) [Select]
Musuu
Script[ShotData]

ChenShot01
image chenshot01.png
subimage 0, 0, 15, 15
hitbox 3.5, 7
rotate true
spin 0

Of course, I'm open to suggestions.

Once bullets are defined, they can then be used just like current bullets - just use the name of the bullet instead of an image file name in the FireShot commands.



I still also want to, later on, try that thing I mentioned before, where you can color-key a bullet image and then give it a color at runtime.  It would make things simpler, since the scripter wouldn't need to define "MyShot01Blue", "MyShot01Azure", "MyShot01LightBlue", etc, instead just defining "MyShot01" and giving it the color each time, as needed.
It'd also allow the use of literally any color in the RGB spectrum (without making utterly ridiculous amounts of bullet definitions).
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on January 18, 2010, 07:40:17 PM
The trick with random numbers is making sure that they work with replays.  I know how to do that, but it makes it a bit more than just "Call System.Random lol". ;)

Oh, right. Forgot all about replays.

Speaking of the shot data, I don't think it'll be that hard to do, honestly.  The main thing we need is to agree on what information is needed, and a way to present it to the program.  Here's the list of items I think we need for a shot type, just pulling the idea from the top of my head:

  • Graphic & graphic subrect
  • Hitbox sizes
  • If the shot rotates with the angle it is moving at
  • Rate at which the shot graphic spins

Just some possible parameters I'm throwing out there. Also, depending on the hitbox type, even more parameters may be needed (the foci for ellipse for instance: possibly you could even place the circle hitbox somewhere other than the center of the image, in case you're making something really weird, just as long as it defaults to the center.

I still also want to, later on, try that thing I mentioned before, where you can color-key a bullet image and then give it a color at runtime.  It would make things simpler, since the scripter wouldn't need to define "MyShot01Blue", "MyShot01Azure", "MyShot01LightBlue", etc, instead just defining "MyShot01" and giving it the color each time, as needed.
It'd also allow the use of literally any color in the RGB spectrum (without making utterly ridiculous amounts of bullet definitions).

And I almost had forgotten this idea, too. It certainly seems promising.
Title: Re: A replacement for Danmakufu?
Post by: SONIC BHOCOLATE STRIKER on January 18, 2010, 09:35:03 PM
@Nuclear Cheese: I know doc is most people's least favorite part, that's why I volunteered for it :P

I pretty much want to make it so that, with each release, every (user-accessible) function is documented cleanly, either (preferably) in a website, maybe auto-generated by Doxygen (which I need to learn to use anyway), and in the source code they are all commented properly for those who want to look and see the insides.

My main reason for wanting to do it (aside from gaining an intricate knowledge of how your game works, learning some new programming techniques, scripting, etc) is that every project I've ever used had some part of the doc that was confusing, not finished, ignored, or just lazily done, making my job harder. I want to see this thing produce some awesome games, and to do that, people are gonna need to know how to use it.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 24, 2010, 04:58:51 AM
@Nuclear Cheese: I know doc is most people's least favorite part, that's why I volunteered for it :P

I pretty much want to make it so that, with each release, every (user-accessible) function is documented cleanly, either (preferably) in a website, maybe auto-generated by Doxygen (which I need to learn to use anyway), and in the source code they are all commented properly for those who want to look and see the insides.

My main reason for wanting to do it (aside from gaining an intricate knowledge of how your game works, learning some new programming techniques, scripting, etc) is that every project I've ever used had some part of the doc that was confusing, not finished, ignored, or just lazily done, making my job harder. I want to see this thing produce some awesome games, and to do that, people are gonna need to know how to use it.

I dunno about using Doxygen for things like mdScript ... that looks like it's meant more to map out actual code structure or functions for APIs.

But it would be cool to have you doing the docs and such.  How do you want to go about it?




A quick update tonight - Graphics subrects are now in.

Use the command SetObjImgRect to change an object's image subrect.  The syntax is as follows:

SebObjImgRect(id, x1, x2, y1, y2);

id is, of course, the object that you want to change's ID.

x1, x2, y1, and y2 are the coordinates of the texture image to use for the object's image.


Note: the graphics subrect gets reset whenever you change an object's image.



Thinking of putting together the next test release, but not right now because I'm tired and hungry. :-\
Title: Re: A replacement for Danmakufu?
Post by: Montblanc on January 29, 2010, 11:39:51 PM
After a sizable absence (pfffft, Like you missed me :V), I have returned and played the latest Test Release.

^^ Great work. Playing a lot smoother than the last one I tried, and I even managed to put together a random, mini little pattern to dodge through. I felt all pro.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on January 31, 2010, 10:14:35 PM
After a sizable absence (pfffft, Like you missed me :V), I have returned and played the latest Test Release.

^^ Great work. Playing a lot smoother than the last one I tried, and I even managed to put together a random, mini little pattern to dodge through. I felt all pro.

Hi.  Glad to hear it's working for you.



I'm trying getting test release 4 together, but I just found this weird bug with the font code that I'm ironing out.  Might still get out today, depending on my patience and how much NMH2 pulls me in.



EDIT:
I fixed it.  Turns out I'm a fucking idiot. :vbang:

Test Release 4
Download is hosted on the project page here (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20Release%204%20%282010%20Jan%2031%29.zip&can=2&q==).

This should contain all necessary .dll's and such, although with the new inclusion of fonts I might have missed something again.
Title: Re: A replacement for Danmakufu?
Post by: Prime 2.0 on February 01, 2010, 08:56:49 AM
Test Release 4
Download is hosted on the project page here (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20Release%204%20%282010%20Jan%2031%29.zip&can=2&q==).

This should contain all necessary .dll's and such, although with the new inclusion of fonts I might have missed something again.

Code: [Select]
Musuu no Danmaku version 0.1.3683.32116
Starting logging file ...
2010 Feb 01 02:55:25.718 - Reading config file ...
2010 Feb 01 02:55:25.765 - Finished reading config file.
2010 Feb 01 02:55:25.765 - Initializing engine ...
2010 Feb 01 02:55:25.781 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2010 Feb 01 02:55:27.875 - Initializing font ...
2010 Feb 01 02:55:27.890 - Error during initialization: Unable to load DLL 'freetype6.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Stack trace:
   at Tao.FreeType.FT.FT_Init_FreeType(IntPtr& alibrary)
   at Musuu_no_Danmaku.Font.Init_Font()
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

Yes, you definitely missed something. *googles*

Yeah, slapping freetype6.dll in there fixed it. But there are still no sample sounds! Lol.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 02, 2010, 02:00:32 AM
Code: [Select]
Musuu no Danmaku version 0.1.3683.32116
Starting logging file ...
2010 Feb 01 02:55:25.718 - Reading config file ...
2010 Feb 01 02:55:25.765 - Finished reading config file.
2010 Feb 01 02:55:25.765 - Initializing engine ...
2010 Feb 01 02:55:25.781 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2010 Feb 01 02:55:27.875 - Initializing font ...
2010 Feb 01 02:55:27.890 - Error during initialization: Unable to load DLL 'freetype6.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Stack trace:
   at Tao.FreeType.FT.FT_Init_FreeType(IntPtr& alibrary)
   at Musuu_no_Danmaku.Font.Init_Font()
   at Musuu_no_Danmaku.Graphics.Initialize()
   at Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

Yes, you definitely missed something. *googles*

Yeah, slapping freetype6.dll in there fixed it.

Godammit. >_<



But there are still no sample sounds! Lol.

Get me some sample sounds and I'll use them!

lol.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on February 02, 2010, 06:26:25 AM
I submit my laser-thingy-noise as the death-SFX, since I dunno how else to make a Jimmy Hart version of ZUN's ... maybe I'll throw together something similar for a Spell Card noise and a "powerup" SFX ...
Title: Re: A replacement for Danmakufu?
Post by: SupahVee1234 on February 02, 2010, 08:17:56 PM
Sorry if I ignore all the work done by the developers so far, but wouldn't the project be better started from scratch with C#, XNA and LuaInterface?
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on February 02, 2010, 09:49:32 PM
Why?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 03, 2010, 02:58:10 AM
I submit my laser-thingy-noise as the death-SFX, since I dunno how else to make a Jimmy Hart version of ZUN's ... maybe I'll throw together something similar for a Spell Card noise and a "powerup" SFX ...

When I'm back at my development computer, I need to remember to actually search back through the thread and find the link to that ...



Sorry if I ignore all the work done by the developers so far, but wouldn't the project be better started from scratch with C#, XNA and LuaInterface?

Point the first - I tried installing the XNA dev stuff on my computer.  It failed miserably.

Point the second - Correct me if I'm wrong, but I think XNA isn't available on non-MS operating systems.

Point the third - It is already in C# (although I'm guessing you already knew that).

Point the fourth - Call me insane, but I found it easier to script up my own scripting language rather than using Lua (at least partly a lack of familiarity with Lua, but such is things).

Point the fifth - While it's not supported currently, if there's significant demand I believe we could add support for Lua scripts (even running alongside other scripts!) sometime in the future.

Point the sixth - Setting up a custom scripting language, in my view at least, makes it easier to custom-tailor the functionality of it to the specific purpose of the program.  Also, it makes it easier to add in features that aren't yet supported, since it's all our code.


Don't take this as "fuk u ur wrong lol" or such.  I'm just pointing out my reasoning behind the decisions made in this project.



Why?

I'm kinda curious to this as well, to be honest.
Title: Re: A replacement for Danmakufu?
Post by: SupahVee1234 on February 03, 2010, 12:48:54 PM
Dunno, I think LUA is very solid and a perfect language for this project. Why create a new scripting language?
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on February 03, 2010, 08:47:54 PM
Dunno, I think LUA is very solid and a perfect language for this project. Why create a new scripting language?
Point the fourth - Call me insane, but I found it easier to script up my own scripting language rather than using Lua (at least partly a lack of familiarity with Lua, but such is things).

Point the fifth - While it's not supported currently, if there's significant demand I believe we could add support for Lua scripts (even running alongside other scripts!) sometime in the future.

Point the sixth - Setting up a custom scripting language, in my view at least, makes it easier to custom-tailor the functionality of it to the specific purpose of the program.  Also, it makes it easier to add in features that aren't yet supported, since it's all our code.
Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 05, 2010, 11:08:52 AM
I tried running it, all i get is a blue screen, even after i installed SDL.NET.
I don?t get it... why isn?t it working?
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 05, 2010, 05:17:49 PM
I tried running it, all i get is a blue screen, even after i installed SDL.NET.
I don?t get it... why isn?t it working?

"Blue screen" as in your computer goes boom and crashes (would be very bad), or the window pops up and stays blue?

I should note that the window turns solid blue when it first comes up, while it's loading the initial data.  It should cut to the menu after a few seconds (how long exactly depends on your computer's specs and what else is running at the time).
If the window just stays solid blue, then it could be a bug.

Please try the following steps to get a debug log file:

Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 05, 2010, 06:11:17 PM
Code: [Select]
Musuu no Danmaku version 0.1.3683.32116
Starting logging file ...
2010 Feb 05 19:08:17.548 - Reading config file ...
2010 Feb 05 19:08:17.618 - Finished reading config file.
2010 Feb 05 19:08:17.618 - Initializing engine ...
2010 Feb 05 19:08:17.669 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2010 Feb 05 19:08:20.804 - Initializing font ...
2010 Feb 05 19:08:20.838 - Error during initialization: Die DLL "freetype6.dll": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.
Stack trace:
   bei Tao.FreeType.FT.FT_Init_FreeType(IntPtr& alibrary)
   bei Musuu_no_Danmaku.Font.Init_Font()
   bei Musuu_no_Danmaku.Graphics.Initialize()
   bei Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

did you forget to update your zip?
because it seems that a certian DLL is still missing.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 05, 2010, 07:52:28 PM
Code: [Select]
Musuu no Danmaku version 0.1.3683.32116
Starting logging file ...
2010 Feb 05 19:08:17.548 - Reading config file ...
2010 Feb 05 19:08:17.618 - Finished reading config file.
2010 Feb 05 19:08:17.618 - Initializing engine ...
2010 Feb 05 19:08:17.669 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2010 Feb 05 19:08:20.804 - Initializing font ...
2010 Feb 05 19:08:20.838 - Error during initialization: Die DLL "freetype6.dll": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.
Stack trace:
   bei Tao.FreeType.FT.FT_Init_FreeType(IntPtr& alibrary)
   bei Musuu_no_Danmaku.Font.Init_Font()
   bei Musuu_no_Danmaku.Graphics.Initialize()
   bei Musuu_no_Danmaku.Program.Main(String[] args)

The program will close now.

did you forget to update your zip?
because it seems that a certian DLL is still missing.

Yeah, freetype6.dll ... Prime2.0 also found that I had forgot to include it.  You can google for a download for it.  Just throw it in the same directory and it should work.

I have to head out soon, but if I remember I'll update the test build to add the dll (and post here to indicate I did so).


One more question though - the way you described it, were you indicating that the program doesn't close on its own when it is erroring?  If so, that's something that needs to be fixed.
Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 05, 2010, 08:10:25 PM
One more question though - the way you described it, were you indicating that the program doesn't close on its own when it is erroring?  If so, that's something that needs to be fixed.

It just shows a blue screen and then closes on it?s own. It would be helpful to get a "DLL-Missing" box, kinda like the Touhou games have.

EDIT: got the .dll now.
It would be kinda helpful if there was an .html file whice has all the functions explained...
because i don?t know whice of these things does what, and i don?t feel like searching for them on the 17 pages of this topic (18th page not counted as there aren?t any informative posts here, yet)

EDIT?: oh btw... i just made the first (to my knowledge) customed character in the history of Musuu no Danamku.
Download here!(link removed, due to updated version - keep on reasing through this topic and you will find it...)
Zip includes: player script(of course), shot(:V) and sprite(whice looks messed up inside the program for some wierd reason).

EDIT?: also... i noticed (while playing around and making a script on my own) that, depeding on how much there is on the screen it slows down and that INCLUDES the text function (especially the amount of letters used in them). hopefully it is just my computer...
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on February 06, 2010, 11:08:46 AM
EDIT?: also... i noticed (while playing around and making a script on my own) that, depeding on how much there is on the screen it slows down and that INCLUDES the text function (especially the amount of letters used in them). hopefully it is just my computer...

Yes. The program starts to slow down at certain object amounts, which due to the code not being optimized enough are somewhat low (for bullet hell standards). For me it's about 1000 objects onscreen on my newer computer and about 500 on an older one. A major part of this is most probably the still-unoptimized collision checking, since the slowdown stops whenever the player character dies, even if I don't set the code to clear the bullets upon death, but also starts up again when the player character respawns. Danmakufu has similar limits, but only much higher (about 4000 small bullets on my newer computer). I haven't tried text drawing functions yet but I do know they cause higher amounts of slowdown than ordinary images, since the same happens with Danmakufu, too.

This however does prove that the collision checking code (and possibly even other parts of the program like graphics rendering) are in need of optimization. I assume this will be done once the initial features are added in and the developers can start planning on releasing a stable release.

Also, concerning these "initial features", could it be useful to piece together a to-do list on whatever should be finished before the initial "stable" release, or possibly even the releases afterwards. There's been a lot of suggestions flying around in this topic but one has yet to gather them together in a single list. It could help people get an idea on what still has to be done, and having one for the initial release could help developers to decide on when to stop adding features and start fleshing out the program (more user-friendly error handling, code optimization and stuff like that). Then, after the program has a stable user-friendly release, all the useful extra features that aren't necessary for the first release could be added in.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on February 06, 2010, 07:07:23 PM
Oh yeah -- after fooling around with SimSynth (http://www.threechords.com/hammerhead/simsynth.shtml) a bit, I have managed to produce an SFX (http://www.mediafire.com/?myrzo2nkzdm) which is almost, but not quite, enturely unlike the Touhou death SFX.
Found it!

And here's a sort-of spellcard sound (http://www.mediafire.com/?gmntmyh2zty) and a mediocre charge-up sound (http://www.mediafire.com/?lkgyjnujvy0).
Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 06, 2010, 09:19:26 PM
here's a sort-of spellcard sound (http://www.mediafire.com/?gmntmyh2zty) and a mediocre charge-up sound (http://www.mediafire.com/?lkgyjnujvy0).

SCARD.wav sounds like the spell finishes.
CHARGEUP.wav sounds kinda accaptable through very basic.
Spoooon.ogg sounds kinda like the megaman death sound from Megaman, only unlooped.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 06, 2010, 11:47:09 PM
It just shows a blue screen and then closes on it?s own. It would be helpful to get a "DLL-Missing" box, kinda like the Touhou games have.

Okay, at least it's working as it's currently intended to.

Popping up a message box is trickier than you probably think, since it's pretty API-specific (for instance, there is a Windows-specific MessageBox function), and one of the main goals of this project is to keep it able to run on multiple platforms (with minimal, if any special-case code).

Also, this is a generic error-catch, so it's not just there for a missing DLL, but any possible error during initialization.  This could include missing font file, missing necessary graphics, etc.

Any suggestions on a better way to indicate a statup error?

Pre-Post EDIT:

MediaFire cooperated enough for me to download this.  Looks like the graphical weirdness is due to the smoothing that is applied to graphics in the game.  Perhaps we need to add an option to disable said smoothing on certain graphics?

It might be fixable in the image file, though.  I pulled your image up in GIMP, and noticed that all of the pixels in the transparent areas are white.  This makes the smoothing function fade the edges to white.  You can recolor this invisible area to better fit the borders of your image, and that makes it look a bit better (in my view, at least).

PS - a couple comments on your script (not being mean, just some hints and possible improvements):

Pretty good for a first try with crap documentation, though. ;)



EDIT: got the .dll now.
It would be kinda helpful if there was an .html file whice has all the functions explained...
because i don?t know whice of these things does what, and i don?t feel like searching for them on the 17 pages of this topic (18th page not counted as there aren?t any informative posts here, yet)

SonicBHOC is going to start putting together some documentation for this project.  I've been in contact with him via email.

In the meantime, unfortunately there isn't any decent documentation yet.  This is still a pretty new, work-in-progress project, so we haven't got everything fleshed out yet.  Sorry for the inconvenience.



EDIT?: oh btw... i just made the first (to my knowledge) customed character in the history of Musuu no Danamku.
Download here! (http://www.mediafire.com/?3qwyymnnlmy)
Zip includes: player script(of course), shot(:V) and sprite(whice looks messed up inside the program for some wierd reason).

I would have downloaded and checked this out, but MediaFire hates me.

Could you describe/show what you mean by the sprite looking messed up in the program?  It might be a bug in the graphics code.



EDIT?: also... i noticed (while playing around and making a script on my own) that, depeding on how much there is on the screen it slows down and that INCLUDES the text function (especially the amount of letters used in them). hopefully it is just my computer...

Yes. The program starts to slow down at certain object amounts, which due to the code not being optimized enough are somewhat low (for bullet hell standards). For me it's about 1000 objects onscreen on my newer computer and about 500 on an older one. A major part of this is most probably the still-unoptimized collision checking, since the slowdown stops whenever the player character dies, even if I don't set the code to clear the bullets upon death, but also starts up again when the player character respawns. Danmakufu has similar limits, but only much higher (about 4000 small bullets on my newer computer). I haven't tried text drawing functions yet but I do know they cause higher amounts of slowdown than ordinary images, since the same happens with Danmakufu, too.

This however does prove that the collision checking code (and possibly even other parts of the program like graphics rendering) are in need of optimization. I assume this will be done once the initial features are added in and the developers can start planning on releasing a stable release.

Correct, there is still some decent amounts of optimization to do in the collision detection code.  Specifically, in the code that decides what particular pairs of objects need to be collision-checked.

With the sheer number of objects on screen, it would be CPU suicide to collision-check every possible pair of objects, especially when so many potential collisions don't even yield anything important (two enemy bullets collided?  WHOOP-DE-FREAKIN'-DOO ...).  The code instead has code to build a list of what object pairs would actually have some meaning if they collide, and then uses that list to run collision detection.

The main issue right now is that the program dynamically rebuilds the list each frame, which is certainly not very efficient (but less prone to stupid errors in the code).  So, yeah, I'm gonna have to go back and optimize it at some point.



Also, concerning these "initial features", could it be useful to piece together a to-do list on whatever should be finished before the initial "stable" release, or possibly even the releases afterwards. There's been a lot of suggestions flying around in this topic but one has yet to gather them together in a single list. It could help people get an idea on what still has to be done, and having one for the initial release could help developers to decide on when to stop adding features and start fleshing out the program (more user-friendly error handling, code optimization and stuff like that). Then, after the program has a stable user-friendly release, all the useful extra features that aren't necessary for the first release could be added in.

This is probably a good idea.  Admittedly, I tend to be a bit disorganized with my projects. :V



Found it!

And here's a sort-of spellcard sound (http://www.mediafire.com/?gmntmyh2zty) and a mediocre charge-up sound (http://www.mediafire.com/?lkgyjnujvy0).

More MediaFire links.  Dammit.

Pre-Post EDIT:
MediaFire is actually cooperating with me?  Wow.

These effects remind me of stuff from the Atari era of video game consoles (not a bad thing!).  We can use these, at least as samples to throw in the test releases.

I'm kinda intrigued as to why SCARD and CHARGEUP are in WAV format, while Spooon is in OGG ...





Unfortunately, this weekend is pretty much shot for progress, since I'm busy.  Next weekend is looking iffy as well.
I really hate having to bum out on working on this, but unfortunately sometimes this "real life" thing just gets in the way.* >__>
(* See also - almost every weekday of the past five-or-so months <__<)

At least there's Test release 4.1 (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20Release%204.1%20%282010%20Feb%2006%29.zip&can=2&q=#makechanges).
Just added in the missing .dll file.
Title: Re: A replacement for Danmakufu?
Post by: Dizzy H. "Muffin" Muffin on February 07, 2010, 12:59:09 AM
I'm kinda intrigued as to why SCARD and CHARGEUP are in WAV format, while Spooon is in OGG ...
Um ... because I forgot I'd converted spoon into OGG before. |3
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on February 07, 2010, 02:12:33 AM
At least there's Test release 4.1 (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20Release%204.1%20%282010%20Feb%2006%29.zip&can=2&q=#makechanges).
Just added in the missing .dll file.

I tried this, but I'm still getting a window to pop up with a blue background, then it closes (on linux). Maybe I need freetype6.dll.config? I can't seem to find it anywhere though. I did copy the other .config files for the tao framework though.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 07, 2010, 05:36:55 AM
I tried this, but I'm still getting a window to pop up with a blue background, then it closes (on linux). Maybe I need freetype6.dll.config? I can't seem to find it anywhere though. I did copy the other .config files for the tao framework though.

What's the logfile say?

I don't think the .config files are necessary, to be honest, but if everything else fails it might be worth a try.
Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 07, 2010, 09:23:03 AM
PS - a couple comments on your script (not being mean, just some hints and possible improvements):
  • Not sure if it's intended or not, but you make no reference to Hitbox.png
  • You're not correctly reassigning the player sprite to danielu2.png, so that image is never shown either.  You need to call SetImage again with the new image name; simply reassigning the variable player won't work.
    Also, you might want to take the image assignment outside of the if statement, so that the image will reassign even if the player isn't firing.
I accidentaly added Hitbox.png in there, sorry.
I tried to make the second sprite appear in many different ways, this was one of the only things that worked and didn?t crash the program.
I put it here:
Code: [Select]
   tick
   {
      count = count-1;
      SetImage(player, true, 20);
      if (count <= 0 && GetKeyState(key_shot))
      {
and it crashes, as soon as i call the playerscript.

EDIT: After some playing around with the script, i got it to work but i don?t know how...
Code: [Select]
//set variable to unfocused sprite here
         player = "danielu.png"
         if (GetKeyState(key_focus))
         {
//set variable to focused sprite here
player = "danielu2.png"
         }
SetImage(player, true, 20);

will update the scriptfile now and re-upload it.

EDIT2: Download my MusuuNoDanmaku Character, whice nobody will care of anymore, as it has nothing special to it. (http://www.mediafire.com/?ykymjhlnzmy)
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on February 07, 2010, 10:08:04 AM
Oh, in case we're uploading our player characters:

PT8's awesomeface character you may have seen already in this thread. (http://www.mediafire.com/?ndondenntnm)

Features respawning (it has infinite lives as of now, I planned on implementing a life counter but I'm currently too lazy for that), visible hitbox (both when focused and unfocused), initial invincibility upon respawning and options. The sprite and the options aren't made by me, but the shots and the hitbox are. Also comes with a custom death SFX I made that may be reused as you see fit.
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 07, 2010, 10:30:25 AM
I accidentaly added Hitbox.png in there, sorry.
I tried to make the second sprite appear in many different ways, this was one of the only things that worked and didn?t crash the program.
I put it here:
Code: [Select]
   tick
   {
      count = count-1;
      SetImage(player, true, 20);
      if (count <= 0 && GetKeyState(key_shot))
      {
and it crashes, as soon as i call the playerscript.

EDIT: After some playing around with the script, i got it to work but i don?t know how...
Code: [Select]
//set variable to unfocused sprite here
         player = "danielu.png"
         if (GetKeyState(key_focus))
         {
//set variable to focused sprite here
player = "danielu2.png"
         }
SetImage(player, true, 20);

will update the scriptfile now and re-upload it.

EDIT2: Download the first MusuuNoDanmaku Character that has an visable hitbox if focused. (http://www.mediafire.com/?ykymjhlnzmy)

The problem with your first example is that you don't define the variable player.  Unless you've defined it as an object or global variable, a variable is local scope and "disappears" as soon as that particular script finishes executing.  Danmakufu does this similarly, except that Danmakufu still requires you to explicitly declare local variables.

In your second example, you define the player variable right within the scope of the tick function, so when you go to use it, it's got a value in it.

This is certainly, at least partly, due to a lack of documentation as well as the currently crap error reporting that MnD has.


PS - Hate to bust your proverbial bubble, but I think PT8Sceptile beat you to the "MnD player with a visible hitbox when focused" thing when he gave :awesome: a nose. :V



Oh, in case we're uploading our player characters:

PT8's awesomeface character you may have seen already in this thread. (http://www.mediafire.com/?ndondenntnm)

Features respawning (it has infinite lives as of now, I planned on implementing a life counter but I'm currently too lazy for that), visible hitbox (both when focused and unfocused), initial invincibility upon respawning and options. The sprite and the options aren't made by me, but the shots and the hitbox are. Also comes with a custom death SFX I made that may be reused as you see fit.

... speaking of :awesome: ...
Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 07, 2010, 10:38:32 AM
[...] PT8Sceptile beat you to the "MnD player with a visible hitbox when focused" thing [...]

crud...
At least i have the Power of brofists on my side.

EDIT: I made some spellcards out of boredom. (http://www.mediafire.com/?nwmmgzjqnmu)
Title: Re: A replacement for Danmakufu?
Post by: SupahVee1234 on February 07, 2010, 12:55:10 PM
Anyway, I'm interested in how your scripting engine works... Will you release the source code, or at least the scripting language part of the source code?
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on February 07, 2010, 01:54:36 PM
Anyway, I'm interested in how your scripting engine works... Will you release the source code, or at least the scripting language part of the source code?

The source code has been released for a while in the Google Code repository (http://code.google.com/p/musuu-no-danmaku/source/browse/#svn/trunk). Also, the program apparently uses a tool called ANTLR to translate the scripting language into a simpler language it can read, so researching that might also have some advantages in understanding the grammar file of the program (or more like may be necessary to understand it, since I can understand the rest of the code with no prior C# experience but can't figure out how the grammar file works at all since I haven't studied how ANTLR works).
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 08, 2010, 03:04:45 AM
The source code has been released for a while in the Google Code repository (http://code.google.com/p/musuu-no-danmaku/source/browse/#svn/trunk). Also, the program apparently uses a tool called ANTLR to translate the scripting language into a simpler language it can read, so researching that might also have some advantages in understanding the grammar file of the program (or more like may be necessary to understand it, since I can understand the rest of the code with no prior C# experience but can't figure out how the grammar file works at all since I haven't studied how ANTLR works).

To clarify on ANTLR:

ANTLR is a program that takes a grammar and translates it into code that reads said grammar.

The grammar file specifies the format and structure of the script language being read, as well as what snippets of code to run when it finds certain strucutures.

In the case of Musuu no Danmaku, the grammar specifies the syntax of mdScript, and translates each possible command into an equivalent set of mdBase commands for the actual script engine to parse.


You can check the ANTLR site (http://www.antlr.org/) for some more info.
Specifically, this project uses ANTLR version 3.



EDIT: I made some spellcards out of boredom. (http://www.mediafire.com/?nwmmgzjqnmu)

Apparently, the secret to getting MediaFire to cooperate is to just keep clicking the link until it works right >__>
Some niffy stuff here, even if a bit simple.  Nice to see some legit danmaku in the program.



EDIT:

Just as a performance guage, as long as I have nothing else major running (I'm looking at you, FireFox!), these scripts all run without slowdown on my desktop:

AMD Sempron 3000+ (or was it 3300+)
1GB RAM
ATI Radeon HD2600XT 512MB
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on February 08, 2010, 04:14:39 AM
What's the logfile say?

I don't think the .config files are necessary, to be honest, but if everything else fails it might be worth a try.

Code: [Select]
Musuu no Danmaku version 0.1.3683.32116
Starting logging file ...
2010 Feb 07 23:12:25.936 - Reading config file ...
2010 Feb 07 23:12:25.965 - Finished reading config file.
2010 Feb 07 23:12:25.966 - Initializing engine ...
2010 Feb 07 23:12:26.082 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2010 Feb 07 23:12:27.409 - Initializing font ...
2010 Feb 07 23:12:27.443 - Error during initialization: freetype6.dll
Stack trace:
  at (wrapper managed-to-native) Tao.FreeType.FT:FT_Init_FreeType (intptr&)
  at Musuu_no_Danmaku.Font.Init_Font () [0x00000]
  at Musuu_no_Danmaku.Graphics.Initialize () [0x00000]
  at Musuu_no_Danmaku.Program.Main (System.String[] args) [0x00000]

The program will close now.

As I suspected, it has to do with freetype6.dll...
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 09, 2010, 03:25:15 AM
Code: [Select]
Musuu no Danmaku version 0.1.3683.32116
Starting logging file ...
2010 Feb 07 23:12:25.936 - Reading config file ...
2010 Feb 07 23:12:25.965 - Finished reading config file.
2010 Feb 07 23:12:25.966 - Initializing engine ...
2010 Feb 07 23:12:26.082 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2010 Feb 07 23:12:27.409 - Initializing font ...
2010 Feb 07 23:12:27.443 - Error during initialization: freetype6.dll
Stack trace:
  at (wrapper managed-to-native) Tao.FreeType.FT:FT_Init_FreeType (intptr&)
  at Musuu_no_Danmaku.Font.Init_Font () [0x00000]
  at Musuu_no_Danmaku.Graphics.Initialize () [0x00000]
  at Musuu_no_Danmaku.Program.Main (System.String[] args) [0x00000]

The program will close now.

As I suspected, it has to do with freetype6.dll...

Huh.  Strange that it doesn't give any more information.  I'm not sure what to suggest at the moment. :-\
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 10, 2010, 10:14:13 PM
So, I tried to create a danmaku in Musuu no Danmaku.
And it worked.  It crashed if I tried to play music, but, oh well.

Here (http://www.mediafire.com/?z1n4azjznhm) it is.  I don't know what it is, but it's there.

Some things that I really hope you add:

All that being said, Musuu no Danmaku is awesome.  Keep up the good work!

(P.S. The music crash didn't bring up anything in the log.  I don't know whats up with that.)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 11, 2010, 02:56:38 AM
So, I tried to create a danmaku in Musuu no Danmaku.
And it worked.  It crashed if I tried to play music, but, oh well.

Here (http://www.mediafire.com/?z1n4azjznhm) it is.  I don't know what it is, but it's there.



(P.S. The music crash didn't bring up anything in the log.  I don't know whats up with that.)

I'm on my laptop right now, so I can't check out your script at the moment, unfortunately.


What exactly were you trying when the music command crashed?  Right now the error handling is a bit lax (read: very crappy and almost nonexistant :V), so it isn't to nice about some things.
Also, crash as in the program closes out, or crash as in returns to the menu?  It should do the latter in case of an in-script error.

For the log file, just in case you missed it, you need to add "-l" as a parameter when running the program in order for it to create a log file.

Other things to note about music: right now, it'll error if the indicated music file doesn't actually exist.  Also, MP3 is not supported.  I made a post earlier about what formats are supported, but basically anything SDL supports; I'd recommend OGG.



Some things that I really hope you add:
  • Some way to get the ids of all objects of a given type (e.g. not just all Effects, but all Effects named "Option")

Already there - use the same command, but with the name of a specific object type to get only the IDs of that object type.

Furthermore, you can even get a list of IDs for every object currently existing by passing the command an empty string.



  • Some way to get the id of the boss

You can again use the command that gets a list of object IDs to get this.  Use "Boss" to get the IDs of all possible boss enemies, or the specific name of the boss object's object type to only get the ID of a specific boss type.



  • Some way to set the hit box of default bullets

This is planned, as a bullet definition file, where you can define a bullet by image, hitbox, and a few other basic properties.

Technically, it is possible right now, but you'd have to use mdBase to do it, and I honestly don't recommend it.



All that being said, Musuu no Danmaku is awesome.  Keep up the good work!

Glad to hear the feedback.  I certainly intend to keep pushing this project forward (even if family, friends, and work chew through my time during the week and half the weekend >__>).
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 11, 2010, 04:13:10 AM
The particular command that caused the crash was
Code: [Select]
PlaySfx("PlayerDeath.ogg");And it did cause the whole program to quit.  This code is inside of the Awesomeface player character, and the download for that includes "PlayerDeath.ogg".
The error doesn't appear in the log.  However, I do have a whole bunch of weird stuff in the logs, so I'll just show you the log after the crash.  Here you go:
Code: [Select]
Musuu no Danmaku version 0.1.3683.32116
Starting logging file ...
2010 Feb 10 23:09:04.875 - Reading config file ...
2010 Feb 10 23:09:04.937 - Finished reading config file.
2010 Feb 10 23:09:04.937 - Initializing engine ...
2010 Feb 10 23:09:04.984 - Initializing graphics: 800x600 windowed, hardware surfaces enabled
2010 Feb 10 23:09:10.234 - Initializing font ...
2010 Feb 10 23:09:11.125 - Graphics init completed.
2010 Feb 10 23:09:11.125 - Loading script objects ...
2010 Feb 10 23:09:11.359 - Creating new Game object ...
2010 Feb 10 23:09:13.640 - Error building file list: The process cannot access the file 'C:\Documents and Settings\Bille\Desktop\Musuu no Danmaku\Musuu no Danmaku log file starting 2010 Feb 10 2309.txt' because it is being used by another process.
Stack trace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path)
   at Musuu_no_Danmaku.Menu.Fill_In_File_List(Boolean select_players)
2010 Feb 10 23:09:13.750 - Starting main loop ...
2010 Feb 10 23:09:17.406 - Loading script file: TheEnemy.txt
2010 Feb 10 23:09:17.625 - Loaded Object_Type - TheEnemy of type Boss
2010 Feb 10 23:09:17.640 - Loaded Object_Type - EvilShot of type Enemy_Shot
2010 Feb 10 23:09:17.656 - Error building file list: The process cannot access the file 'C:\Documents and Settings\Bille\Desktop\Musuu no Danmaku\Musuu no Danmaku log file starting 2010 Feb 10 2309.txt' because it is being used by another process.
Stack trace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path)
   at Musuu_no_Danmaku.Menu.Fill_In_File_List(Boolean select_players)
2010 Feb 10 23:09:18.390 - Loading script file: Awsumface.txt
2010 Feb 10 23:09:18.390 - Loaded Object_Type - ThePlayer of type Player
2010 Feb 10 23:09:18.390 - Loaded Object_Type - Respawner of type Effect
2010 Feb 10 23:09:18.390 - Loaded Object_Type - Hitbox of type Effect
2010 Feb 10 23:09:18.406 - Loaded Object_Type - LeftOption of type Effect
2010 Feb 10 23:09:18.406 - Loaded Object_Type - RightOption of type Effect
2010 Feb 10 23:09:18.437 - Spawning an object of type TheEnemy as the enemy.
2010 Feb 10 23:09:18.656 - Spawning an object of type ThePlayer as the player.

Other than that, The fact the GetObjectList() works like that is great.  I'll be able to make better options now. 
I'll be off making more weird danmaku then.  Don't work to hard.  You're awesome!

(Oh wait! P.S.!  Is there are rand() function or something.  Because I need a rand() function.  My above script uses the players x location as some sort of hobo's rand(), but a real rand() would super awesome.)

(P.S. II!  I've created a Notepad++ syntax for mdScript, and I can post that too.)
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 11, 2010, 05:00:51 AM
The particular command that caused the crash was
Code: [Select]
PlaySfx("PlayerDeath.ogg");And it did cause the whole program to quit.  This code is inside of the Awesomeface player character, and the download for that includes "PlayerDeath.ogg".

Odd ... I haven't tested using OGG for sound effects, but I'm guessing PT8Sceptile had it working if it was included.  I'll try to take a look at this once I get back to my desktop.



The error doesn't appear in the log.  However, I do have a whole bunch of weird stuff in the logs, so I'll just show you the log after the crash.  Here you go:
<t3h log>

Nothing important here.  The only errors it's reporting are when it's grabbing the list of files for the menu - it's trying to check the log file that it's writing.  It's a piece of "dumb" code that shouldn't affect anything aside from having this extra error mentioned here.



(Oh wait! P.S.!  Is there are rand() function or something.  Because I need a rand() function.  My above script uses the players x location as some sort of hobo's rand(), but a real rand() would super awesome.)

Random number functionality is, of course, planned (I did make NTSD, after all), but not yet implemented.



(P.S. II!  I've created a Notepad++ syntax for mdScript, and I can post that too.)

Sounds cool.  I've never used Notepad++, but I hear it has some niffy features.

The basic syntax of mdScript should be pretty much fixed at this point; only things that I can see changing in the near future would be if we add in new keywords.
(Technically, the functions that you call from your scripts aren't defined in mdScript, but rather in an aggregate list of function scripts defined in the program itself.)





Oh, and arcanesign - gave a bit of thought to your weird DLL issue ... are you using the DLL from test release 4.1, or did you download the DLL from somewhere?  That might have something to do with it, if you did grab a different one.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on February 11, 2010, 02:01:10 PM
The particular command that caused the crash was
Code: [Select]
PlaySfx("PlayerDeath.ogg");And it did cause the whole program to quit.  This code is inside of the Awesomeface player character, and the download for that includes "PlayerDeath.ogg".
Odd ... I haven't tested using OGG for sound effects, but I'm guessing PT8Sceptile had it working if it was included.  I'll try to take a look at this once I get back to my desktop.

Yes, I can confirm it's working for me. As long as the file is in the same folder with the game it should play as usual. However, figuring out the problem here might be difficult since it doesn't even leave any traces of an error in the log file. You could of course try out if other sound effects work (possibly something weird happened to the file during upload), if sound effects of other file types such as .wav work and does the same happen with music playing.



Also, as for the To-Do -list for the initial release I suggested, here's something to start with (since no-one else is apparently creating one):


That's pretty much all I can think of in the moment that Musuu needs to obsolete Danmakufu. If I've forgotten something, just add it to the list, and if you consider something on the list too irrelevant/tricky to implement for the first release, feel free to exclude it. This is just something to help people get a better idea on the amount of work left.

...Also, considering that this has been worked on for about half a year pretty much only during weekends, I'm really surprised on how short that list is.
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 11, 2010, 02:35:32 PM
All I would add to that would be:

Oh, and I'll probably have a new danmaku up sometime today.
Title: Re: A replacement for Danmakufu?
Post by: arcanesign on February 11, 2010, 08:26:13 PM
Oh, and arcanesign - gave a bit of thought to your weird DLL issue ... are you using the DLL from test release 4.1, or did you download the DLL from somewhere?  That might have something to do with it, if you did grab a different one.

I used the one in the 4.1 release, downloaded the whole thing from the google code page.
Title: Re: A replacement for Danmakufu?
Post by: MaronaPossessed on February 12, 2010, 03:33:47 AM
Tried the test file and so far you're doing a great job!

I intend to wait for this to be done so I can hire a group of people to do a game with that engine^^
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 12, 2010, 03:52:35 AM
Well, here's (http://www.mediafire.com/?zlml2ldjzuy) my second  danmaku.  Unlike the last one, this one isn't terrible. 

Something I noticed: A GetAngleToPlayer() or a GetAngleToObj() function would be really nice.  having to type:
Code: [Select]
if (player_id > -1)
{
xdiff = player_id->x - id->x;
ydiff = player_id->x - id->y;
if (xdiff == 0 && ydiff == 0) ydiff = 1;
angle - atan2(ydiff, xdiff)l
}
gets tiring after a while.

I'll keep making stuff.  Have a nice day/night.
Title: Re: A replacement for Danmakufu?
Post by: MaronaPossessed on February 12, 2010, 05:09:54 PM
Well, here's (http://www.mediafire.com/?zlml2ldjzuy) my second  danmaku.  Unlike the last one, this one isn't terrible. 

Something I noticed: A GetAngleToPlayer() or a GetAngleToObj() function would be really nice.  having to type:
Code: [Select]
if (player_id > -1)
{
xdiff = player_id->x - id->x;
ydiff = player_id->x - id->y;
if (xdiff == 0 && ydiff == 0) ydiff = 1;
angle - atan2(ydiff, xdiff)l
}
gets tiring after a while.

I'll keep making stuff.  Have a nice day/night.

Keep getting errored when selecting it.
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 12, 2010, 05:19:42 PM
Do you have the "Shot" directory?  I thought it came with the Musuu download, but it doesn't seem to have.  I think it was in one of the other test danmaku.  I don't remember which one, though.  If you can't find it, I'll put up a download link to it.
Title: Re: A replacement for Danmakufu?
Post by: PT8Sceptile on February 12, 2010, 07:14:19 PM
Well, here's (http://www.mediafire.com/?zlml2ldjzuy) my second  danmaku.  Unlike the last one, this one isn't terrible. 

This is pretty much excellent. Nice primitive version of a multi-spellcard boss. Excellent work (even if I miss my X-button while getting surprise-walled to death by phase 3 and phase 5 just outright murders me)!

Also, I don't think the Musuu download had the "Shot" -directory, since the default script doesn't reference it at all. It was probably in the example scripts.
Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 12, 2010, 08:52:55 PM
Do you have the "Shot" directory?

Well i made one for the download in my script and i made some alternate colored Shot1.png.
I am confused now...

EDIT: looks like it was my bullets.
Seeing how others use "my" bullets now it would be best to tell the that these bullets have been used before downloading and having them download this (http://www.mediafire.com/?tjekgdono3l) first, to make sure the script works properly.
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 12, 2010, 09:57:13 PM
Okay, yeah, so the bullet graphics I used came from By's danmaku.  Sorry about that.  I wanted to use more than one color of bullet, and I didn't notice it wasn't part of the default package. 
So, If anyones having trouble with my danmaku, you can either download by's danmaku, or change wherever it says "Shot/shot1COLOR.png" to "shot1.png".
And by, if you don't want me using your bullets, just tell me.

I think I'll try my hand at a player script next, so expect something some time tomorrow.

Oh, and thanks for playing my danmaku PT8Sceptile!  I'm happy you enjoyed it.
And yeah, phase 3 (thats with two options, right?) is pretty nasty.  And stage 5 (no options) came straight from Subterranean Animism, so you know it's going to be bad.
Title: Re: A replacement for Danmakufu?
Post by: Danielu Yoshikoto on February 12, 2010, 10:07:18 PM
[...] if you don't want me using your bullets, just tell me.

I actually made them to be used for Danmakufu Musuu No Danmaku scripts.
But i wasn?t expecting anyone to already use them this early... i might try to also make different colored versions of Shot2.png but i used it once and it wasn?t turning (all bullets pointed to the bottom while flying in any direction), preaty much just a bunch of "V"s on the screen.
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 12, 2010, 11:33:34 PM
Cool, I'm glad you don't mind me using your bullets.  And your problem with shot2 was probably that you used FireShot01S() instead of FireShot01().  FireShot01S() makes stationary bullets (thats what the S is for) and FireShot01() makes rotating bullets.  There are two options because circular bullets look better when they don't rotate.
Title: Re: A replacement for Danmakufu?
Post by: phi2dao on February 13, 2010, 04:56:15 AM
Well, I finished my player early, so here (http://www.mediafire.com/?ytttvymrrda) it is.  It's nothing special, but it has a working hit box, startup invincibility, and it re-spawns after 2 seconds.  The hit box, invincibility, and re-spawner are inspired by PT8Sceptile's awesomeface player, but are, for the most part, coded differently.

The Mima sprite sheet came form Johnny Walker's Mima (Mystic Square) touhou danmakufu player script.  If using that was bad, well, I'm sorry!  I won't do it again!

More comments on Musuu no Danmaku itself:
Title: Re: A replacement for Danmakufu?
Post by: Nuclear Cheese on February 14, 2010, 04:07:05 AM
I used the one in the 4.1 release, downloaded the whole thing from the google code page.

Dang it.

I notice you're on a 'nix system.  I'm wondering if there's something else it's missing specific to that side of things.  Unfotrunately, I don't have any 'nix systems to even try this on (nor the experience with such systems) ... anyone else here have any advice?



Also, as for the To-Do -list for the initial release I suggested, here's something to start with (since no-one else is apparently creating one):

Thanks for putting this together.  Really good to get a list of what people want, so we can direct this program's development properly.

  • Bullet definition files

Planned, of course.  We need to agree on what info is needed and how to format it.



  • Additional functions for:
    • Random numbers
Of course. ;)



  • Improved audio control (loop points, pausing/resuming, possibly fadein/fadeout)

Planned.



  • Possibly some improved bullet shooting functions like CreateShotA to avoid having to script overtly simple patterns with objects

Can be done.  Do we want something specifically mirroring CreateShotA, or something similar, but with some differences?



  • Default support for:
    • Lives/respawning
Of course.  Need to plan this out a bit, but I'm planning on adding a miss script, for player scripts to take action to animate their "ONOES I DEAD" and such, with a default for when there isn't one specified by the player script.



  • Points/Graze (partially implemented with -dt, but needs to be shown on the interface and lack handling functions like GetGraze() and SetPoints())

As you mention, the numbers are there, but they're not shown in-game.  This is pretty much just defining where and how they're shown.



  • Bombs (altough I could see these being already scripted with some cleverness in player scripts, these probably need a default implementation, too)

Yeah, a default implementation is definitely needed.  Will most likely add a bomb script for this.



  • Power system

Planned, based on the discussion that was going down earlier in this thread.



  • Plural files, stage files, possibly game files?

Certainly planned.  We need to nail down the formatting for how these'll work ... there were some ideas thrown around earlier, I remember.



  • Dialogue events

Planned, although these are probably gonna take back-seat to the more gameplay-related items.



  • Lasers

These are gonna be a bit tricky to implement, but I'm sure they'll get in there.



  • Effect objects with vertices, possibly 3D drawing (altough I'm not sure if 3D drawing needs to be in the initial release, but that's your call).

I'd say this is lower-priority, but certainly planned at some point.



  • User-defined functions/subroutines (tasks can probably be simulated well enough with dummy objects).

Functions are definitely planned.  I do plan on adding tasks later on, but they will work a bit differently than Danmakufu's tasks.



  • Inter-object messaging

Already possible via global variables.  I do, however, have plans for an actual implementation of this type of thing specifically.  Probably low priority, though.



  • Replays

Of course!  Lower priority, but definitely on the list.
NTSD for MnD hopefully never have the replay problems of its Danmakufu sibling.



  • Various bugfixing

Definitely.  Any bugs I can iron out, I will.



  • Code optimization to make the program run faster

Definitely planned.  Like I mentioned, the collision routines could use some decent optimization.  Right now, it is pretty good performance-wise (none of the posted scripts have any slowdown, so long as I don't have other stuff running), but better performance is always a good thing to aim for.
Figuring out multi-threading for this project could also fall under this.



  • Better error handling

For script errors, definitely.  I plan to give a major overhaul in that area, such that you'll have a better idea of what occurred, including where the error occurred, a decent description of the error that occurred, and probably even a stack trace of where the scripts were.
For program errors, I can look at what further steps can be taken to get good error handling.  I do feel that overall this area is pretty solid already, though.



All I would add to that would be:
  • Custom collisions

Could you please elaborate on this?  There is plan to have more than just circle collision types evetually - is that what you're asking for?



  • Documentation

SonicBHOC has volunteered to work on this.  Like I mentioned, I've been keeping in touch with him via email.



  • More bullet graphics

Of course.  Will probably come with or shortly after the bullet definition files.  The ones in the test releases are just quick samples.  I suck at making graphics anyways.
There's also my idea that would allow the use of one graphic to create bullet graphics of any color, most likely using shaders.



More comments on Musuu no Danmaku itself:
  • Needs a sqrt() function

Will need to add in exponent functionality - this'll simply by "X ^ 0.5".



  • Or some other way to find the distance between objects

Could be calculated by a script once we have exponents in, but we can also add in a helper function for this.



  • Custom Player Shots

    You can already script custom player shots by using the Player_Shot base type, much like using Enemy_Shot for a custom enemy shot.



    Well, I finished my player early, so here (http://www.mediafire.com/?ytttvymrrda) it is.  It's nothing special, but it has a working hit box, startup invincibility, and it re-spawns after 2 seconds.  The hit box, invincibility, and re-spawner are inspired by PT8Sceptile's awesomeface player, but are, for the most part, coded differently.

    The Mima sprite sheet came form Johnny Walker's Mima (Mystic Square) touhou danmakufu player script.  If using that was bad, well, I'm sorry!  I won't do it again!

    This is pretty cool.



    Well, here's (http://www.mediafire.com/?zlml2ldjzuy) my second  danmaku.  Unlike the last one, this one isn't terrible.

    This is pretty cool as well.  Nice job with the hackjob plural boss scripting.



    Something I noticed: A GetAngleToPlayer() or a GetAngleToObj() function would be really nice.  having to type:
    Code: [Select]
    if (player_id > -1)
    {
    xdiff = player_id->x - id->x;
    ydiff = player_id->x - id->y;
    if (xdiff == 0 && ydiff == 0) ydiff = 1;
    angle - atan2(ydiff, xdiff)l
    }
    gets tiring after a while.

    I'll keep making stuff.  Have a nice day/night.

    I can add a helper function for this.  Only question is - what should be used when there is no player object to get an angle to?  Should we return any specific default value?



    Do you have the "Shot" directory?  I thought it came with the Musuu download, but it doesn't seem to have.  I think it was in one of the other test danmaku.  I don't remember which one, though.  If you can't find it, I'll put up a download link to it.

    There are no subdirectories in the test release.  The "Shot" directory was added in by someone's scripts (By's, I think).



    I actually made them to be used for Danmakufu Musuu No Danmaku scripts.
    But i wasn?t expecting anyone to already use them this early... i might try to also make different colored versions of Shot2.png but i used it once and it wasn?t turning (all bullets pointed to the bottom while flying in any direction), preaty much just a bunch of "V"s on the screen.

    For shots that rotate, use FireShot01 instead of FireShot01S.  The provided sample script doesn't give a good indication of this, admittedly, since shot2.png is only used with a custom shot currently.



    That's pretty much all I can think of in the moment that Musuu needs to obsolete Danmakufu. If I've forgotten something, just add it to the list, and if you consider something on the list too irrelevant/tricky to implement for the first release, feel free to exclude it. This is just something to help people get a better idea on the amount of work left.

    ...Also, considering that this has been worked on for about half a year pretty much only during weekends, I'm really surprised on how short that list is.

    Glad to hear the feedback!
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on February 14, 2010, 04:56:22 AM
    Okay, by "Custom Collisions" I just meant letting us script what happens when one object hits another.
    I can't remember what I wanted it for though.  Hmm...  It probably wasn't important.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on February 14, 2010, 07:16:23 AM
    Okay, by "Custom Collisions" I just meant letting us script what happens when one object hits another.
    I can't remember what I wanted it for though.  Hmm...  It probably wasn't important.

    Writing this off the top of my head, might not be exactly correct:

    Code: [Select]
    // stuff
    {
       // stuff

       collide "SomeObject"
       {
          // do stuff here
       }

       collide_2 "SomeOtherObject"
       {
          // do stuff here
       }

       // stuff
    }

    The name in quotes can be a specific defined object type, a base type ("Player", "Enemy_Shot", etc), or it can be an empty string ("") to specify collision with all objects (avoid doing that though, it means it collision checks with everything).

    collide is a first-size collision (for instance, player gets hit by a bullet), collide_2 is a second-size collision (grazing, for instance).

    In these, it automatically defines a local variable called collided_with_id, which gives the ID number of the object that was collided with.


    This functionality should be working just fine in the current test release.  Sorry if it hasn't been discussed.
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on February 14, 2010, 09:17:28 AM
    Can be done.  Do we want something specifically mirroring CreateShotA, or something similar, but with some differences?

    Danmakufu's CreateShotA -system works decently. However, Musuu might be able to get away with less thanks to being able to modify the properties of ordinary non-object shots in the main script just by saving the ID returned by the CreateShot-function in a variable.


    Of course.  Need to plan this out a bit, but I'm planning on adding a miss script, for player scripts to take action to animate their "ONOES I DEAD" and such, with a default for when there isn't one specified by the player script.

    Sounds good.

    Yeah, a default implementation is definitely needed.  Will most likely add a bomb script for this.

    Yes. Won't be a major problem since this only needs the same treatment as lives with just a "triggers when X is pressed" -script added to player objects.


    Certainly planned.  We need to nail down the formatting for how these'll work ... there were some ideas thrown around earlier, I remember.

    Yes, I recall you making a post (http://www.shrinemaiden.org/forum/index.php?topic=2129.msg213465#msg213465) on how plurals could be done and your plans looked pretty good.

    As for stages, a generic "Stage" -object could do this as long as it has the ability to play a plural file. All it really has to do is to draw the backgrounds, spawn the enemies, and start the boss fights.

    I assume game scripts refer mainly to menus, which then proceed to play stages when certain menu items are selected. Probably needs a function for startting stages ( PlayStage(stage type, arbitary parameter) where the arbitary parameter is something is a value/array instructing the stage on how does it need to work, like for example determining has it been selected through stage practice or the real game, possibly what difficulty the stage is on etc... ) and some default implementation of a menu (a list of selections maybe, with up moving your selection up in the list and down moving you down, with the scripter being able to draw the menu himself while getting the current selection through some "GetSelection" -function for highlighting the current selection somehow. And in addition to that, scripts "Select" and "Deselect" triggering upon pressing X or Y respectively, altough maybe that isn't necessary since you can just follow these in the main loop with if-statements).

    There's just some ideas to work with for starters regarding stages and such.

    Planned, although these are probably gonna take back-seat to the more gameplay-related items.

    True, since these can be custom-scripted with relative ease too. A default implementation is helpful, but lower priority than those things that are harder to custom-script.


    These are gonna be a bit tricky to implement, but I'm sure they'll get in there.

    They're pretty much "effect-objectlike bullets" with render-type ADD instead of ALPHA and vertices laid out so that the bullet image is "stretched" in Danmakufu. The same will probably work in Musuu, with possibly an option for a "repeat this graphic" -type laser, too. They just need their own rendering function (or a generic rendering function for effect objects that they use, too), and the collision types. Collision is annoying, though. It has to be an ellipse or a line segment with radius (http://www.shrinemaiden.org/forum/index.php?topic=2129.msg99168#msg99168), like was already suggested before. In both cases collision-checking is a bit trickier than simple circular collision checking.

    Also, considering collisions, I guess other collision types should be added to the list, too.

    I'd say this is lower-priority, but certainly planned at some point.

    3D can be of especially low priority, since you can create "3D-like backgrounds" with simple effect objects, too. As for effect objects, I'd assume it's just defining a list of vertices for both the initial image and the background (possibly relative to position like in Danmakufu) and giving those coordinates to GL's vertex-defining function instead of your default rectangular coordinates.

    Functions are definitely planned.  I do plan on adding tasks later on, but they will work a bit differently than Danmakufu's tasks.

    Well, adding Danmakufu-like tasks would be redundant since dummy objects can do pretty much everything they can, and the object-based programming Musuu's scripting language uses makes them somewhat obsolete.

    Already possible via global variables.  I do, however, have plans for an actual implementation of this type of thing specifically.  Probably low priority, though.

    ...wait? You can define global variables in Musuu? Somehow like this?

    Code: [Select]
    define GlobalVar

    Object "SomeObject" {
       
        initialize {
            //Do stuff to GlobalVar.
            GlobalVar = 5;
        }

    }
    Object "SomeOtherObject" {
       
        tick {
            //Do some other stuff to GlobalVar
            GlobalVar++;
        }

    }

    If that's possible, scripting with this just became about a million times more effective.

    Also, I have a suggestion regarding the messaging system. Could we define a "dummy property" for each object that could be accessed with the property operator like ObjectID->arg , but doesn't have any direct effects on the behavior of the object like ObjectID->x, ObjectID->y, ObjectID->speed or ObjectID->angle have. This could serve as a simple "messaging system" between objects since you can pass arrays as the variable. This would be especially useful once Musuu can add and remove items in an array like array = array ~ [1] and array = erase(array, 3) in Danmakufu (if that hasn't been implemented yet), since then you could just have an object's dummy property be an array of arrays where you add arrays as "messages" and remove them in the object being messaged to after handling them properly (for example, if you want to inform an object you have made to start firing, you could in the boss object just code: Obj->arg = Obj->arg ~ [["FireStuff"], [true]]; The recipient object sees that the arg-array has an item. Checks arg[0][0], sees that it concerns "Firing stuff", checks arg[0][1], sees it's true, sets a local variable true to instruct it's tick-script to fire stuff, does the same for other "messages" in arg like arg[1][0], arg[2][0] etc... as long as arg has any messages and then cleans arg so that it's an empty array again).

    More bullet graphics
    Of course.  Will probably come with or shortly after the bullet definition files.  The ones in the test releases are just quick samples.  I suck at making graphics anyways.
    There's also my idea that would allow the use of one graphic to create bullet graphics of any color, most likely using shaders.

    With image subrects in one could probably already use the existing shotsheets like the CtC one and such.

    Also:
    (http://img85.imageshack.us/img85/3835/sheetd.png)
    A bulletsheet I've been making for my upcoming game I've planned to make with Musuu. It's still not completely finished (it for example lacks big bubble bullets, fireballs, butterflies and stuff like that) but you may use whatever's on it for test script bullets (like I have done with my own test scripts).

    Or some other way to find the distance between objects
    Could be calculated by a script once we have exponents in, but we can also add in a helper function for this.

    Actually, couldn't you currently use (x2 - x1)/cos(atan2(y2 - y1, x2 - x1)) as a workaround? Altough this will definitely be useful as a default function, since it gets used quite often.

    You can already script custom player shots by using the Player_Shot base type, much like using Enemy_Shot for a custom enemy shot.

    By the way, something about custom player shots that's interesting me: How does one define how much damage they do to the boss aside from using the parameter in the default player shot dreation function? Does that have some function of it's own that can set it or do we just have to custom-code the collide functions to damage the enemy?

    I can add a helper function for this.  Only question is - what should be used when there is no player object to get an angle to?  Should we return any specific default value?

    I'm suggesting downwards as the default value.

    Also, concerning the To-do -list, I guess I forgot a simple item that should be added to it: Drawing functions. While effect objects can do most of the things they can, I'd guess adding them could be a major timesaver when scripting backgrounds. Just something to consider.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on February 14, 2010, 09:47:12 PM
    Danmakufu's CreateShotA -system works decently. However, Musuu might be able to get away with less thanks to being able to modify the properties of ordinary non-object shots in the main script just by saving the ID returned by the CreateShot-function in a variable.

    Alright.  Once we decide exactly what it needed, it can be implemented.



    They're pretty much "effect-objectlike bullets" with render-type ADD instead of ALPHA and vertices laid out so that the bullet image is "stretched" in Danmakufu. The same will probably work in Musuu, with possibly an option for a "repeat this graphic" -type laser, too. They just need their own rendering function (or a generic rendering function for effect objects that they use, too), and the collision types. Collision is annoying, though. It has to be an ellipse or a line segment with radius (http://www.shrinemaiden.org/forum/index.php?topic=2129.msg99168#msg99168), like was already suggested before. In both cases collision-checking is a bit trickier than simple circular collision checking.

    The collision checking is probably the roughest part of implementing lasers ... we need a good model of the laser shape and routines to collision-check it with the same as well as other shapes.  But, of course, we'll get there.



    Well, adding Danmakufu-like tasks would be redundant since dummy objects can do pretty much everything they can, and the object-based programming Musuu's scripting language uses makes them somewhat obsolete.

    I plan tasks to be a bit different compared to Danmakufu, like I said previously.  I think they'll still be useful for some things, and I'm sure it'll be more convenient in certain situations.



    ...wait? You can define global variables in Musuu? Somehow like this?

    t3h codez

    If that's possible, scripting with this just became about a million times more effective.

    Almost.  You use the global keyword to define them instead of define.  I did it like this to make the syntax less ambiguous.

    Another important note is that a global variable will only be recognized by scripts in a file that define it as a global.  With your example, for instance, if another code references a variable named GlobalVar without declaring it as global, it'll still be a local-scoped variable, even though it is a global defined elsewhere.  This is necessary so that we don't pollute one script's variables by defining globals in another.



    Also, I have a suggestion regarding the messaging system. Could we define a "dummy property" for each object that could be accessed with the property operator like ObjectID->arg , but doesn't have any direct effects on the behavior of the object like ObjectID->x, ObjectID->y, ObjectID->speed or ObjectID->angle have. This could serve as a simple "messaging system" between objects since you can pass arrays as the variable. This would be especially useful once Musuu can add and remove items in an array like array = array ~ [1] and array = erase(array, 3) in Danmakufu (if that hasn't been implemented yet), since then you could just have an object's dummy property be an array of arrays where you add arrays as "messages" and remove them in the object being messaged to after handling them properly (for example, if you want to inform an object you have made to start firing, you could in the boss object just code: Obj->arg = Obj->arg ~ [["FireStuff"], [true]]; The recipient object sees that the arg-array has an item. Checks arg[0][0], sees that it concerns "Firing stuff", checks arg[0][1], sees it's true, sets a local variable true to instruct it's tick-script to fire stuff, does the same for other "messages" in arg like arg[1][0], arg[2][0] etc... as long as arg has any messages and then cleans arg so that it's an empty array again).

    My plan was to allow a script to define functions that could be called by other script objects, with a syntax something like:
    some_other_object_id->message_function(arg);
    These would allow you to define object behaviors that can be called upon externally.

    Sound like a good idea?



    With image subrects in one could probably already use the existing shotsheets like the CtC one and such.

    Could, yeah, but it would be better to create our own, so that we're not stealing other people's work.



    By the way, something about custom player shots that's interesting me: How does one define how much damage they do to the boss aside from using the parameter in the default player shot dreation function? Does that have some function of it's own that can set it or do we just have to custom-code the collide functions to damage the enemy?

    SetLife(#)

    Since shots have no need for a life counter, I use the life value for the amount of damage a player shot will do to the enemy.



    I'm suggesting downwards as the default value.

    Also, concerning the To-do -list, I guess I forgot a simple item that should be added to it: Drawing functions. While effect objects can do most of the things they can, I'd guess adding them could be a major timesaver when scripting backgrounds. Just something to consider.

    Ah, right.  Those will be in there.  Shouldn't even be that hard to implement.
    Title: Re: A replacement for Danmakufu?
    Post by: Azure Lazuline on February 14, 2010, 10:09:28 PM
    You could perhaps use my shotsheet when it's done. It was originally made just for my DMF project, but I'd love to see it used elsewhere. It would need to wait until your implementation of actual sheets is supported, though (and PNG alpha channel, if that's not already done).
    Title: Re: A replacement for Danmakufu?
    Post by: anonl on February 15, 2010, 12:52:30 AM
    The collision checking is probably the roughest part of implementing lasers ... we need a good model of the laser shape and routines to collision-check it with the same as well as other shapes.  But, of course, we'll get there.
    You can take a look at the TouhouDS source code (specifically src/arm9/collision.cpp). It has functions for circle<->circle, line<->circle and line<->line collision checking. The rest of the code is also pretty well optimized.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on February 15, 2010, 02:34:50 AM
    You could perhaps use my shotsheet when it's done. It was originally made just for my DMF project, but I'd love to see it used elsewhere. It would need to wait until your implementation of actual sheets is supported, though (and PNG alpha channel, if that's not already done).

    It should already support alpha transparency.  As far as support for sheets, it's sort-of there ... to use it right now, you'll need to define a custom enemy shot type so you can set the graphic properties.  Of course, this will change by the time we have bullet definition files.



    You can take a look at the TouhouDS source code (specifically src/arm9/collision.cpp). It has functions for circle<->circle, line<->circle and line<->line collision checking. The rest of the code is also pretty well optimized.

    Probably is worth a look.  I'll keep this in mind.




    Quick update - just added random numbers.  Two functions:

    rand() - simply returns a number in the range of [0.0, 1.0)
    rand_int(low, up) - returns an integer in the range of [low, up)

    Important to note that current implementation, at least, the upper bound on rand_int is a value it won't hit (this is how the underlying command, System.Random.Next(int, int) is implemented).  If there's demand, I can add in code to adjust for this behavior.
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on February 15, 2010, 07:06:07 AM
    Almost.  You use the global keyword to define them instead of define.  I did it like this to make the syntax less ambiguous.

    Another important note is that a global variable will only be recognized by scripts in a file that define it as a global.  With your example, for instance, if another code references a variable named GlobalVar without declaring it as global, it'll still be a local-scoped variable, even though it is a global defined elsewhere.  This is necessary so that we don't pollute one script's variables by defining globals in another.

    This will be ridiculously useful...


    My plan was to allow a script to define functions that could be called by other script objects, with a syntax something like:
    some_other_object_id->message_function(arg);
    These would allow you to define object behaviors that can be called upon externally.

    Sound like a good idea?

    Well that pretty much does the same thing. These will also be really useful once implemented.

    SetLife(#)

    Since shots have no need for a life counter, I use the life value for the amount of damage a player shot will do to the enemy.

    *PT8 suddenly remembers all the positive side-effects of having a good documentation.

    Clever. However, no-one is going to figure that out on their own without some serious looking through the code...

    It should already support alpha transparency.  As far as support for sheets, it's sort-of there ... to use it right now, you'll need to define a custom enemy shot type so you can set the graphic properties.  Of course, this will change by the time we have bullet definition files.

    Wait what?

    Code: [Select]
    SetObjImgRect(FireShot01S(GetX(), GetY(), angle + tcount/2/90*pi + pi, 2, "sheet.png"), 16*8, 16*8 + 16, 0, 16);
    All that is needed to get a specific bullet image out of a shotsheet is one line of code like this (it does, however, get a bit repetitive having to type all of this in so I'm eagerly waiting for the bullet definition files).

    Quick update - just added random numbers.  Two functions:

    rand() - simply returns a number in the range of [0.0, 1.0)
    rand_int(low, up) - returns an integer in the range of [low, up)

    Important to note that current implementation, at least, the upper bound on rand_int is a value it won't hit (this is how the underlying command, System.Random.Next(int, int) is implemented).  If there's demand, I can add in code to adjust for this behavior.

    At last! These have been long waited for! Both implementations are fine for me.

    Also:

    List updated based on whatever had been mentioned (low priority stuff marked, draw functions and math functions like the mentioned square root added, inter-object messaging changed to the object message function idea you have and random function striked over to signify being ready).
    Title: Re: A replacement for Danmakufu?
    Post by: Theme97 on February 17, 2010, 05:32:48 AM
    Holy hell, it's been a while.

    I've been busy lately and I stopped getting thread notifications, so this was pretty much left forgotten for a while.

    At any rate, just wanted to say I'm not dead yet. I might not be able to do much for now, but I'm definitely going to try and get back into this.

    Edit:
    • Some more mathematical functions like the power function.
    • Improved audio control (loop points, pausing/resuming, possibly fadein/fadeout)

    I was working on these before I up and disappeared, so I can probably dig those back up.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on February 21, 2010, 01:48:56 AM
    *PT8 suddenly remembers all the positive side-effects of having a good documentation.

    Clever. However, no-one is going to figure that out on their own without some serious looking through the code...

    Yeah, that's one thing we certainly need to work on.  Like I said, sonicbhoc is looking at it.



    Wait what?

    Code: [Select]
    SetObjImgRect(FireShot01S(GetX(), GetY(), angle + tcount/2/90*pi + pi, 2, "sheet.png"), 16*8, 16*8 + 16, 0, 16);
    All that is needed to get a specific bullet image out of a shotsheet is one line of code like this (it does, however, get a bit repetitive having to type all of this in so I'm eagerly waiting for the bullet definition files).

    ... derp.  I forgot that function takes an ID parameter.  Go me.





    Some quick progress tonight:
    I refactored the function list code such that it explicitly defines the argument list for each function.  It doesn't give any visible changes in functionality right now, but it'll be necessary for implementing user-defined functions later on.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on February 21, 2010, 02:14:55 AM
    Can I make a suggestion? Don't use "life" for "this is how much damage it does" -- what if you want a shot to keep going after it hits something, and you want to specify "number of times the shot can hit something before dying"?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on February 21, 2010, 03:12:51 AM
    Can I make a suggestion? Don't use "life" for "this is how much damage it does" -- what if you want a shot to keep going after it hits something, and you want to specify "number of times the shot can hit something before dying"?

    The you'll have to override the default "player shot collides with enemy" function anyways, since that not only deals out damage, but also deletes the shot.

    A default "penetrating" shot can be added in as well, but I'd think there's a fair amount of potential for variety in that category, so custom implementations are probably gonna be necessary in some cases.
    Title: Re: A replacement for Danmakufu?
    Post by: Shockman on February 22, 2010, 02:17:43 AM
    you should also make different scoring systems available like normal bombing, MoF style power, and UFOs.
    Title: Re: A replacement for Danmakufu?
    Post by: arcanesign on February 22, 2010, 09:52:48 PM
    For documentation, you may want to skim through these articles, I found them helpful:

    http://jacobian.org/writing/great-documentation/
    Title: Re: A replacement for Danmakufu?
    Post by: SupahVee1234 on February 22, 2010, 10:12:13 PM
    Didn't feel like reading the whole thread, but are the shotsheets like in Danmakufu, or it's just a colour and you change Hue via code?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on February 23, 2010, 03:19:32 AM
    you should also make different scoring systems available like normal bombing, MoF style power, and UFOs.

    There is plan to have a flexible power/bomb system in place.  It was discussed a few pages back.  We'll still need to nail down the exact details, but effectively a game script will be able to set the power/bomb item values and costs for bombing, etc.



    For documentation, you may want to skim through these articles, I found them helpful:

    http://jacobian.org/writing/great-documentation/

    This looks like it could be useful.

    btw - any luck on getting the latest test release to run?  Sorry I can't provide any advise or other help, but like I said I don't really have any applicable expertise when it comes to 'nix systems.



    Didn't feel like reading the whole thread, but are the shotsheets like in Danmakufu, or it's just a colour and you change Hue via code?

    Right now, bullet graphics are simply loaded as images.  It is possible to use a subrect of an image for a shot graphic, albeit a bit messy code-wise currently.

    The plan is to give the scripter the ability to custom-define bullet data (image, hitbox, etc) using a script file.  This has not yet been implemented, however.

    I also have an idea that will allow a scripter to provide a single bullet image (color-keyed) which the program can then use to create bullet graphics in that shape of any color on-the-fly.  This'll probably come later on, but if it works out like I think it will, it'll reduce graphic file memory consumption on disk as well as texture memory consumption.
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on February 23, 2010, 06:03:21 AM
    If you could put out another test release with the random number functions or something, I would really appreciate it.  I've been trying to think of cool danmaku to create, but they all work best with random numbers.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on February 24, 2010, 02:25:29 AM
    If you could put out another test release with the random number functions or something, I would really appreciate it.  I've been trying to think of cool danmaku to create, but they all work best with random numbers.

    I can look at putting together another test release this weekend.  Can't do it sooner since I'm too busy between work and other commitments (like usual >__>).
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on February 24, 2010, 05:21:12 PM
    That's fine.  Don't stress yourself.

    EDIT:
    I just noticed that the Useful Miscellaneous Code Snippets (http://www.shrinemaiden.org/forum/index.php?topic=5164.0) thread seems to have a get distance to line segment function that could be used for laser collisions if you don't already have an idea on how to do that.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 01, 2010, 02:02:43 AM
    Incoming new stuff.  w00t!


    I just finished implementing shot definition files.  It's pretty simple and straightforward:

    Code: (shots.txt) [Select]
    Musuu
    Script[mdBullet]
    Type[Shot]

    shot Shot1
    image shot1.png
    size1 5.5
    size2 7.5
    rotate false

    shot Shot2
    image shot2.png
    size1 5.5
    size2 7.5
    rotate true
    rect_x1 0
    rect_x2 -1
    rect_y1 0
    rect_y2 -1

    It should be pretty straightforward, but here's a description anyways:



    Once this is set up, you simple need to include the shot description file as such in your script:

    Code: (TheEnemy.txt) [Select]
    Musuu
    Name[Sample Enemy]
    Type[Enemy]

    // include the shot definitions
    include("shots.txt");

    // TheEnemy
    // Enemy boss that makes some fucking danmaku.
    Boss "TheEnemy"
    {
       // etc ...

    And then, when using FireShot01, instead of an image file name, give the shot type name defined in the file, such as:
    FireShot01(id->x, id->y, angle, 2.5, "Shot1");

    This will automatically pull the necessary details of the shot and apply it to the shot.

    You can also use this setup for custom shots - in your custom shot scripts init, add a call to the function SetShotInfo("shottype") and it will load the same parameters to the object.



    Note that I've removed the function FireShot01S, since its functionality is no longer necessary.



    With that, here's Test Release 5.

    Download is here (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20release%205%20%282010%2002%2028%29.zip&can=2&q=).

    In addition to the above-mentioned bullet definitions, there are also the random number functions added, and this time around I borrowed a couple of KimikoMuffin's sound effects for use as samples.
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on March 01, 2010, 03:26:04 AM
    Awesome!  I can't wait to write danmaku using rand()...

    Something I noticed when moving stuff to the new version.  Musuu no Danmaku can't look into subdirectories.  It would make organization much easier if it could.  I don't think we should have enforced subdirectories, like in Danmakufu, where players have to be in /player and scripts in /script, but some subdirectory crawling would be nice.

    Thats all for now, expect some more danmaku from me soon!

    EDIT: What's the optimal ratio of hitbox size to graze hitbox size?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 01, 2010, 03:56:21 AM
    Something I noticed when moving stuff to the new version.  Musuu no Danmaku can't look into subdirectories.  It would make organization much easier if it could.  I don't think we should have enforced subdirectories, like in Danmakufu, where players have to be in /player and scripts in /script, but some subdirectory crawling would be nice.

    This is a known issue, and I'll be putting in code for this at some point.  It'll be able to traverse directories freely.

    Related to this, right now if you try to include a file from within another file in a directory other than the current directory, it still looks for the include'd file in the current directory.  This will also be fixed.



    EDIT: What's the optimal ratio of hitbox size to graze hitbox size?

    I'd say it depends on the particular graphic.  I think generally the graze size is about as large as the sprite itself.

    The hit size is probably much more variable, and depends on how big the "core" of the shot is, so to speak.
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on March 01, 2010, 06:58:08 AM
    Test Release 5.

    Excellent, I've waited this for a long time. At last I can use shots with hitbox size bigger than the default one.

    However, you made a tiny mistake. The program errored on me until I changed all the decimal part indicators in the shot definition file from '.' to ','. I assume you do know how to fix this, though, since this has caused you trouble before, too.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 01, 2010, 07:59:47 PM
    I think it'd be a good idea to give line-numbers at minimum when a script fatalerrors. I got "The given key was not found in the dictionary" when I tried to run Phi2Dao's boss-script, which is neither helpful nor informative. :<
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on March 01, 2010, 10:16:07 PM
    The problem probably was that I used FireShot01S() a lot, and that function has been depreciated.  Change all FireShot01S() into FireShot01().

    I'm planning on writing a bullet definition file for the shot sheet that PT8Sceptile posted earlier (if they don't write one first), and when I do I'll upgrade my old enemies and repost them.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 02, 2010, 12:37:14 AM
    Hooray, it wor-- AUGH SHE'S CHASING ME

    Hmm. Maybe some system for "separate hitbox for items and bullets" maybe ... NO I DIDN'T SET THE HITBOX TO ZEROOOOO
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 02, 2010, 03:29:34 AM
    Excellent, I've waited this for a long time. At last I can use shots with hitbox size bigger than the default one.

    However, you made a tiny mistake. The program errored on me until I changed all the decimal part indicators in the shot definition file from '.' to ','. I assume you do know how to fix this, though, since this has caused you trouble before, too.

    ... fuck.  Stupid me forgot about that.

    I'll have it fixed first opportunity I get (sometime this weekend, hardships notwithstanding) and I'll upload an updated release.



    I think it'd be a good idea to give line-numbers at minimum when a script fatalerrors. I got "The given key was not found in the dictionary" when I tried to run Phi2Dao's boss-script, which is neither helpful nor informative. :<

    This will be handled.  I have to throw together a ton of structure to get this in place, but once it is you'll get much more detailed error reports.

    As phi2dao says, this is due to you calling FireShot01S, which was removed from the function list.  To clarify, the functions are stored in a Dictionary<string, function_definition>, where the key is the function name.  Right now, it doesn't have a "nice" check as to whether or not the list has the called function, so if it tries to grab something that isn't there, it asplodes and throws that exception.



    Hmm. Maybe some system for "separate hitbox for items and bullets" maybe ... NO I DIDN'T SET THE HITBOX TO ZEROOOOO

    Clarify?  Are you talking about player hitbox sizes?  Right now, if I'm remembering correctly, the player-item collision checking uses the same collision as the graze hitbox, which is larger than the actual hitbox used for "omg I dead" collisions.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 02, 2010, 03:42:21 AM
    Well, uh,
    when I did set the hitbox-size to 0
    , it ceased to collect items.

    Um, what's the exact syntax for setting size? |3
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on March 02, 2010, 04:05:00 AM
    SetSize(size1, size2);

    size1 is the collision size.  If it's 0, you can't be hit.
    size2 is the graze size.  If it's 0, you can't graze or collect items.

    So, for an invincible player that can still graze and collect items, you want SetSize(0, something); And not SetSize(0, 0);
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 02, 2010, 08:53:39 AM
    Right, I did SetSize(0, 32); and I couldn't collect items for some reason.
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on March 02, 2010, 02:59:24 PM
    I'm planning on writing a bullet definition file for the shot sheet that PT8Sceptile posted earlier (if they don't write one first), and when I do I'll upgrade my old enemies and repost them.

    You're not the only one doing that.

    However, while you're doing that, you might as well use this newer version (remember, it's still in development, since I'm only now getting to see how these bullets actually look in danmaku patterns.):
    (http://img638.imageshack.us/img638/2127/sheet.th.png) (http://img638.imageshack.us/img638/2127/sheet.png)

    No bullet locations have changed so whatever old data you've written will work.

    However, on more important matters:

    SetSize(size1, size2);

    size1 is the collision size.  If it's 0, you can't be hit.
    size2 is the graze size.  If it's 0, you can't graze or collect items.

    So, for an invincible player that can still graze and collect items, you want SetSize(0, something); And not SetSize(0, 0);
    Right, I did SetSize(0, 32); and I couldn't collect items for some reason.

    Which brings us to some interesting points I stumbled upon when playing with hitbox sizes. There are three problems in total that I noticed and started figuring out explanations for. These problems are:

    1 - Yes, making your hitbox size 0 will make you immune to both bullet collision AND item collection. Therefore I assume the collection function in the standard point item object is in collide1, not collide2. However, I can't say this for certain, since I have no idea where the default point item code is! I can find the functions it uses, but that doesn't specify is the function used in collide or collide2. Anyways, a simple switch fixes everything here (if I assume right).

    Then:

    2 - Actually, the bullet's collision size in the ShotData file is it's size_2, and not size_1. I noticed this when coding hitboxes for large bubble bullets (that are considerably smaller then the sprite). And lastly:
    3 - I don't get any graze at all. Whenever I start musuu with -dt, the graze counter stays at 0, period.

    However, 2 and 3 have a simple answer/solution. I took a look in the code for parsing bulletsheets and found this:

    Quote from: Musuu code
    else if (line.ToLower().StartsWith("size1 "))
                    {
                        // define the shot's size1
                        if (current_name != null)
                        {
                            current.size1 = double.Parse(line.Substring(5).Trim());
                        }
                    }
                    else if (line.ToLower().StartsWith("size2 "))
                    {
                        // define the shot's size2
                        if (current_name != null)
                        {
                            current.size1 = double.Parse(line.Substring(5).Trim());
                        }
                    }

    Facepalm. Thankfully fixing that is pretty much trivial now that we know where the problem lies.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 03, 2010, 02:30:16 AM
    Right, I did SetSize(0, 32); and I couldn't collect items for some reason.

    How odd.  Perhaps it's a bug in the collision algorithm.  I'll have to look into ...



    Facepalm. Thankfully fixing that is pretty much trivial now that we know where the problem lies.

    ... it.

    I reiterate ... fuck.


    Memo to self - stop rushing to get code out for test releases.  It's making me look bad.
    Title: Re: A replacement for Danmakufu?
    Post by: 8lue Wizard on March 03, 2010, 09:36:51 AM
    I would've expected Collide1 for item collection, leaving Collide2 for the magnetism effect...

    no? o.o
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on March 03, 2010, 02:19:19 PM
    Yes, found it. Now, for whatever collision type point items use:

    Quote from: Musuu code
                collide2 = new Script.Instruction[1];
                collide2[0] = mdBaseReader.Parse_Instruction_Line("call \"point_item_collect\", !collided_with_id");
                point_item.Attach_Script(collide2, "collide Player");

    While the variable name does indeed cause confusion, I believe this to be collide instead of collide2, since if it were collide2, the last line should be:

    Quote from: Musuu code
    point_item.Attach_Script(collide2, "collide2 Player");

    Therefore, calling SetSize(0, something) does prevent a player from collecting point items.

    I would've expected Collide1 for item collection, leaving Collide2 for the magnetism effect...

    no? o.o

    This seems like the better idea. Actually, the way this probably should be coded is to leave the point item collect to collide and implement player invincibility through some other means than reducing the collide1 size to zero (most probably through overriding the default "player collided with enemy shot/enemy/boss" collide functions with custom ones on custom players, or perhaps implementing default ones that have inbuilt invincibility support and add a SetPlayerInvincibility function similar to Danmakufu).
    Title: Re: A replacement for Danmakufu?
    Post by: Azure Lazuline on March 03, 2010, 06:33:25 PM
    You should use collide2 for the magnetism effect, but the actual item hitbox for collecting should be in the coding for the item, not the player. Things like how fast the item moves when it's "magnetized" should also be in the item code.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 03, 2010, 09:57:35 PM
    Maybe we should have a separate radius for magentism effect altogether -- it's much wider than grazing in MoF et al, i.e. when you Focus.

    Or am I misunderstanding you?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 04, 2010, 02:59:39 AM
    I would've expected Collide1 for item collection, leaving Collide2 for the magnetism effect...

    no? o.o

    I think the "magnetism" effect should be separately implemented in the item's tick function, since it's not anywhere as universal as item collection and such.

    And, in case you're wondering - the size1 and size2 parameters are per-object.  You can't set different sizes when colliding with different objects.



    Yes, found it. Now, for whatever collision type point items use:

    While the variable name does indeed cause confusion, I believe this to be collide instead of collide2, since if it were collide2, the last line should be:

    Therefore, calling SetSize(0, something) does prevent a player from collecting point items.

    ... something like that.  When I'm finally back at my desk (and not totally fried mentally), I have to go back and kick some ASCII to make it work right.



    This seems like the better idea. Actually, the way this probably should be coded is to leave the point item collect to collide and implement player invincibility through some other means than reducing the collide1 size to zero (most probably through overriding the default "player collided with enemy shot/enemy/boss" collide functions with custom ones on custom players, or perhaps implementing default ones that have inbuilt invincibility support and add a SetPlayerInvincibility function similar to Danmakufu).

    You should use collide2 for the magnetism effect, but the actual item hitbox for collecting should be in the coding for the item, not the player. Things like how fast the item moves when it's "magnetized" should also be in the item code.

    I think you guys are slightly misunderstanding how it works.  Setting the size1 or size2 effectively defines the object's collision as a circle (more shapes to come later!) of that radius.  When collision-checking between two objects, it (effectively) checks if the collision circles for the two are intersecting; that is, total distance from one object to the other is <= the sum of their size1 or size2 parameters.

    Setting the size to zero is a special case that basically says "this thing can't collide".  Of course, it only affects the "collision layer" that is set to zero (size1 set to 0, size2 set to 5, you'll still get collide2 events).

    The issue right here is that, as PT8Sceptile pointed out in the code, I mixed up the collide/collide2 on the default point item scripts.  Possibly when I was reworking the function definitions to allow specification of # and types of arguments.  Thus it tries to use size1 instead of size2 for collision-checking items with the player.


    As far as invulnerability goes - I do agree that there should be a better way to implement invulnerability, and I do plan to implement such.  It'll probably involve a simple invulnerability frames counter, along with adding a function to "kill t3h player" which does nothing if the player is invulnerable.  This'll come about the same time as proper lives/bombs support does.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 04, 2010, 04:56:03 AM
    Just had a thought: a separate "framework" script-type, included by different stage/enemy scripts, and it would handle stuff like lives, score, UI, etc., and then stuff like lives/respawning would be handled in that instead of hardcoded.

    Oh yeah, by the way, I forget if there was any plans for the level-script specifying the playing-field size ...
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 05, 2010, 03:50:36 AM
    Just had a thought: a separate "framework" script-type, included by different stage/enemy scripts, and it would handle stuff like lives, score, UI, etc., and then stuff like lives/respawning would be handled in that instead of hardcoded.

    There were some ideas that were kinda approaching this being thrown around previously ...



    Oh yeah, by the way, I forget if there was any plans for the level-script specifying the playing-field size ...

    This idea also got tossed in the pile.  Certainly possible to implement, although it'll be later on in development.




    I just put together Test release 5.1 (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20release%205.1%20%282010%2003%2004%29.zip&can=2&q=) - this should fix the two issues that were brought up in 5.
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on March 05, 2010, 03:50:04 PM
    I just put together Test release 5.1 (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20release%205.1%20%282010%2003%2004%29.zip&can=2&q=) - this should fix the two issues that were brought up in 5.

    Good news: Decimal annotation and point items work as supposed. Good work.

    Bad news:

    Quote from: mdBulletParser
                    else if (line.ToLower().StartsWith("size2 "))
                    {
                        // define the shot's size2
                        if (current_name != null)
                        {
                            current.size1 = double.Parse(line.Substring(5).Trim(), number_format_info);
                        }
                    }

    is still looming there in the source code. Just a friendly reminder on the fact that there were actually three problems instead of two.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 05, 2010, 08:30:11 PM
    This is exactly why I feel like grazing etc. should be in scripts instead of hardcoded. |3
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 06, 2010, 12:54:41 AM
    Good news: Decimal annotation and point items work as supposed. Good work.

    Bad news:

    is still looming there in the source code. Just a friendly reminder on the fact that there were actually three problems instead of two.

    Memo to self: Arg stop rushing arg!

    I fixed it in the codebase.  I kinda want to wait a couple days before putting up another updated build, incase something else pops up.

    Besides, you can't see graze counts yet (except the debug info flag), so I don't think it's that big a deal.  And this bug only affects bullet definitions from mdBullet files, so we won't see it affecting other things.



    This is exactly why I feel like grazing etc. should be in scripts instead of hardcoded. |3

    Thing is, they are scripted.  There are functions defined in the default bullet behaviors, that can easily be overriddden by a custom-defined EnemyShot type.

    You can see the functions defined in the Game class's initialization code.  These scripts are also put in place by default when a new enemy shot type is defined, but they can be overridden by defining new scripts for the same events.
    Title: Re: A replacement for Danmakufu?
    Post by: Prime 2.0 on March 06, 2010, 01:50:53 AM
    Bullets should disappear when they hit the player by default. Preferably in a method tied to the sprite used.  :V
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on March 06, 2010, 02:43:35 AM
    Oh right. *selfbap* I thought it was the source code for some reason ... I need to look through the not-source-codes some more |3
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on March 16, 2010, 02:12:49 AM
    Hey guys, just poking in to say I haven't run away.
    I started working on multiple directory support, but it's not complete yet.  It's got quite a few little details that need to be taken into account.


    Bullets should disappear when they hit the player by default. Preferably in a method tied to the sprite used.  :V

    Define "in a method tied to the sprite"?  I never really noticed this myself.
    (Not an art person etc etc you all know this already I'm sure)
    Title: Re: A replacement for Danmakufu?
    Post by: Prime 2.0 on March 16, 2010, 04:18:00 PM
    What I meant by that was that the default animation played by the dissipating bullet would be determined by the sprite used for said bullet. Different bullets dissapear in different ways, you see. :E

    Also, if you want to notice it, just go through Kaguya's endgame gauntlet. The one with those quickly moving lines of bullets will make the dissipation rather obvious, if you get hit by said line of bullets.
    Title: Re: A replacement for Danmakufu?
    Post by: null1024 on March 16, 2010, 09:10:55 PM
    Fired the example up to test, ran rather slow on my machine [at 800x600, sped up a bit at 640x480, problem went away at 320x240, but that's really small... but I'm so glad my laptop still supports fullscreen with such a low resolution...], and when the life display had a really small decimal part to it [like 50.00000000003], everything went even slower.

    I'm on a laptop with a 2.1GHz Dual Core Pentium, 3GB RAM, and one of the Intel GMA things for my video accelerator.
    Title: Re: A replacement for Danmakufu?
    Post by: lumber_of_the_beast on April 02, 2010, 07:50:36 AM
    Bumping, with what's probably a stupid question, but I've never used this or Danmakufu before and I don't know if I should learn danmakufu or wait for this or use this as is please don't hurt me  :ohdear:

    Will we be able to do complex, DoDonPachi-style backgrounds, with structures to blow up and ground-based enemies to hide behind them and under bridges and stuff? Or dink around with UI elements, like what bombs or the boss health bar look like?
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on April 03, 2010, 10:08:53 AM
    Bumping, with what's probably a stupid question, but I've never used this or Danmakufu before and I don't know if I should learn danmakufu or wait for this or use this as is please don't hurt me  :ohdear:

    Will we be able to do complex, DoDonPachi-style backgrounds, with structures to blow up and ground-based enemies to hide behind them and under bridges and stuff? Or dink around with UI elements, like what bombs or the boss health bar look like?

    Interactable backgrounds are under my understanding completely feasible even in DMF, and will be just as feasible in Musuu once it gets better drawing functions, verticed effect objects and possibly 3D, although that is only really required in extreme cases (and can actually be somewhat worked around if you're incredibly good with verticed effect objects). These interactable backrounds can be made with enemies that don't kill you on contact, but still have a certain amount of life before they die (and then trigger the destruction effect). The only thing required to make them is good enough scripting skills (which may be quite a lot depending how complex the backgrounds will be since more complexity = more code) and patience (and a fast enough engine, which might be the biggest obstacle of doing that in Musuu as of now since it's collision detection is still quite unoptimized, and there most probably are several other places in the code too that could be done better).

    Also, concerning the UI, Musuu seems to be headed in a direction where everything is customizable, so yes. Removing the lifebar might be tricky at the moment but otherwise customizing lives/bombs/etc... should be completely possible even as of now. Just add some effect objects on a drawing layer above the border image (which, by the way, can also be changed by changing the border image in the folder). Just remember that using text images is oftentimes faster that drawing text, since both Musuu and DMF have somewhat slow text-drawing functions. You can also achieve similar results in DMF with a bit of effect objects and stuff, but customizing the default functionality is a bit trickier in DMF.

    As for whether you should use DMF or Musuu, I'd say DMF is still somewhat better, but Musuu is well on it's way to overthrowing it. The biggest problem Musuu has as of now is it's unoptimized code, which severely limits what you can do, and lack of several useful things such as user-definable functions or stage scripts. If the engine can be optimized to even somewhat similar levels as DMF's and the lacking basic scripting functionality gets added in, I'd be ready to say that Musuu is at least as useful as DMF, if not more useful. However, even then it might be a question of taste. DMF has a lot more useful default features while musuu is more easily customizable, and their scripting languages are different. I'd say if you want to start scripting now DMF is better, but if you aren't in a hurry and can spend time designing graphics/BGMs/dialog for your game before starting to script it (like I'm doing at the moment), you should consider Musuu seriously. However, it all depends on how the development will proceed. Only time will tell.

    Also, has there been any progress since last update? It's been quite a while and the topic had even fallen down to the second page during that time. I'm not hurrying you up or anything but I'm just curious about how things are proceeding.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on April 03, 2010, 06:24:55 PM
    A brainstorming-thought: allowing scripters to make a "game" file, which would consist of all the script/graphics/sound/music/EVERY files you want, in one (say) uncompressed zip file, to distribute games more easily.

    Also, I kinda forget, but there was a "start music file from arbitrary point" function planned, wasn't there?

    Another crazy idea I had recently was whether it might be somehow possible to do Braid-style time-reversal, here or in Danmakufu. I'm really just tossing out ideas as they come to me.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on April 04, 2010, 01:46:16 AM
    Hey guys, I still exist.

    I gotta apologize; I haven't been able to get anything done in the last couple weeks. 



    What I meant by that was that the default animation played by the dissipating bullet would be determined by the sprite used for said bullet. Different bullets dissapear in different ways, you see. :E

    Also, if you want to notice it, just go through Kaguya's endgame gauntlet. The one with those quickly moving lines of bullets will make the dissipation rather obvious, if you get hit by said line of bullets.

    Ah, I see. We'll need to decide how to setup this in the bullet definitions files - I'm not sure how much variability we could have here.  If nothing else, would could allow it to point to a series of image subrects to define an animation (but there is probably some other, simpler way that I'm not thinking of at the moment).



    Fired the example up to test, ran rather slow on my machine [at 800x600, sped up a bit at 640x480, problem went away at 320x240, but that's really small... but I'm so glad my laptop still supports fullscreen with such a low resolution...], and when the life display had a really small decimal part to it [like 50.00000000003], everything went even slower.

    I'm on a laptop with a 2.1GHz Dual Core Pentium, 3GB RAM, and one of the Intel GMA things for my video accelerator.

    There's many possible factors that could be causing the slowdown here:

    First, what other programs are you running at the same time?  Musuu tends to start slowing down for me if I leave my (20+ tabs of) Firefox open, but as soon as that closes it smooths out.

    Second, what OS?  I don't think this'll make a huge difference, but some OSs may have worse overall performance than others.

    Third, Musuu (currently, at least) does not support multiple cores, so it is only making use of one of the cores in your processor.  There has been talk of adding in multithreading, which will make it able to support multiple cores, but that is a rather complex thing to implement here.

    Fourth, "Intel GMA things for my video accelerator" - this could be the biggest issue.  Quick google to wikipedia tells me that this is a low-end integrated video card.

    Fifth, it should be noted that the engine still has a lot of optimization to go through, so there is definitely some performance improvement potential to be had down the line.


    As far as the text slowing things down more - the text display algorithm (right now, at least) is a rather heavy processor-use piece of code, so when it gets to the "50.0000000003" case, where it has a bunch more characters to display, it has to put in a lot more work to show it (although I think yours is a bit extreme of a case).

    Also, to note - the reason we get the "50.000000003" case to begin with is due to floating-point rounding.



    Bumping, with what's probably a stupid question, but I've never used this or Danmakufu before and I don't know if I should learn danmakufu or wait for this or use this as is please don't hurt me  :ohdear:

    That's a question that you'll have to decide on your own.  Danmakufu is out right now and has a (mostly) fine set of usable features, although with some annoying quirks and some strange limitations.  Musuu is still in development and will probably be for at least a few more months (don't take this as any indication of a release timetable, please), but hopes to be more powerful and flexible that Danmakufu in the long run.

    It should be noted, though, that the two do (or will, for features not yet implemented in Musuu) share a fair bit of commonality at a higher-level view (IMO, anyways).



    Will we be able to do complex, DoDonPachi-style backgrounds, with structures to blow up and ground-based enemies to hide behind them and under bridges and stuff? Or dink around with UI elements, like what bombs or the boss health bar look like?

    Like PT8 said, ground-based enemies/objects are already possible in Danmakufu.  In Musuu, they're definitely doable as well right now - basically I'd think you'd just create an object that moves along the screen at the same rate as the background.

    For the UI, I know Danmakufu lets you pick a custom border image.  I also know you can draw over the border in some way (I haven't looked at it, myself), as well as customize player life and bomb icons.  Musuu doesn't have any of this yet, but there is definitely plans to have a fully customizable UI.



    Also, concerning the UI, Musuu seems to be headed in a direction where everything is customizable, so yes. Removing the lifebar might be tricky at the moment but otherwise customizing lives/bombs/etc... should be completely possible even as of now. Just add some effect objects on a drawing layer above the border image (which, by the way, can also be changed by changing the border image in the folder). Just remember that using text images is oftentimes faster that drawing text, since both Musuu and DMF have somewhat slow text-drawing functions. You can also achieve similar results in DMF with a bit of effect objects and stuff, but customizing the default functionality is a bit trickier in DMF.

    Actually, not true regarding Musuu and drawing over the border - right now, all scriptable drawing in Musuu is done within the gameplay frame only.  Of course, this is a limitation that will be removed later on.



    Also, has there been any progress since last update? It's been quite a while and the topic had even fallen down to the second page during that time. I'm not hurrying you up or anything but I'm just curious about how things are proceeding.

    As stated above, I've been unable to make any updated in the last couple weeks.  Mainly due to more family crap and being even further behind on sleep that I usually am (which is quite an accomplishment, unfortunately).



    A brainstorming-thought: allowing scripters to make a "game" file, which would consist of all the script/graphics/sound/music/EVERY files you want, in one (say) uncompressed zip file, to distribute games more easily.

    We've had this idea before; I  don't know how easy/hard it'd be to write code that reads a .zip file, though.

    At the very least, there is also the plan to create the compact script file format which could include all the necessary assets for a game.



    Also, I kinda forget, but there was a "start music file from arbitrary point" function planned, wasn't there?

    There might have been.  The only ones I remember were basic "play music" and "A-B repeat" (either in the same file, or with two files A and B).  What you mention is probably doable.



    Another crazy idea I had recently was whether it might be somehow possible to do Braid-style time-reversal, here or in Danmakufu. I'm really just tossing out ideas as they come to me.

    While I'm not sure how it's done in Braid (never played it), generally any time-reversal mechanic is, at best, a pain in the ass to impement and, at worst, nigh-impossible.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on April 04, 2010, 04:59:25 AM
    Then I shall concern myself no further with the Braid idea. (I'd imagine that it has something to do with "everything is fugging deterministic" and built an engine specifically for time-reversal shennanigans.)

    I think "start from arbitrary point in music" would be highly useful, though. I suspect one of the reasons ZUN made you start over levels when you used a continue in MoF (the first game to feature game-over music) was that he couldn't be assed to add support for "stop music A, play music B, then stop music B and possibly resume A from where it left off."

    Hmm. I'm toying with other ideas, such as (basically) Variable Mix (http://tvtropes.org/pmwiki/pmwiki.php/Main/VariableMix) (beware, TVTropes) but, um, it can wait.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on April 05, 2010, 01:44:32 AM
    Then I shall concern myself no further with the Braid idea. (I'd imagine that it has something to do with "everything is fugging deterministic" and built an engine specifically for time-reversal shennanigans.)

    Either everything needs to be, as you said, deterministic, such that the game engine could calculate the rewind, or you'd literally need to save the game's state at a regular interval (ideally every frame, but that would probably be overkill), such that you can "rewind" by loading up an earlier state.  Given the user-scripted nature of a project like Musuu, the latter would probably be the only "reasonable" option.



    A bit of progress today - I added in support for traversing directories in the menu.  This almost finishes up support for multiple directories, except it doesn't properly set up paths yet when loading and playing sound files.  Unfortunately, I'm a bit too fried to work at that one tonight, so it'll have to wait until next weekend or so.

    The way it is right now, the program can traverse to any directory - it lists directories in a light green color in the menu (to distinguish them from the files, which are a light blue), and you just select one to change to that directory.  You can also indicate different paths for included scripts and images, and it'll act accordingly.

    The way it works, effectively, is that each loaded object type is labelled with the directory of the file it is loaded from.  That directory is used as the base directory for all file references made in that type's scripts.


    Finally, I should emphasize at this point that people should use the forward slash ("/") to separate directory names in a path, rather than the backwards slash ("\").  The backwards one is only used as such on Windows platforms, while the forwards one works on all platforms (that I know of, anyways).  Using the forward slash should ensure that scripts will work properly on all platforms.

    While I'm on the topic of platform-independant file access, I'd also like to remind you that some operating systems have case-sensitive file naming; some others don't.  Script accordingly. ;)
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on April 07, 2010, 03:57:08 AM
    It took me long enough, but I finally made a shot script for the shot sheet posted earlier.  Here (http://www.mediafire.com/?4jmy1nqhbmm) it is.  The .rar contains the shot sheet, the shot script, and the ruby program that I used to create the shot script.

    To use this, just unpack it in your Musuu folder, and put
    Code: [Select]
    include("sheet.txt") in your Musuu script.

    NOTES:  There is something weird with how Musuu selects rectangles.  Sometimes colors bleed into each other.  I think the problem isn't on my end though.

    PS: I actually have ideas for Danmaku, so I might actually post something sometime soon!
    Title: Re: A replacement for Danmakufu?
    Post by: SupahVee1234 on April 07, 2010, 08:59:59 PM
    Hey Nuclear, I'm trying to make my own Danmakufu-clone with C#, SFML and LuaInterface, but I can't figure out how to implement a "yield / wait" function in my scripts. Do you run the script in a separate thread? How do you handle the wait function?  :blush:
    Title: Re: A replacement for Danmakufu?
    Post by: anonl on April 07, 2010, 10:27:29 PM
    I'm trying to make my own Danmakufu-clone with C#, SFML and LuaInterface, but I can't figure out how to implement a "yield / wait" function in my scripts.
    I used LUA in TouhouDS -- you can implement yield using lua threads and coroutine.yield()
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on April 12, 2010, 01:02:09 AM
    It took me long enough, but I finally made a shot script for the shot sheet posted earlier.  Here (http://www.mediafire.com/?4jmy1nqhbmm) it is.  The .rar contains the shot sheet, the shot script, and the ruby program that I used to create the shot script.

    To use this, just unpack it in your Musuu folder, and put
    Code: [Select]
    include("sheet.txt") in your Musuu script.

    NOTES:  There is something weird with how Musuu selects rectangles.  Sometimes colors bleed into each other.  I think the problem isn't on my end though.

    PS: I actually have ideas for Danmaku, so I might actually post something sometime soon!

    The color bleeding issue probably has something to do with the blending function - it sounds like it's starting to blend into the next pixel on the image.  I might be able to tweak the texture coordinates slightly to fix this (in the engine code), but if nothing else it could most likely be solved by just adding a one or two pixel of empty buffer zone between each bullet image.



    Hey Nuclear, I'm trying to make my own Danmakufu-clone with C#, SFML and LuaInterface, but I can't figure out how to implement a "yield / wait" function in my scripts. Do you run the script in a separate thread? How do you handle the wait function?  :blush:

    Musuu no Danmaku doesn't have separate script tasks, nor does it have the yield/wait functions.  There are plans to implement such, however, and if I remember correctly there was an idea how to do it earlier in the thread (although it may be more applicable to my custom script engine than your Lua-based one).

    As far as running scripts in separate threads - this can get really ugly.  If you have multiple threads running scripts, you lose deterministic behavior, since you can't be guarenteed that one thread will finish processing X before or after another thread finished processing Y.  Right now Musuu runs everything in a single thread; there was talk of moving the rendering side of things to a separate thread, but that's on the backburner for now.


    (PS - how many Danmakufu clones in progress are there?  Mine, Blargel's, SupahVee's, ... did I start a fad or something? :/)



    Multiple directory support is FINALLY done in MnD.  Took me far too much longer than it should have, but it should work fine now.

    I moved point_item.png into a subdirectory called basic, which will be the place to store common engine assets (now that I think about it, the background image should probably go there, too).


    Once again, I must emphasize that, when writing in any directory names, scripters should use the forward slash ('/') instead of the backward slash ('\') to ensure cross-platform compatibility.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on April 19, 2010, 01:33:36 AM
    Hey again people.  Just bumping in here to mention that I've started working on updated script error reporting code.

    Right now it has specific error messages for the following conditions:

    The way it is right now, you can only get the full error description in the log file - the menu only shows a one-liner indicating the outermost script from which the error occurs.  My current plan is to add a button press or option in the menu that will allow the user to see the full info from the last script error that occured, and maybe also to save that info to a file.


    The error reports look something like this (not exact, as the reporting isn't final):

    Error in TheEnemy.initialize ...
    Variable not defined: some_other_stuff


    It will retain call stack information, so scripters will have a bit more context to help them debug their scripts.


    There's still some work to do with it, though.  At the very least, it still needs messages for when it can't load a file (image, sound, music, etc) and when it hits the infinite-loop protection.  Am I missing other ones?


    On the bright side, I've got some extra time this week, so I might be able to get something done before the next weekend.


    EDIT:

    So much for that extra time ...
    Work, finding out my website hosting expired, work, L4D, work, ... oh right MnD! :derp:


    Got some more done with the error reporting tonight.  It will now also create error messages if you try to load a non-existant file (image, sound, or music) as well as if you hit the infinite loop protection.
    To note - since the image files are loaded right when they're needed in the graphics engine, rather than during script execution, the code can't (currently, at least) give script context for a missing image file.

    I also moved the code that spawns the initial player and enemy objects so that it runs on the first game tick, rather than right after it finishes loading everything in the menu.  This shouldn't have any visible effects, but it makes things more straightforward in the code (and gets rid of a bit of duplicated code).


    Still need to get the "hey here's that error you just had" option into the menu, but then I think the new error reporting scheme is pretty much good to go for the time being.



    Oh, crazy idea I just had while typing this - in addition to the option of saving the error report like described above, perhaps I could also add the option of saving the complete game state to a file.  This would mainly include a listing of all objects currently in the game (position, image, type, object variables, ...) as well as global variables and, once they're implemented, similar information for tasks.
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on April 23, 2010, 12:49:17 PM
    Oh, crazy idea I just had while typing this - in addition to the option of saving the error report like described above, perhaps I could also add the option of saving the complete game state to a file.  This would mainly include a listing of all objects currently in the game (position, image, type, object variables, ...) as well as global variables and, once they're implemented, similar information for tasks.

    This sounds really interesting and potentially useful. Once this thing has gotten to a somewhat stable point definitely experiment with that.

    Checklist update:

    *Concerning lasers, they need 3 things to match DMF:s
    - Elliptical/line segment with radius/some other laserlike collision type.
    - Stretching effect similar to verticed effect objects.
    - ADD rendering.

    Number two somehow suggests that verticed effect objects should be higher than low priority, even if 3D certainly is such. Another assistive feature is that they are something that OpenGL practically does for us, the only things required are creating a list of vertices and a variable to save the vertice data interpretion type (for example, TRIANGLEFAN, TRIANGLESTRIP, or the one MnD is currently using in it's draw function: QUADS). Then just add a new draw function or modify the existing one to use vertice data instead of rectangle bounds, and scripting functions to modify these variables.

    Collision is however tricky: It's quite easy to approximate elliptical collision, but getting exact results is most certainly not easy. This raises the question of how accurate should MnD:s collisions be (since more accuracy means less efficience). This is especially problematic with small elliptical bullets because there are often hundreds of objects on the screen and if most of them were elliptical, using accurate collision checking methods without a lot of pruning first may result in a noticeable performance drop.
    Title: Re: A replacement for Danmakufu?
    Post by: Azure Lazuline on April 23, 2010, 06:05:22 PM
    Danmakufu's lasers use line segment collision, not elliptical collision. Or at least, I think they do. Either way, it would be nice to have that option - that will work much better for long, thin lasers than an elliptical collision box would. You could perhaps have that plus two types of elliptical collision (accurate/efficient), even if that gets a bit complicated; that way every situation is handled and the only downside is having an extra parameter in the shot definition file or laser-creation function (which you could even overload so it's not always needed).
    Title: Re: A replacement for Danmakufu?
    Post by: SupahVee1234 on April 25, 2010, 09:14:08 PM
    Uh, are you looking for another programmer? I don't really like working alone on a big project.

    So, can I give you a hand?  :ohdear:
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on April 26, 2010, 01:09:50 AM
    *Concerning lasers, they need 3 things to match DMF:s
    - Elliptical/line segment with radius/some other laserlike collision type.
    - Stretching effect similar to verticed effect objects.
    - ADD rendering.

    Number two somehow suggests that verticed effect objects should be higher than low priority, even if 3D certainly is such. Another assistive feature is that they are something that OpenGL practically does for us, the only things required are creating a list of vertices and a variable to save the vertice data interpretion type (for example, TRIANGLEFAN, TRIANGLESTRIP, or the one MnD is currently using in it's draw function: QUADS). Then just add a new draw function or modify the existing one to use vertice data instead of rectangle bounds, and scripting functions to modify these variables.

    Collision is however tricky: It's quite easy to approximate elliptical collision, but getting exact results is most certainly not easy. This raises the question of how accurate should MnD:s collisions be (since more accuracy means less efficience). This is especially problematic with small elliptical bullets because there are often hundreds of objects on the screen and if most of them were elliptical, using accurate collision checking methods without a lot of pruning first may result in a noticeable performance drop.

    Based on the discussion earlier, we're going to go with a line segment-based collision setup for lasers, with some algorithm to check if something is within X distance from a line segment (or if two line segments are within X distance of each other) ...



    Uh, are you looking for another programmer? I don't really like working alone on a big project.

    So, can I give you a hand?  :ohdear:

    The google code page is here (http://code.google.com/p/musuu-no-danmaku/).  Take a look at the codebase - if you're up to it, I can add you to the developer list.



    Sorry, no new progress today since I instead decided to go and buy a new computer.  Silly me. :3
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 02, 2010, 10:32:14 PM
    Bumping to let you guys know that the error handling code is in place and checked into the codebase.

    The way it works is as follows:


    I decided to just go ahead and implement my full-dump idea from before, since it wasn't much more than I was already implementing.


    The overview looks something like this:

    Code: [Select]
    Error in TheEnemy.tick ...
    Error in PlaySfx ...
    Attempted to load unknown file: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\Shot9001.wav

    (sample is from a script I wrote to test error handling, which deliberately tries to load a non-existant sound file)

    What this gives is a simple stack trace of the script execution, up to where the error occurred.

    The full dump looks like this:

    Code: [Select]
    Error in TheEnemy.tick ...
    Error in PlaySfx ...
    Attempted to load unknown file: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\Shot9001.wav

    Object types loaded:
    BasicEnemyShot
    BasicPlayerShot
    PointItem
    TheEnemy
    EvilShot
    AnotherPlayer


    Globals:
    - point_value [Number_Literal] = 10000


    Objects:

    0 - TheEnemy
    Location: (243, 100)
    Angle: 0
    Speed: 0
    Life: 146.7 / 150
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\reimu1.png
    Local variables:
    - parameters [Array] containing 5 entries
      - entry 1 [String_Literal] = reimu1.png
      - entry 2 [Number_Literal] = 60
      - entry 3 [Number_Literal] = 0.5
      - entry 4 [Number_Literal] = 150
      - entry 5 [Number_Literal] = 75
    - num_bullets [Array] containing 4 entries
      - entry 1 [Number_Literal] = 3
      - entry 2 [Number_Literal] = 7
      - entry 3 [Number_Literal] = 5
      - entry 4 [Number_Literal] = 7
    - num_bullets_index [Number_Literal] = 1
    - count [Number_Literal] = 60
    - move [Number_Literal] = 0.5

    1 - AnotherPlayer
    Location: (241, 379)
    Angle: 0
    Speed: 0
    Life: 0 / 0
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\test1.png
    Local variables:
    - count [Number_Literal] = -7

    5 - BasicPlayerShot
    Location: (241, 152)
    Angle: 0
    Speed: 8
    Life: 1.1 / 1.1
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\player_shot1.png
    Local variables:

    6 - BasicPlayerShot
    Location: (241, 192)
    Angle: 0
    Speed: 8
    Life: 1.1 / 1.1
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\player_shot1.png
    Local variables:

    7 - BasicPlayerShot
    Location: (241, 211)
    Angle: 0
    Speed: 8
    Life: 1.1 / 1.1
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\player_shot1.png
    Local variables:

    8 - BasicPlayerShot
    Location: (241, 251)
    Angle: 0
    Speed: 8
    Life: 1.1 / 1.1
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\player_shot1.png
    Local variables:

    9 - BasicEnemyShot
    Location: (243, 100)
    Angle: 2.36336282618944
    Speed: 2.5
    Life: 0 / 0
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\shot\shot1.png
    Local variables:
    - this_bullet_grazed [Boolean_Literal] = False

    10 - BasicEnemyShot
    Location: (243, 100)
    Angle: 3.14876098958689
    Speed: 2.5
    Life: 0 / 0
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\shot\shot1.png
    Local variables:
    - this_bullet_grazed [Boolean_Literal] = False

    11 - BasicEnemyShot
    Location: (243, 100)
    Angle: 3.93415915298433
    Speed: 2.5
    Life: 0 / 0
    Image: C:\Documents and Settings\NuclearCheese\My Documents\Visual Studio 2005\Projects\Musuu no Danmaku\Musuu no Danmaku\bin\Debug\shot\shot1.png
    Local variables:
    - this_bullet_grazed [Boolean_Literal] = False

    In addition to the overview, you get information on all loaded types, global variables, and the details for every individual object currently in the game.  It can get to be a lot of information, but I can see it helping scripters debug their scripts.
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on May 03, 2010, 01:06:50 AM
    Could you release a new version with all of this new stuff?  Or tell me how I could compile it myself?
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on May 03, 2010, 03:39:00 PM
    Could you release a new version with all of this new stuff?  Or tell me how I could compile it myself?

    For compiling it yourself (this is at least what I've done and succeeded in doing, but I'm no expert on C# stuff, so someone else might know an easier way or better programs for the job):

    1. Get the necessary programs: A SVN client (I used TortoiseSVN), a C# Compiler/IDE (in my case SharpDevelop) and a tool for converting the ANTLR file into C# (again in my case, ANTLRworks). Install whichever ones need installing
    2. Create a folder where you'll store the code and use the SVN client to checkout a copy of the code into the folder.
    3. Use whichever ANTLR tool you have to convert the mdScript_to_mdBase.g -file into the C# lexer/parser files (they should have a similar file extension as the other code files).
    4. Open up the IDE and then either:
      4a. Use one of the preconfigured project files. The repository seems to have some for Visual studio and they may work, but seeing as I used SharpDevelop, I can't really give you advice on them.
    ...or if that doesn't work:
      4b. Create a new project for Musuu. Add all the files you checked out with SVN into your project files. Then, add all the .dll -files distributed with Musuu, including the SDL.NET -dll you probably have installed on your computer to get Musuu working, into your project references.
    5. Compile. It should show some warning/ToDO - messages, but if there are no errors that prevent compiling, you've probably succeeded.
    6. Take the compiled file and put it into the Musuu folder (don't delete the old one incase the new one doesn't work for some reason). Run the file.

    Afterwards when updating, you only need to do a SVN-update to your files, reconvert the .g -file, add any new files into your list (if you're not using an existing project file), add any new .dlls (again, if you're not using the existing project files) and compile.

    I've succeeded in this, so it certainly should work in compiling the files, but I can't guarantee that I can remember every single step I've taken (at least I haven't had to edit the files at all, though). Again, if anyone knows an easier way or better programs to use, go ahead and correct me.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 04, 2010, 02:26:24 AM
    Could you release a new version with all of this new stuff?  Or tell me how I could compile it myself?

    I could put together a new testing release later in the week or the weekend.  Too busy with work and family stuff during the week (fortunately, it looks like this'll start taking less of my time soon).



    For compiling it yourself (this is at least what I've done and succeeded in doing, but I'm no expert on C# stuff, so someone else might know an easier way or better programs for the job):

    1. Get the necessary programs: A SVN client (I used TortoiseSVN), a C# Compiler/IDE (in my case SharpDevelop) and a tool for converting the ANTLR file into C# (again in my case, ANTLRworks). Install whichever ones need installing
    2. Create a folder where you'll store the code and use the SVN client to checkout a copy of the code into the folder.
    3. Use whichever ANTLR tool you have to convert the mdScript_to_mdBase.g -file into the C# lexer/parser files (they should have a similar file extension as the other code files).
    4. Open up the IDE and then either:
      4a. Use one of the preconfigured project files. The repository seems to have some for Visual studio and they may work, but seeing as I used SharpDevelop, I can't really give you advice on them.
    ...or if that doesn't work:
      4b. Create a new project for Musuu. Add all the files you checked out with SVN into your project files. Then, add all the .dll -files distributed with Musuu, including the SDL.NET -dll you probably have installed on your computer to get Musuu working, into your project references.
    5. Compile. It should show some warning/ToDO - messages, but if there are no errors that prevent compiling, you've probably succeeded.
    6. Take the compiled file and put it into the Musuu folder (don't delete the old one incase the new one doesn't work for some reason). Run the file.

    Afterwards when updating, you only need to do a SVN-update to your files, reconvert the .g -file, add any new files into your list (if you're not using an existing project file), add any new .dlls (again, if you're not using the existing project files) and compile.

    I've succeeded in this, so it certainly should work in compiling the files, but I can't guarantee that I can remember every single step I've taken (at least I haven't had to edit the files at all, though). Again, if anyone knows an easier way or better programs to use, go ahead and correct me.

    This sounds about right for a general-case.  One thing to note, though, is that I read that SharpDevelop can read Visual Studio project files - not sure if it requires anything special myself, since I mainly use Visual C# Express.

    To note, the main project file was made in Visual C# Express 2005; there is also a project file from 2008 in the repository as well.
    Title: Re: A replacement for Danmakufu?
    Post by: PT8Sceptile on May 04, 2010, 03:38:30 PM
    One thing to note, though, is that I read that SharpDevelop can read Visual Studio project files - not sure if it requires anything special myself, since I mainly use Visual C# Express.

    To note, the main project file was made in Visual C# Express 2005; there is also a project file from 2008 in the repository as well.

    I've tried opening the main project file once (they had the same file extension as the project files SharpDevelop saves, so I thought it might have a chance of working), but unfortunately it was unable to open it properly. Haven't tried with the 2008 one, though.

    But whatever, I've got my workarounds working so the project file isn't really an issue. More like a convenience if it actually decided to work.
    Title: Re: A replacement for Danmakufu?
    Post by: Foremoster on May 04, 2010, 06:31:57 PM
    I dream of a drag and drop system. Kinda like RPG maker.
    Sticks and stones can break my bones, but words may hurt your brain :derp:
    " eh wonder how that will work "
    Title: Re: A replacement for Danmakufu?
    Post by: GenericTouhouFailure on May 05, 2010, 08:21:30 AM
    I know I'm being a complete ⑨ for:
    1. Not searching this thread for a Downloadz link hard enough
    2. not understanding how the heck am I supposed to "Edit the /Library/Frameworks/Mono.framework/Versions/Current/etc/mono/config file to include the entries from the SdlDotNet.dll.config and Tao.Sdl.dll.config files." what the shit do i add?!? *internal raging from unability of running danmaku*

    Ps: this mac user has sum ugly as fuck star graphics that causes puking (made for a danmaku test project in flash)
    comes in 7 colors (take a look first)
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 09, 2010, 09:26:00 PM
    I dream of a drag and drop system. Kinda like RPG maker.
    Sticks and stones can break my bones, but words may hurt your brain :derp:
    " eh wonder how that will work "

    You mean a way to just drag-and-drop to design danmaku patterns?  I believe there was another project around here to do that for Danmakufu scripts, but (unless I missed sometihng) there isn't such a thing for Musuu no Danmaku yet.  At this point the main focus is getting the game engine itself in working order with all of its desired features, but if someone wants to take a shot at desiging such a program for MnD (or if they want to add to/modify the aforementioned Danmakufu-targetting program to work with MnD as well), feel free to give it a go.



    I know I'm being a complete ⑨ for:
    1. Not searching this thread for a Downloadz link hard enough
    2. not understanding how the heck am I supposed to "Edit the /Library/Frameworks/Mono.framework/Versions/Current/etc/mono/config file to include the entries from the SdlDotNet.dll.config and Tao.Sdl.dll.config files." what the shit do i add?!? *internal raging from unability of running danmaku*

    Download links generally are found on the Google Code page for this project (http://code.google.com/p/musuu-no-danmaku/).  I also post links for individual Test Releases as they are releases.
    (such as below)

    As far as configuring Mono for whatever, I'm not particularly familiar with that end of things, since I don't use Mono myself, but I know some people around here have run this program with Mono - perhaps they can help?
    My understanding is that, once you have Mono installed, you'd just need to navigate to the directory you unzip'd the Musuu no Danmaku files into and run it something like:
    mono "Musuu no Danmaku.exe"

    ... I could be wrong on that, though. :/



    Test Release 6 (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20release%206%20%282010%2005%2009%29.zip&can=2&q=#makechanges)

    Now contains directory navigation and support for multiple directories, as well as much improved script error handling and reporting.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 30, 2010, 01:33:32 AM
    Hey guys, remember me?

    I've been a bit busy the past few weeks, so there hasn't been any updates.  But that all changes today!

    I just added in support for lives and respawning.  It works as follows:


    The way this is designed to be used is something like this:

    While this approach is a bit more cumbersome than Danmakufu's, it allows player scripts to give customize miss animations and such.


    Right now, the default script I put in there just respawns the player immediately, with 300 frames of invulnerability.  But I put in custom scripts into the two sample player scripts, which has them freak out in place for 90 frames (set the image to a random angle every frame) before respawning with 240 frames of invulnerability.


    I'm planning to do something similar with bomb scripts by adding a bomb script that gets called whenever the player hits the bomb button (inventory and "no-bomb" settings notwithstanding).




    Also, I added in text display of score, graze, lives, and bombs while in-game.  Yay. :V
    Title: Re: A replacement for Danmakufu?
    Post by: Mjonir on May 30, 2010, 04:23:47 PM
    Sorry for not reacting to what you just posted, but I've got a general question:

    Are you creating a new scripting language from the bottom up, or are you using parts of an existing language ?


    If you're making a new one (I think it's the case), what were your reasons not to use an existing one?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 30, 2010, 10:28:10 PM
    Sorry for not reacting to what you just posted, but I've got a general question:

    Are you creating a new scripting language from the bottom up, or are you using parts of an existing language ?


    If you're making a new one (I think it's the case), what were your reasons not to use an existing one?

    This engine has its own scripting languages, which were created from scratch.

    The main one is mdScript, which is a script language using a C-like syntax, and is somewhat similar to what is used in Danmakufu's scripts.
    This is interpreted using a parser built in ANTLR.  You can see the source on the Google code page - it's the file with the .g extension.  When an mdScript file gets read in, it is converted to mdBase, which is an internal script language used by the code itself during script execution.

    There is also mdBullet, which is used for defining custom bullet information.
    This has a simple enough syntax that it I just have code that interprets it directly.


    The reasons I went down the path of creating a new scripting language are pretty simple:


    There's also the idea that, once the engine is more complete, we could add in support for other scripting languages as well (Lua has been brought up a few times in this thread, and the idea of reading Danmakufu scripts has appeared at least once or twice).
    Title: Re: A replacement for Danmakufu?
    Post by: Mjonir on May 30, 2010, 11:08:31 PM
    Thank you very much for your complete reply, I'll probably have a closer look at how it works later now that I get the idea :)

    Quote
    If something is broken in our scripting language, we can simply fix it, whereas if something is broken in someone else's script language, we'd need to rely on them to fix it (might not be entirely true, given the amount of open-source projects out there today).  This also applies to new features to be added into the scripting language.

    I was told Lua was very easy to tweak and very reliable. For example somebody told me that an infinite loop protection would only require 5 added lines of code into Lua.

    Quote
    Call me crazy if you must, but I actually found it easier to set up my own scripting language than to use someone else's.

    You're not, I also had this idea at first... and when I first looked at the principles of embedding, I thought making mine would be way easier :P


    I asked this because I'm currently wondering what to do for my own project. Embedding another langage has the advantage of easily bringing a huge lot of advanced possibilities through the syntax itself (think of Python instructions for example, and object-oriented), and through third-party libraries (math/matrix functions for example).

    I'm still thinking about all of this, but at the moment I think I'll embed Lua or Python (I really can't decide which :s). I'd give the game programmer 2 ways of using my engine: On one hand very simple instructions/functions which are completely coded in the C++ application, and on the other hand access to low-level functions of my engine (like direct-access to the object-manager or the sprite manager) which will allow the game programmer to bring the complexity in the script rather than in the C++ application so that he can choose exactly how things are done and even add the possibility of doing things that weren't implemented at all in the engine in the first place. For example the game programmer could decide to directly handle files using some Lua/Python libraries and save some permanent data if this is not impletemented in the engine.

    Like I said I'm still it brainstorming about all this, it also brings more complication related to the embedding of the language and things like being in sync with the framerate (although I'll probably have to re-do this as well). I thought all of this may be solved in a standard Lua/Python library packed with the engine.


    All of this to tell you that if it works like it should, it might be a very nice feature to have in your engine. It's worth thinking about it :)
    Title: Re: A replacement for Danmakufu?
    Post by: lumber_of_the_beast on June 08, 2010, 02:50:32 AM
    And today's dumb question:

    Might it be possible to have two different power meters - one for your own shot, and one for options? Maybe by - and keep in mind I have never tried anything remotely like this before so I do not know if I am using the right words - defining Power1 and Power2 as opposed to just Power in the stage and player scripts, and then setting it up so that if the player script receives a Power boost instead of a Power1/2 boost, it applies to both, and if the stage script tries to give a Power1 or Power2 item to a shottype that lacks those, it'll instead dispense a Power item?
    Title: Re: A replacement for Danmakufu?
    Post by: Danielu Yoshikoto on June 08, 2010, 05:15:39 AM
    Might it be possible to have two different power meters - one for your own shot, and one for options? Maybe by - and keep in mind I have never tried anything remotely like this before so I do not know if I am using the right words - defining Power1 and Power2 as opposed to just Power in the stage and player scripts, and then setting it up so that if the player script receives a Power boost instead of a Power1/2 boost, it applies to both, and if the stage script tries to give a Power1 or Power2 item to a shottype that lacks those, it'll instead dispense a Power item?

    I think it might be possible due to the Power (as in 0-127 or 0.00-4.00) for the Characters is actually manually scripting into the players (to my knowledge). Danmakufu doesn?t keep the variable for Power on it?s own and it doesn?t have any Power Ups build in. So they would have to be made manually for the script/stage/game as well as for the player. And yes... It should be possible to set up two variables with the name "Power1" and "Power2" then.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on June 09, 2010, 02:40:10 AM
    And today's dumb question:

    Might it be possible to have two different power meters - one for your own shot, and one for options? Maybe by - and keep in mind I have never tried anything remotely like this before so I do not know if I am using the right words - defining Power1 and Power2 as opposed to just Power in the stage and player scripts, and then setting it up so that if the player script receives a Power boost instead of a Power1/2 boost, it applies to both, and if the stage script tries to give a Power1 or Power2 item to a shottype that lacks those, it'll instead dispense a Power item?

    There is no built-in power system yet, although there was talk of having a setup which allowed the game scripter to set the value of power items and the thresholds for the different "power levels" which in turn define the power at which the player script should shoot.

    Creating a second power level, even with the above idea implemented, wouldn't be too hard.  Just use a global for your Power2 level, and have your game/stage scripts adjust as necessary.  The only catch would be that, if you want your player to function with other scripts, you'll need to set up a default value for Power2, or detect that you're on a different script and base the Power2 off of the regular shot power level.

    But, as Danielu Yoshikoto said, it's definitely possible to script in Musuu no Danmaku.



    New stuff today: Bombs.

    Bombs are triggered under the following conditions:
    - Player presses bomb key
    - Player has a bomb in stock
    - Player is not in invulnerability

    It'll subtract a bomb stock and run the bomb script.  Like miss, it's meant for the player object, but any object type can use it.

    Bomb stock resets when the player misses (specifically, at the same time a life is deducted).


    There is a built-in default bomb script that just gives the player script three seconds of invulnerability, but I added scripts to both of the sample player scripts:


    PS - family obligations that kept me busy during the week have all but completely ended.  That means a bit more time for me to slack offwork on MnD.  Yay.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on June 14, 2010, 01:57:40 AM
    Hope you don't mind the bump ... this thread has gotten rather quiet in recent times.


    I just implemented the majority of what's necessary for plural scripts.  This includes all of the necessary Script Engine items that are necessary for it.  Here's how it works:

    The first script calls the function SetPlural, which takes an array of object type names that are used for the plural script.  Then, when each script has gone through its time/life/etc, it calls the function NextPlural, which reassigns the object to the next object type in the list given.  Additionally, I added the function LastPlural, which returns if the object is currently at the end of its defined plural list.


    It works something like this:

    Code: [Select]
    Musuu
    Script[mdScript]
    Type[Enemy]

    Plural "PluralEnemy"
    {
       initialize
       {
          SetPlural(["TheEnemy", "AnotherEnemy");
          NextPlural();
       }
    }

    include("TheEnemy.txt");
    include("AnotherEnemy.txt");

    The above sample (written on the spot - might not be syntax-perfect) will set up the object to have two object types in its plural queue - first is TheEnemy, and then AnotherEnemy.  It then uses the NextPlural function to immediately switch over to the first type in the list - doing it this way allows TheEnemy to both stand on its own as a single attack as well as the opener for this plural.

    Also note the include statements - the object types referenced by the SetPlural must be read in by the scripting engine too, or it'll error.


    The big item left to add for plural scripts is a separate script language (which I'm calling mdPlural) which will be similar to Danmakufu's plural file syntax, so that scripters can more easily define plural scripts.


    Just like the check for the deleting the boss when its life runs out, right now the script needs to manually call NextPlural when the boss's life hits zero.  However, this will change.

    My plan is to add a zerolife script, which will be automatically run when an object's life is reduced from a positive value to a nonpositive value.  By default for a boss, it will clear enemy shots, and then either advance the plural or destroy the boss as appropriate.
    Sound like a good plan?





    Also, memo to self: get the program to catch errors from ANTLR, so we can report them correctly.
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on June 14, 2010, 04:48:29 AM
    Er ... could you clarify what you meant by "plural script"? I can't remember if you explained it before and I'm slightly too brain-fogged to work it out on my own from the context ...
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on June 15, 2010, 02:16:58 AM
    Er ... could you clarify what you meant by "plural script"? I can't remember if you explained it before and I'm slightly too brain-fogged to work it out on my own from the context ...

    Plural script is a script that defines a sequence of attacks for an enemy, which are faced one after the other.  The term is used the same way in Danmakufu.


    EDIT:

    Added some new functionality with the new zerolife script.  This is called when an object's life is reduced from positive to nonpositive.  There is a default zerolife script given for all Boss object types, which will clear enemy bullets and either advance to the next script in a plural or destroy the object if there are no more scripts in the plural sequence.


    I also added a small bit in the ANTLR grammar such that ANTLR now throws an exception when it encounters a syntax error, rather than trying to bullshit its way through it.  It doesn't give any details (line number, exact problem, etc) yet, but it'll get there.  For now, at least it no longer pretends to properly load scripts that it can't properly interpret.
    Title: Re: A replacement for Danmakufu?
    Post by: ray10k on June 21, 2010, 06:20:12 PM
    I am not sure if this is the right place to address this, but in the first post of this thread, under item number six, it was mentioned that bullets would be colored using only the red and green channel in a file. however, in mountain of faith and subterranean animism there are a few bullets using black parts.
    my suggestion (and forgive me if it has already been made, or is simply ⑨ish) is to use
    the red channel for opacity (or alpha),
    the green channel for brightness (255: completely white/color, 0: completely black),
    and the blue channel for the parts that need to be colored (assuming the pixel is set to 255 green, 0 blue would mean white, 255 blue would mean completely in the chosen color).

    I hope this doesn't sound too stupid.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on June 22, 2010, 11:42:42 PM
    I am not sure if this is the right place to address this, but in the first post of this thread, under item number six, it was mentioned that bullets would be colored using only the red and green channel in a file. however, in mountain of faith and subterranean animism there are a few bullets using black parts.
    my suggestion (and forgive me if it has already been made, or is simply ⑨ish) is to use
    the red channel for opacity (or alpha),
    the green channel for brightness (255: completely white/color, 0: completely black),
    and the blue channel for the parts that need to be colored (assuming the pixel is set to 255 green, 0 blue would mean white, 255 blue would mean completely in the chosen color).

    I hope this doesn't sound too stupid.

    That idea for bullet coloring has been put on the "would be nice, but it's not necessary" list.  Also, your idea for the red channel is redundant, since we already would be using the alpha channel for transparency (.png kicks ass).  Having a channel fade from black to white/color sounds like it might be a good idea, though.
    I also had the idea that the third color channel could be used for a secondary color on the graphic.

    Oh, and just so everyone knows - if I do end up getting this idea working, my plan is to also create a small tool that takes in a "normal" bullet image and creates a "color-coded" one like described above, so that you won't need a PhD in Photoshop in order to make them.


    Right now bullet graphics, like all other graphics, are just standard images.  The plan is, if/when this idea gets in place, it'll be a second option when drawing an image, rather than just drawing an image normally.  This means it'll be applicable to not just bullet graphics, but any graphics that are displayed in the game (for instance, waves of same-shaped, different-color'd enemies could look nice with this).


    BTW - I've been pretty lazy with the first post, and as the note at the top says, a lot of that information is out-of-date, so it may be a good idea to not take it all at face value.


    EDIT: Ooh, new page.  Also new progress:

    I just implemented "message functions".  These are functions that you define within an object type.  Later on, any script that has the ID number of an object of that object type can call the message function to request some action or value from that object.
    On a related note, I also added the return command to mdScript, which returns a value from the current script (if no value is given, it returns a default value of zero).


    Here's a sample of message functions in action:

    Code: [Select]
    Musuu
    Script[mdScript]
    Name[Message Testing]
    Type[Enemy]

    Boss "TheEnemy"
    {
       initialize
       {
          SetLife(9001);

          id = CreateObject("OtherObject", 50, 50);
          id->"send id"(GetMyID());
       }

       tick
       {
          if (GetLife() < 1000)
          {
             SetLLife(2000);
          }
       }

       message "hurt" (amount)
       {
          SetLife(GetLife() - amount);
       }

       message "get stuff"
       {
          return "stuff";
       }
    }

    Effect "OtherObject"
    {
       define id;

       initialize
       {
          id = -1;
       }

       message "send id" (new_id)
       {
          id = new_id;
       }

       tick
       {
          if (id > -1)
          {
             id->"hurt"(50);
          }
       }
    }

    The enemy script first spawns an "OtherObject" object.  Then is calls that object's "send id" message function, so that the enemy can give its own ID number to the newly spawned "OtherObject".

    In turn, each frame the :OtherObject" object calls the "hurt" message function of the enemy object.  The enemy object's tick function simply makes sure the enemy's lifebar never drops down to zero (which would cause an error in the "OtherObject" object since the enemy object would be deleted).

    Also note the "get stuff" message function (which isn't used at all in this example).  Since it takes no args, it forgoes the open and close parenthesis when it is being defined.  You'll still have to use the parens when calling it, though.  (Does this sound like it could get confusing?  I can make it always require the parens for consistency ...)

    Of course, these can be used for much more complicated tasks if you put your mind to it.  These message functions can use all of the normal script commands, and have access to all of the called object's defined variables.  This is just a relatively simple example used to demonstrate usage.


    You'll notice that all of the message function names are in quotes - I decided to do that for a couple reasons.  First, it leaves you more freedom with the naming (spaces, symbols, etc).  Second, it ensures we can't have any overlap with object properties.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on July 22, 2010, 02:48:53 AM
    Hey guys.

    I hate to come in here just to apologize for not making any progress, but, well ...
    I have to apologize, since I haven't made any progress in the past month or so.  :fail:

    Been really distracted, and I'm not sure what to work on next on this ... anyone have any preferences on what gets worked next?  Here's a list of things I've considered getting to soon ...



    Of course, if I missed an "OMG WHY U NOT DOING THIS ALRAEDY?! :derp:" item that should be in done soon, let me know.


    Also - when do you guys want the next test release?
    So far, since the last release, I've added:
    Title: Re: A replacement for Danmakufu?
    Post by: Azure Lazuline on July 22, 2010, 02:56:02 AM
    Stage files or lasers should be your next target. If you get stuck on one though, just do some optimization.
    Title: Re: A replacement for Danmakufu?
    Post by: Naut on July 22, 2010, 03:00:31 AM
    Wassup

    So I haven't really been following this as closely as I should, but I really do want to script in your language. The problem is, I'm not really interested in devoting hours and hours to reading through this whole thread and trying to teach myself the language, while still keeping up with updates. So, for the next thing to be done, I'd love to see an extremely basic tutorial on scripting within Musuu. Since the majority of us that are following your engine know danmakufu, you can assume we know really extreme basic stuff and whatnot, so you can just provide us with syntax. Right now I just have no idea how to get things started, and some terms look very foreign (I know they're explained in the thread, but hunting through so much information is...  :ohdear:). So uh, I'd love it if you could write a few paragraphs explaining what all these new terms are and how things operate. I know I'm not the only person who looks at this project and gets discouraged because of the massive wall of jumbled information everywhere, so I think it'd be really benificial to you to have more play testers and whatnot.

    Without knowing much about anything at the moment, and after a really basic tutorial is written, I'd love to see a pause feature next implemented. It pausing the music as well would be all sorts of awesome. Afterwards... Probably tasks, given they're easy to use and very useful. Of your list, I think the power system would be the least important thing to be done at the moment.
    Title: Re: A replacement for Danmakufu?
    Post by: Lord Phantasm Satori on July 22, 2010, 06:33:14 AM
    yeah. thing is, I'm not sure whether I should learn this or danmakufu. considering danmakufu is in japanese and has little support outside this forum.

    actually I'm not sure I should learn at all since I'm not even sure what I can use and how I could even contact Zun to ask permission to do so...
    Title: Re: A replacement for Danmakufu?
    Post by: Stuffman on July 22, 2010, 08:02:05 AM
    Ditto Naut. What we really need right now is some starting documentation.

    Quote
    actually I'm not sure I should learn at all since I'm not even sure what I can use and how I could even contact Zun to ask permission to do so...

    The official guidelines are that you can use ZUN's IP, but not any actual media he made. So, for instance, you could make Reimu a boss, but you would need to produce your own sprite of her, your own images of yin-yang balls, and your own version of Mystic Oriental Love Consultation (or whichever of her themes you prefer), and then everything would be kosher.

    Note that these rules are rarely followed in the western fandom due to our depressing lack of talent.
    Title: Re: A replacement for Danmakufu?
    Post by: Lord Phantasm Satori on July 22, 2010, 08:41:24 PM
    aren't the official guidelines made by you guys also? This all started because of an angry ZUN fan-boy yelling at someone to stop using ZUN's work didn't it? and you treat it like it was ZUN himself who said it. I'm not sure about this though, so correct me if I'm wrong.

    I saw the thread where someone posted that, btw.
    Title: Re: A replacement for Danmakufu?
    Post by: DDRMANIAC007 on July 22, 2010, 09:26:23 PM
    Is there a twitter I can follow for this?
    Title: Re: A replacement for Danmakufu?
    Post by: Serela on July 23, 2010, 12:03:44 AM
    aren't the official guidelines made by you guys also? This all started because of an angry ZUN fan-boy yelling at someone to stop using ZUN's work didn't it? and you treat it like it was ZUN himself who said it. I'm not sure about this though, so correct me if I'm wrong.

    I saw the thread where someone posted that, btw.
    I'm pretty sure the guidelines were laid out by ZUN

    Not 100%, but fairly sure
    Title: Re: A replacement for Danmakufu?
    Post by: Suikama on July 23, 2010, 03:16:38 AM
    Is there a twitter I can follow for this?
    Here's ZUN's twitter if you want (http://twitter.com/korindo)
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on July 23, 2010, 03:24:41 AM
    So I haven't really been following this as closely as I should, but I really do want to script in your language. The problem is, I'm not really interested in devoting hours and hours to reading through this whole thread and trying to teach myself the language, while still keeping up with updates. So, for the next thing to be done, I'd love to see an extremely basic tutorial on scripting within Musuu. Since the majority of us that are following your engine know danmakufu, you can assume we know really extreme basic stuff and whatnot, so you can just provide us with syntax. Right now I just have no idea how to get things started, and some terms look very foreign (I know they're explained in the thread, but hunting through so much information is...  :ohdear:). So uh, I'd love it if you could write a few paragraphs explaining what all these new terms are and how things operate. I know I'm not the only person who looks at this project and gets discouraged because of the massive wall of jumbled information everywhere, so I think it'd be really benificial to you to have more play testers and whatnot.

    Ditto Naut. What we really need right now is some starting documentation.

    ... dammit, I knew I was forgetting something.  A while back, sonicbhoc stepped up to do some documentation ... then promptly disappeared.  :/

    I just threw together a quick, really basic boss script example on the wiki here (http://code.google.com/p/musuu-no-danmaku/wiki/mdScriptTutorial1).

    I'll see about getting some more out soon.


    yeah. thing is, I'm not sure whether I should learn this or danmakufu. considering danmakufu is in japanese and has little support outside this forum.

    The two aren't mutually exclusive.



    Is there a twitter I can follow for this?

    No.  I'm not a fan of twitter, personally, and if I set one up I'd probably just end up forgetting to update it. >__>
    However, it appears that Google Code is nice enough to set up RSS feeds for projects, if that helps - here's a list (http://code.google.com/p/musuu-no-danmaku/feeds)



    Let's see ... things people called out:




    Here's ZUN's twitter if you want (http://twitter.com/korindo)

    Hi, keeper of the Brofists.  You're posting while I'm posting. :]
    Title: Re: A replacement for Danmakufu?
    Post by: Suikama on July 23, 2010, 03:27:20 AM
    Hi, keeper of the Brofists.  You're posting while I'm posting. :]
    :wikipedia:

    Also, man, I totally thought this was the Q&A thread when I posted that :getdown:
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on July 30, 2010, 12:41:51 AM
    Hey guys, just popping in to say I added a quick function reference for mdScript:

    http://code.google.com/p/musuu-no-danmaku/wiki/FunctionReference (http://code.google.com/p/musuu-no-danmaku/wiki/FunctionReference)

    Please note that I used the latest code as a reference, and it is possible I listed a function that is not yet in a released version.


    Also, I was hoping to get more done on this project this week, then SC2, BB:CS, work, etc. all happened at once and my schedule went boom. :/
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on August 12, 2010, 03:03:27 AM
    Hey again.

    Fun fact:  I hate summer.  It's too freaking hot, and robs me of my resolve to do much of anything that involves effort.
    (Also doesn't help that I'm still working through several games and such >__> )


    Just got around to thinking about tasks a bit, and I wanted opinions on the syntax.  My thoughts were perhaps something like this:

    Code: [Select]
    Musuu
    Script[mdScript]

    Effect "Testing Tasks"
    {
       task "task one"
       {
          i = 0;
          while (i < 60)
          {
             i++;
             delay(i);
          }
       }

       task "task two"
       {
          i = 60;
          while (i > 0)
          {
             i--;
             delay(i);
          }
       }

       initialize
       {
          Start("task one");
          Start("task two");
       }
    }

    (sample code, may not be perfect, etc.)

    In this sample, we define two tasks, named "task one" and "task two" respectively.  In the initialize event, we spawn one instance of each task.

    Each task, itself, is a trivial affair that just counts up/down.  The delay function, as you'll probably guess, delays the task execution for the given number of frames.  I'll probably also add in a stop (or similarly named) function which will end the task right there.

    Each task will be owned by the object that spawned it.  The upside to that is the task will have access to the object's variables.  One catch, though, is that the task will disappear along with the object if the object is deleted.  (Is it any different in Danmakufu?  I seriously never use tasks in DMF, so I have no idea :/ )


    As far as implementation, I did a bit of digging, and I believe that I can use anoNL's idea of using generators to handle this (suggested way back on page ⑨ (http://www.shrinemaiden.org/forum/index.php/topic,2129.msg135275.html#msg135275)).  It's pretty much just some fancy code work ... only real complication is that I'd have to refactor a bit of the Script Engine to allow for it (shouldn't be too much, though).


    Also, please not that I currently do not plan on supporting the delay and (maybe) stop commands in event scripts (initialize, tick, etc).  In my opinion it ruins the semantics of these scripts (scripts run once each time the event occurs), and really doesn't fit with some of the events, anyways (why would you be delaying in a collision script, for instance?).
    In other words, these commands will be exclusively for tasks - one of the only places where I'm putting a limitation like this.



    In other news - has anyone taken a look at the documentation I put up?  It'd be nice to get some feedback ... I'm not sure if what I wrote up matches people's expectations and such.


    Hopefully I'll be able to get more done on this soon.
    Title: Re: A replacement for Danmakufu?
    Post by: Lord Phantasm Satori on August 12, 2010, 04:58:12 AM
    could you provide a sample of what a simple pattern might look like? so far, it looks less imposing than when I glanced at a random danmakufu script.
    Title: Re: A replacement for Danmakufu?
    Post by: NaGeL on August 12, 2010, 02:12:13 PM
    Hello

    I skimmed through fast through the topic and i have a question:
    IS this a new danmaku engine or  you're upgrading danmakufu?
    and is there some where a future list?

    sorry for these noobish question but i would like to know because i may be doing a danmaku  game.
    Title: Re: A replacement for Danmakufu?
    Post by: Nonnie Grey on August 13, 2010, 06:55:38 AM
    In other news - has anyone taken a look at the documentation I put up?  It'd be nice to get some feedback ... I'm not sure if what I wrote up matches people's expectations and such.

    Everything looks pretty good to me. The script deconstruction styled tutorials work pretty well as a primer and the function descriptions are easy enough to grasp, at least for this novice Danmakufu scripter. The only one I really had trouble understanding was the description for SetPlural. Then again, there's nothing else in there about Plurals that I could find (bar NextPlural and LastPlural descriptions, naturally), so it could just be an issue of context.

    Now for the main reason why I finally decided to post in this thread after lurking it for so long... I haven't actually tried scripting anything yet, but a question did come to me after stumbling on something in the latest test release. Do you intend to have the script browsing reined in to just the folder Musuu is in and its child folders or are you keeping it as is? As it stands right now, you can back up and away from the Musuu folder and look literally anywhere on your hard drive for compatible scripts if you know the way.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on August 14, 2010, 10:12:43 PM
    could you provide a sample of what a simple pattern might look like? so far, it looks less imposing than when I glanced at a random danmakufu script.

    Here's a very simple sample, which simply creates a boss that stays still and fires a spread of 5 shots straight downward every second.

    Code: [Select]
    Musuu
    Name[Sample Enemy]
    Type[Enemy]

    // include the shot definitions
    include("shots.txt");

    // TheEnemy
    // Enemy boss that makes some danmaku.
    Boss "TheEnemy"
    {
       define count;

       initialize
       {
          // Set the image to reimu1.png
          // Also set it to always be aligned (don't rotate), and at layer 30
          SetImage("reimu1.png", false, 30);

          // set the collision sizes
          SetSize(18, 24);

          // Set the amount of life for the boss
          SetLife(150);

          // our timer variable
          count = 60;
       }

       tick
       {
          // decrement our counter
          count--;
          if (count <= 0)
          {
             // reset the counter
             count = 60;

             // Fire a spread of bullets
             angle = 140;
             while (angle <= 220)
             {
                FireShot01(GetX(), GetY(), angle, 2.5, "Shot1");
                angle += 20;
             }
          }
       }
    }

    This sample works in the current test release, although the boss won't despawn when she runs out of life, since that isn't scripted in the current test release (it is in the latest code, though).  When the next test release comes around, the boss will despawn properly when killed.



    Hello

    I skimmed through fast through the topic and i have a question:
    IS this a new danmaku engine or  you're upgrading danmakufu?

    This is a completely separate project.  I don't have the means to upgrade danmakufu, mainly since I don't know of any way to get the source code for it.


    and is there some where a future list?

    You mean a list of items that are planned to be worked on?  There's a list that PT8Sceptile put together ... lemme grab it:

    Checklist update:
    • Bullet definition files
    • Additional functions for:
      • Random numbers
      • Some more mathematical functions like the power function.
      • The drawing functions.
      • Improved audio control (loop points, pausing/resuming, possibly fadein/fadeout)
      • Improved bullet shooting functions like CreateShotA to avoid having to script overtly simple patterns with objects
    • Default support for:
      • Lives/respawning
      • Points/Graze
      • Bombs
      • Power system
    • Plural files, stage files, possibly game files? (plural files partly implemented)
    • Lasers*
    • User-defined functions/subroutines/tasks.
    • Message functions for objects.
    • Various bugfixing
    • Code optimization to make the program run faster
    • Better error handling (mostly done)
    • *Low priority* Dialogue events.
    • *Low priority* Effect objects with vertices*, 3D drawing.
    • *Low priority* Replays.

    (Updated to reflect recent developments)

    This list represent the current list of items for a complete first "real" release of the program.  There are also other items that have been thrown around.



    Everything looks pretty good to me. The script deconstruction styled tutorials work pretty well as a primer and the function descriptions are easy enough to grasp, at least for this novice Danmakufu scripter. The only one I really had trouble understanding was the description for SetPlural. Then again, there's nothing else in there about Plurals that I could find (bar NextPlural and LastPlural descriptions, naturally), so it could just be an issue of context.

    Plural scripts are basically a simplified way to string together multiple scripts in a row.  It's comparable to Danmakufu's Plural boss scripts, although much more flexible.

    Basically, the way it works is that you give a series of object types using SetPlural.  Then, each time you call NextPlural, the object advances to the next object type in the list.

    I do intend to add a separate file format that will make setting this up easier.



    Now for the main reason why I finally decided to post in this thread after lurking it for so long... I haven't actually tried scripting anything yet, but a question did come to me after stumbling on something in the latest test release. Do you intend to have the script browsing reined in to just the folder Musuu is in and its child folders or are you keeping it as is? As it stands right now, you can back up and away from the Musuu folder and look literally anywhere on your hard drive for compatible scripts if you know the way.

    I currently have no intention of limiting where the program can search for files, unless someone can give me a reason otherwise.

    ... although, admittedly, this does complicate replays a bit since it means it'll be harder to find the correct path for a script file that the replay uses.  Especially when combined with the fact that we select an enemy script and a player script.  Hmm ... perhaps I'll need to make with some trickery for the replay files.
    Title: Re: A replacement for Danmakufu?
    Post by: Something XutaWoo-y on August 19, 2010, 12:24:32 AM
    Out of curiosity, would it be too much to ask for the ability to code multiplayer? I'm thinking about multiple things (player versus player danmaku, phantasmagoria clones, tyrian style player turrets), but I'd imagine that, with some ingenuity, it'd be possible to do all of the above by simply allowing more than one player character for certain scripts. And being able to switch player bullets hitting other players.

    For the sake of GetPlayeretc (outside of the player scripts, anyway), perhaps an extra argument for which player to check?

    Also, if this is for generalized danmaku shoot 'em ups, a way to replace the default life system would be nice.

    Then again, considering the recent news, a English-based danmaku engine that will be consistent (hopefully), is always nice. :V
    Title: Re: A replacement for Danmakufu?
    Post by: Lord Phantasm Satori on August 19, 2010, 05:04:19 AM
    oh yeah, would bosses with multiple damagable parts be able to be done?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on September 06, 2010, 12:04:08 AM
    Well, here I am again.  I really need to stop getting distracted by shiny things new games so much.  Stupid me.

    Sudden cat acquisition doesn't help, either. :V


    Out of curiosity, would it be too much to ask for the ability to code multiplayer? I'm thinking about multiple things (player versus player danmaku, phantasmagoria clones, tyrian style player turrets), but I'd imagine that, with some ingenuity, it'd be possible to do all of the above by simply allowing more than one player character for certain scripts. And being able to switch player bullets hitting other players.

    For the sake of GetPlayeretc (outside of the player scripts, anyway), perhaps an extra argument for which player to check?

    There aren't currently any plans to support multiple players in the initial version of Musuu no Danmaku, at least.  On the bright side, it isn't something that hard to add in (just need to allow multiple player control configurations, spawn multiple player objects, and ensure the correct player inputs go to the correct objects, mainly).



    Also, if this is for generalized danmaku shoot 'em ups, a way to replace the default life system would be nice.

    Then again, considering the recent news, a English-based danmaku engine that will be consistent (hopefully), is always nice. :V

    The overall plan is to make this as generalized as possible, so having a different life system could definitely be doable.  To get thought rolling on this, any particular ideas that you'd be looking to implement?



    oh yeah, would bosses with multiple damagable parts be able to be done?

    With the current engine design, you'd have to create multiple objects that encompass the various parts of your boss, but it should definitely be possible.





    I've (finally) gotten off my lazy ass again and put some stuff down in the code.  Specifically, I added pausing, and a pause menu.  It currently only has "Resume Game" and "Return to Menu" options.

    I also added the FPS counter in the lower-right corner; I think I might end up adding a config option to enable/disable its display later on.  Also a few minor code cleanup tweaks.


    Yay progress!   :3



    Next items on my list are stages and tasks.  To be honest, stages are practically already feasible, by just creating an invisible enemy that spawns enemies/bosses at certain times; in reality adding stages is just adding in an official base type for them in the script engine.
    Tasks, on the other hand, will be quite the 'fun' task, code-wise.  I have a general idea of how I'm going to implement them, but it's gonna be a bit tricky.

    Also, there's the optimizations on the collision detection engine I want to get in sometime soon.  Mainly, right now the engine loops through the entire list of objects in the game, determining pair-by-pair whether it needs to check for collision between the two objects.  On the other hand, the new approach will keep track of this information as objects are inserted and deleted, which should give a substantial speed boost in that part of the program overall.



    Oh yeah - remember I said sonicbhoc disappeared?  The reason behind that is he's at college/university, where they have a massively restrictive network, such that he can't even SVN to the code repository. :/
    Title: Re: A replacement for Danmakufu?
    Post by: Something XutaWoo-y on September 09, 2010, 09:40:29 PM
    The overall plan is to make this as generalized as possible, so having a different life system could definitely be doable.  To get thought rolling on this, any particular ideas that you'd be looking to implement?
    For a few examples, a health system like in PoFV where you have a few hits, but you get pushed back and get blink invincibility when hit. Another example would be a plain standard system where you have a certain amount of hits before dying; like, say, in pretty much every game. :V
    A way to do shields and "armor" would be nice; basically, a second health bar that probally regenerates and prevent damage to the player's real health until depleted, like in Tyrian. As for armor, it's like that but it doesn't complete prevents damage, just reduces it; think of something like in an FPS.

    Of course, the latter two could easily be coded by the coder him/herself with a player version of SetDamageRate and tinkering with variables, so yeah. :V
    Title: Re: A replacement for Danmakufu?
    Post by: Dizzy H. "Muffin" Muffin on September 10, 2010, 06:39:30 PM
    I still say that if I were doing it, for maximum flexibility, rather than putting just about anything in the hardcode (bullet-types, how items work, death, hitboxes/graze, "continue," even field-size and UI-setup), I'd put specific game-details in default/example scripts which you'd, like, "include" in the user-made scripts, so that if someone wanted to make a setup like Suguri (which is almost entirely different from Touhou), the game engine wouldn't get bogged down with hardcoded defaults which would just be ignored by the script. Kinda like how RPG Maker XP/VX do it ...
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on September 13, 2010, 01:21:35 AM
    For a few examples, a health system like in PoFV where you have a few hits, but you get pushed back and get blink invincibility when hit. Another example would be a plain standard system where you have a certain amount of hits before dying; like, say, in pretty much every game. :V
    A way to do shields and "armor" would be nice; basically, a second health bar that probally regenerates and prevent damage to the player's real health until depleted, like in Tyrian. As for armor, it's like that but it doesn't complete prevents damage, just reduces it; think of something like in an FPS.

    Of course, the latter two could easily be coded by the coder him/herself with a player version of SetDamageRate and tinkering with variables, so yeah. :V

    I still say that if I were doing it, for maximum flexibility, rather than putting just about anything in the hardcode (bullet-types, how items work, death, hitboxes/graze, "continue," even field-size and UI-setup), I'd put specific game-details in default/example scripts which you'd, like, "include" in the user-made scripts, so that if someone wanted to make a setup like Suguri (which is almost entirely different from Touhou), the game engine wouldn't get bogged down with hardcoded defaults which would just be ignored by the script. Kinda like how RPG Maker XP/VX do it ...

    Well, then perhaps I should let you know about the idea I had today.  Most things like this are actually handled via built-in script functions.  I think that, once I allow the scripter to create their own functions, I could also allow a script to override those built-in functions, which could easily alter the "default" functionality quite a lot.



    Got a bit of stuff done tonight.  I added a formal "Stage" script type.  Looks something like this:

    Code: [Select]
    Musuu
    Script[mdScript]
    Type[Stage]
    Name[A Stage]

    Stage "Test Stage"
    {
       initialize
       {
          // do stuff
       }

       tick
       {
          // do stuff
       }
    }

    When making a stage script spawn other objects (enemies, primarily), don't forget that you need to include the files which hold the scripts for the things you're spawning.

    Note also that Stage types have a higher spawning priority than Boss types.  This means that if you load both a Stage type and a Boss type, the Stage one will be spawned as the default, initial enemy.


    I also added in the mdPlural file format, which allows the user an easier way to define a basic plural object (like a multi-phase boss):

    Code: [Select]
    Musuu
    Script[mdScript]

    / A sample plural script
    / Comments start with a '/'

    / Type and name of this plural object
    Plural "Enemy Boss"

    / The various phases of this enemy
    / "file" "type"
    "Enemy1.txt" "Phase1"
    "Enemy2.txt" "Phase2"
    "Enemy2.txt" "Phase3"

    Note that the Plural type here (declared right before the type name, "Enemy Boss") indicates that this is a plural enemy.  This is done so that this script has higher spawning priority than its component Boss scripts.

    In this case, the enemy boss is composed of three phases, defined as scripts within two files.


    Right now, mdPlural doesn't support multiple type definitions in a single file (unlike the other script formats), but I can add it if there is demand (I figured it'd be much less needed than the other types, since you're probably not defining many Plural types except for gigantic game scripts, where you'd probably want a bit of organization anyways :V )
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on December 05, 2010, 03:02:33 AM
    Hey guys, remember me?
    I hate that it's taken me so long (work, you know >__> ), but I've finally got another update to MnD!

    I've gone ahead and implemented lasers!  :3


    Right now it just works like this:



    Additionally, there were a couple optimizations and code refactorings, as well as a bug fix to stop objects from collision-checking with themselves (oops, not sure how I let that through to begin with).



    Here's the latest look at the running "to do" list:

    Checklist update:
    • Bullet definition files
    • Additional functions for:
      • Random numbers
      • Some more mathematical functions like the power function.
      • The drawing functions.
      • Improved audio control (loop points, pausing/resuming, possibly fadein/fadeout)
      • Improved bullet shooting functions like CreateShotA to avoid having to script overtly simple patterns with objects
    • Default support for:
      • Lives/respawning
      • Points/Graze
      • Bombs
      • Power system
    • Plural files, stage files, possibly game files?
    • Lasers
    • User-defined functions/subroutines/tasks.
    • Message functions for objects.
    • Various bugfixing
    • Code optimization to make the program run faster
    • Better error handling (mostly done)
    • *Low priority* Dialogue events.
    • *Low priority* Effect objects with vertices, 3D drawing.
    • *Low priority* Replays.



    A few things about this list:
    Title: Re: A replacement for Danmakufu?
    Post by: lumber_of_the_beast on December 05, 2010, 04:22:59 AM
    Glad to see this is still in progress :D

    Random musing: How exactly does one make curvy lasers?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on December 08, 2010, 11:55:58 PM
    Glad to see this is still in progress :D

    Random musing: How exactly does one make curvy lasers?

    There currently is no built-in support for curvy lasers.  I think they're a much lower priority feature than regular lasers, given how rarely they're used.

    In the meantime, it would be possible to simulate a curvy laser by using a string of "chained together" lasers, but that would be a bitch and a half just to implement.



    Also, for those keeping track - I can't guarantee any regular schedule for updates in the near future, since it falls on to several factors (all of which seem to be working against me lately  :colonveeplusalpha: ).  Apologies for this project slowing down so much.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on December 27, 2010, 09:08:28 AM
    New progress - power system!
    (in other words - the ability to set up power items and such.)


    The basic idea behind it is as follows:


    To give an example of how this works in practice, here is the script to set up a powerup system similar to PCB:
    Code: [Select]
          // Set PCB-style power system
          SetPowerDisplay(power_display_fraction);

          SetPowerThreshold(1, 8);
          SetPowerThreshold(2, 16);
          SetPowerThreshold(3, 32);
          SetPowerThreshold(4, 48);
          SetPowerThreshold(5, 64);
          SetPowerThreshold(6, 80);
          SetPowerThreshold(7, 96);
          SetPowerThreshold(8, 128);

          SetPowerMax(128);

          SetPowerMaxDisplay("MAX POWER!");


    Here's a rundown of how it works:

    The SetPowerDisplay function determines how power will be displayed in the HUD.  I'll go over the defined values below; in this case, it's setting it to display it as "<amount> / <max>".

    The SetPowerThreshold defines the threshold amounts for each power level.  In this case, we define all 8 levels to correspond to the power amounts in PCB where you power up.

    The SetPowerMax sets the maximum power amount - in this case it is the same as the final threshold.

    The SetPowerMaxDisplay tells the game engine to replace the power display with the given text when at the maximum power amount.  If this is not given, the power display will remain as-is at max power.



    As another example to show how this can work, here's a script to do a power system similar to MoF/SA (disclaimer: I haven't played as much of the newer Touhou games, so this might not be as accurate as the PCB-style script):

    Code: [Select]
    global power_value_2;

    // ...
    {
       // ...
       {
          // Set MOF/SA-style power system
           SetPowerDisplay(power_display_decimal_fraction);

           SetPowerThreshold(2, 20);
           SetPowerThreshold(4, 40);
           SetPowerThreshold(6, 60);
           SetPowerThreshold(8, 80);

           power_value_2 = 20;

           SetPowerMax(100);

           SetPowerLostOnMiss(20);
       }
    }

    For the general idea of this one, we are equating 20 units of power items with 1.00 value on the MoF display.  The powerup system works entirely with integers (to make life simpler), so we count the lowest denominator (0.05) as one unit of power.

    In this case, SetPowerDisplay indicates a "#.## / #.##" display style.  What this does is match the MoF-style display, where the whole-number is the number of power thresholds you have passed, and the fractional part is the % you are to the next threshold.  (To be specific - in MoF, every 20 power items was equivalent to 1.00 - one 'threshold').

    We only define thresholds for half of the power levels.  Since MoF only has four "power-up" points (when the player obtains each option), these are mapped to these thresholds.  The player will jump from power level zero straight to 2, then to 4, etc.

    Here, we also define the maximum power amount to be above the last threshold.  Like MoF, this gives a "buffer zone" where you can lose some power and still be at the highest power level.

    SetPowerLostOnMiss, as the name implies, sets the amount of power lost when the player loses a life.  The default is 16, but for this we want 20 (the amount of one threshold - equivalent to 1.00).

    Finally, the business with power_value_2.  This is a globally defined value that determines how much power a large power items gives the player (for reference, the small item's amount is power_value).  By default, this is 8; here, we want it to be 20, which is enough to push the meter up 1.00 (one whole threshold).  The global statement at the beginning tells the game to treat the name as a global variable, rather than a local one, so we are sure to set the correct value.  I might end up making functions to set these values later on ...




    In your player script, use the function GetPowerLevel() to get the current player power level, based on the above data.  Again, the value returned by this function is in the range of zero through eight, inclusive.



    Finally, to spawn a power item, simply create a new object of type PowerItem (small power item) or PowerItem2 (large power item).




    In short, this setup allows us to define the power system with the game, and still allow any player script to work with it by giving the player script a set of discrete power levels to work with.  I used both above power system scripts with the same player script, and it allowed the player script to utilize the two different power systems without any problems.  :D




    There are six power display types defined currently (all are prefixed with power_display_):


    Happy holidays!
    BV
    Title: Re: A replacement for Danmakufu?
    Post by: phi2dao on December 30, 2010, 03:51:35 AM
    This is still alive?  Best holiday present ever!

    If you would be kind enough to release another test version, I'll make something for you :)
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on December 31, 2010, 04:01:20 AM
    This is still alive?  Best holiday present ever!

    If you would be kind enough to release another test version, I'll make something for you :)

    I'll get on that.  I just looked back at what's been done since the last test release, and it's a pretty big list:


    Before I put out a release, I want to go ahead and throw together some quick scripts to demonstrate (most of) these features (as well as some other basics) - basically, I'm going to create a simple stage and such.
    Don't expect anything amazing; last time I tried to create a stage it didn't end up with anything amazing. :V


    Also, I'd really like to get some new graphics for (later) official releases ... I think the silly-looking blue triangle isn't exactly a 'professional-looking' character sprite, to say the least.  ;)



    EDIT:

    Test Release 7 (http://code.google.com/p/musuu-no-danmaku/downloads/detail?name=Musuu%20no%20Danmaku%20-%20Test%20release%207%20%282010%2012%2030%29.zip&can=2&q=#makechanges)

    Includes a whole new test script stage, with two variants that just have different power systems (PCB-like and MoF-like).

    Player scripts have been updated to use power systems and now have bombs:




    I wasn't feeling too creative, so the sample stage doesn't (currently) feature lasers or anything using message functions.  :V

    Also, don't expect any sort of balance in regard to difficulty as the stage progresses or between player types.  I just kinda threw this stuff together.


    Enjoy!
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 21, 2011, 01:52:26 AM
    Hey again.

    I've been working on MnD's inner workings a bit, and I've got some new stuff to report:


    First, error reporting has been vastly improved, since now it'll report the line number an error occurred on.  This includes both syntax errors (detected when the script file is loaded) and runtime errors.


    Secondly, I just got done coding up some major optimizations for collision detection.  This has bumped up the game's performance considerably.

    I have two collision performance test scripts, which each just create 100 objects that can all collide with each other.  One script uses circular objects, the other uses laser objects.  To give you an idea of the improvement, here's the FPS numbers for the old and new collision algorithms:

    Old AlgorithmNew Algorithm
    Circles35-4156-62
    Lasers26-2952-57

    ... before you start thinking that it's bad, since it's choking on "only 100 objects", keep in mind that each of those objects is being collision-checked with every other one; this results in nearly 10,000 collision checks per frame.  This is something that wouldn't come up in a normal script - a lot of object pairs have no reason to be collision-checked, since there's no scripts to run for such a collision.



    Here's the latest look at the running "to do" list:

    Checklist update:
    • Bullet definition files
    • Additional functions for:
      • Random numbers
      • Some more mathematical functions like the power function.
      • The drawing functions.
      • Improved audio control (loop points, pausing/resuming, possibly fadein/fadeout)
      • Improved bullet shooting functions like CreateShotA to avoid having to script overtly simple patterns with objects
    • Default support for:
      • Lives/respawning
      • Points/Graze
      • Bombs
      • Power system
    • Plural files, stage files, possibly game files?
    • Lasers
    • User-defined functions/subroutines/tasks.
    • Message functions for objects.
    • Various bugfixing
    • Code optimization to make the program run faster (major progress)
    • Better error handling (mostly done)
    • *Low priority* Dialogue events.
    • *Low priority* Effect objects with vertices, 3D drawing.
    • *Low priority* Replays.



    One more thing - I had another niffy idea, and I figured I'd throw it out here:

    To help scripters figure out issues in their scripts, I was thinking of implementing a runtime script debugger.  I'd have it be a separate program that connects to MnD via a socket (meaning you could, if you wanted, run it on a different computer than MnD itself is running on), and allow you to set breakpoints, inspect variables, and other fun things. :3

    It'll be a bit to implement, but I think it'll go a long way to help people figure out issues in their scripts.  Also, based on how I plan to implement it, it'll force me to refactor some of the script engine, which also will help with other things (like implementing tasks).

    I have a basic idea of how the communication protocol for the debugging interface will work - it'll be all-text, so it won't be a pain to implement another program to interface it (or, if you're a bit crazy, access it through telnet :V )
    Title: Re: A replacement for Danmakufu?
    Post by: XephyrEnigma on May 21, 2011, 04:33:06 PM
    Oh, so you're actually going through with this? If you get a perfectly stable version out I will love you forever.
    Title: Re: A replacement for Danmakufu?
    Post by: Stuffman on May 21, 2011, 11:59:12 PM
    This is starting to look really good. How long until we have function documentation? That's the only thing really stopping me from playing around with it at this point.
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 24, 2011, 12:17:43 AM
    Oh, so you're actually going through with this? If you get a perfectly stable version out I will love you forever.

    Technically, the current "Test Release" is "perfectly stable", albeit feature-incomplete. :3




    This is starting to look really good. How long until we have function documentation? That's the only thing really stopping me from playing around with it at this point.

    It might be a bit out of date (I think I last updated it a bit before the last test release), but there is this page (http://code.google.com/p/musuu-no-danmaku/wiki/FunctionReference) on the MnD project site.  Between that and the sample scripts that come with the Test Release, you should hopefully be able to get something rolling.
    Title: Re: A replacement for Danmakufu?
    Post by: XephyrEnigma on May 24, 2011, 12:41:08 AM
    Uh.. If I were to make some folders to organize everything (so that all the resources arent in one folder, would that still work?
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 24, 2011, 01:45:42 AM
    Uh.. If I were to make some folders to organize everything (so that all the resources arent in one folder, would that still work?

    Sorting the files into subfolders is file, so long as you add the folder names to the files when you reference them in code.

    For instance, if you have an "images" subfolder to store your visual resources, you could do something like this:

    SetImage("images/cool.png", false, 30);



    You'll notice I used a forward slash ('/') instead of a backwards one ('\').  While either will work fine on a Windows system, the backwards slash won't work on non-Windows systems (which should (hopefully) be supported via Mono), so using a forward slash makes the script (theoretically, at least) more portable.



    (btw, for reference - the "false" indicates that the image will not rotate as the object rotates, while the "30" indicates what layer the image is drawn on - higher layers get drawn over lower layers.
    Title: Re: A replacement for Danmakufu?
    Post by: XephyrEnigma on May 24, 2011, 02:26:34 AM
    One last little thing here, if I wanted to use an animated picture for a sprite, I can do so? Or do they absolutely have to be static?
    (I'm guessing I can, but looking for confirmation)
    Title: Re: A replacement for Danmakufu?
    Post by: Nuclear Cheese on May 25, 2011, 11:16:19 PM
    One last little thing here, if I wanted to use an animated picture for a sprite, I can do so? Or do they absolutely have to be static?
    (I'm guessing I can, but looking for confirmation)

    Right now, the only way to animate a sprite is to keep reassigning its image each frame (not much different than what you'd do in Danmakufu).  Basically, you need a static image of each frame of the animation, and set the appropriate one each frame in your script to have it animate in the game.

    I have thought about adding the ability to script simple animations, but that wouldn't come until later.
    Title: Re: A replacement for Danmakufu?
    Post by: Stuffman on May 25, 2011, 11:56:22 PM
    Maybe a nice, easy way to do it would be some sort of, like, image equivalent of CreateShotA?

    CreateAnimation(image x, image y, true/false looping);
    SetAnimationStep(same parameters as SetImage, number of frames);
    SetAnimationStep...
    SetAnimationStep...
    StartAnimation();

    It would need to read the variables in image x and image y each frame so it could be moved dynamically, and you'd need to make it more complicated if you wanted to have the ability to kill the animation before it's finished, so I guess it's not really that simple. Still, even something as lacking in functionality as the above would be pretty useful.
    Title: Re: A replacement for Danmakufu?
    Post by: Azure Lazuline on May 26, 2011, 03:10:33 PM
    As long as there's some equivalent of #include_function, there's no reason NC would have to make an animation library. Just leave it to the users, like how Blargel made one for Danmakufu.
    Title: Re: A replacement for Danmakufu?
    Post by: Stuffman on May 27, 2011, 09:14:07 PM
    Well there's no reason he has to do anything besides the most basic graphics and object functions since we could program everything else ourselves, but it's nicer to have that stuff built in :V

    That said, I don't expect him to do anything beyond DMF's graphic functions, it's just a suggestion worth thinking about.