Likely the most important feature of this year's summer convention, we (Smeagol, DepressivesBrot and myself) have improved the fortification feature.
The pure mechanics are the same - only this time, you can define via xml what you want to construct and what to deconstruct. You can pretty much create ANY structure the game knows. And I mean ANY.
A small demonstration in A9, Smeagols's AIMNAS:
The first xml, TableData/Items/StructureDeconstruct.xml, allows setting up what structures you want to pull down, how, and what you might get:
Read this as: if we have item #5832 (a shovel in AIMNAS) in our primary hand, then clicking on a structure of .sti library deb_02.sti which is tileset member 1 or 2 will destroy this structure and give us item #1544 (wooden planks, medium) with 100% status.
The second xml, TableData/Items/StructureConstruct.xml, allows setting up what structures we can create with items:
Read this as: if we have item #1544 in our primary hand (wooden planks, medium, sound familiar?), then we will build a structure of sti library deb_02.sti from this. If we face north or south doing so, we will build number 1 from that set, otherwise 2.
Of course, in order for this to work, the map needs to have these sti sets. What we don't know we cannot build... Yes, I've tried getting rid of that (which would allow us to build anything anywhere), but that part of the code is so whack that it is on hold.
As AIMNAS was built with thing like this in mind, many of these constructions will work in all maps there. For example, you can now create earthwork in all maps with a simple shovel, as Smeagol made room for that in his tilesets. This is not possible in vanilla maps, so you'll need AIMNAS or a similarly advanced map mod to get the most out of this feature.
You can also create walls this way (not shown in the video, but it works). As deconstructing walls would allow a player to flatten an entire city right under the enemies eyes with just a spy and a shovel (I'm looking at you, Gorro!), I do not allow tearing down walls this way in the code.
As you can set up what you get depending on what direction you face, you can set up your fortifications very detailed.
Via <usCreatedItemStatus> and <usItemStatusLoss>, you can set up very detailed how much of your 'resource' is used. For example, the concertina I've used loses 1% per tile, thereby making constructions less of an item hassle.
For increased immersion, you can set up what items deconstruct what - so a hammer could be used for rocks, a shovel for earth, a wrench for machines, a wirecutter for concertina wire, an axe for trees... now your dreams of playing a lumberjack have come true! :axe:
The Items.xml ItemFlag values 2 (FULL_SANDBAG) and 8 (CONCERTINA) aren't use anymore. I'll likely reuse those numbers soon, so removing these numbers from your items won't hurt.
This feature is fully savegame compatible.
It has been added in r7491 an GameDir r2140. GameDir >= 2140 is required from now on du to the new xmls.
Messages:344
Registered:July 2006 Location: France
One of many applications: Now we can have a full crafting system.
With TableData/Items/StructureDeconstruct.xml, we can gather the ressources from the environment.
With transforms and merges, we can shape/refine them into different materials.
With TableData/Items/StructureConstruct.xml, we can make some of the items placeble on the terrain.
EDIT: It could be interesting that the deconstructed tile be replaced by something (or nothing, as it is now), defined by xml (StructureDeconstruct.xml).
For example, a deconstructed tree with an axe becomes a log, or a mined rock with a pick stays a rock (the same or a smaller/different one, without the "ore"?)
[Updated on: Sun, 07 September 2014 13:00] by Moderator
This is great feature! Thanks! I would come up with few superlatives, but my guess is they have all been used already, when describing one of your many additions to 1.13.
I also have an idea about a possible improvement of this feature. It would be especially helpful in preventing exploits you mentioned (dismantling entire town in a matter of minutes, or constructing impenetrable defenses even though the enemy is virtually on your doorstep...). Certain tasks (like de/constructing a wall, it would have to be specified in the XML) could be performed only as an assignment (and therefore taking some time etc.). The one major problem I see here is how exactly would the player tell their mercs what should be built, and where. I think this would require the game to switch to tactical, and there the player would define what it is exactly they want (in a similar manner as shown on the video), but the actual changes to the map would be made only after the assignment is finished. I have absolutely no knowledge of JA2 source code, so it may be that this is quite easy to implemented, but it may also be insanely difficult.
[Updated on: Sun, 07 September 2014 17:29] by Moderator
One of many applications: Now we can have a full crafting system.
With TableData/Items/StructureDeconstruct.xml, we can gather the ressources from the environment.
With transforms and merges, we can shape/refine them into different materials.
With TableData/Items/StructureConstruct.xml, we can make some of the items placeble on the terrain.
EDIT: It could be interesting that the deconstructed tile be replaced by something (or nothing, as it is now), defined by xml (StructureDeconstruct.xml).
For example, a deconstructed tree with an axe becomes a log, or a mined rock with a pick stays a rock (the same or a smaller/different one, without the "ore"?)
All subject to tileset limitations. So probably not at this point.
One of many applications: Now we can have a full crafting system.
With TableData/Items/StructureDeconstruct.xml, we can gather the ressources from the environment.
With transforms and merges, we can shape/refine them into different materials.
With TableData/Items/StructureConstruct.xml, we can make some of the items placeble on the terrain.
EDIT: It could be interesting that the deconstructed tile be replaced by something (or nothing, as it is now), defined by xml (StructureDeconstruct.xml).
For example, a deconstructed tree with an axe becomes a log, or a mined rock with a pick stays a rock (the same or a smaller/different one, without the "ore"?)
Mining rocks for ore? What's next, running a magically enchanted automining system on tofu?
Messages:344
Registered:July 2006 Location: France
If you want to do a mod with that in mind, have fun
It's up to people/modders to do what they want with the tools given to them.
Currently, if you go into the mines, you will find silver nuggets on the floor, and there are mine assignments. We're not that far.
And by the way, these were oly examples
Messages:85
Registered:April 2012 Location: New York
DepressivesBrot
Grim
One of many applications: Now we can have a full crafting system.
With TableData/Items/StructureDeconstruct.xml, we can gather the ressources from the environment.
With transforms and merges, we can shape/refine them into different materials.
With TableData/Items/StructureConstruct.xml, we can make some of the items placeble on the terrain.
EDIT: It could be interesting that the deconstructed tile be replaced by something (or nothing, as it is now), defined by xml (StructureDeconstruct.xml).
For example, a deconstructed tree with an axe becomes a log, or a mined rock with a pick stays a rock (the same or a smaller/different one, without the "ore"?)
Mining rocks for ore? What's next, running a magically enchanted automining system on tofu?
What's next you say? A full JA2 implementation in Minecraft! We can farm enemy drops with pit traps! The Minecraft engine would certainly would make fortifications easier to build...
Just found your post from 9/2013 where you said something similar. Beat me to it.
[Updated on: Wed, 17 September 2014 05:12] by Moderator
Incredible feature. It works perfect with Wildfire 6.07 (base: r7516, gamedir 2145). Till now I have redone tilesets for all sectors to use sandbags and concentrina with shovel, so I can buid them anywhere (but one disadvantage: I noticed thas winning of battles is now very easy)
[Updated on: Wed, 24 September 2014 16:47] by Moderator
@Baroni: Good to hear
Yes, one can wall in the Ai if one wants - no way for me to discourage that (apart from all the work that requires). In AIMNAS one can create earth piles everywhere, and smeagol make sure that some of them are passable, which is a good way to remove that exploit.
@yarco: The building part itself would require AI adjustments that are relatively easy to make. There is, however, no 'build AI' - the AI wouldn't know when to build what, and frankly, neither would AI.
Due to internal code reasons, sandbags on the ground are different from sandbags on roofs, so no. This can be done, but I currently have no interest in doing so.
I konw that I highly advocated a "place fortifications only if no enemies around in order to avoid exploits" policy. But, I have rethought this... I still think that some fortifications (like sandbags, piles of earth, concertina) should not be placeable when enemies are around, but certain others (like tires, roadblocks, oil drums, wooden barricades) should.
How about adding an xml tag "can be deconstructed during combat mode" and "can be constructed during combat mode" to the deconstruction and construction xmls?
Fix in r7938: constructing/deconstructing a fortification only worked if the tileset was part of the additional tileset, not if it was a part of GENERIC 1.
The fact that nobody spotted this for almost an entire year makes me wonder whether anybody has even tried this out, tbh
[Updated on: Sun, 26 July 2015 12:47]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
Uh-oh. I guess that makes me look pretty stupid right now.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
No. It simply means that you can build all structures in a maps tileset, not those added to the tileset that shadow others in GENERIC 1. Or: You can now build anything from GENERIC 1 that isn't shadowed by the maps specific tileset.
If you don't know what a tileset is, this will likely not explain anything
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
As the amnount of time I can currently spend on coding JA2 is severely limited, I plan to spend it doing rather small things for now, sometimes in preparation of upcoming features. One thing I want to do is to get rid of the 'empty sandbag' <-> 'full sandbag' mechanic. While filling sandbags before placing them is immersive, it doesn't add much 'value' to the game and is rather annoying. Idea is to get rid of the full sandbag item, and declare the empty sandbag to be a 'stack' of 100 sandbags. This would allow to create 100 sandbag tiles via constructing, and get those items back (1%) when deconstructing. As a result, sandbags aren't such a scarce resource (it's a friggin' bag). The 'sandbag-specific code will be deleted, because I want the 'construction'-code to be simpler (before I make it more complicated again in an upcoming feature).
Unless there are justified objections, I will do that when I have the time.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
As announced, sandbags no longer need to be filled as of r7968 & GameDir r2269.
Sandbags no longer need to be filled, item #1541 has been removed.
Empty sandbags (#1540) are now a 'stack' of bags that can be used to create 100 sandbag structures and can be merged. As a result sandbags are no longer so scarce, as one 15-item delivery from BR should be enough for quite a few barriers
Item flags 1 and 4 (EMPTY_SANDBAG and SHOVEL) are no longer used.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.