Home » MODDING HQ 1.13 » v1.13 Coding Talk » [IDEA] New Magazine System
Re: [IDEA] New Ammunition System[message #280876] Fri, 27 May 2011 18:06 Go to previous messageGo to previous message
Kazuya is currently offline Kazuya

 
Messages:208
Registered:January 2009
ChrisL
We treat guns just like magazines. When you load a magazine into a gun, we transfer the ammo list from the magazine to the gun, make a note of the magazines index number on the gun, then delete the magazine. Since every item uses the same OBJECTTYPE structure, this is a very simple procedure.

And I'm suggesting "deleteing" the magazine object once it's loaded into a gun because there's really no reason to store any of the magazines object data. When we eject the magazine from the gun, we simply create an object using the previously stored magazine index number and transfer the gun's ammo list to the new magazine item.

That makes absolutely no sense to me. If we are going to handle empty magazines, we will have to recreate every magazine object, once we unload the gun. Why delete an item, if it is going to be used? Furthermore, if we are going to expand the idea of ammuniton and magazines, we will run into a myriad of other problems, when the magazine gets deleted. Let's assume there is a new drum magazine for a certain gun. If we treat the drum magazine like an attachment, we can define a simple weapon rasing costs malus to it for example. You attach the drum magazine and your gun gets that malus. You detach the magazine and the game will remove the malus. The attachments system can take care of this. If you delete the magazine however, this feature becomes a lot more complicated. Not only will you have to take care of the changeing of the raising costs, you will also have to take care, that this malus gets removed once you recreate the magazine out of thin air. The same would apply to less or more reliable magazines, that affect the jamming probability. Damaged magazines would be another problem. In order to take care of that, the condition of the magazine would have to be stored in the gun, if we keep the deleting approach. Otherwise we would be able to repair a magazine by loading and unloading it. All this just because of the deleting part.

ChrisL
3- Do we use a single "generic magazine" item for empty mags or just use the "mag types" for all mags? The upside of a single "generic magazine" is that you could create large stacks of magazines for transport, which reduces inventory management. But it would mean we'd need a way to tell the code why kind of mag we wanted when we removed one from the stack. And you also run into the unrealistic ability of getting an 8rnd .45ACP mag from a drop and "converting" it to a 100rnd 5.56 C-Mag.

Once magazines and ammunition is separated, there is no need to worry about this part. A magazine all alone would represent just that, an empty magazine. A full magazine would have an ammoitem attachment. Keeping the magazine as an attachment allows to give the player exactly what he expects when he unloads a gun. He gets he very same magazine that he put into the magazine well. Another benefit would be, that two identical magazines that are loaded with different rounds, could be stored in the same inventory slot.


DepressivesBrot
Well, guess it's pretty inefficient to drag the mag around for something banal like a few extra points on jam rate then.

Even if we look at the new system with just the most basic features, we can conclude that there isn't much to be gained by deleting the mag once it is loaded. Before I load a gun, the game has to store both items, the mag and the gun in my inventory. The old system reduces the required memory for the hundreds of items that might be in the game world temporarily about one single object. If I unload a gun before it is fired empty, I go back to having two items. Storing the magazine item doesn't increase the overall memory costs, it merly remains the same all the time. And if we are going to handle empty magazines, we will hav to recreate the deleted object anyway. All you gain is a temporary reduction in memory at the costs of processing power.

Report message to a moderator

Sergeant 1st Class
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: (New) Common Attachment Framework (new title; was The NAS Receiver)
Next Topic: Path finding problems in 1.13
Goto Forum:
  


Current Time: Sat Jan 25 13:12:06 GMT+2 2025

Total time taken to generate the page: 0.06375 seconds