bugBattle for Wesnoth - Bugs: bug #11706, Extensions for particle engine

 
 
Show feedback again

bug #11706: Extensions for particle engine

Submitted by:  Richard Kettering <jetryl>
Submitted on:  Mon 19 May 2008 08:18:10 PM UTC  
 
Category: Feature RequestSeverity: 4 - Important
Priority: 1 - LaterItem Group: Graphics
Status: NonePrivacy: Public
Assigned to: Jérémy Rosen <boucman>Open/Closed: Open
Release: 1.5.xOperating System: any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 30 Dec 2009 09:53:11 AM UTC, comment #1:

we are getting closer but are not there yet

i'll work on it post 1.8

Jérémy Rosen <boucman>
Project MemberIn charge of this item.
Mon 19 May 2008 08:18:10 PM UTC, original submission:

Right now our engine allows support for drawing additional, arbitrary animations, each moving along arbitrary x,y, positions over time. This gets a heck of a lot closer to being useable as a "particle engine"; the main thing that's missing is to make a movement path that has some element of [b]randomness[/b] in it - such as a linear slide from a fixed starting position to a random end position.

We can even deal quite well with a fixed number of particles being emitted, the key thing is simply that their paths be different each time they're emitted - that is the main thing that's useful about particle engines, their ability to produce a infinite number of variations of something that would otherwise have only one variant. If, for example, a few sparks burst off of the victim of a magic missile - if they fly off in random directions, every single time the animation plays, it will look different. [u]And it will look different with no additional content creation cost.[/u]

[b]There are a few movement behaviours I can see being useful for "particles":[/b]
Linear - particle moves from one spot to another
Arbitrary physical behaviour:
particle moves under the affect of in-game gravity
particle floats up and is caught by wind
particle bounces, etc
particle flutters back and forth like a falling leaf/feather

The best way to do these would simply be to allow the animation to call some sort of referentially transparent function during the animation, to determine the x,y position of the individual animation (be it "missile" "" or any special animation name). This function would be a function of time - for any input time, it would need to be able to return arbitary values of x and y. (I understand that randomness would goof with the ref transparency; possibly we could store a seed, or something. It needs to appear random, rather than actually be random.)

This function would need to be able to do the following:
- evaluate arithmetic formulas (Dave's formula system might apply here)
- use a few basic trig functions (cos, sine, etc)

[b]Example syntax:[/b]
[missile_frame]
offset=0~random(.5,.8)
# this frame would travel from an offset of zero, to an offset that was randomly chosen to lie in the range between .5 and .8. This final position would be determined when the animation started.
[/missile_frame]

Typically, for a given animation, it would emit a fixed-number of particles (around 4-10) for each missile frame. Use of these would be fairly rare, and would generally only get used on animations that would sensibly kick up debris - smoke from a thunderer's muzzle flash, sparks from a magic missile, etc. Most units would not have particle effects.

This request is currently for a "fixed number of particles", but it would be worthwhile to look into ways to extend this, or design this so it could be extended in the future, to create a random number of particles (preferably from a description of a single one which there will be several copies of). From my experience, we'll do rather well with a fixed number, but having a random number would improve things.

Richard Kettering <jetryl>
Project Member

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by boucman (Posted a comment)
  • -unavailable- added by jetryl (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 29 Jan 2012 09:40:59 PM UTCshadowmasterStatusPostponed=>None
    Wed 30 Dec 2009 09:53:11 AM UTCboucmanStatusNone=>Postponed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup