BITMAP Custom ExplosionGenerators

BITMAP Custom ExplosionGenerators

Requests for features in the spring code.

Moderator: Moderators

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

BITMAP Custom ExplosionGenerators

Post by Argh »

Without getting into all of the details, as I'm going to do a big writeup about this over the next couple of days...

I am building new, GPL-friendly code for all of the commonly-used Includes used for COB scripts. Everything is getting altered enough to qualify as "original Art"

One of the things that I encountered, that lead me to a very intriguing possiblity, was that BITMAP1, 2, 3, etc... aren't actually used by the COB interpreter, and do not cause error messages if they aren't defined.

What I was thinking was... that it should be pretty easy to have the COB interpreter check for BITMAPX, where X is a string, say, "BITMAP_ARGH_EXPLOSIONSMALL"... and then have some way to tie this to a Custom ExplosionGenerator. Then we could (if we feel like taking the extra effort) build death events and use EXPLODE events that just had a BITMAPX defined, allowing us to do cool stuff like:

1. Blood splashes, sparks, small smoke, etc., from units taking damage, specific to the unit- not to the weapon!

2. More detailed explosions, but without having to write and maintain several hundred lines of code in a custom ExplosionGenerator.

3. By abusing EXPLODE | BITMAPX, we could have all sorts of called FX for other purposes, without having to build some giant new system within Spring.

... basically, I think this would be a great idea, as it would solve a bunch of issues, involves very little new code (just some way for the COB interpreter to see that BITMAPX is being called, and then a way, probably in the unit FBI, to associate that with a custom ExplosionGenerator... say, a line like "BITMAP_ARGH_EXPLOSIONSMALL=custom:ARGH_EXPLOSIONSMALL" :-)
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Post by PicassoCT »

So for example - a Pyro could start burning ? Or melting...

Man that if this works.... i see hundreds of hours work coming for Cadyr & Co.


Proceed without Mercy :wink:
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Yeah... but the benefits for all mods, especially if the explosiongenerators would respect the relative Y orientation of the probably-invisible Piece they were being generated from... would be huge.

We could have a series of quick, nearly-clear and not very large texturemaps of blues, pinks and yellows that could look like very realistic jetflames...

Blood splashes could just be simple Dirt code, and we could even have gradations with this idea, from "just a flesh wound" to "instagib"... and a custom texture for the groundflash would allow for "blood" that stayed on the ground...

Electrical splashes, mud flying from tires... there's just so much we could do with this, and it'd be (relatively) simple to add to Spring.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It'd allow nanoglow to be added to nanoframes on a per unit per mod basis and even randomized. It'd do wodners for building animations, and could be used for nifty cloaking decloaking animations....

Imagine zwzsg stargate with a proper event horizon with the flash and the outburst once it's dialled in then a proper exit animation with it dissipating.

Remember US particle cannons in CC Generals how they changed as they charged up?

What about glowing eyes?

How about using the lightning animation to make a firing sequence even better by showing the charge building.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Mud from wheels XD, that would kill my comp for good, and so would anything else in this thread, proceed without mercy, cuz I am upgrading, pretty soon, too :P


Edit: Yesss! I can do the death stingers particle cannon now... It can charge up :mrgreen:
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

.... exactly!

All we really need to reach this level of Nerdvana... is a fairly small amount of new code, I think. Based on where the custom ExplosionGenerator code is going... so long as it has the timing functions that are really needed, along with the more generic strings used to call up multiple instances of the "same" general effect... it really could be that simple...
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

This is basically a simulation of a particle system.

Brilliant! :O

Edit: Oh, and Caydr *has* no Co.

Although i imagine he'd need one >.>
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

The BITMAP* things are just #define commands, they never reach the compiler. The precompiler replaces them with numbers. Look into the exptypes.h. There is no way to pass a string through this.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Waitaminute, though! What if we could use long, unique numbers? And what happens if we #define them as letters instead...

In short, that's a minor obstacle, methinks...

[EDIT]
Ok, defining it as a string kills Scriptor.

But using a long number... no problem!

So, our task would just be ever-so-slightly annoying... "10000001=custom:EXPLOSION_ARGH_01;"... no problem.
[/EDIT]
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Remember that these things are flag arrays and that some flags are reserved for SHATTER, FALL, FIRE and SMOKE. You can't just use an arbirary number, you have to make sure a certain number of its lower bits are zero.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Ok, I'll buy that. So basically, we need a few zeros at the end... so, instead of 100000001, we need 100000000, 200000000, and so forth... right?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Hm, the lower six bits are used for the part explosion behaviours. I think we're better off changing that to a piece-based system, i.e. each piece has a corresponding explosion generator that is triggered when the piece is exploded. If you need multiple generators for one piece define none for it and add multiple empty pieces in its location that get all of those generators. Maybe also require the 6th bit (64) to be set for that generator to be triggered.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Post by Sheekel »

OMG. If this works...


:twisted:
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

actually I think it'd be easier to add in a new function say

call-exp explosionName;
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

AF, that'd require that Scriptor was modified. From what little I can gather, Scriptor wasn't well-written, and people's attempts to modify it haven't worked out. If you want to give it a go someday, great, but I don't mind working with large abstract numbers if that's how it could work with Scriptor now.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I dont get how these numbers correlate to the explosion names
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

He wants to have a separate file define that correlation.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Yup. That'd keep things relatively simple.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

where's this scriptor source code?
User avatar
Aun
Posts: 788
Joined: 31 Aug 2005, 13:00

Post by Aun »

Post Reply

Return to “Feature Requests”