Programmer needed: Procedural Weapon Generation

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
Sleeper Service
Posts: 2275
Joined: Sun Mar 24, 2013 8:49 pm

Programmer needed: Procedural Weapon Generation

Post by Sleeper Service »

Hey there FTL loving coders

Q: Whats the matter here?
I would like to ask if anyone with programming skills is willing to help out with FTL Captain's Editions Infinite Addon. The idea is to introduce a few thousand (!) procedural generated weapon variants in CE Infinite, much as in loot centered games, like Diablo or Borderlands. This will be a side feature, available as another addon. It's not very FTLish, but would contribute significantly to semi-endless playability.

Q: How is that supposed to work?
The idea was to take all the base weapons CE and vanilla provide and make copies of them that are slightly (or significantly) modified, by prefixes like piercing, heavy, optimized and so on. Some prefixes would be applied to all weapons, some just to certain types.

The weapons would still feel a lot like their basic variant, but also play slightly different. A system not much different from Borderlands' weapon generation. There already is a list of about 50 prefixes and their function. Most of them have positive and negative versions, so the games will not get flooded with superior gear. The prefixes also affect price and rarity.

Q: Why don't you do this yourself?
While trying to implement this idea, I quickly realized that the task of creating this weapons is much more tedious than I had expected (tried to do this via templates and find and replace). I also realized that it could be done much more efficiently with a probably quite simple program. I have zero programming knowledge and it would take me month to learn how to do this myself, so I'm turning to the community.

Q: Wait, you want people to spend time coding a one-time use program?
The usefulness of the program in question would be limited, indeed. But having this process automatized would allow to also include new weapons later. If the program recognizes blueprint tags dynamically, it could also work immediately with the stuff that AE ads.

Q: What should that program do exactly?
It should process base weapon blueprints, like this one:

Code: Select all

<weaponBlueprint name="BA_LASER_DUAL_2">
	<type>LASER</type>
	<title>Dual Shot Laser Mark II</title>
	<short>Dual Laser II</short>
	<desc>Military version of the dual laser.</desc>
	<tooltip>Fires 2 lasers, 1 damage each.</tooltip>
	<damage>1</damage>
	<shots>2</shots>
	<sp>0</sp>
	<fireChance>1</fireChance>
	<breachChance>0</breachChance>
	<cooldown>8</cooldown>
	<power>2</power>
	<cost>70</cost>
	<bp>7</bp>
	<rarity>4</rarity>
	<image>laser_light2</image>
	<launchSounds>
		<sound>lightLaser1</sound>
		<sound>lightLaser2</sound>
		<sound>lightLaser3</sound>
	</launchSounds>
	<hitShipSounds>
		<sound>hitHull2</sound>
		<sound>hitHull3</sound>
	</hitShipSounds>
	<hitShieldSounds>
		<sound>hitShield1</sound>
		<sound>hitShield2</sound>
		<sound>hitShield3</sound>
	</hitShieldSounds>
	<missSounds>
		<sound>miss</sound>
	</missSounds>
	<weaponArt>ba_laser_dual_2</weaponArt> 
</weaponBlueprint>
into variants, like this one:

Code: Select all

<weaponBlueprint name="BA_LASER_DUAL_2_PIERCING">
	<type>LASER</type>
	<title>Piercing Dual Shot Laser II</title>
	<short>Dual Laser II</short>
	<desc>Military version of the dual laser.</desc>
	<tooltip>Fires 2 lasers, 1 damage each. Piercing: Shield Piercing +1</tooltip>
	<damage>1</damage>
	<shots>2</shots>
	<sp>1</sp>
	<fireChance>1</fireChance>
	<breachChance>0</breachChance>
	<cooldown>8</cooldown>
	<power>2</power>
	<cost>115</cost>
	<bp>7</bp>
	<rarity>5</rarity>
	<image>laser_light2</image>
	<launchSounds>
		<sound>lightLaser1</sound>
		<sound>lightLaser2</sound>
		<sound>lightLaser3</sound>
	</launchSounds>
	<hitShipSounds>
		<sound>hitHull2</sound>
		<sound>hitHull3</sound>
	</hitShipSounds>
	<hitShieldSounds>
		<sound>hitShield1</sound>
		<sound>hitShield2</sound>
		<sound>hitShield3</sound>
	</hitShieldSounds>
	<missSounds>
		<sound>miss</sound>
	</missSounds>
	<weaponArt>ba_laser_dual_2</weaponArt> 
