Home » MODDING HQ 1.13 » v1.13 Coding Talk » Idea for Ammo Purchasing & Crates -- Feedback Requested
Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302050] Tue, 20 March 2012 18:19 Go to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
I have an idea to streamline the way we purchase ammo via BR et al, and the way ammo crates work.

It came to me whilst checking out the various new items added in AIMNAS. As anyone who's played it knows, there are Ammo Box items, with anywhere from 15-200 rounds/box. These boxes are purchased at the shops instead of the magazines.

This struck me as a wonderful idea, because it means you no longer need to wade through page after page of various magazine sizes at BR's. It also means that we can set different coolness levels for when players can purchase ammo vs when enemies can start using it (box coolness != magazine coolness).

In AIMNAS, fake ammo items are used to allocate the boxes to the correct BR filter. However, this is very simple to work around in code, so we won't need these kinds of items.

What I propose is to change the "ammo crate" boolean flag into a byte field, and move it from the Item array to the Magazine array. This would make it a dropdown in the editor. Proposed values would be: Bullet(s), Magazine, Box, Crate.

This would allow us to differentiate between magazines, boxes and crates in the code easily. (The "Bullet(s)" item can be equivalent to "Magazine" for now; I'm sure we'll think of a reason to use it later.)

This would simplify the BR ammo filtering, allowing magazines to remain filterable correctly (for vanilla and mods), while allowing boxes to be filtered correctly as well.

In addition, if we differentiate between boxes and crates, we can refactor the ammo crate creation code to create boxes before crates. By this, I mean we can create a box item if the number of rounds is <= X boxes, and a crate if it's more. This would therefore avoid creating the massive ammo crates if there are only a few rounds of ammo. I've lol'd several times at the giant size 34 boxes that have been created for <30 rounds of ammo Razz

Thoughts? Suggestions? Anyone have a good number for X?


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302052] Tue, 20 March 2012 18:31 Go to previous messageGo to next message
Sam Hotte

 
Messages:2020
Registered:March 2009
Location: Middle of Germany
X = # of boxes that can be stacked into one single ssector inventory slot?
So, if the boxes would occupy another inventory slot, game resorts to crates in order to maximize clear arrangement.
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302054] Tue, 20 March 2012 18:43 Go to previous messageGo to next message
Biernath_J

 
Messages:181
Registered:August 2003
Location: Poland
The idea of boxes is really good. Buying ammo from BR is sometimes unbearable, especially with current unresponsive interface controls.

I have some concerns though:

- box sizes, they have to be portable, in order to transport them easily from Drassen to where needed
- difference in how they look, I'm pretty good in recognizing magazine shapes and colors now, I never use ammo crates for that reason - I'm just faster with magazine recognition
- creating magazines from boxes has to be very simple, because there's no point in streamlining the shopping in order to make gun loading a pain
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302055] Tue, 20 March 2012 19:05 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
Quote:

- box sizes, they have to be portable, in order to transport them easily from Drassen to where needed


Size 20 is what's used across the board in AIMNAS, and it seems reasonable, but we might want to make them bigger.

Quote:

X = # of boxes that can be stacked into one single ssector inventory slot?


I guess that could work... Simply looking at the AIMNAS setup, some of the boxes hold 150-200 rounds, so you could end up with a lot of full boxes before getting a crate. Maybe that's ok?

Quote:

- difference in how they look, I'm pretty good in recognizing magazine shapes and colors now, I never use ammo crates for that reason - I'm just faster with magazine recognition


If we were to lift the graphics from AIMNAS, they're all different. Only thing we'd need is a green recolouring of the 9x18mm box for Glaser.

Quote:

- creating magazines from boxes has to be very simple, because there's no point in streamlining the shopping in order to make gun loading a pain


Agreed. They should have the same abilities of ammo crates in this area.

...

Going off topic a bit, but I've also written some code to make the Shift+R auto-reload also refill the magazines in everyone's inventories. So there will be less mucking around with making sure your squads are fully replenished.


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302056] Tue, 20 March 2012 19:08 Go to previous messageGo to next message
Biernath_J

 
Messages:181
Registered:August 2003
Location: Poland
From financial point of view, making huge boxes (with lots of ammo) does not sound so good. Especially when you start a game and make it to Drassen, you may desperately need bullets for this only good weapon you found, and big boxes would be expensive.

