Home » MODDING HQ 1.13 » v1.13 Coding Talk » [IDEA] New Magazine System
Re: [IDEA] New Ammunition System[message #282883] Fri, 10 June 2011 00:28 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
One thing I am hoping to be able to setup is the ability to "reload" a belt fed weapon without removing the existing belt. This would conceivably let you load in larger then normal belts onto LMGs. And the AP cost of doing that would be lower the the AP cost of completely reloading the weapon.

Re: [IDEA] New Ammunition System[message #282890] Fri, 10 June 2011 01:09 Go to previous messageGo to next message
Wil473

 
Messages:2855
Registered:September 2004
Location: Canada
Halving the number of ammunition related items (or better as your numbers indicate) takes the sting out of the conversion work.

With respect to the stock maps, it may be possible to get away with simply replacing old magazines with ammunition piles of the same calibre/ammotype. Where there are different sizes of the same calibre/ammotype they can be filled in empty NMS magazines. This was how I was planning on implementing any NMS and still be able to use original UC and DL maps.

Worse case scenario, if the process cannot be automated, I can always offer Wolf00 a Faustian bargain: he goes through all the maps to replace the old magazines, I'll add a dozen of the oddball calibre/ammotype combo's that he wants.

EDIT: a few other capabilities for consideration:
- will the existing reload modification tags in items.xml be usable to modify reload cost of a magazine as it is being loaded?
- Also, will attachments be able to add "Legal" NMS magazine items? ie. belt feed attachment for the ARES Shrike.

[Updated on: Fri, 10 June 2011 01:16] by Moderator



Re: [IDEA] New Ammunition System[message #282897] Fri, 10 June 2011 01:25 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
Can you give me an example of the "existing reload modifications tag" and what it's currently used for and by? My eyes are starting to glaze over after going through 232 of the 377 weapon entries in the "vanilla" weapons.xml file to update ubMagSize and add ubChamberSize. Smile

Can't the Ares Shrike already use a 200rnd belt? It's supposed to have the same "M27 Feed System" that the M249 (Minimi) uses. Anyway, yes, you should be able to have attachments that change the valid magazines using the existing NAS system. You'd just make the mag attachable to the attachment and when you add the attachment to the gun, the new mag should be an option. Though you won't be able to remove mag support this way.

Re: [IDEA] New Ammunition System[message #282900] Fri, 10 June 2011 02:04 Go to previous messageGo to next message
Wil473

 
Messages:2855
Registered:September 2004
Location: Canada
- I use it right now to to increase reload cost for guns when the C-Mag adapter is attached. Now with NMS there will no longer be a C-Mag adapter, as the NMS C-Mag just loads directly into guns it is set for. I was wondering if it was still possible to have different reload costs between magazines that fit the same gun (your post bottom of last page indicates retaining the current APsToReload).


Re: [IDEA] New Ammunition System[message #282904] Fri, 10 June 2011 02:49 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
Hmm. Ok. How about if I put the APsToReload into Magazines.xml. That would represent the default APs required to load that mag into a "standard" weapon. Then in Weapons.xml we have a modifier (positive or negative... maybe a percentage?) which gets applied to the default. That way you can use the same mag items in the M16 and FAMAS but have each rifle get it's own actual reload cost. Then you wouldn't need a modifier for the mag. Only for the weapon itself. I'll need to update UDB so that we display the "APs to Reload" based on the mag and the weapon. And if the weapon doesn't currently have a mag installed, I'll need to have it display the modifier instead of the actual value.

Re: [IDEA] New Ammunition System[message #282905] Fri, 10 June 2011 03:03 Go to previous messageGo to next message
Wil473

 
Messages:2855
Registered:September 2004
Location: Canada
Sounds good.

EDIT: actually, putting the primary reload cost on the magazine sounds better than good, this means I can dispense with the attachment based dual feed system on the full size FN Minimi variants. (Right now the attachment's purpose is to differentiate between 30 and 200 rounds, and muck up reload costs so that you cannot use the "wrong size" magazine during a combat turn.)

[Updated on: Fri, 10 June 2011 20:54] by Moderator



Re: [IDEA] New Ammunition System[message #283022] Fri, 10 June 2011 21:41 Go to previous messageGo to next message
wolf00

 
Messages:1153
Registered:September 2006
Location: Czech Republic

will473: for me is interesting something special like .45 acp in * variant or .357* or .44*,i think .338* maybe exist,also .338 ap or sofpoint can add some spice to game... .50bmg in sofpoint is interesting for me ... Smile sorry for big ot
Re: [IDEA] New Ammunition System[message #283452] Tue, 14 June 2011 20:29 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
Just wanted to keep you all informed. I'm still working on setting up the xml files. It's been a pretty involved process because I'm reorganizing the items.xml file to account for removing all of the old ammo items. And since so many xml files link back to items.xml, that means I've had to mess with just about every xml file to keep all the changes consistant. At this point I just need to finish cleaning up the sti files and preping the temporary ammo and mag grapics. Then I need to finish setting up the conversion xml file (to convert from the pre-NMS items.xml) and create the new xml file that will link "ammo to mags to guns". Once I have these last few steps finished, I can start working on the actual coding.

Re: [IDEA] New Ammunition System[message #283455] Tue, 14 June 2011 20:43 Go to previous messageGo to next message
Cell

 
Messages:618
Registered:February 2011
User deleted
Re: [IDEA] New Ammunition System[message #283681] Fri, 17 June 2011 01:14 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
I've just finished setting up the new items.xml with all new mag and ammo items. And I've gone through all the images and cleaned everything up. Only thing I need to do now is setup the new xml file that will link "ammo to mags to guns". However, I also need a bunch of graphics. Currently I have placeholders for most of the ammo items but I'm thinking we'll want proper ammunition graphics for when all is said and done. Anyone out there any good with graphics who would like to lend a hand? Here's a list of all the ammo items that I need graphics for:

.30 cal AP ammo
.30 cal HP ammo
.300 WM AP ammo
.300 WM HP ammo
.30-06 AP ammo or stripper clip
.338 Lapua Magnum ammo
.357 mag Std, AET, AP, G & HP ammo or speed loader
.38 Special Std, M, AP, G, Hp & HPS ammo or speed loader
.40 S&W Std, AET, AP, G, HP & M ammo
.44 mag Std, AET, AP G & HP ammo or speed loader
.45 ACP Std, AET, AP, HP, G, & M ammo
.454 Casull Std, AP & HP ammo or speed loader
.45 WM Std, AP & HP ammo
.50 AE Std & HP ammo
.50 BMG ammo
10mm Std, AP, HP, AET, G & M ammo
12.5mm Std & Flechette ammo or speed loader
12.7mm Std & Subsonic ammo
4.5x30mm Std & AET ammo
4.7mm ammo
5.45x18mm Std & HP ammo
5.45x39mm AP, HP, HPC, C, & T ammo
5.56x45mm AP, HP, G, M, T, HPC, C & SCF ammo
5.7mm AP, HP & AET ammo
6.8x43mm AP & HP ammo
6x35mm AP & HP ammo
7.62x25mm Std, AET, C, HP & HPC ammo
7.62x37mm ammo
7.62x39mm AP, C, HP, HPC, M & T ammo
7.92x57mm AP & HP ammo or stipper clip
9mm MS ammo
9x18mm Std, AP, HP & G ammo
9x19mm Std, AET, AP, APC, C, G, HP, HPC, M & T ammo
9x21mm ammo
9x39mm ammo
20mm HE, Mustard, Smoke, Stun, Tear Gas & Thermo shells
25mm HE, Mustard, Smoke, Stun, Tear Gas & Thermo shells

Where I say "ammo or speed loader", I'm using the speed loader graphic for the actual speed loader, which is a kind of magazine. So I'm thinking we want "loose round" graphics for the ammunition.
Where I say "ammo or stripper clip", I'm doing those just like speed loaders. The stipper clip is a seperate magazine item which is using the old graphic. So I think we want new "loose round" graphics for the ammunition.
Also notice that I need graphics for 20mm and 25mm shells. Because of how NMS is going to be able to work, we'll be able to load explosives or ammunition into a magazine so I need new "loose round" graphics for those shells as well.

Re: [IDEA] New Ammunition System[message #283749] Fri, 17 June 2011 18:11 Go to previous messageGo to next message
tais

 
Messages:808
Registered:February 2008
Location: NL
You could always try to ask smeag, maybe he has some time to help on this.. if he can get some time away from yoga ^^


Re: [IDEA] New Ammunition System[message #283885] Sun, 19 June 2011 03:11 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
Another update for you all. I believe I have all the new xml files setup. I ended up creating an Ammunition.xml which stores the ammo specific details (calibre & type), an AmmoLink.xml which links ammo to mags and guns, a MagLink.xml which links mags to guns, and an ItemConversion.xml which tells the system the new index number for items based on the old number. I also modified the existing Magazines.xml so it knows the mag size, base aps to reload, and whether the "mag" is a mag, speed load, stipper clip or belt. Weapons.xml has been modified so that the ubMagSize tag now represents a weapon's internal mag size, a new ubChamberSize tag has been added so we know if the weapon has a chamber that can be manually reloaded, and the APsToReload tag now represent a modifier to the base tag found in Magazines.xml.
Only xml related task I have left for this project is to work out the "default quantity", weight, and itemsize for the ammo. But I will probably just use very generic values to start with. Basically what this all means is I can finally start working on the actual code.

Anyway, I setup AmmoLink and MagLink pretty much just like Attachments.xml. I decided to go with seperate files partly to keep the size of Attachments.xml down, and partly because it was easier to update the xml editor to support three files rather then trying to get it to split one file. But mainly I went with seperate files because it should speed up searches. Since every time we do anything with ammo or mags we're going to have to sift through these xml files, I figured it would speed things up (if only slightly) by not having to sort through item entries that have nothing to do with the specific type of item we're interested in.

Re: [IDEA] New Ammunition System[message #284432] Wed, 22 June 2011 21:56 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
With the current system (OMS), when there are no enemies in the sector and you try to "reload" a partially loaded weapon, you actually "top off" the clip that's currently in your weapon. What I'm not sure about is, should NMS do the same thing?

Keep in mind that in NMS, ammo in a magazine (internal or external) is setup as a LIFO (last in, first out) stack. So if you "top off", you'll be adding rounds to the top of the mag in your weapon in the reverse order from the mag you're loading from. In other words, imaging two clips loaded as follows:
C1-1 C2-1
C1-2 C2-2
C1-3 C2-3
C1-4 C2-4
C1-5 C2-5

If you "top off" C1 using C2, the result would be:
C2-5
C2-4
C2-3
C2-2
C2-1
C1-1
C1-2
C1-3
C1-4
C1-5

This isn't really a concern if you're using the same ammo in both mags. But what if you've got mixed ammo in either/both of the mags? AP in C1 but HP in C2, for instance. Or a 2:1 AP:Tracer mix in C1 and straight AP in C2. You may inadvertantly "top off" your loaded mag with ammo that you don't actually want. And correcting that "mistake" would involve manually unloading the weapon and "reloading" a different clip. Not impossible but certainly a few extra steps.

So I'm looking for some opinions. Should the ability to "top off" mags that are loaded in weapons still be allowed and it's up to the player to remember what will happen when you do that? Or should I force you to remove a mag from a weapon before "topping off"?

Re: [IDEA] New Ammunition System[message #284433] Wed, 22 June 2011 22:07 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
That's a tough one but I guess 'topping off' with some arbitrary mag is the least elegant option. Though removing the feature will also raise protest.
Maybe we should replace the current mag with the fullest available (if that one has more rounds left) and leave the topping off and sorting out for the player to do after combat?


Re: [IDEA] New Ammunition System[message #284442] Thu, 23 June 2011 00:27 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
That's also an option but, again, it's not going to be the same as what you're used to. Basically, "topping off" the mag already loaded in a gun is just a time saving function. In reality, you'd eject the mag, add some rounds to the "top" of the mag, then insert the mag back into the weapon. So the idea of simply adding round to the "top" of the loaded mag isn't a major issue. I'm just looking for opinions as to whether that's what we should be having the code do. About the only real concern with simply swapping is that you may end up with alot of partially loaded mags. That's realistic but this may be one of those areas where realism needs to give way to playability. The point of NMS is to bring a bit more realism and flexibility to the magazine system, while keeping additional inventory management to a minimum.
I won't go for adding rounds to the "bottom" of the mag in this fashion. If you want to do that, you should remove the mag, unload the mag, and then reload the mag properly. So that leaves us with three apparent options:

1) "Top off" the same way OMS does it by simply adding round to the "top" of the loaded mag.
2) Swap the mags but don't "top off". This is what happens when there are enemies present.
3) Don't do anything.

And before you ask, I can only code the system to do one of the three.

Re: [IDEA] New Ammunition System[message #284472] Thu, 23 June 2011 09:35 Go to previous messageGo to next message
JMich

 
Messages:575
Registered:January 2011
Location: Greece
ChrisL
1) "Top off" the same way OMS does it by simply adding round to the "top" of the loaded mag.
2) Swap the mags but don't "top off". This is what happens when there are enemies present.
3) Don't do anything.

And before you ask, I can only code the system to do one of the three.
Actually, I fear you will have to code at least the first two, for use with OMS/NMS. If using OMS, which obviously means no ammo mixing, then we should be able to top off the magazines, just like now. My suggestion, though not so sure how easy it will be, is that if the magazine only has one type of ammo, and we have another magazine with again only that type of ammo, allow it to be topped off. If the ammo is mixed, do not.

If this suggestion cannot be implemented, then I'd say do not allow magazine topping in NMS, but allow it on map screen, even if in combat, like how you can currently combine items in the map screen.
Re: [IDEA] New Ammunition System[message #284496] Thu, 23 June 2011 17:44 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
What I meant was, I couldn't code two (or more) different systems that you would be able to switch between.

And no, it won't be an issue making it so that you only "top off" when you're loading the same kind of ammo into a mag that has only one kind of ammo. That's not hugely difficult.

Re: [IDEA] New Ammunition System[message #284497] Thu, 23 June 2011 17:51 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
Hmmm, that being possible, I'd say let it top off 'single type' magazines but leave mixed ones untouched (on the assumption that if you mixed stuff, you likely have a reason and don't want it to be messed up).
Oh, one thing: If possible, the function should prefer loose or boxed ammo over taking ammo from other magazines.


Re: [IDEA] New Ammunition System[message #284611] Fri, 24 June 2011 19:22 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
Right now what I've done is set the ReloadGun function so that if the ammo loaded in the weapon and the ammo in the mag you're trying to "top off" with are all identical (so you have just AP rounds in your gun and you're loading from a mag that has just AP rounds in it) then you can "top off". If either has mixed ammo (so mixed in the gun, or mixed in the new mag, or both) the you swap mags instead.

So far I'm just dealing with the ReloadGun function which is the function that actually reloads a weapon. Basically whether you "pick up" ammo and click on a weapon, simply use the reload hotkey or if your weapon runs completely out of ammo and you try clicking on an enemy, this is the function that runs. Each of the above possibilities has a different way of getting to the function, however. Once I finish ReloadGun, I'll worry about the others where, yes, I will make loose rounds (and ammo boxes/crates) a higher priority then filled mags.

Re: [IDEA] New Ammunition System[message #284612] Fri, 24 June 2011 19:24 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
Sounds sensible to me.


Re: [IDEA] New Ammunition System[message #284649] Fri, 24 June 2011 23:41 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
Been side-tracked to the GetAPsToReloadGunWithAmmo() function which is really going to return the APs to reload the destination item from the source item since it's perfectly possible (though certainly not ideal) to try to reload a magazine while in combat.

Anyway, loading a mag into a weapon is fairly straight forward. But when we use the "loose round" system, there are several possibilities based on the type of feed system the weapon uses. For instance, if we're reloading a mag or loading rounds into any weapon that uses an internal "port-mag", then the state of the weapon isn't really relevant. But if we're reloading a breach loading weapon, a cylinder loaded weapon, or most weapons with internal box mags (where we reload past the chamber), then knowing whether the chamber is open at the time of loading is actually valid. Trouble is, currently we only know if a weapon is mag-fed or not (using the Weapons.xml:SwapClips flag). This leaves me with two options.

1- I can treat all "non mag-fed" weapon the same and require the the chamber is open during the reload process. Unfortunately, this would mean you couldn't overload a weapon because opening the chamber to reload the weapon would also empty the chamber of any rounds left.
2- I can add a new tag (or expand the existing tag) so we can identify the actual feed system on the weapon. This just adds a bit of coding work (and xml editor updates) but it would give us the most realistic option. Just not sure if this much realism is warranted or not.

Re: [IDEA] New Ammunition System[message #284650] Fri, 24 June 2011 23:46 Go to previous messageGo to next message
Gorro der Grüne

 
Messages:1542
Registered:March 2009
Location: Broadwurschd-City
Sir, You have work to do
Re: [IDEA] New Ammunition System[message #284652] Sat, 25 June 2011 00:08 Go to previous messageGo to next message
Wil473

 
Messages:2855
Registered:September 2004
Location: Canada
I'd vote for 2, may also be a good idea to have as part of one of the Tool Tips (Bobby Ray's) display the feed type so player have another value to consider (ie. do I pay more for a closed bolt SMG just to get that +1 in chamber ability)


Re: [IDEA] New Ammunition System[message #285308] Sat, 02 July 2011 10:10 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
Looks like the shotguns held another oddity after all: Neostead (Basic 1.13) and its spiritual successor Keltec KSC (AIMNAS) feed from two independent 6rd magazines (so 12rds in total) with a switch to use 1) left exclusively 2) right exclusively 3) both alternating.

I'm not saying this detail should be modeled. I just wanted to share the information.


Re: [IDEA] New Ammunition System[message #285310] Sat, 02 July 2011 10:18 Go to previous messageGo to next message
Gorro der Grüne

 
Messages:1542
Registered:March 2009
Location: Broadwurschd-City
so why can't You mix ammo?
Re: [IDEA] New Ammunition System[message #285392] Sat, 02 July 2011 21:59 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
with NMS you will be able to mix ammo. There just won't be two seperate feed systems. You could load a "12rnd 12g mag" with alternating ammo to simulate the effects of option 3 on the Neostead. You could also load a "12rnd 12g mag" with 6 rounds of slug and then 6 rounds of buckshot to simulate options 1 or 2 on the Neostead. But you won't be able to "flip a switch" and change the way the Neostead feeds rounds. And you'll notice that you're using a "12rnd 12g mag" and not 2 6rnd mags. NMS will open alot of possibilities but there are still limitations to what I can make the code do. Smile

Re: [IDEA] New Ammunition System[message #286744] Sat, 16 July 2011 23:55 Go to previous messageGo to next message
Cell

 
Messages:618
Registered:February 2011
User deleted
Re: [IDEA] New Ammunition System[message #286746] Sun, 17 July 2011 00:07 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
No. Maybe Chatner needs some though.

Btw, could we get a small lifesign of this project? Wink


Re: [IDEA] New Ammunition System[message #286748] Sun, 17 July 2011 00:45 Go to previous messageGo to next message
Cell

 
Messages:618
Registered:February 2011
User deleted
Re: [IDEA] New Ammunition System[message #286749] Sun, 17 July 2011 01:00 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
You want to play a sound for every bullet? That's potentially 200 'clips' when loading a belt or 100 for a drum, surest way to drive the player crazy.


Re: [IDEA] New Ammunition System[message #286750] Sun, 17 July 2011 01:01 Go to previous messageGo to next message
Logisteric

 
Messages:3395
Registered:December 2008
Location: B
DepressivesBrot
You want to play a sound for every bullet? That's potentially 200 'clips' when loading a belt or 100 for a drum, surest way to drive the player crazy.


... or da mooder in a cell
Re: [IDEA] New Ammunition System[message #286751] Sun, 17 July 2011 01:07 Go to previous messageGo to next message
Cell

 
Messages:618
Registered:February 2011
User deleted
Re: [IDEA] New Ammunition System[message #286752] Sun, 17 July 2011 01:12 Go to previous messageGo to next message
Logisteric

 
Messages:3395
Registered:December 2008
Location: B
code? a sound for an action (putting in a round) is not that much a problem - how do you want to do it?
Re: [IDEA] New Ammunition System[message #286753] Sun, 17 July 2011 01:12 Go to previous messageGo to next message
Blue_Fox

 
Messages:588
Registered:September 2006
Location: Netherlands
Some just not ... Smile

[Updated on: Sun, 17 July 2011 01:13] by Moderator

Re: [IDEA] New Ammunition System[message #286754] Sun, 17 July 2011 01:13 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
Cell
the clip sound when a bullet is placed over another...?
How about you don't panic when told to use your brain and start to communicate clearly and non-ambiguously.


Re: [IDEA] New Ammunition System[message #286755] Sun, 17 July 2011 01:15 Go to previous messageGo to next message
Blue_Fox

 
Messages:588
Registered:September 2006
Location: Netherlands
Better ask for more information instead of writing some ...
Re: [IDEA] New Ammunition System[message #286756] Sun, 17 July 2011 01:16 Go to previous messageGo to next message
Cell

 
Messages:618
Registered:February 2011
User deleted
Re: [IDEA] New Ammunition System[message #286757] Sun, 17 July 2011 01:16 Go to previous messageGo to next message
Logisteric

 
Messages:3395
Registered:December 2008
Location: B
better avoid coffeeshops
Re: [IDEA] New Ammunition System[message #286758] Sun, 17 July 2011 01:26 Go to previous messageGo to next message
Cell

 
Messages:618
Registered:February 2011
User deleted
Re: [IDEA] New Ammunition System[message #286759] Sun, 17 July 2011 01:28 Go to previous messageGo to previous message
Logisteric

 
Messages:3395
Registered:December 2008
Location: B
have you ever filled a mag? it does make a sound for every bullet
Previous Topic: (New) Common Attachment Framework (new title; was The NAS Receiver)
Next Topic: Path finding problems in 1.13
Goto Forum:
  


Current Time: Mon Dec 17 10:11:50 EET 2018

Total time taken to generate the page: 0.02971 seconds