</weaponBlueprint>
by applying user defined prefixes, that could look like this one:

Code: Select all

ID: _PIERCING; title_start: Piercing; tooltip_end: Piercing: Shield Piercing +1; stats_changes: adds one to <sp> tag, multiplies <cost> tag by 1.5, ads one to <rarity> tag
The program would probably have to read an xml file with all the base blueprints to get stated. It should be able to modify any tags that appear in the base weapon blueprints. If the prefixes changes tags that don't exist in a blueprint, it would have to add the tag automatically.

For drones, the program would also have to create new variants of the respective drone blueprints. Further the program should apply separate prefixes for the actual drones (for affecting drone stats beyond its weapon properties).

Besides producing the thousands of new weapon blueprints, it would also have to generate various FTl compatible blueprint lists that include all the new variant IDs. This is essential for fully integrating the new weapons into the game. The best solution for that would be having the program replace all the entries for a base weapons in autoBlueprints.xml with their respective hundreds of variants. (This has to be automatized as well, because adding thousands of weapons to lists would be... tedious at best.)

Q: What do I get out of this?
Well you produce content that hundreds of people are going to play and have fun with. :D

Q: Couldn't such a program do much more?
My concept just involved applying one prefix at a time. If we look at Boarderlands (I'm not a huge fan of that game, its just a very suitable example for procedural generated sci fi loot) than we see that it often applies multiple prefixes to one gun. The attributes weapons can have are layered in a way that prevents similar or contradictory effects to be applied on one weapon. Thats how Borderlands gets its "bazzillions" of guns. With an elaborate enough program, we could have this in CE infinite as well.

It could even make visual changes, by tinting or slightly stretching the weapon graphic and producing new animation entries for each ID... :roll:

Q: You really think someone will code this?
Well I'm not sure anyone would be interested in executing the concept. But I'd say there are a lot of people that would like to play the result. I'm asking for help here, but I don't demand or expect anything. I wanted to put that whole concept out there to display what could be further done with FTL (CE Infinite). If the idea interests you and you have the time and skill, then this is your chance to contribute to CE. :)
Last edited by Sleeper Service on Tue Feb 25, 2014 10:22 pm, edited 1 time in total.
Image
Working on a sci-fi deckbuilder nowadays.
Other games I made.
User avatar
Ora_unit_SR388
Posts: 190
Joined: Fri Apr 12, 2013 2:41 pm

Re: Programmer needed: Procedural Weapon Generation

Post by Ora_unit_SR388 »

This is certainly an interesting idea, but the problem of manufacturing lots of different weapons could become tedious.
User avatar
Kieve
Posts: 944
Joined: Tue Sep 18, 2012 2:21 pm

Re: Programmer needed: Procedural Weapon Generation

Post by Kieve »

Ora_unit_SR388 wrote:This is certainly an interesting idea, but the problem of manufacturing lots of different weapons could become tedious.
That's precisely the request for a programmer - in theory, it would be easier to write a script that outputs blueprints with the desired change, rather than re-coding thousands of weapon variants by hand.
English Narwhal
Posts: 402
Joined: Tue Dec 03, 2013 9:12 pm

Re: Programmer needed: Procedural Weapon Generation

Post by English Narwhal »

I would love to do this, but I'm kind of tied up with doing a bunch of stuff for normal Infinite Space. If I end up writing a script for this kind of stuff, I'll share it with you.
Image
User avatar
Estel
Posts: 465
Joined: Sat Jun 22, 2013 4:03 am

Re: Programmer needed: Procedural Weapon Generation

Post by Estel »

I'm pretty sure that this could be achieved with some more-than-average sophisticated shell script (bash/ash compliant) in unix-like systems - instead of full-blown-program - as it "only" deals with editing some text in procedural manner. But, it's way beyond my skills. I know some shell gurus and would like to ask them for help - of course without promises that anything will come out of this.

One catch, hoever - it's going to be "deaf telephone" - guy who doesn't know much about modding FTL (me) is going to forward requirements for guys that doesn't know FTL at all. So, Sleeper, while your example is nicely written, I would need an exact description + example of every single thing that said script would need to do with every prefix/weapon/drone. And where should it put copy (before/after original one in new file? Doesn't matter? Any other things to be wary of?)

Now, AIUI, it would work like this:

~$ FTLparser.sh file1 directory1 directory2

...where file1 is file with list of prefixes and their attributes, directory1 is one containing files to be edited, and directory2 is where output, modified files should appear.

