Author Topic: New conduct idea: No Time To Grind  (Read 5550 times)

Offline nas1m

  • Master Member
  • *****
  • Posts: 1,268
Re: New conduct idea: No Time To Grind
« Reply #15 on: August 12, 2014, 01:25:13 pm »
Any chance to expose some mapgen parameters as well?
This could make custom cities really interesting...
That would be considerably more involved, but it can be done.  I'd probably prefer that you tell me what you want done differently (or optionally differently) and I try to make it happen ;)
That mainly depends on how your mapgen works :).
What I would like to see is for example:
  • The ability to generate bigger rooms or hallways that are locked by locked doors (shortcuts, treasure rooms, bot zoo, you get me ;)). I am going for something with a more dungeony feel here - no idea whether this is feasible
  • Some way to influence how bots are selected and where they are spawned
  • Anything that allows to "shape" the generated map in some way (number of rooms/hallways, minimum/maximum/average room size, number of locked doors/loot chests/terminals/whatever)
No idea what amount of control you can allow here as, as I said, I have no notion of how you are actually generating the maps we currently get :).
Craving some more color and variety in your next Bionic run? Grab a boost and a couple of custom floors!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: New conduct idea: No Time To Grind
« Reply #16 on: August 12, 2014, 01:45:00 pm »
Oh, you mean mission mapgen.  I meant city mapgen.  Which right now is just picking what type each node is, since the placement and links between them are drawn from an .xml file.  Though there's no reason we can't have it procedurally generate such a map, the main barrier would be the strong potential for wild balance variations.

Mission mapgen is a whole other pile of cans of radioactive worms.  In order for me to do much with it, much less expose it to modding, I would first have to figure out what it's doing myself :)  I did very little of that side of the project.

That said, mapgen was actually written and tested as an external tool so that the results could be quickly examined, etc.  It's basically an extension/evolution of the similar tool used in AVWW/Valley2 for chunkgen.  I could ask Chris if I can just make that and its source code available; it wouldn't impact the game directly (I'd still need to incorporate and desired changes myself) but it would give enterprising players a chance to see what sort of changes would do what, and possibly identify places where more on-the-fly modding could be done (kind of like the slices in Valley2).

It would require a good knowledge of C# and a willingness to work in code that doesn't have many comments ;)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline nas1m

  • Master Member
  • *****
  • Posts: 1,268
Re: New conduct idea: No Time To Grind
« Reply #17 on: August 12, 2014, 02:01:40 pm »
Oh, you mean mission mapgen.  I meant city mapgen.  Which right now is just picking what type each node is, since the placement and links between them are drawn from an .xml file.
Well, I guess I gotta take what I can get right ;).
Being able to pick the nodes would definitely a step forward, I think. Who knows, maybe Bionic will be your first title featuring Steam workshop in a few years ;D...

Though there's no reason we can't have it procedurally generate such a map, the main barrier would be the strong potential for wild balance variations.
In my book, this would not be necessary right now I guess. Being able to handcraft an alternate city is totally sufficient for me.
 
Mission mapgen is a whole other pile of cans of radioactive worms.  In order for me to do much with it, much less expose it to modding, I would first have to figure out what it's doing myself :)  I did very little of that side of the project.
I see :). No point in doing this until you can get some proper input, right ;)?

That said, mapgen was actually written and tested as an external tool so that the results could be quickly examined, etc.  It's basically an extension/evolution of the similar tool used in AVWW/Valley2 for chunkgen.  I could ask Chris if I can just make that and its source code available; it wouldn't impact the game directly (I'd still need to incorporate and desired changes myself) but it would give enterprising players a chance to see what sort of changes would do what, and possibly identify places where more on-the-fly modding could be done (kind of like the slices in Valley2).
I am a C/C++ developer by trade, but I would be willing to bang my head on this if you will let me. It definitely sounds like an interesting object of study. And since I would like to get into C#/Unity sometime in the future anyway... I would be very interested to fiddle with this a bit :D.

Can't promise when that will be, though...

EDIT:
It would require a good knowledge of C# and a willingness to work in code that doesn't have many comments ;)
Oh, I know what that means, trust me :).
« Last Edit: August 12, 2014, 02:07:55 pm by nas1m »
Craving some more color and variety in your next Bionic run? Grab a boost and a couple of custom floors!

