Author Topic: A replacement for Danmakufu?  (Read 244749 times)

PT8Sceptile

  • All hail Giant Catfish!
Re: A replacement for Danmakufu?
« Reply #420 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:



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.

Re: A replacement for Danmakufu?
« Reply #421 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.

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #422 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.
to quote Naut:
"I can see the background, there are too many safespots."
:V

PT8Sceptile

  • All hail Giant Catfish!
Re: A replacement for Danmakufu?
« Reply #423 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...

Re: A replacement for Danmakufu?
« Reply #424 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?
« Last Edit: November 20, 2009, 11:49:23 PM by Theme97 »

Re: A replacement for Danmakufu?
« Reply #425 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);

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #426 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 ...



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?



Source is viewable from here.  Have fun being horrified at my shitty organization and plethora of "#warning TODO"s. ;)

I'm busy tomorrow, so don't expect much.
to quote Naut:
"I can see the background, there are too many safespots."
:V

Re: A replacement for Danmakufu?
« Reply #427 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 ...)

PT8Sceptile

  • All hail Giant Catfish!
Re: A replacement for Danmakufu?
« Reply #428 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?



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!

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #429 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 or this.
to quote Naut:
"I can see the background, there are too many safespots."
:V

Re: A replacement for Danmakufu?
« Reply #430 on: November 23, 2009, 12:24:18 AM »
Never mind that, then. |3

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #431 on: November 25, 2009, 02:03:53 AM »
Quick update tonight:

  • Added the option for the program to use non-power-of-2 textures, including a configfile option for it.  It now defaults to using non-power-of-2 textures (reason the option is there and such is because not all graphics cards, especially older ones, support it)
  • Couple of graphics touch-ups
    • Smooth texturing (PT8 - should make what you pointed out look better)
    • Fixed a slight, hard-to-notice-in-most-cases texture wrapping error
to quote Naut:
"I can see the background, there are too many safespots."
:V

KomeijiKoishi

Re: A replacement for Danmakufu?
« Reply #432 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.
« Last Edit: November 25, 2009, 12:45:07 PM by VideoGameCrack »

Re: A replacement for Danmakufu?
« Reply #433 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.
« Last Edit: November 26, 2009, 04:32:19 AM by Theme97 »

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #434 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.
  • 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.



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.
to quote Naut:
"I can see the background, there are too many safespots."
:V

Re: A replacement for Danmakufu?
« Reply #435 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.

Re: A replacement for Danmakufu?
« Reply #436 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)

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #437 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, ...
  • fixed the drawing order issue
  • coded configurable (keyboard) input
  • started work on two enhancement issues

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?
to quote Naut:
"I can see the background, there are too many safespots."
:V

Re: A replacement for Danmakufu?
« Reply #438 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.



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.
« Last Edit: November 27, 2009, 01:19:57 PM by Theme97 »

Re: A replacement for Danmakufu?
« Reply #439 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.

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #440 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.



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):
  • Make sure to test your changes before you commit them to the source.
    Run the program and make sure none of your new functionality/fix screws up.  Try to hit all the different cases for the new code.  Also, where applicable, test related, unmodified functionality to ensure it hasn't been corrupted.
    It's practically impossible to test every possible case, but we need to at least ensure we don't break the main code line with a commit.
    When in doubt, upload a patch or commit to a branch, and ask others to test it as well.
    • Also, if you want to make an interim/incomplete commit for some reason, make sure to commit to a branch.  Generally, you probably won't have a reason for this, but just in case the situation comes up ...
  • Comment your code
    It is important to comment what the code does at a large scale, and how it works.  Don't comment on obvious things, like "This gets the sum of A and B" - that just clutters up the code.  The important part is that someone else should be able to come in with minimal knowledge of how the project works, and at least be able to have some understanding of how the code works without spending hours tracing around.
    This also applies to the XML-style comments - at the very least, put a summary comment for each function, describing what it does.
  • Try to keep your local copy of the source up-to-date.
    If your copy is behind, you might have problems that crop up with your changes when combined with other parts of the code that have been updated separately.
  • Avoid "hackjob" implementations
    Not that I'm entirely innocent of this myself, but it may be worth the effort to spend 10 minutes or so looking to see if there's a better way to do what you're trying to do.
  • While it's not a big deal now, since there's just me (and soon Theme), in the future there could very well be many people working in the code at once.  To avoid conflicts and duplicate effort, it would be a good idea to note in an issue when you start working on it, so that someone else doesn't start working on it as well.
  • Please don't start really huge changes (such as "I'm gonna completely redefine mdScript") without approval.  Large changes like that can break lots of stuff, and others may not like the direction being taken.
    Small changes (such as "Fixing crash when ___" or "Adding new function to convert foo to bar") are okay to work without approval, but still keep in mind what else could be affected by the change.

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:

  • Optimized the function to get the next power of 2 (for texture dimensions) - Theme
  • Abstracted collision detection, so that we can more easily add new collision types later on.

to quote Naut:
"I can see the background, there are too many safespots."
:V

Re: A replacement for Danmakufu?
« Reply #441 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?

Re: A replacement for Danmakufu?
« Reply #442 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.

PT8Sceptile

  • All hail Giant Catfish!
Re: A replacement for Danmakufu?
« Reply #443 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

CreateShot01S


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.
« Last Edit: November 29, 2009, 07:35:58 PM by PT8Sceptile »

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #444 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 ...
to quote Naut:
"I can see the background, there are too many safespots."
:V

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: A replacement for Danmakufu?
« Reply #445 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

Re: A replacement for Danmakufu?
« Reply #446 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)

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: A replacement for Danmakufu?
« Reply #447 on: November 30, 2009, 02:51:37 AM »
Oh, whoops. Left that part out.

Montblanc

  • I'll drive my toe into your eye socket,
  • And I'll Spin in it~
Re: A replacement for Danmakufu?
« Reply #448 on: November 30, 2009, 10:28:08 PM »
Just popping in to continue to uselessly say I'm loving the progress~

Go useless me~

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: A replacement for Danmakufu?
« Reply #449 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. ;)
« Last Edit: December 01, 2009, 03:55:26 AM by Nuclear Cheese »
to quote Naut:
"I can see the background, there are too many safespots."
:V