I think smaller boxes would be better - both from economic and logistic point of view.
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302062] Tue, 20 March 2012 19:42 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
Ok, any suggested quantities of rounds/box, and box sizes, by caliber?

Here's what AIMNAS has (all size 20):

Caliber        Rounds
.30 Car        120
.30-06          50
.300 WM         50
.338 Lapua      25
.357           100
.38            150
.40            150
.44            100
.45 ACP        100
.45 WM          60
.454            60
.50 AE          60
.50 Beowulf     50
.50 BMG         15
4.6x30         100
4.7x33         100
5.45x18        150
5.45x39        120
5.56x45        120
5.56x45 SCF     96
5.7x28         100
6x35           120
6.8x43         100
7.62x25        150
7.62x37         50
7.62x39        100
7.62x51         80
7.62x54R        50
7.92x57         50
9x18           150
9x19           150
9x21           100
9x39            80
10mm           150
12 Gauge        50
12.3x50         50
12.7x97         15
12.7x108        15
CAWS            50
Dart            10




Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302063] Tue, 20 March 2012 19:45 Go to previous messageGo to next message
Biernath_J

 
Messages:181
Registered:August 2003
Location: Poland
That's what I'm talking about. 150 rounds of this pistol/revolver ammo, which you won't be using so long to actually use it up. And it's gonna be a pain to buy early on.
I'd go with 50-round boxes, and keep '50' as a starting point.
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302065] Tue, 20 March 2012 19:51 Go to previous messageGo to next message
Wil473

 
Messages:2855
Registered:September 2004
Location: Canada
Madd Mugsy
What I propose is to change the "ammo crate" boolean flag into a byte field, and move it from the Item array to the Magazine array. This would make it a dropdown in the editor. Proposed values would be: Bullet(s), Magazine, Box, Crate.

This would allow us to differentiate between magazines, boxes and crates in the code easily. (The "Bullet(s)" item can be equivalent to "Magazine" for now; I'm sure we'll think of a reason to use it later.)


Eh, New Magazine System rides again?

within the confines of the existing system, I've got something similar going. Ammo Crates are the only ammo that's available to buy, and I set the size to 500 rounds. Too lazy to go to the extent of creating a "retail" magazine size.

EDIT: 500 was a medium between the stock 5000 ammo crates, and actual retail sizes.

[Updated on: Tue, 20 March 2012 19:52] by Moderator



Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302067] Tue, 20 March 2012 20:05 Go to previous messageGo to next message
smeagol

 
Messages:2710
Registered:June 2008
Location: Bremen, Germany
HAM 5 code had the option to choose with a right click on a crate to choose mag size / box size to create out of a crate.

Unfortunately HR went AWOL... this might be interesting to re-create as well.


Edit:
Also, a special "Box tag" was proposed several times on the IRC, noone seemed interested in coding that...

[Updated on: Tue, 20 March 2012 20:06] by Moderator



Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302071] Tue, 20 March 2012 20:44 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
Actually, bob was interested, he just forgot - as usual Very Happy


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302102] Wed, 21 March 2012 07:28 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
Ok, so I've been mucking around with this in the code a bit. I've added a new ubMagType variable to the MAGAZINE struct, and adjusted the code everywhere accordingly. I've also updated the XML editor to remove the AmmoCrate flag, add a dropdown for ubMagType, and set all the values in my test xmls.


However, I've come across a small design question... A decision needs to be made about when to create a crate with Ctrl+Shift+A vs creating a box. Here are some options; feel free to add more:

1. Merge everything into ammo boxes, and then if there are more than X ammo boxes in a slot, merge them into a crate. This is how I've coded it currently.

2. Merge everything into ammo boxes. Press Ctrl+Shift+A again to merge everything to crates.

3. Merge everything into ammo boxes. Press Ctrl+Shift+A again to merge to crates if there are more than X boxes in a slot.

