Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: ExternalComponents XML disection for Quadrent, the 2D spaceship game  (Read 575 times)

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse

Spoiler: XML (click to show/hide)

Talvara

  • Bay Watcher
    • View Profile

Its cool to see someone taking an interest into what I'm doing, Your notes look correct to me.

Quote
<ExternalComponent isSymetrical="True" Name="DualCannon"> <comment comment="isSymetrical is most likely for editor use, as the Points define a entire shape, not a half shape, Name is obvious">
I'm not sure if im even using the 'isSymetrical' tag anymore at this point :D, Symmetry is also kind of buggy. I just messed around with it a little to see if isSymetrical still does what I think it does. and the entire non symetrical builds arent behaving properly. (guess that one goes back on the todo list)

Perhaps I can save a little on the XML file size if I actually didn't store the entire collision shape for symmetrical designs, good catch.

Quote
<Engine_02 Position="(1.2500, -0.3976, 0.0000)" Angle="0.0000" Scale="(1.0000, 1.0000)" /> <comment comment="These are general structures, the name of the structure tells the game engine what part it is working with, the third part of the tuple Position loads is apparently unused"
  the last component of the position is actually used for depth sorting. when you change the 'depth' of a component it'll either push it away from the camera or drag it towards it, this way the user can define which things should be on top and which things should be below.

I'm actually planning on making the name a little more complex. currently its not possible to have ship-art components of the same name even if they're placed in different texture atlases(or sub-folders) so... I think I should also add the name of the atlas in these xml files to allow for art bits having the same name.

Quote
<ExternalEffect Name="Shooter" ShooterRateOfFire="10.0000" ShooterAccuracyAngle="3.0000" ProjectileLifetime="2.0000" ProjectileVelocity="0.5000" ProjectileVelocityDecay="0.2000" ProjectileColor="RGBA(0.0000, 0.0000, 0.0000, 0.0000)" ProjectileSize="10.0000" ProjectileDamage="0.5000" Position="(-1.4063, 2.0313, 0.0000)" Angle="0.0000" Scale="(-1.0000, 1.0000)" />
Looking at this I'd say your bullets are invisible, since their colour is completely black and transparent. In the future I want 'projectiles' to have their own XML's so... in a different editor you'd design your bullets. and then instead of having all this speed/colour/damage information in the shooter components it'd just point to which type of projectile it should spawn.

Quote
<PolygonCollider isHole="false"> <comment comment="<Guess>probably defines the structure, ishole tells it that it doesnt collide </Guess>"
Pretty much, You can't define a polygon with a hole in it as a single polygon, so if a design has 'negative space' it'll need to keep track of that with multiple polygons, some of them earmarked as holes. (these holes aren't actually used for collision detection, but I am using them to calculate the interior space for the spacecraft and for the new damage system I'm working on.)



---

Anyway, cool that you're taking an interest. I do think this post might have made more sense in the already existing thread instead of making a new one ;)
« Last Edit: May 28, 2016, 11:57:21 am by Talvara »
Logged

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse

Its cool to see someone taking an interest into what I'm doing, Your notes look correct to me.

Quote
<ExternalComponent isSymetrical="True" Name="DualCannon"> <comment comment="isSymetrical is most likely for editor use, as the Points define a entire shape, not a half shape, Name is obvious">
I'm not sure if im even using the 'isSymetrical' tag anymore at this point :D, Symmetry is also kind of buggy. I just messed around with it a little to see if isSymetrical still does what I think it does. and the entire non symetrical builds arent behaving properly. (guess that one goes back on the todo list)

Perhaps I can save a little on the XML file size if I actually didn't store the entire collision shape for symmetrical designs, good catch.

Quote
<Engine_02 Position="(1.2500, -0.3976, 0.0000)" Angle="0.0000" Scale="(1.0000, 1.0000)" /> <comment comment="These are general structures, the name of the structure tells the game engine what part it is working with, the third part of the tuple Position loads is apparently unused"
  the last component of the position is actually used for depth sorting. when you change the 'depth' of a component it'll either push it away from the camera or drag it towards it, this way the user can define which things should be on top and which things should be below.

I'm actually planning on making the name a little more complex. currently its not possible to have ship-art components of the same name even if they're placed in different texture atlases(or sub-folders) so... I think I should also add the name of the atlas in these xml files to allow for art bits having the same name.

Quote
<ExternalEffect Name="Shooter" ShooterRateOfFire="10.0000" ShooterAccuracyAngle="3.0000" ProjectileLifetime="2.0000" ProjectileVelocity="0.5000" ProjectileVelocityDecay="0.2000" ProjectileColor="RGBA(0.0000, 0.0000, 0.0000, 0.0000)" ProjectileSize="10.0000" ProjectileDamage="0.5000" Position="(-1.4063, 2.0313, 0.0000)" Angle="0.0000" Scale="(-1.0000, 1.0000)" />
Looking at this I'd say your bullets are invisible, since their colour is completely black and transparent. In the future I want 'projectiles' to have their own XML's so... in a different editor you'd design your bullets. and then instead of having all this speed/colour/damage information in the shooter components it'd just point to which type of projectile it should spawn.

Quote
<PolygonCollider isHole="false"> <comment comment="<Guess>probably defines the structure, ishole tells it that it doesnt collide </Guess>"
Pretty much, You can't define a polygon with a hole in it as a single polygon, so if a design has 'negative space' it'll need to keep track of that with multiple polygons, some of them earmarked as holes. (these holes aren't actually used for collision detection, but I am using them to calculate the interior space for the spacecraft and for the new damage system I'm working on.)



---

Anyway, cool that you're taking an interest. I do think this post might have made more sense in the already existing thread instead of making a new one ;)
that'd be nice. what about special effects for the bullets, like
<effect type="countdownExplosive" timer="10.00" radius="5.43" strength="4.00" blastrgba="(255,255,255,50)" internalPointer="cde_1" useForMain="true">

<effect type="spliterTimed" timer="10.00" objectCount="4" spawnedObject="minibolt">

<effect type="fadeoutTimed" timer="5.67" fadeTorgba="(0,0,0,255)"  fadeback="true">

<effect type="selfDestructTimed" timer="5.67" deathAffects="true" deathAffect="cde_1">
etc. etc.