Offline Teal_Blue

  • Hero Member Mark II
  • *****
  • Posts: 935
Re: New conduct idea: No Time To Grind
« Reply #18 on: August 12, 2014, 03:50:05 pm »
I'm beginning to think i am an 'armchair programmer', which is not at all. After listening to the nice descriptions of what i would need to uncover and where it is all found and what to do with it, it all went over my head.

Which makes me think i am good at daydreaming, but probably not very good at all for making suggestions that would really work, at least by me. But maybe some of the programmers in the forums could make it worth your while.

Anyway, thank you for considering my ideas, even if i am not very well equipped to actually do anything with them.
Take care,
-Teal

p.s.  well, after all my doubts, i ran across a GreenHeartGames Steamworks Integration Kit, for free for Developers and thought i would mention it. Even if i am not able to completely code, well, maybe i can mod a little bit, and the SteamWorks kit looks pretty cool for developers adding Steamworks to their games. Check it out, its pretty cool. :)   

http://steamcommunity.com/games/239820/announcements/detail/269407496738566853


« Last Edit: August 13, 2014, 12:08:37 am by Teal_Blue »

Offline Aeson

  • Full Member Mark II
  • ***
  • Posts: 176
Re: New conduct idea: No Time To Grind
« Reply #19 on: August 13, 2014, 04:00:38 am »
Quote
Possibly something I could add support for in  the next few weeks, if anyone is actually serious about cooking up their own city
I personally am not inclined to make any maps any time soon.

Quote
That would be considerably more involved, but it can be done.  I'd probably prefer that you tell me what you want done differently (or optionally differently) and I try to make it happen
Were I to make a map for myself, I think that the first thing that I'd want to be able to do, as far as tweaking city map generation goes, would be to add weights to each of the nodes to make it more (or less) likely for certain types of missions to spawn there, though given that it does not appear that any such weighting is present that seems like it'd be a significant amount of effort to add. A possibly very slightly easier form of this would be just a weighting for the likelihood of the HQ appearing/not appearing on the node in question. This would however also carry the drawback of potentially requiring a significant amount of additional effort on the part of the map creator, especially if the game were not set to provide 'default' weightings.

Another thing that would be potentially interesting for custom map generation is the ability to add a chance that a grid connection will not be present (e.g. node 1 connects to node 17 50% of the time rather than all the time), though this would likely require some additional pre-game map checks to ensure that there are no unconnected sections of the mission grid, and once again seems as though it would be a relatively large amount of work for relatively little gain. On the other hand, it'd give you a semi-random map to play on (possibly with a base 'skeleton' of grid connections that ensure that all map nodes are always connected to the grid somehow, with the random node connections coming afterwards). This, as with the above, seems as though it'd require a fair amount of work on your end before it'd be possible.

Aside from those, I don't know that there's much else that I'd want to be able to play with as far as city map generation went.

Quote
But to actually add one (rather than replacing the port city one, which you could do by yourself) I'd need to add an entry to the city-type enum.  But I could add some "Custom" ones that would be ignored by the game unless it found matching files, basically what I did with the floor types and floor edge types so nas1m could mod those without competing for space with the stock assets.  Though there'd be a few more wrinkles in this case like having a separate language file (modifications to a_bionic.xml will typically be overwritten with every update).
As far as the city-type enum goes: would it be possible to expose this in a text file that the game reads, rather than adding Custom_1, Custom_2, etc to the enum list? Then if I'm creating a map mod and nas1m is creating a map mod and we both want to use one another's map mods, I can use CityName_Aeson1 or something like that and nas1m can use CityName_nas1mA or something like that, and neither of us would likely need to worry about whether or not we both used CityName_Custom1 for our maps and have to go looking through the language files (or make anyone else go digging through the language files) to figure out which custom city each of us used. Or add a line to the top of the language file that tells the game to add a new CityName enum to the list?

