Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: WMCoolmon on November 12, 2006, 07:17:53 pm

Title: C11122006 - Particles & Waypoints
Post by: WMCoolmon on November 12, 2006, 07:17:53 pm
Adds two things:

Waypoints support for scripting (Partial)
Not really tested, just something that I threw in pretty quickly.

Particle system modification
Why I'm releasing this build - I've rewritten a chunk of the particle system so that it uses the same method for all particle types, eg including smoke & fire. There probably won't be any significant performance hit, but any changes (good are bad) need to be noted. Not sure whether this is what people have been talking about when they've been talking about re-doing the particle system, but this will enable me to build a proper BSG FTL effect.

Link removed in case this was causing pilotfile corruption. See my last post in this thread.

EDIT: This build also adds support for displaying Lua parser errors, I don't think that was in the last build(s). It's also based on the most recent CVS, which includes a lot of the fixes from the 3.6.9 branch, which weren't in the last build.
Title: Re: C11122006 - Particles & Waypoints
Post by: Axem on November 12, 2006, 08:59:02 pm
Normally your builds won't work unless I use a debug build, but it seems that even that won't work now. I get a CTD when trying to get into the tech room. But since it is a debug build, the debug spew gave me some fun info for you. ;)

Code: [Select]
Glow point bank 3 texture num is 1116958 for 'fighter01.pof'
Glow point bank texture not found for 'fighter01.pof', setting as the normal one num
Found bitmap red_glow_small -- number 705
Glow point bank 4 texture num is 1102705 for 'fighter01.pof'
Glow point bank texture not found for 'fighter01.pof', setting as the normal one num
Bad chunk type 573693272, len=573959152 in model_octant_find_faces_sub
Int3(): From c:\documents and settings\administrator\my documents\my source code\fs2_open\code\model\modeloctant.cpp at line 401
Title: Re: C11122006 - Particles & Waypoints
Post by: Bobboau on November 12, 2006, 09:19:57 pm
something screwy with your fighter01.pof (Ulysses)
Title: Re: C11122006 - Particles & Waypoints
Post by: Axem on November 12, 2006, 09:41:21 pm
Then talk to :V: about that. :p I got that crash even if I had zero mods in my data folders.
Title: Re: C11122006 - Particles & Waypoints
Post by: Bobboau on November 12, 2006, 10:41:25 pm
no, it's loading a modified fighter01.pof, if you would notice it is loading glowpoint textures for it, which the stock one didn't have.
Title: Re: C11122006 - Particles & Waypoints
Post by: Bobboau on November 12, 2006, 10:42:21 pm
which chunk of the particle system did you re-write? how is it diferent?
Title: Re: C11122006 - Particles & Waypoints
Post by: WMCoolmon on November 12, 2006, 11:36:03 pm
Code: [Select]
struct particle_batcher {
private:
int bmap_id;
int bmap_nframes;
geometry_batcher *bmap_batchers;

For each particle animation. Whenever a new particle is created, the vector of particle_batchers is checked for an entry corresponding to the new particle's animation. It automatically grabs the first frame of the animation using bm_get_info(), so there are no duplicate entries (hopefully). If it can't find a set of geometry batchers for the new particle's animation, it pushes another particle_batcher entry onto the Batchers vector. The index into the Batchers[] vector is then saved in the particle struct, and is used to batch render the frames in particle_render_all().

The result is that the particle system gets a lot cleaner and has a lot less duplicate code, and more fine control is possible than while using the ordinary batch_render system. My guess is that it may be slightly faster, but probably not noticeable, because it doesn't have to look for a geometry_batcher each frame; it already has the index right there in the particle struct, so it just has to do a subtraction operation to figure out where in the array to put it.

Also, I think this build may have some kind of compilation errors. I noticed some bizarre model, ship select, and trail issues, did a rebuild of the solution, and they disappeared.
Title: Re: C11122006 - Particles & Waypoints
Post by: WMCoolmon on November 17, 2006, 04:34:42 am
Somewhat newer build:

http://fs2source.warpcore.org/temp/wmc/axemtest.zip