Request for comments: UniversalWeapon

Request for comments: UniversalWeapon

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Request for comments: UniversalWeapon

Post by KDR_11k »

UniversalWeapon

Summary:
The UniversalWeapon will be a weapon capable of replacing any existing weapontype. It will use submodules that can be combined to get any desired behaviour. Every hardpoint can use a Lua function

UniversalWeapon plugin "hardpoints"
[*]Target finder
[*][*]Any target
[*][*]Manual
[*]LOF verifier (TryTarget)
[*][*]Line
[*][*]Ballistic trajectory
[*][*]Unrestricted
[*]Aimer
[*][*]Direct
[*][*]Coaxial
[*][*]UnitHeading
[*][*]Piece
[*][*]Fixed
[*][*]MaintainBurstDirection
[*]Launcher
[*][*]Projectile
[*][*]Beam
[*][*]Instahit

UniversalWeaponProjectile hardpoints
[*]InFlight (movement along speed vector is implicit) (can use any number)
[*][*]Accelerate
[*][*]Ballistic
[*][*]Arc Trajectory
[*][*]Guided
[*][*]InertiaGuided
[*][*]TurnToward (accepts event to execute when turn is finished)
[*][*]Spawn Projectile
[*]Event (hit unit/ground/water, timeout) (can use any number)
[*][*]Explode
[*][*]Destroy (not implicit in Explode)
[*][*]Bounce
[*][*]Spawn Projectile
[*][*]SetTimer
[*][*]SetTrajectory
[*][*]SetEvent
[*][*]SetDraw
[*]Draw (can use any number)
[*][*]Model
[*][*]Trail
[*][*]CEG
[*][*]Laser
[*][*]Sprite
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Request for comments: UniversalWeapon

Post by imbaczek »

Good idea. Should allow to make exploding sheep, banana bombs and other fun stuff. Super sheep will need to change trajectory from Lua to work (i.e. you'll need to be able to modify heading and velocity of a fired projectile - I see that you've already listed SetTrajectory, but I'm not sure if that's that.)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Request for comments: UniversalWeapon

Post by KDR_11k »

SetTrajectory is a fixed event that replaces/adds/removes a Trajectory module (e.g. replace guidance with ballistic once the flight time ends, replace accelerate with turntowards for vlaunch, ...), I'm planning a Lua module (i.e. a class that just forwards all calls to Lua) for every hardpoint that would be used for things you cannot express with the available modules.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Request for comments: UniversalWeapon

Post by imbaczek »

Oh. The name is confusing, then - SetFlightController or something similar would be better. SetTrajectory suggest that you could e.g. set waypoints for a missile.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Request for comments: UniversalWeapon

Post by rattle »

Blendmodes for sprite weapons, overlay and additive at least.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Request for comments: UniversalWeapon

Post by AF »

The ability to attach units and features? Imagine a wave blasting away trees and carrying them along and depositing them in a nearby harbour where they slowly sink, or jumping from unit to unit.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: Request for comments: UniversalWeapon

Post by Zpock »

IMO it would be nice with a weapon fully integrated with LUA. For starters a way to keep track of where the projectile is like with units. Also ability to set all the parameters in LUA would be nice, like position and all that for projectiles but also damage range, etc for the weapon dynamically. Then I would consider going back from using my own hacked together LUA weapons in my project.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Request for comments: UniversalWeapon

Post by yuritch »

KDR_11k wrote:UniversalWeapon
...
[*]Aimer
[*][*]Direct
[*][*]Coaxial
[*][*]UnitHeading
[*][*]Piece
[*][*]Fixed
[*][*]MaintainBurstDirection...
What will those options do? Some of their names aren't clear enough for me. Is Coaxial meant for weapons that can only aim in the direction their 'master' weapon aims? Will UnitHeading mean it can only aim where the unit is facing (sort of like turret=0 weapons do now)?
Why I ask all of that: suppose I want to make a unit like this:
Image
As you can see, it has a machinegun on the back of turret, that can only fire in the opposite direction from the main gun (it has a coax MG with the main gun, too). So basically it's like WeaponMainDir=0 0 -1, only (0,0,0) vector being not the unit heading, but current turret position.
Will something like that be possible with that proposed system? Because ATM such a unit is scriptable, but the limitations would mean that MG on the back will almost never be able to fire.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Request for comments: UniversalWeapon

Post by KDR_11k »

Direct = firepoint to target
Coaxial = aimpoint to target (OTA behaviour, I'Ve heard)
Heading = turret = 0, yes
Piece = piece orientation
Fixed = fixed vector
MaintainBurst = Make sure later shots in a burst aim in the same direction as the first

The Aimer would just determine the direction the shot is fired in.

Slave weapons aren't part of the proposal yet, I think those would work under target finder or something.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Request for comments: UniversalWeapon

Post by smoth »

I mentioned abstracting the weapons into a base type but trepan told me that it would be OO overkill.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Re: Request for comments: UniversalWeapon

Post by jcnossen »

There must have been more arguments to that, there already is a weapon base class, but it sucks
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Request for comments: UniversalWeapon

Post by AF »

A basic weapon that had no real attributes and instead relied on a lua script to implement its functionality would be best imo.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Request for comments: UniversalWeapon

Post by KDR_11k »

I disagree, Trepan objected top lua-projectile interfacing because that'd just be horribly slow due to the number of propjectiles in play. It'd suck to have to reimplement everything in Lua just because you want one behaviour slightly different.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Request for comments: UniversalWeapon

Post by AF »

even if all you wanted was a very simple particle?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Request for comments: UniversalWeapon

Post by Argh »

Looks great, I really couldn't come up with anything new to add. Looks like just about all of the requests are in there, frankly, this makes me rub my hands together with glee, anticipating making wild new weapons that actually do something new for a change :-)
User avatar
Decimator
Posts: 1118
Joined: 24 Jul 2005, 04:15

Re: Request for comments: UniversalWeapon

Post by Decimator »

I see one useful tag that could be added, a cruisealtitude tag so a projectile will try to maintain a certain distance above the ground/water.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: Request for comments: UniversalWeapon

Post by Zpock »

KDR_11k wrote:I disagree, Trepan objected top lua-projectile interfacing because that'd just be horribly slow due to the number of propjectiles in play. It'd suck to have to reimplement everything in Lua just because you want one behaviour slightly different.
Why is this a problem if things like spammed flashes EMGs are still handled by simple hardcoded stuff, but when you want to make say a complicated MIRV nuke or heatseeking missle, you don't have to do the whole thing in LUA from ground up or resort to some epic hack?

On the other hand, When I think of it, you'd basically be doing that anyway even if you could get some assistance by the engine... The main thing that would be nice is if you didn't have to mess with unit behaviour, but could basically get a weapon fired, and then handle it from there in LUA.

I admit I don't really understand how this whole system will work out, with the hardpoints and how exactly it will tie in with LUA and what you will be able to do.
Post Reply

Return to “Engine”