Railgun attack update

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Railgun attack update

Re: Railgun attack update

by Graf Zahl » Sat Apr 07, 2012 6:58 am

Oh, I didn't even notice that finally a patch was available that works...


Added.

Re: Railgun attack update

by hfc2x » Tue Mar 13, 2012 5:46 pm

Wow, a customizable railgun attack would be really kickass! Definitely looking forward to this.

Re: Railgun attack update

by Enjay » Mon Feb 20, 2012 5:05 am

Very much looking forward to being able to use additional flexibility with the railgun. I really like the possibility of being able to have a fullbright rail and the new enhancements all sound very nice.

Re: Railgun attack update

by DoomRater » Sun Feb 19, 2012 11:01 pm

Sweet I can make a super ripping chainsaw now? One that'll cutthrough everything in front?

Re: Railgun attack update

by NeuralStunner » Sun Feb 19, 2012 9:36 pm

Hooray! =:)

Re: Railgun attack update

by Xaser » Sun Feb 19, 2012 8:18 pm

So, I decided to flex my coding muscle and finish up this feature. It's got a few changes from the original version and some new additions since, so I'll go ahead and list all the stuff the patch adds:

New Flags:
  • RGF_FULLBRIGHT: Makes all spawned particles fullbright.
New A_RailAttack/A_CustomRailgun Parameters:
  • range: Maximum distance (in map units, as fixed-point) the rail shot will travel before vanishing.
  • duration: Lifetime of spawned particles, in tics. Default is 35, and a value of '0' means "use default."
  • sparsity: Distance between individial particles. Implemented as a float multiplier, with 1.0 as the default.
  • driftspeed: Speed at which particles "drift" away from their initial spawn point. Implemented as a float multiplier, with 1.0 as the default.
  • spawnclass: Actor to spawn in place of trail particles. If non-null, the specified actor will be spaced sparsity units apart instead of the usual trail. Particle-specific properties such as duration, driftspeed, and rail color are naturally ignored in such a case.
There's still one thing missing: actor spawning doesn't yet respect maxdiff yet, but I haven't added that yet because I first want to play around with improving maxdiff's behavior a bit (which I see as a separate code submission altogether). Otherwise, this should be submit-worthy, parameter names subject to change of course. I've also cleaned up the code a bit since kg's patch, so there's no more passing the entire Flags variable to P_RailAttack or hiding the fullbright information in the color attribute of particle_t (it has its own variable in the struct now). ;)

Anyhow, the patch:
xa-rails.zip
Railgun upgrade. See xa-rails.txt for test wad documentation.
(28.06 KiB) Downloaded 72 times
The zip contains a TortoiseSVN .patch along with a test wad for the curious (based on kgsws's work). Let me know if there are any issues with it -- first time making a patch here but Tortoise makes it easy enough to hopefully be Xaserproof.

Thanks for kickstarting this, kgsws. Something I've been wanting to see for a while, myself. :P

Re: Railgun attack update

by kgsws-CZ » Wed Sep 28, 2011 8:15 am

Ok, here is new patch for latest svn revision.
Attachments
railgun.zip
(25.54 KiB) Downloaded 61 times

Re: Railgun attack update

by Gez » Fri Sep 23, 2011 3:08 am

I'm a big fan of Shift-Ctrl-F, personally.

A lot of code in ZDoom is macrofied. Trying to understand how the macros work exactly is sometimes a bit hard (especially when they call other macros which call other macros...) but is not necessary. What matter is to understand what they do and look how they're used. Generally, just looking at the existing examples is enough. The point which might still be obscure is the DEFINE_PROPERTY args format string (e.g. the "Iii" in "DEFINE_PROPERTY(poisondamage, Iii, Actor)"
or the "ZF" in "DEFINE_PROPERTY(damagefactor, ZF, Actor)"); to understand how it works you have to look at ParsePropertyParams() in thingdef_parse.cpp.

Re: Railgun attack update

by FDARI » Fri Sep 23, 2011 1:30 am

The hard bit is getting to know the code. However, a good way to find out where various bits of code are, and how they work, might be to look at patches from code submissions (pending and processed); they contain file names, line references, and description of their effects.

I haven't tried that approach myself. I just did my best to locate the entrypoint, find out where the game was running, and get a feel for the general flow of code, then to browse for relevant filenames and generally follow the flow of the code. For advanced stuff, you might need familiarity with both, but most of what you'd do is so standardised that you will not necessarily have to understand exactly how it works. Understanding, however, is very useful when you try to verify your own code.

Re: Railgun attack update

by Xaser » Thu Sep 22, 2011 10:16 pm

Indeed, looking at the patch, RAF_FLASHPARTICLES is still implemented as a flag and maxdiff+puff are hijacked for the RAF_SPAWNACTOR effect. That leaves this feature woefully incomplete, awesome as it is otherwise.

I can already see how to do the former -- add a new "duration" arg and set p->ttl to its value. How hard is it to add new arguments anyway? Haven't modified ZDoom's source myself just yet, but it doesn't seem too super-hard.

Re: Railgun attack update

by NeuralStunner » Thu Sep 22, 2011 8:04 pm

I was just thinking about this again, Xaser's remarks and all. Maybe someone else could take a crack at it?

Re: Railgun attack update

by Edward-san » Sun Jul 17, 2011 6:17 am

what happens if you use 'svn diff -u > rail.diff', in the sense of posting the output file?

Re: Railgun attack update

by kgsws-CZ » Sun Jul 17, 2011 5:28 am

Ah, i forgot to remove non-patch text "Pouze v zdoom", line 1 and 211. Will that fix this problem?

Re: Railgun attack update

by Edward-san » Fri Jul 15, 2011 3:00 pm

From what I see imho this is the output of the classic 'diff -rup' command in linux.

Re: Railgun attack update

by Graf Zahl » Fri Jul 15, 2011 12:53 pm

What do you make this with? I still can't apply it.

Top