Home » MODDING HQ 1.13 » v1.13 Feature Requests » Advanced randomization for items (mapping)
Advanced randomization for items (mapping)[message #310581]
|
Mon, 24 September 2012 16:23
|
|
JAsmine |
|
Messages:306
Registered:May 2011 |
|
|
When creating or editing a map, we have the possibility to add items which might not always appear, but have a certain possibility to appear (1-100%).
Example:
in sector A13, at gridno 9566, there is a 50% chance for a a .38 s&w to lie on the ground. If this pistol will be there or not is decided when the map is loaded for the first time. In about every second game, there will be this certain pistol there.
What I imgagine is, that this system could be improved by making it a bit more complex:
Idea:
Have a certain possibility for an item to appear and if the item appears, it is randomly picked from a certain pool of items.
Example:
in sector A13, at gridno 9566, there is a 50% chance for a pistol to lie on the ground. If the pistol will be there or not is decided when the map is loaded for the first time. In about every second game, there will be a pistol there. IF a pistol is there, there will be a 25% chance for it to be either a .38 s&w, a .357 barracuda, a beretta 92F or some sig-sauer.
Conclusion:
This more complex system would allow modders to create maps with more diversity. It could add a lot to the replay-value of the game.
Report message to a moderator
|
|
|
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310687]
|
Wed, 26 September 2012 23:42
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
... Or not. He had a hdd crash and lost his code. I've taken the liberty of adopting this project. First tests are sucessful. Depending on progress and rl issues, I might release this next week.
Important note to modders: This feature will require certain item numbers (like, say, 1700 - 1800) to be fixed. This means that these are 'random item placeholders'. You place them in a map, and upon loading that map, they are replaced with items depending on a xml.
It will also be possible to simply add these items to the enemy item selection, and then generate items from that xml on a soldier. This will both allow much more than 50 guns per progress level, but also much easier finetuning.
If you, say, set up a random item class 'FN guns from pre-2000', you could place that class in maps - it'll always be FN. Or allow the enmey to onyl select FN guns etc..
It'll also be possible to combine classes this way. I'm sure you get the idea.
Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310754]
|
Sat, 29 September 2012 00:45
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
The fixed numbers are indeed needed for compatibility reasons. So a mapper M places item #1700 in the map.
Then modder A says, vis his xmls: Ok, #1700 is a random item in my map. It references 'vanilla handguns'. So in this case, #1700 refers to items #1 to #8. When loading the map with A's xml, a radnom handgun (#1 - #8) spawns.
Modder B however, says #1700 is a random item, but it references 'AKs' in his mod. He can set up those numbers however he likes.
Note that it will also be possible to check for coolness/game progress here, as well as giving a random item a bonus/malus to coolness.
The important thing here is that a mapper can only place random items, but the selection of the 'real' items only happens when loading the map ingame. At that exact point, the game has to know that #1700 is in fact a random item an needs to be replaced accordingly. If you move your items inside your xml, and #1700 ends up being, say, a steel helmet, then all the items the mapper intended to be random gun-placeholders will end up being steel helmets.
This also enforces the mapper to always use the same item numbers in his maps, otherwise they are incompatible.
Note that the '1700-1800' was just a example. I honestly have no idea on how many random item 'classes' we'd need for vanilla for example. Thing is, I'd like these numbers to be constant in every mod that uses this - and I'd like them to be consecutive. 1700 is just the next free 'nice' number in GameDir.
Random items can reference other random items, basically. I currently build a list of up to 200 allowed items to choose from (can easily be changed, though). So one could make lists like 'HK ARs', 'FN ARs', 'Colt ARs' and link them together to 'NATO ARs' etc. Should also be possible in enemy item selections. Not exactly sure about mercs (because of the display on the websites, but shouldn't be too much of a problem).
Report message to a moderator
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310793]
|
Sun, 30 September 2012 22:58
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
Update: The random items feature is ready to go. I'll propably commit it today or tomorrow.
What I will not commit will be randomized starting gear for our mercs. I am a bit unsure if that would really be advisable... at least in vanilla 1.13 there isn't enough LBE to really justify this, as the wrong LBE can leave you usable to carry your starting inventory, which looks really odd.
A much bigger problem is that, as I see the code after a quick glance, the AIM/MERC starting gear on the websites is read from the data read from the xmls. If I randomize upon reading an xml, the dsipalyed gear will differ each time you start your game exe. The alternative, creating upon hiring, would be equally wacky, as then you'd have no idea what equipment you are buying :heavy:
Apart from that, everything seems to work as promised.
IMPORTANT NOTE: I will provide a example xml data for this. However, as stated before, I do not know how many 'random item classes' we will need to, say, randomize the vanilla maps. The '100' was a wildshot. THIS IS THE POINT WHERE A MAPPER'S/MODDER'S INSIGHT IS VERY VERY WELCOME. If we really roll this out, every mapper and modder must use the same numbers in order to achieve compatibility. I personally don't care which numbers to use ( but am not looking forward to generate legions of item dummies to move this to higher numbers).
Luckily, a few of the currently most active modders have already found this thread :party:
To explain how the stuff will work:
We add an item like this to Items.xml:
-
1623
random item number 1
random item 1
If you can read this, Flugente propably didn't catch a certain way to create items. Go and report your antics to him!
random item 1
NO DESCRIPTION NECESSARY.
268435456
1
2
1
9
8
13
90
1
4 <--- reference to random item class 4
6 <--- add +6 to the curret coolness, this way, we can spawn cooler items than currently allowed according to progress
RandomItems.xml looks like this:
...
2
vanilla handguns
0
0
0
0
0
0
0
0
0
0
1
2
3
4
5
6
7
8
0
0
...
4
test: random guns
2
0
0
0
0
0
0
0
0
0
768
769
770
771
772
773
0
0
0
0
...
As you can see, item #1623 is a random item that references RANDOMITEM #4. This one includes a few guns (768-773) and also references RANDOMITEM #2, which are the vanilla handguns.
This way, you can create whole 'libraries' of items in RandomItems.xml and 'link' them together. You can also reference other random items (note that a random item can be added only once in our search, after that its ignored to prohibit looping). When 'dereferencing' a random item, up to 200 items can be selected. That puts the theoretical maximum of enemy gun choices to 10K per level :moosegrin:
So yeah, post thoughts/criticism/etc..
[Updated on: Sun, 30 September 2012 23:00] by Moderator Report message to a moderator
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310797]
|
Sun, 30 September 2012 23:57
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
Update: as of r5594 and GameDir r1544, this feature is in the trunk. For an example, I sorted our assault rifles in in RandomItems.xml. It works like stated above: I sorted them by manufacturer, so for example 'HK assault rifles' has a bunch of ARs, and also references the G36 and XM-families.
Items.xml has two new entries: #1623 spawns a random NATO AR, while #1624 spawns a random WP AR. Both have a varied coolness modificator, just so you see how that works.
Of course, from a modders perspective, it would propably be better to sort ARs by caliber/coolness/range/whatever. But I think you'll get the idea.
Place #1623 and #1624 in a map, and see what spawns upon loading. Or assign them to EnemyGunChoices.
Report message to a moderator
|
|
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310802]
|
Mon, 01 October 2012 01:25
|
|
Wil473 |
|
Messages:2815
Registered:September 2004 Location: Canada |
|
|
So as a checklist of what items can be randomized:
Map placed items (ground) - yes
Map placed item (units) - yes?
EnemyGunChoices.XML - yes
MercStartingGear.XML - no
Merges.XML - soon?
Item_Transformations.XML - ???
I'm good for Index 1700-1800, or even up to 2000. V4.xx moved the weapons range to 2001-3000, and ammo is 3001- last item. Now we need Smeagol, Buns, IoV's current rep, et al's input on the range.
EDIT:
Forgot one in the list, can random items be used as default attachments (items.XML)? ie. a gun is created in-game (via any or all mechanisms: map placement, Bobby Ray's delivery, enemy gun assignment, or merchant) and it has a randomly assigned scope.
[Updated on: Mon, 01 October 2012 02:41] by Moderator Report message to a moderator
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310832]
|
Mon, 01 October 2012 22:46
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
Merges and Item transformations also work, just did that. I haven't yet placed guns in the Map Editor (I don't know how that works), but random items should work there as well.
Also, if the item selected to spawn is pure food, and the food system is off, it will not spawn. This makes it possible to place loads of food in maps without having a bunch of useless items if playing without food.
Note that if you add random items to the enemy gun and item choices, it would be wise to make results possible. If no legal item can be found (empty lists, or currently, coolness is too high), then no item will spawn. An exception is guns, if no gun is found, the enemy gets a Glock 17.
For example, if you use the random ARs I provided in Omerta for enemy gear, they won't get them, caue those ARs are too cool. Either use them for higher progression, but 'uncooler' items in there, or increase their .
Note: I consider this to be pretty much finished. I have also provided examples on how this works. I will not fill in all values for the trunk and for the vanilla maps. I consider that the work of modders or other voluntaries. For example, sorca_2's analysis of the current guns practically highlights him as a very good choice to categorize weapons into similar categories. :sign:
[Updated on: Mon, 01 October 2012 22:47] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310838]
|
Tue, 02 October 2012 00:47
|
|
smeagol |
|
Messages:2705
Registered:June 2008 Location: Bremen, Germany |
|
|
I have at the moment something like 2.8k entries (with around 200 random nothing items in between due to stuff I kicked out). Thus with a sorting mechanism, that would allow deleting of these nothing items when they are at the end of the list I could probably cut it down to around 2.6k items. I'm still adding a few items here and there on a daily basis, to fill out the gaps. But I really would like to reorder all items (except those 350 in the beginning obviously), but as I said earlier, with the xml editor as it is right now, this is basically not possible for me right now.
I don't know how many random items would be advisable, but 100 seems quite low indeed. One prob is that the editors (map editor and xml editor) get slower with each item added and probably also the game gets slower (sector inv lagging, anyone?). So having something like 1k entries for random item entries might be overdoing it a bit... dunno.
Btw... probably a bad idea, because it would make coding way more difficult... but wouldn't it be possible to have them in an entirely new xml instead of items.xml?
Also an idea I had today would be a chance modifer for items to show up at Tony's (make some stuff more common and others more rare, not related to coolness).
Report message to a moderator
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310839]
|
Tue, 02 October 2012 01:02
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
Hmm. Not sure about sector inventory lagging, I always assumed it was because of the number of items in a sector, not the size of the Item[]-struct (its always at size ~16K, regardless of defined items).
Well, there already is a new xml. I assume you mean a kind of new items, which spawn regular items but do not appear in our beloved Items.xml. Kinda like ActionItems... I deem that possible (but then again, I never deem anything impossible), but the amount of work is huge. Not mentioning that it would require some twisted, insane hacking in the editor, and in ancient code that begs to cause errors. Forget it. I'd rather repair NCTH and implement the New Magazine System. About the same amount of work, to put in perspective.
Problem with items in shops, or on the websites, is that the item's iamge is shown before the item really 'exists' gamewise. This results in the item you see and buy not necessarily being the item you receive. No problem compatibility-wise, as that is in xmls anyway, but I get your point.
Report message to a moderator
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310841]
|
Tue, 02 October 2012 01:29
|
|
Wil473 |
|
Messages:2815
Registered:September 2004 Location: Canada |
|
|
Before, I simply moved the guns and ammo past 2000 to make room for the random items (and all the misc classes of other stuff), I was already pushing past 3k items. I wanted to put ammo at the end because that is where the most item index inflation is occurring (shakes angry fist at Wolf00).
The problem with random items is that the number of possible combinations exceeds the base items (exponentially?).
In my current scheme, 1000 slots in a solid block are devoted to weapons (guns), 1000+ also in a solid block are devoted to ammo. I'm going to guess that the random item indexes will probably comprise the next largest block (well perhaps the place-holder guns I have to assist BR ammo sorting will take up more).
As both Smeagol and myself are looking at the hell of resorting items in our respective mods (I've got the "luxury" of starting with a mod that doesn't have Gearkits to worry about, but then need to fill them in for AFS/DL-1.13), how about agreeing on earmarking 1701 - 2000 for this feature, that gives us 300 random item lists.
Incidentally, my thoughts on New Magazine System have always been to use it as a means to cut down on item indexes - if you are working on a NMS of some kind, you may be able to solve the problem of where to put the Random items by eliminating the Old Magazine items. v1.13 has a nearly continuous block of ammo items from 351- 591 (one gun, and the four NIV hard coded items). NMS as last discussed would have resulted in the elimination of OMS (replaced by pseudo-OMS where NMS was made to function like OMS).
EDIT: needing no coding, but possibly upsetting to anyone still using them, the old coated/treated pseudo NAS armours are indexes 1100-1169.
[Updated on: Tue, 02 October 2012 01:41] by Moderator Report message to a moderator
|
|
|
|
Re: Advanced randomization for items (mapping)[message #310842]
|
Tue, 02 October 2012 01:41
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
It was a bit of irony on my side. While a full working NMS would be awesome, and I have a pretty detailed concept for it, the sheer, insane, mind-boggling amount of coding does not justify the meagre gains by it in my view.
Same thing for NCTH. The only person capable or finishing it is Headrock himself. Anyone else attempting it, however efficient she/he will be, will enrage hordes of forum people. Seemingly anyone has an opinion on how NCTH should work, and lots of those people get angry if they feel the repair goes in the wrong way. It would result in NCTH spawning N-NCTH, with different factions fiercely defending their 'true' NCTH
The above statements was to show how much I'd dislike implementing smeag's alternative random items, not to state I will work on NMS
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Advanced randomization for items (mapping)[message #316175]
|
Mon, 11 March 2013 12:14
|
|
Parkan |
|
Messages:439
Registered:April 2010 Location: Russia,Sevastopol |
|
|
Sorry for my misunderstanding.I have a question about all this stuff.
1.13 mod is a very good mod,but it lacks some balance in weapons.1.13 mod have a huge number of weapons(really guys maybe it is time to not add any new weapons to game?because it already huge number of this).So,with such huge number of weapons we have not good balance in appearing of weapons in game during campaigh.I give you an example:Player start mission(for example on impossible difficulty and normal progress of weapons) with progress game 0/0(alternaive game progress is turned off for default how i know,yes?).He take drassen,loot from enemy soldiers is very crap(weapons of coolnes 1-2,then player take sam site(game progress from 5/5 to 10/10,loot from enemy still around 1-3 coolnes level,but in boxes in sector player can find few good sniper rifles or any other good stuff not related to game progress(or stuff really beyond of game progress).Even after drassen attack from enemy or for example player decide to capture another city for example chitzena with game progress around 10/10 to 15/15 enemy will have a very big advantage of weapons not related to game progress.So player can capture few cool weapons of coolnes level 5-7 in very early stage of the game
and use it till end of mission(because such cool weapons use ammo like 5.56 7.62*51 and etc)So,game balance with weapons really busted and it really need to fix.
My question is:this Advanced randomization will fix such troubles of appearing stuff\items,weapons of not related to game progress?
Report message to a moderator
|
Master Sergeant
|
|
|
|
Goto Forum:
Current Time: Wed Apr 17 22:36:23 GMT+3 2024
Total time taken to generate the page: 0.02239 seconds
|