Home » MODDING HQ 1.13 » v1.13 Coding Talk » [IDEA] New Magazine System
|
|
|
|
|
|
|
|
|
Re: [IDEA] New Ammunition System[message #283681]
|
Fri, 17 June 2011 01:14
|
|
ctiberious |
|
Messages:605
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.
Report message to a moderator
|
|
|
|
|
Re: [IDEA] New Ammunition System[message #283885]
|
Sun, 19 June 2011 03:11
|
|
ctiberious |
|
Messages:605
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.
Report message to a moderator
|
|
|
|
Re: [IDEA] New Ammunition System[message #284432]
|
Wed, 22 June 2011 21:56
|
|
ctiberious |
|
Messages:605
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"?
Report message to a moderator
|
|
|
|
|
Re: [IDEA] New Ammunition System[message #284442]
|
Thu, 23 June 2011 00:27
|
|
ctiberious |
|
Messages:605
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.
Report message to a moderator
|
|
|
|
Re: [IDEA] New Ammunition System[message #284472]
|
Thu, 23 June 2011 09:35
|
|
JMich |
|
Messages:546
Registered:January 2011 Location: Greece |
|
|
ChrisL1) "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.
Report message to a moderator
|
First Sergeant
|
|
|
|
|
|
|
Re: [IDEA] New Ammunition System[message #284649]
|
Fri, 24 June 2011 23:41
|
|
ctiberious |
|
Messages:605
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.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: [IDEA] New Ammunition System[message #286770]
|
Sun, 17 July 2011 09:51
|
|
Logisteric |
|
Messages:3199
Registered:December 2008 Location: B |
|
|
@ cell
as every round you fill into a mag does indeed make a sound it's only logical to assume you are talking about that - if you want some microf*ck-like 'your mag has properly been filled, sir'-sound you should say that in the first place
... btw, if anyone calls me arrogant/elitist again i link him to a couple of your 'read above'-posts
[Dieter added a star]
[Updated on: Sun, 17 July 2011 12:10] by Moderator Report message to a moderator
|
Captain
|
|
|
|
|
Re: [IDEA] New Ammunition System[message #286942]
|
Mon, 18 July 2011 22:19
|
|
ctiberious |
|
Messages:605
Registered:March 2007 |
|
|
My first redesign of the xml files was a complete, from the ground up, redesign. I put all similar classed items together, with gaps between each class of item for later expansion. So, as an example, items 1-9 were all money class items, or "blanks" specifically set aside so that modders could add money class items and still keep everything together. This worked just fine except if we play a version of the game that limits us to only 350 items (this is what happens if you start the game with only a Data folder).
There are approximately 145 "static" items. That is, items that the code references directly. The "Angel vest" is only one such item. Various armors are referenced for creature NPCs and tanks, as an example. And there are a couple "generic" gun entries as well. These are all easily handled regardless of how I redesign the xml layout. In other words, if I change the "Kevlar Leather Vest" to item 40, so long as I tell the code that the item is now 40, the quest should run just fine. So I just have to change my redesign/clean-up so that we have the "basic" items in the first 350 indecies so that regardless of how you play the game, you still get access to the correct equipment.
Right now I'm looking at restoring the first 350 items back to their original layout, then tack all the "new" stuff in an orderly fashion from 351 on. The main stumbling block is that NMS is a replacement of OMS. My intention is to include the ability to play in "OMS mode" but even if you did, the code would still be using NMS. There would just be alot of automation running in the background. For example, right now you load a "5.56mm Mag 30" 'ammo item' into a weapon to load it. Once NMS is finished, playing in OMS mode would still allow you to load a "5.56mm Mag, 30" item, and from the players point of view, both items should basically appear the same (at least, that's the intent). But from the code side, the "5.56mm Mag, 30" is just a mag item which will automatically be loaded with 30 rounds of the appropriate ammunition. As a result, I can't simply add all the NMS items after 350. If I did, and you tried to play the game with only the Data folder, you'd have weapons, armor, items, etc. And you'd have EITHER ammunition or magazines, but not both. So you really wouldn't be able to play. I have to make sure that all the magazine and ammunition items that "DATA only" needs are included in that first 350 indecies.
I'm hoping all this makes sense.
Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Thu Apr 25 23:53:04 GMT+3 2024
Total time taken to generate the page: 0.02672 seconds
|