BulletML plugin, preview release

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Mon Jun 21, 2010 5:26 pm

First release! Give input!

Download plugin 1.01 (preview) .zip updated link 19.07.

Download example (exe & .cap), you can modify the xml files to
change the patterns.

Source code


[size=60:313wpgtq]Shot from example app - aircraft sprites by Mark Simpson[/size:313wpgtq]

* 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 with the manual can be found at
http://www.asahi-net.or.jp/~cs8k-cyu/bu ... dex_e.html.

Here's an example:

[code:313wpgtq]<?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:313wpgtq]
This script fires one bullet at angle 90, default speed. Not terribly
useful yet. Here's a more complex example:

[code:313wpgtq]<?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:313wpgtq]
This script fires a slow-moving bullet, aimed at the player, that in turn spawns 100 other
bullets at 50ms intervals, in random directions. The speed of these
bullets depends on the difficulty level (rank).

* 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 renders its own bullets. On the other hand, individual bullets are not individual Construct objects.

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.

* Appearance

You can change the bullet texture and size. Standard colour filter,
opacity and effects are also available. Bullets can be oriented to the direction they are travelling.

* Collisions

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)
or a number of milliseconds is exceeded (configurable).

* 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, "aim" is assumed; bullet flies to the
x,y coordinate set by "Set target position" action.

* Error reporting

This object has a "On error occurred" condition and "Last error
string" expression. Useful for spotting XML errors.

* Limitations, known issues
- BulletML does not define a bullet's appearance. Maybe it could be
added (but it would break compatibility).
- If you destroy a BulletML object all its bullets are destroyed as
well. You might want to wait until the bullet count is zero. I can
probably add a smarter Destroy action.
- changing the filter color affects the currently existing bullets as
well. While consistent with Construct, it might be more useful to have
a separate color property and Set Color action.
- bug: if a script contains "vanish" action, Finished condition does
not always trigger.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Mon Jun 21, 2010 8:02 pm

Any benchmarks for speed/ # of objects yet?
Also I'm kind of curious (before I download and test) as to what your using for bullets, sprite etc.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Jun 21, 2010 8:47 pm

It doesn't use Construct Sprites but handles its own rendering (technically: textured quads in the case of rotated bullets, point sprites when there's no rotation).

Haven't ran very scientific benchmarks, but it's pretty fast. Here's a test I did just now:

Over 20000 bullets on screen (a bit of a challenge for the player :P ), colliding with one object (player ship), still pushing over 60 FPS. (2.8ghz dual core, GF 9800 GT).


[size=65:1jh7uo7q]stare at this long enough and your screen will begin to wave[/size:1jh7uo7q]

I can probably optimize it further, but there's still features to be added first. Anyway, performance is not the main catch here (Construct could easily push a few thousand Sprites -- more than enough for games) but the ability to script the patterns.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Mon Jun 21, 2010 9:01 pm

Thats pretty cool Luomu. Great screenshot too.

An editor would be nice where you could change parameters and see the bullets patterns in realtime and then export the xml file.

:D
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon Jun 21, 2010 9:35 pm

hey luomu
might I suggest posting this in Construct Discussion?

it's become the unspoken standard place to release new plugins, or plugin betas, and alot more people will see it. I think the average user ignores the Construct Engineering board, because it's mainly for plugin developers and construct developers to talk about the development side of things
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jun 22, 2010 3:52 pm

Very interesting. I like the concept, and it has its own advantages and disadvantages compared to doing it with events. I'm liking the cleaner event sheet and increased performance for massive screen filling patterns. However, with events and sprite based bullets you still have more control. Useful addition nonetheless. Another great plugin Luomu!
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Jul 01, 2010 7:37 am

[size=85:3pa838cy](back from the greek sun)[/size:3pa838cy]

I will post this somewhere more visible when it's less rough around the edges. Things I still need to do:
- Fix bugs!
- Create a cool demo game (just one level)
- Look again into using Construct objects as bullets, earlier I deemed it too tricky
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Wed Jul 14, 2010 9:19 am

Notable things I've added lately:
* Ability to use construct objects as bullets, allows for example per-bullet effects like trails and using the existing collision detection
* Easy "play file name.xml x times with delay y milliseconds" action

[size=65:33a41cde]Little green mutants with trails[/size:33a41cde]
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Sun Jul 18, 2010 10:09 pm

[quote="Luomu":1nu4u21q]Notable things I've added lately:
* Ability to use construct objects as bullets, allows for example per-bullet effects like trails and using the existing collision detection
* Easy "play file name.xml x times with delay y milliseconds" action

[size=65:1nu4u21q]Little green mutants with trails[/size:1nu4u21q][/quote:1nu4u21q]


So, uh, are you going to release that one? I really couldn't use this unless it supports per-pixel collisions.

Other than that, I really like the idea of being able to create patterns this way. Soooo much more organized than my current method.
B
4
S
1
G
5
Posts: 98
Reputation: 1,648

Post » Mon Jul 19, 2010 6:39 am

[quote="kaos":1ubtos73]So, uh, are you going to release that one? I really couldn't use this unless it supports per-pixel collisions.[/quote:1ubtos73]
Oh yeah, have a look: BulletML-1.01.zip. Still not an official release though.

For this week I'm on a machine with no dev tools so I can't quickly fix any bugs. Been working on the demo game instead.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Next

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 1 guest