As far as adding in custom city maps goes, being able to just have a mod folder where I could place a properly structured directory that the game reads and supplies the default assets if no replacements are produced therein for the map icons would be good. I.e. if I wanted to add CityName_Aeson1 to the game, then I'd find the Mod directory in Bionic Dues (or whatever equivalent you provided) and add the folder 'Aeson1' to that directory, and at minimum Aeson1 would contain an Images subdirectory with the map image and the node/connection grid and \Language\en subdirectory containing a_Aeson1.XML, which is the appropriately modified a_bionic.XML for whatever the map was. That might be more effort than you want to put into it, though, and certainly it's not a significant amount of trouble on my end to just put in an Aeson1.PNG and an Aeson1.XML file into the existing Images folder and an a_Aeson1.XML into the existing languages folder (or whatever the appropriate names would be if you created a hardcoded set of custom maps).

All this being said, I would most likely not take advantage of this except possibly for my own personal use. If you're waiting to add this kind of stuff based on the number of people interested in creating and distributing user-designed maps, you probably shouldn't place me on the side of the scale that says to do it.

Quote
I'm beginning to think i am an 'armchair programmer', which is not at all. After listening to the nice descriptions of what i would need to uncover and where it is all found and what to do with it, it all went over my head.
If all you want to do, at least for the time being, is to create a new city map to play on, then all that you need to do is get yourself a PNG image (maybe with alpha channel?) that you want to use for the city background, and then create a list of nodes and connections. At present, you'd rename your PNG image to PortCity.PNG, and you'd use an XML writer to turn your list of nodes and connections into PortCity.XML; both of these would be saved in

C:\Program Files (x86)\Steam\SteamApps\common\Bionic_Dues\RuntimeData\Images\CityMap

or your equivalent directory, and overwrite the current image and XML file. You can create PNG images (but not ones with alpha channels) using MS Paint, which I believe comes free with Windows, or a number of free image editing programs (such as Gimp or Paint.NET) which you can find online; many of these image editing programs also allow you to create PNG images with alpha channels if the game requires there to be one. I believe that XML files can be created by writing a TXT file in e.g. NotePad and changing the file extension afterwards, assuming that you properly format all the lines when you're typing; XML files may possibly also be written using Word and  Save As => XPS, and then change the file extension to XML from XPS. OpenOffice appears to have an XML writer in it, and it would not surprise me if some code editing packages such as NotePad++ included an XML option to help with formatting, though I do not know which ones do or do not.

As far as formatting the grid node/connections file goes, that appears to be fairly simple. The first line of the file must be <root> and the last line of the file must be </root>. In between those two tags, you have two sets of tags: the node tags (<node id="NODE_NUM" loc="NODE_X,NODE_Y"/>), and the connection tags (<con a="NODE_NUM1" b="NODE_NUM2"/>). The node tags come first, going in ascending order, and the connection tags follow. An example grid node/connection file for a 9-node map would be the following:
Code: [Select]
  <root>
    <node id="1" loc="10,10"/>
    <node id="2" loc="10,20"/>
    <node id="3" loc="10,30"/>
    <node id="4" loc="20,10"/>
    <node id="5" loc="20,20"/>
    <node id="6" loc="20,30"/>
    <node id="7" loc="30,10"/>
    <node id="8" loc="30,20"/>
    <node id="9" loc="30,30"/>
    <con a="1" b="2"/>
    <con a="1" b="4"/>
    <con a="2" b="3"/>
    <con a="2" b="5"/>
    <con a="3" b="6"/>
    <con a="4" b="5"/>
    <con a="4" b="7"/>
    <con a="5" b="6"/>
    <con a="5" b="8"/>
    <con a="6" b="9"/>
    <con a="7" b="8"/>
    <con a="8" b="9"/>
  </root>
This node map would give a city map that looks something like the following:
Code: [Select]
  1 - 2 - 3
  |   |   |
  4 - 5 - 6
  |   |   |
  7 - 8 - 9
