[epiar-devel] Weapons Design
chris at epiar.net
Mon Dec 7 10:31:20 PST 2009
Not too complicated, or if it is, it's worth doing. Let's do it right from the start instead of trying to add on. Be sure to talk to Matt about how to best go about the Lua part. imo, this seems doable for the 0.2.0 deadline: we don't need all the various types of weapons implemented by then but we do need support for a lot of them by then.
The mass idea is good. In space, you can throw however much mass you want on a ship, but I think this absolutely should affect the speed of the ship, which in turn adds strategy to the game and encourages players to buy better engines, which might require better energy reactors, which in turn might require new ship models.
Regarding the ShipOutfit class, this is a good idea, and it should be again, Lua scripted, because we just don't know what types of outfits we want. Some might be massless and have political side effects (fake IDs to alleviate a bad reputation for a certain alliance) and some might be as mundane as weapons. Other things like a ramscoop energy collector obviously has yet another entirely new function, so good idea. ShipOutfit is another property that likely should just be a list contained in the ship class.
What I'd like to do is get this sort of framework stuff out of the way by 0.5.0, so we can spend the remaining versions fixing bugs, enhancing existing code and effects, and massively writing planets, weapons, scenarios, etc. and tweaking values so that by 1.0, we not only have a completed game engine, but all the really important bits there too: the content.
On Dec 7, 2009, at 7:09 AM, Maoserr wrote:
> It might be worthwhile to have an 'ShipOutfit' class and derive the
> 'Weapon' and 'Ammo' from it. Also I think a single weapon slot should be
> able to fire multiple types of ammo (I.E. a missile launcher can fire both
> Official missiles and Black market missiles).
> Also in EV, all 'ShipOutfit' had mass, and this might be one of the
> constraints in addition to the number of slots, we should really put this
> in a Wiki page and flush all the requirements out (perhaps not important
> until we have more code though).
> Another thing to think about is if we want a FighterBay to be a weapon or
> a separate type of Outfit (it would fire Fighters). But perhaps thinking
> that far ahead would complicate things.
> The type of of design I'm actually thinking about is this:
> 1) Player presses a key to fire some sort of weapon
> 2) The 'Weapon' class has a Lua callback function for the action 'Fire',
> and then the Lua code takes care of decrementing the ammo count/reducing
> energy/send the player back due to the recoil, etc etc. The 'Fire'
> callback could even accept arguments (IE different firing mode: spread
> fire vs. concentrated fire vs. multifire vs. ...) and decide how the
> weapon gets fired.
> 3) The Lua callback then launches whatever Ammo, beam, etc, and attaches a
> call back to the ammo with some default properties (i.e. the ship that
> fired it, the target of the ammo, the initial velocity)
> 4) The ammo callback then launches on update and checks for modification
> to its parameters (interference due to environment, enemy guidance
> scrambler, heck, the enemy could even have a "retargeting" outfit that
> redirects the missile back at its own ship for all that matters)
> Might be too complicated to implement, but worth considering.
> On Mon, 07 Dec 2009 09:28:55 -0500, moses <moses7 at mchsi.com> wrote:
>> I think that's great. What about automatic targetting weapons for close
>> encounters at less damage?
>> On Sun, 2009-12-06 at 20:55 -0800, Shawn Reynolds wrote:
>>> The weapons system is an important part of the game and I want to make
>>> sure that it will be scalable to meet our needs in the future. So I
>>> wanted to let everyone know the design and get their opinion.
>>> So my design is the following I have a weapons class which contains a
>>> list of weapon classes. The weapons class holds the list of all the
>>> weapons available in the world. The weapons are parsed from xml file
>>> and contains the attributes specific the weapon.
>>> When the players ship is created he gets a list of weapons available to
>>> the ship. New weapons can be added to the ship simply by adding it to
>>> the ships weapons list. The weapons are copied from the master list to
>>> the ships.
>>> So here is where I have a question... Should the ammo be stored with
>>> the ships weapon list (ie every weapon has unique ammo) or should I
>>> track ammo separately so that we can have different weapons share ammo?
>>> Anyway back to talking about the design. So the ship class has a fire
>>> function that calls the selected weapons fireWeapon function. When the
>>> weapon is fired it checks the weaponType that was assigned to the
>>> weapon. If the weapon is of type projectile (iemissiles, photon
>>> torpedo's) then it will spawn a projectile sprite and add it to the
>>> world with the properties specified in the selected weapon. The
>>> projectile sprite is the missile at this point and gets its
>>> coordinates and direction from the ship. I setup weapon types so that
>>> we could have other classes for different types (ie energy weapons)
>>> that way they can behave differently then projectiles.
>>> Also we are planning on adding lau code for the ai of the missile, that
>>> way we can do homing missiles.
>>> epiar-devel mailing list
>>> epiar-devel at epiar.net
>> epiar-devel mailing list
>> epiar-devel at epiar.net
> epiar-devel mailing list
> epiar-devel at epiar.net
More information about the epiar-devel