After some testing, I'm thinking that X should be smaller than the number of boxes that can fit into a slot in the inventory pool. With my current pocket sizes xml, I can put 128 size 20s into a single slot... Even at 50 rounds/box, that's 6400 rounds, which is more than one crate can hold Razz Perhaps X should be configurable in the ini file?

Edit: Or, we could do #1 and as Smeagol mentioned, somehow rig up a way for crates to be splittable into boxes... could be tricky though.


Edit: Nevermind -- I've figured out a way to do this without anything complicated Razz

1. Ctrl+Shift+A creates crates
2. Shift+A creates boxes

Yes/No?

[Updated on: Wed, 21 March 2012 09:20] by Moderator



Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302112] Wed, 21 March 2012 11:18 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
Nice and clean solution. I like it.
How do you sort boxes at BR btw?


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302115] Wed, 21 March 2012 11:43 Go to previous messageGo to next message
Anonymous
Where do the mercenaries get the labeled cardboard boxes/crates from? Smile
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302117] Wed, 21 March 2012 11:54 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
From the same magical bag of holding they get every other magazine from. That's how it is until someone else takes up NMS.


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302118] Wed, 21 March 2012 12:02 Go to previous messageGo to next message
Anonymous
Where does the magical bag come from? What came first the chicken or the egg?

What happened to that proposed NMS anyways?
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302120] Wed, 21 March 2012 12:04 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3809
Registered:July 2009
1)The chopper pilot that brings you to Arulco hands them out
2)The egg
3)ChrisL didn't have the time to work on it anymore


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302142] Wed, 21 March 2012 17:25 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
Quote:

How do you sort boxes at BR btw?


Boxes will still be sorted alphabetically or however they are now.

They will be filtered by weapon type, just like the magazines however...

Normally, it tries to track down a matching weapon type for a given caliber and magazine size to determine if the ammo belongs on a filtered page. I just tell it to ignore the magazine size if it's a box and voil


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302158] Wed, 21 March 2012 19:17 Go to previous messageGo to next message
Biernath_J

 
Messages:181
Registered:August 2003
Location: Poland
I guess large calibers could be sold in smaller packs, like 10, 20 or 25.
Some cheap, boring rounds could still be sold in 100-round boxes, because they won't bankrupt you anyway.
Making different sized boxes for the same ammo is a waste of time IMHO.
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302238] Fri, 23 March 2012 08:22 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
First draft of ammo box implementation has been sent to RoWa21 to add to the dev trunk. XML editor has been updated with new MagType field. The ammo box stuff also includes the additional P4-P9Items tileslot stuff.

Boxes cap out at 100 rounds. I tried to keep capacities simple, like 15, 25, 50, 100, and tried to keep weights less than 20. Item sizes are still rough.

I also added any remaining crates, and tweaked all the prices, capacities and weights for crates to keep them under 900 hg.





Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302239] Fri, 23 March 2012 08:49 Go to previous messageGo to next message
Fozzie

 
Messages:184
Registered:April 2010
Location: Germany
I guess those boxes should at least fit into a SAW Pouch. If you take the AIMNAS numbers quoted above, there's 20 less bullets of 7.62x51 in a box than there are in a belt-fed magazine, and those fit. I have no clue, however, of the exact "size categories".

Another question that came up in my mind while reading this topic:
would it be possible to make Ctrl+Shift+M "refill" items in merc inventories? Cause you mentioned making Shift+R to fill up magazines. Would that work for canteens, med-packs, toolkits etc. as well?
Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302254] Fri, 23 March 2012 17:00 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
It should be doable... I'll take a look when I get a chance.

BTW, I was missing box images for 9x18mm Glaser (green) and .38 HPS (purple?), so I've just used the HP (blue) coloured ones for now. Can someone please do recolours of them for me?


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302256] Fri, 23 March 2012 17:21 Go to previous messageGo to next message
Wil473

 
Messages:2855
Registered:September 2004
Location: Canada
Ah just to make sure, the XML Editor will know how to update from the old tag in Items.XML to the new one in Weapons.XML right?


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302263] Fri, 23 March 2012 19:45 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
The new tag is in Magazines.XML.

