[Added] Railgun attack update

Moderator: Developers

Re: Railgun attack update

Postby FDARI » Fri Sep 23, 2011 2: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.
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

Re: Railgun attack update

Postby Gez » Fri Sep 23, 2011 4: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.
Gez
 
Joined: 06 Jul 2007

Re: Railgun attack update

Postby kgsws-CZ » Wed Sep 28, 2011 9:15 am

Ok, here is new patch for latest svn revision.
Attachments
railgun.zip
(25.54 KiB) Downloaded 23 times
kgsws-CZ
 
Joined: 19 Jul 2009

Re: Railgun attack update

Postby Xaser » Sun Feb 19, 2012 9: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 19 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
User avatar
Xaser
secretly a supercomputer being a government
 
Joined: 20 Jul 2003
Location: .plɹoʍɹǝʌǝu.

Re: Railgun attack update

Postby NeuralStunner » Sun Feb 19, 2012 10:36 pm

Hooray! =:)
User avatar
NeuralStunner
O'Neill with it.
 
Joined: 21 Jul 2009
Location: The Colonies

Re: Railgun attack update

Postby DoomRater » Mon Feb 20, 2012 12:01 am

Sweet I can make a super ripping chainsaw now? One that'll cutthrough everything in front?
User avatar
DoomRater
Flash Junkie
 
Joined: 28 Jul 2004
Location: www.wetheplayers.net

Re: Railgun attack update

Postby Enjay » Mon Feb 20, 2012 6: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.
User avatar
Enjay
The Force is strong with this one.
 
Joined: 15 Jul 2003
Location: Scotland

Re: Railgun attack update

Postby hfc2x » Tue Mar 13, 2012 6:46 pm

Wow, a customizable railgun attack would be really kickass! Definitely looking forward to this.
User avatar
hfc2x
Skulltag/Zandronum enemy
 
Joined: 17 Aug 2009
Location: Osorno, Chile

Re: Railgun attack update

Postby Graf Zahl » Sat Apr 07, 2012 7:58 am

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


Added.
User avatar
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Previous

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest