[PLUGIN] BulletML

Completed plugins, behaviors and effects.

Post » Tue Aug 17, 2010 8:38 pm



Download plugin (260 KB):
[url:1z4lqy6h]http://paahdin.com/projects/bulletml/BulletML-1.02.zip[/url:1z4lqy6h]
Mirror: [url:1z4lqy6h]http://github.com/downloads/Luomu/BulletML/BulletML-1.02.zip[/url:1z4lqy6h]

Source code:
[url:1z4lqy6h]http://github.com/Luomu/BulletML[/url:1z4lqy6h]

Very simple example .cap:
Download

Demo game:
Download | Separate thread

* What is BulletML?

Bullet Markup Language is an XML-based system for describing bullet barrages in shoot 'em up games. It is designed by the prolific shooting game author Kenta Cho.

The BulletML page can be found at http://www.asahi-net.or.jp/~cs8k-cyu/bu ... dex_e.html.

Here's an example:

[code:1z4lqy6h]
<?xml version="1.0" ?>
<!DOCTYPE bulletml SYSTEM "http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/bulletml.dtd">
<bulletml xmlns="http://www.asahi-net.or.jp/~cs8k-cyu/bulletml">
<action label="top">
<fire>
<bullet>
<direction type="absolute">90</direction>
</bullet>
</fire>
</action>
</bulletml>
[/code:1z4lqy6h]

This script fires one bullet at angle 90, default speed. Not terribly useful yet. Here's a more complex example:

[code:1z4lqy6h]
<?xml version="1.0" ?>
<!DOCTYPE bulletml SYSTEM "http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/bulletml.dtd">
<bulletml xmlns="http://www.asahi-net.or.jp/~cs8k-cyu/bulletml">
<action label="top">
<fire>
<direction type="aim">0</direction>
<speed>150</speed>
<bulletRef label="seed" />
</fire>
</action>

<bullet label="seed">
<action>
<repeat>
<times>100</times>
<action>
<fire>
<direction type="absolute">$rand * 360</direction>
<speed>200 + $rank * 200</speed>
<bullet />
</fire>
</action>
<wait>50</wait>
</repeat>
</action>
</bullet>
</bulletml>
[/code:1z4lqy6h]

This script fires a slow-moving bullet that in turn spawns 100 other bullets at 50ms intervals, in random directions. The speed of these bullets depends on the difficulty level (rank).

Check the demo game for a variety of patterns.

* About this plugin

This plugins adds a BulletML object that can read and play BulletML files. It is a bit like the existing particle system object; you can have multiple emitters and each object manages its own bullets.

While any bullet pattern could be created with events, describing them with external files is more reusable and they can be modified without changing the .cap, including after the game is published.

* Appearance

You can either let the emitter render the bullets (just like a particle system) by setting a texture or you can replace the bullets with Sprite objects.

* Collisions

If you are not using Sprites as bullets this object has its own collision condition. All collisions are bullet point against object bounding box. Arcade shoot 'em up games usually use hidden hitboxes that are smaller than the player craft.

Bullets are destroyed when they collide with an object.

* Lifetime

Bullets are destroyed when they collide, exit the screen (toggleable), their associated Sprite is destroyed or a set number of milliseconds is exceeded.

If you Destroy the emitter, all its associated bullets vanish. This is a technical limitation, but not too tricky to work around.

* Units

Speeds are pixels per second, time units are milliseconds. The BML spec treats time values as frames for some reason but this wouldn't be very useful when frame rate can be anything from tens to hundreds.

Separate multiplier values are provided for speeds and time values.

* Directions, targeting

(absolute directions) When script type is "vertical" 0 is right and 90 down. With "horizontal" 0 is up and 90 right.

If you want the bullets to fly in the direction the emitter is pointing, use "relative" direction and angle 0.

When no direction is specified, BulletML spec assumes "aim" is assumed; bullet flies to the x,y coordinate set by "Set target position" action.

* Learning BulletML

Reading just the reference is not very good for learning the capabilities of this system. Check out the demo game, this Java-based demo applet or download some of Kenta Cho's games - many of them contain BulletML files you can take apart.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Wed Aug 18, 2010 7:47 pm

Downloading Now..

I got this when i tried to open the zip file.

B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Wed Aug 18, 2010 9:43 pm

The file opens for me. This looks pretty cool, will try it later.
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Thu Aug 19, 2010 7:39 am

[quote="DravenX":oo28pdt8]Downloading Now..
I got this when i tried to open the zip file.
[/quote:oo28pdt8]Download it again? The file should be 260 kilobytes. Added a mirror in any case, I know my webhost is not the best.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Thu Aug 19, 2010 2:07 pm

I had problems with the original download reporting that the file was corrupt last night (still do today using a different PC and a different ISP). The mirror link is working though.

Can't wait to have a play with this, and with Construct in general :)
B
1
G
2
Posts: 7
Reputation: 639

Post » Fri Aug 20, 2010 5:44 am

Wow. This is like the platform behavior for bullet hell games.

I'm in.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Aug 20, 2010 6:46 pm

Between the release and the demo game I forgot - maybe it would be good to have a very simple example to quickly show how this plugin is used.

Here.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Mon Aug 23, 2010 5:23 am

Do you have to use external files for this plug to work?
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Mon Aug 23, 2010 7:47 am

[quote="toralord":wwrski89]Do you have to use external files for this plug to work?[/quote:wwrski89]Yes, that is one of the main ideas. I guess you could use the resource plugin to unpack files on the fly. I could probably also add "Set string..." type action but it could get confusing with complex patterns.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Tue Aug 24, 2010 4:58 am

Nice :D
I like the demo game too, its pretty fun.
B
4
S
1
G
5
Posts: 98
Reputation: 1,648

Next

Return to Completed addons

Who is online

Users browsing this forum: No registered users and 0 guests