It should be fine to still have the ammo crate tag there, but it will not automagically update everything for you. Existing ammo items will default to the "magazine" magtype. You will need to change the crates to the crate type manually. This should only take a few moments to do though, using the "enable editing" setting on the context menu in the grid in the editor.


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302264] Fri, 23 March 2012 20:02 Go to previous messageGo to next message
Wil473

 
Messages:2855
Registered:September 2004
Location: Canada
Yes, magazines.XML, no coffee when I posted that...

Thought of a quicker way to set the crate type, all my crate/retail boxes are 500 rounds in size - all I have to do is use Notepad++ to find all occurrences of size 500 and have it append the new tag to the end of it.

The hard part is deciding whether to continue with my "hybrid" solution of ammo crates = retail box or split them up again.


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302274] Fri, 23 March 2012 22:25 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
Crates and boxes are treated pretty much the same way in the code. The main differences are creating them (Shift-A vs Ctrl-Shift-A), and the fact that the box items themselves are smaller and hold less rounds.

Whether you have either boxes, crates, or neither, it should be fine.


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302520] Wed, 28 March 2012 09:03 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
Now that this is implemented in the latest SCI, are there any comments?

Also, I'm not sure I mentioned it before, but I also bumped the item limit to 16k to go along with the new p4-p9items STIs.


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302915] Sat, 07 April 2012 08:26 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
I am debating whether to swap the shift-a for boxes and ctrl-shift-a for crates shortcuts... any opinions?

My normal keypress order after clearing a sector is ctrl-shift-f, ctrl-shift-m, shift-a, shift-m. The extra ctrl press/hold for boxes seems more natural than lifting my finger up so I'm just holding shift.


Re: Idea for Ammo Purchasing & Crates -- Feedback Requested[message #302920] Sat, 07 April 2012 11:29 Go to previous message
Scouty

 
Messages:77
Registered:April 2008
Ah, shift+A creates boxes... didn't know that, very useful! I'm loving the boxes sold by BR, especially since some ammo types are now available earlier (shotgun shells mostly). At the normal BR setting you had to wait for 20 progress before.

Intuitively, hotkeys with both ctrl+shift do more/larger actions compared to just shift ones, so the current setup seems logical.

Are you taking suggestions on general crate behaviour btw? I got a few:

What would actually make more sense in general: if those inventory hotkeys worked with the sector inventory open. Because that's where you do all the equipping and sorting.

I find it hard to figure out which ammo a crate holds, since the description text is so small (playing 1024x768 on a 1280x1024 monitor), and the ammo crate icons all look alike. And the maximum capacity is so large you don't really know if you have 30 or 100 bullets left, looking at the status bar.

The ammo boxes are much more distinct, but then you have to deal with partial created mags a lot more. Which are generally a nuisance since they appear at the bottom of the stack. For example, creating 30 round SMG mags from a 100 round box leaves you with 3 mags + 1 partial. It would help if the system would consume additional boxes (if available) to always create full mags, or create less mags.

I think that the crate -> mag mechanic could use a little improvement. The "5 mags" creation feels a bit clunky at times.

For example, why not hover your mouse over the gun when you have merc + sector inv open, then press shift+1/2/etc to create 1/2/etc mags for the selected gun? Or alternatively, when clicking on a gun with an ammo crate, pop up a box similar to the "detonator delay" one, asking you how many clips to create.

For me, the "optimal" system would be one where you designate certain spots in your LBE as "ammo pouches" for a certain caliber, then use a hotkey to reload all the guns, and fill those pouches to max capacity. But that's so very specific to my own OCD and neuroses that it's probably unfit for general implementation. Smile

[Updated on: Sat, 07 April 2012 11:43] by Moderator

Previous Topic: Using bipod in any stance and etc
Next Topic: AI Rewrite - How Reasonable
Goto Forum:
  


Current Time: Sun Dec 16 15:06:38 EET 2018

Total time taken to generate the page: 0.01469 seconds