The vertical lines and dashes represent connections, while the numbers are the nodes (with the node number corresponding to the number on the grid). The example grid that I created above would be 30 pixels wide and 30 pixels tall, so more than likely you'd want to use a much larger grid than the one I gave; while I don't know the image size as they appear on the map, the image icons for the various missions are each 64 to 128 pixels square, suggesting that you'd want a minimum spacing between grid nodes of at least 130 pixels, and preferably at least 250-300 pixels so you can see where the grid connections are. The grid map and the map image are easy to create, though the grid map is a bit tedious and the map image may require some degree of competence with image editing or creation software packages if you want to create a custom map image that looks decent (on the other hand, aside from image ownership issues if you're creating a map mod for distribution, I see little reason why you could not simply download an image off the internet and save it as a PNG file if you found an image you thought would work well as a background which was of a reasonable scale).
« Last Edit: August 13, 2014, 04:03:04 am by Aeson »

Offline nas1m

  • Master Member
  • *****
  • Posts: 1,268
Re: New conduct idea: No Time To Grind
« Reply #20 on: August 13, 2014, 04:15:36 am »
As far as the city-type enum goes: would it be possible to expose this in a text file that the game reads, rather than adding Custom_1, Custom_2, etc to the enum list? Then if I'm creating a map mod and nas1m is creating a map mod and we both want to use one another's map mods, I can use CityName_Aeson1 or something like that and nas1m can use CityName_nas1mA or something like that, and neither of us would likely need to worry about whether or not we both used CityName_Custom1 for our maps and have to go looking through the language files (or make anyone else go digging through the language files) to figure out which custom city each of us used. Or add a line to the top of the language file that tells the game to add a new CityName enum to the list?
If Keith does this the way he did with the custom floor tiles this might not be an issue, I think. There he is only checking for files carrying a specific prefix (like "Custom_") which are then assigned an enum value in the order they are encountered. Since the remainder of the file name is freely selectable we should both (theoretically  speaking) be able to add our own custom maps to the same folder - presuming we add our names to the file name. All that would differ would be the internally assigned enum value, i..e likely where the specific map would occur in e.g. a dropdown. I might be wrong here, though.