I would allow to add new prefixes later (just editing file which lists them and their properties). Or I'm missing something? As said, please be as verbose as possible, it would be pity to get working script just to realize that it does some major thing totally wrong (if we succeed to get someone to write that script at all, that is).

Cheers,
/Estel

// Edit
Sleeper Service wrote: It could even make visual changes, by tinting or slightly stretching the weapon graphic and producing new animation entries for each ID... :roll:
That would be also done by editing some text files, right? don't forget to elaborate on it please, if we're going to get someone's help with writing this, she/he can as good include this feature, while writing such sophisticated script, few files to edit more or less shouldn't matter much.
User avatar
Sleeper Service
Posts: 2275
Joined: Sun Mar 24, 2013 8:49 pm

Re: Programmer needed: Procedural Weapon Generation

Post by Sleeper Service »

OK, so rannI is kind of working on it already. I'm also not sure to which extend a shell script could handle that concept, yet I don't no anything about that stuff. I just assume that it gets more complex when checking the base blueprints for conditions to only apply some prefixes to certain weapons and so on...
Estel wrote: Sleeper Service wrote:It could even make visual changes, by tinting or slightly stretching the weapon graphic and producing new animation entries for each ID... :roll:

That would be also done by editing some text files, right? don't forget to elaborate on it please, if we're going to get someone's help with writing this, she/he can as good include this feature, while writing such sophisticated script, few files to edit more or less shouldn't matter much.
I merely put that out there as a wild idea. The changes made would require the program to also modify the weapons anim blueprint and its actual .png weapon image file. That is beyond simple scripting I'd say, as the program would require some image modifying capabilities (stretching and tinting I guess...) I'm also not sure if the results would be that awesome. This would need a lot of fine tuning and It wasn't a serious suggestion. ;)
Image
Working on a sci-fi deckbuilder nowadays.
Other games I made.
English Narwhal
Posts: 402
Joined: Tue Dec 03, 2013 9:12 pm

Re: Programmer needed: Procedural Weapon Generation

Post by English Narwhal »

Sleeper Service wrote:OK, so rannI is kind of working on it already. I'm also not sure to which extend a shell script could handle that concept, yet I don't no anything about that stuff. I just assume that it gets more complex when checking the base blueprints for conditions to only apply some prefixes to certain weapons and so on...
Estel wrote: Sleeper Service wrote:It could even make visual changes, by tinting or slightly stretching the weapon graphic and producing new animation entries for each ID... :roll:

That would be also done by editing some text files, right? don't forget to elaborate on it please, if we're going to get someone's help with writing this, she/he can as good include this feature, while writing such sophisticated script, few files to edit more or less shouldn't matter much.
I merely put that out there as a wild idea. The changes made would require the program to also modify the weapons anim blueprint and its actual .png weapon image file. That is beyond simple scripting I'd say, as the program would require some image modifying capabilities (stretching and tinting I guess...) I'm also not sure if the results would be that awesome. This would need a lot of fine tuning and It wasn't a serious suggestion. ;)
I tested out a beta version of the script I made, and though it worked... FTL kind of didn't like it.
By that, I mean the game takes a veeerry long time to load them.
Image
User avatar
Sleeper Service
Posts: 2275
Joined: Sun Mar 24, 2013 8:49 pm

Re: Programmer needed: Procedural Weapon Generation

Post by Sleeper Service »

How many blueprints did you add?
Image
Working on a sci-fi deckbuilder nowadays.
Other games I made.
English Narwhal
Posts: 402
Joined: Tue Dec 03, 2013 9:12 pm

Re: Programmer needed: Procedural Weapon Generation

Post by English Narwhal »

Sleeper Service wrote:How many blueprints did you add?
Well, the 51 usable weapons plus 20 'imaginary' weapons times 50 Ian arbitrary amount of prefixes...
3050?
Image
User avatar
Sleeper Service
Posts: 2275
Joined: Sun Mar 24, 2013 8:49 pm

Re: Programmer needed: Procedural Weapon Generation

Post by Sleeper Service »

Really, that slows it down so much? But I guess that makes sense... CE adds about, I dont know, 300 new blueprints? To me it feels like this already noticeably slows down loading. In the end we will might deal with about 10.000 weapons maybe... maybe the player just has to deal with that loading time. Did it run in the end? Could you start an actual game?
Last edited by Sleeper Service on Wed Feb 26, 2014 2:23 pm, edited 1 time in total.
Image
Working on a sci-fi deckbuilder nowadays.
Other games I made.
Post Reply