As far as adding in custom city maps goes, being able to just have a mod folder where I could place a properly structured directory that the game reads and supplies the default assets if no replacements are produced therein for the map icons would be good. I.e. if I wanted to add CityName_Aeson1 to the game, then I'd find the Mod directory in Bionic Dues (or whatever equivalent you provided) and add the folder 'Aeson1' to that directory, and at minimum Aeson1 would contain an Images subdirectory with the map image and the node/connection grid and \Language\en subdirectory containing a_Aeson1.XML, which is the appropriately modified a_bionic.XML for whatever the map was. That might be more effort than you want to put into it, though, and certainly it's not a significant amount of trouble on my end to just put in an Aeson1.PNG and an Aeson1.XML file into the existing Images folder and an a_Aeson1.XML into the existing languages folder (or whatever the appropriate names would be if you created a hardcoded set of custom maps).
Not sure whether this will work for non-images, but this works just fire everything located in the RuntimeData folder using the TexturePack folder (see the readme there for more info on how to use it). Presumably this should work for .xml files as - well this is implemented in a generic way (what I think it is).
« Last Edit: August 13, 2014, 04:23:03 am by nas1m »
Craving some more color and variety in your next Bionic run? Grab a boost and a couple of custom floors!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: New conduct idea: No Time To Grind
« Reply #21 on: August 13, 2014, 09:30:57 am »
Were I to make a map for myself, I think that the first thing that I'd want to be able to do, as far as tweaking city map generation goes, would be to add weights to each of the nodes to make it more (or less) likely for certain types of missions to spawn there, though given that it does not appear that any such weighting is present that seems like it'd be a significant amount of effort to add. A possibly very slightly easier form of this would be just a weighting for the likelihood of the HQ appearing/not appearing on the node in question. This would however also carry the drawback of potentially requiring a significant amount of additional effort on the part of the map creator, especially if the game were not set to provide 'default' weightings.
Weighting for normal node types could be an issue as the game already has a bunch of rules it follows to compute the number of each type to seed, and which types can go next to which others (mainly so the explosive depots don't get put next to anything too critical).

But weighting for the HQ node would be fine (as an hq_weight attribute on the node tag, I suppose), with it assuming a default of 1, and if you set it to zero it never gets picked for the HQ, and if you set it to some other integer it has that relative chance of being picked (so a "10" with all the others at "1" would have 10x as much chance of being selected as any of the others, though that's still a relatively low chance given the quantity of others).


Quote
Another thing that would be potentially interesting for custom map generation is the ability to add a chance that a grid connection will not be present (e.g. node 1 connects to node 17 50% of the time rather than all the time), though this would likely require some additional pre-game map checks to ensure that there are no unconnected sections of the mission grid, and once again seems as though it would be a relatively large amount of work for relatively little gain. On the other hand, it'd give you a semi-random map to play on (possibly with a base 'skeleton' of grid connections that ensure that all map nodes are always connected to the grid somehow, with the random node connections coming afterwards). This, as with the above, seems as though it'd require a fair amount of work on your end before it'd be possible.
Actually that'd be pretty easy, probably with a "chance" attribute on the con tag.  Having it handle cases where some permutations generate disjoint graphs would be somewhat more complex, but basically it could check all the un-picked links for one that would increase the connectivity, add that, and check again.


Quote
As far as the city-type enum goes: would it be possible to expose this in a text file that the game reads, rather than adding Custom_1, Custom_2, etc to the enum list?
That's not possible with enums, sorry.  They're compile-time constants, and changing the list requires rebuilding the game.  But as nas1m said, this doesn't actually constrain the filenames (except to require the "Custom_" prefix so the game knows it's meant to be picked up that way).

There's a bit more complexity on my end to make sure that loading a save with a different number of custom maps doesn't change which map (the image; the graph will already be saved with the game) you're on, but it's not a big deal to do.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline nas1m

  • Master Member
  • *****
  • Posts: 1,268
Re: New conduct idea: No Time To Grind
« Reply #22 on: August 19, 2014, 11:52:44 am »
Did you have a chance yet to ask Chris whether he would be okay with sharing the level generator code?
Not that I have much time at my hands at the moment, but I would be really interested to have a look at this :).

i would even sign an NDA if you want ;).
Craving some more color and variety in your next Bionic run? Grab a boost and a couple of custom floors!

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: New conduct idea: No Time To Grind
« Reply #23 on: August 19, 2014, 12:01:48 pm »
Just want to throw out that I think fewer total missions should be the default, with a conduct for more epic games. What the default is will be players first experience, and a shorter game is much more likely to pull them in for more.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: New conduct idea: No Time To Grind
« Reply #24 on: August 19, 2014, 12:19:53 pm »
Did you have a chance yet to ask Chris whether he would be okay with sharing the level generator code?
Not that I have much time at my hands at the moment, but I would be really interested to have a look at this :).

i would even sign an NDA if you want ;).
Oh, no NDA necessary; I just wanted to check with him first.

Here it is: http://arcengames.com/dl/BionicMapGen.zip

Basically just unzip that, open the sln file within (Visual C# Express 2008 or later should work, we use 2008, though I think Chris has Visual Studio proper while I just have C# Express), and run it to see the output.

Bear in mind it was ported from valley, so there's still some old valley-specific map types in there and whatnot.  Don't expect cleanliness in general ;)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline nas1m

  • Master Member
  • *****
  • Posts: 1,268
Re: New conduct idea: No Time To Grind
« Reply #25 on: August 19, 2014, 04:01:56 pm »
Did you have a chance yet to ask Chris whether he would be okay with sharing the level generator code?
Not that I have much time at my hands at the moment, but I would be really interested to have a look at this :).

i would even sign an NDA if you want ;).
Oh, no NDA necessary; I just wanted to check with him first.
Cool, thanks!
Craving some more color and variety in your next Bionic run? Grab a boost and a couple of custom floors!