Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab  » Additional tile properties
Additional tile properties[message #330919] Fri, 28 February 2014 19:18 Go to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
Additional Tile Properties

With Additional Tile Properties it's possible to supply all tiles with additional data, just like with .jsd files, except in XML.
Files need to have same name as tile's .sti and .jsd files, and be put in \tilesets\AdditionalProperties\, or in specific \tilesets\xx\.

Template:
Toggle Spoiler

Camouflage affinity

To quote source code - LOS.cpp:
case FLAT_GROUND:
// here it would be best if we could have a terrain texture -> camo association instead of terrain type -> camo
//  but we need to allow modders to specify that information in an xml file
// this is because flat ground is used by both (it's irritating to see wood camo work perfectly on brown ground, at least ingame)
return max( GetDesertCamouflage(pSoldier), GetJungleCamouflage(pSoldier) ) * scaler/100;

At the moment, type of camouflage that works on any tile depends on tile's terrain id, which is distributed dynamically depending on tile's position in tileset. As a result:
- urban camo works perfectly on all floors and roofs,
- desert camo works perfectly on all dirt roads,
- wood camo works perfectly on any grass - and by "grass" I mean only fifth and sixth texture of every tileset, not neccessarily being grass,
- everywhere else wood and desert camo work both perfectly,
- snow camo doesn't work at all.

With additional properties it's possible to specify which camo type, and how effectively will work on any tile. Only snow camo will work on snow covered roofs, red carpet in palace won't perfectly cooperate with urban camo anymore, thick grass in the middle of the forest will provide better camouflage than sparse grass near the road.
While most of affinity of any map grid usually comes from surface tiles, other objects like weeds, grass, twigs etc. can influence final affinity too.
http://farm4.staticflickr.com/3755/12837607174_9fc67225d3_o.png

If given map tile works with more than one camo type, not the best type is chosen for calculation like before, but instead combination of all.
Example:
Merc's camouflage: 50% desert, 20% wood
Tile's affinities: 50% desert, 100% wood
Merc's effective camouflage: 0.5*0.5 + 0.2*1.0 = 45%

Camo type affinity of any given spot can be still checked with "f" key in tactical. Name of specific type will be shown if its affinity is at least 50%.

Walking and sneaking sounds

It's now possible to specify footstep volume and stealth difficulty modifier of any tile. Carpets will absorb noise, tile floors amplify it, twigs laying on the tile will make sneaking harder. Choose your path carefully, taffer.
http://farm4.staticflickr.com/3826/12837173035_3c3f5839f2_o.png

Customization

Specifying additional property file for any tile is optional, so are tags inside it.
Feature can be completely disabled in .ini as COVER_SYSTEM_ADDITIONAL_TILE_PROPERTIES under Tactical Cover System Settings.

Files

XMLs for all passable tiles (grounds, floors, roofs, debris, weeds) in tilesets included. Some values might need further refinement.
Files + diff

[Updated on: Sat, 01 March 2014 01:57] by Moderator

Report message to a moderator

Master Sergeant

Re: Additional tile properties[message #330921] Fri, 28 February 2014 19:23 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
@anv maybe this will allow making some of the windows unjumpable? (especially those in tixa)

Report message to a moderator

Lieutenant

Re: Additional tile properties[message #330922] Fri, 28 February 2014 19:37 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
ay caramba

Report message to a moderator

Lieutenant

Re: Additional tile properties[message #330924] Fri, 28 February 2014 19:50 Go to previous messageGo to next message
Slax is currently offline Slax

 
Messages:1411
Registered:July 2006
Location: People riding polar bears...
Gross Bathroom Floor
Hygiene: -80%

Report message to a moderator

Sergeant Major
Re: Additional tile properties[message #330925] Fri, 28 February 2014 20:19 Go to previous messageGo to next message
sardonic_wrath is currently offline sardonic_wrath

 
Messages:48
Registered:June 2011
very nice!
I always found the camouflage/stealth system very unaccessible, those tooltips should change it for the better

Slax
Gross Bathroom Floor
Hygiene: -80%

haha, right... Going prone there should cause a nasty drug effect Smile

Report message to a moderator

Corporal
Re: Additional tile properties[message #330926] Fri, 28 February 2014 20:51 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Tooltips? I think you kind of missed the point Very Happy

Report message to a moderator

Captain

Re: Additional tile properties[message #330929] Sat, 01 March 2014 01:54 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
@sevenfm:
No more Houdini's escapes.
1 will prevent jumping through windows based on given tile. At the moment tag is used only for "build_19" (barred window in Tixa).

Link in the first post updated.

@Slax:
Correct me if I'm wrong, you're asking for new disability - "Germaphobe: loses morale while laying on the ground, using dirty equipment and being around people with slob manners", right? Razz

@sardonic_wrath:
Screens are for presentation purposes, there are no huge red font tooltips in game. "F" key shows cover/camo/range of given tile just like it used to, except now camo part of information is a bit more relevant.

Report message to a moderator

Master Sergeant

Re: Additional tile properties[message #330934] Sat, 01 March 2014 10:21 Go to previous messageGo to next message
Slax is currently offline Slax

 
Messages:1411
Registered:July 2006
Location: People riding polar bears...
You know it. Wink

Report message to a moderator

Sergeant Major
Re: Additional tile properties[message #330935] Sat, 01 March 2014 10:59 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
@anv :bluecool:
This also opens possible door for future implementation of tile-crafting (take goods from tiles using 'hammer' cursor) and tile-transformations (build new road!)

p.s. what about 'shadow' tiles (near walls etc) that have the same light level as tiles in open? could they receive stealth bonus?

p.p.s. i have another crazy idea - mine planting restrictions/bonuses:
for example, it's easy to hide mine or trap in the grass (and it can receive trap bonus in grass or sand), but how will you bury it into the concrete floor?

[Updated on: Sat, 01 March 2014 13:39] by Moderator

Report message to a moderator

Lieutenant

Re: Additional tile properties[message #330942] Sat, 01 March 2014 11:50 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@anv: very nice, I am going to add this to the development source trunk (not to the stable trunk).

EDIT: Commit is done.

[Updated on: Sat, 01 March 2014 12:12] by Moderator

Report message to a moderator

Sergeant Major

Re: Additional tile properties[message #330972] Sun, 02 March 2014 18:19 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Very good Smile

Have you experimented with modifying other properties of structures? Like, say, defining a structure to have another shadow?

Report message to a moderator

Captain

Re: Additional tile properties[message #331005] Mon, 03 March 2014 18:59 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
Static shadows can work without additional data. Problem with them is just that while they drawn over one tile, they're actually situated on the other.
It's possible to check if tile up north (or rather tile being base tile of any multitile structure, that has a segment up north) from given position has shadow cast and then decrease brightness here, depending on how high casting segment is.
That method is not perfect, as there are high structures that (visually) cast almost no shadow - we could instead of height calculate average coverage in given plane, but that would be outright psychotic - plus it's somewhat operation heavy compared to the effect.
https://farm8.staticflickr.com/7408/12906221575_2c948bde7a_o.png
Another problem is position of shadows should change dynamically depending on current time of day... but maybe I'm looking too deep into that. At least they disappear at night. Now, if shadows instead of static .stis were based on dynamically transformed .jsd...

Changing which shadows structure cast should be easy, but despite changing sBuddyNum we'd need to add tile of given index to specific map grid, as it's normally done during map load.

Bonus to traps - now, that makes perfect sense.
0
Keeping in mind traps usually have level between 1-10:
- most floors and roofs get -3, since merc can't bury the trap there, just set it in on top (let's assume no jackhammers are involved),
- snow, sand: +1, because it's easy to bury something there without leaving any trace,
- deep snow: +2,
- debris that can be used to better camouflage trap: +1/+2.
Bonus is calculated during deploying trap by merc, doesn't influence levels of traps already set by mappers.

And of course I uploaded Data/AdditionalProperties while in code Data/tilesets/AdditionalProperties are read. But hey, worked for me Razz

Update:
- fix: data read from Data/AdditionalProperties,
- new tag: + updated data for tiles, trap level influenced by terrain,
- new feature/option: COVER_SYSTEM_STATIC_SHADOWS_DECREASE_BRIGHTNESS.

Source:
Toggle Spoiler
Data:
Toggle Spoiler

[Updated on: Mon, 03 March 2014 19:29] by Moderator

Report message to a moderator

Master Sergeant

Re: Additional tile properties[message #331006] Mon, 03 March 2014 19:18 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
@anv cool!

One suggestion - making <tripwire> usable without great penalties on the floor/road or any plain surface, because it's hard to see anyway, and you can then place tripwire in front of the door, and place tripwire-activated bomb aside.

Also, placing traps on roofs is not good idea now, because it's partially broken - you can place it, activate, but it will not disapper (endless trap).

And crouching in shadows behind the wall now makes more sense than just imaginary roleplaying.

[Updated on: Thu, 30 June 2016 18:43]

Report message to a moderator

Lieutenant

Re: Additional tile properties[message #331020] Mon, 03 March 2014 23:01 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Committed in r7016/GameDir r1972.

@anv: Please append a better description of COVER_SYSTEM_ADDITIONAL_TILE_PROPERTIES in the ini if my description isn't enough.

Report message to a moderator

Captain

Re: Additional tile properties[message #331021] Mon, 03 March 2014 23:19 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Flugente
Committed in r7016/GameDir r1972.

@anv: Please append a better description of COVER_SYSTEM_ADDITIONAL_TILE_PROPERTIES in the ini if my description isn't enough.


Thanks for committing.
I just made a small modification and moved the "AdditionalProperties" folder in the "tilesets" folder (in the gamedata and the source code)

@anv: Please get latest source code from development trunk and see if it still works after commit Smile

[Updated on: Mon, 03 March 2014 23:20] by Moderator

Report message to a moderator

Sergeant Major

Re: Additional tile properties[message #331022] Tue, 04 March 2014 00:24 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
Yup, all is well as of 7019, thank you both.

Report message to a moderator

Master Sergeant

Re: Additional tile properties[message #331048] Tue, 04 March 2014 23:37 Go to previous messageGo to next message
mmm is currently offline mmm

 
Messages:63
Registered:May 2013
Interesting, so basically multi-terrian camo will actually make more sense now because some terrian will require a combination of two(or more).

Report message to a moderator

Corporal
Re: Additional tile properties[message #331159] Mon, 10 March 2014 13:06 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
Is it possible to set properties for specific objects within a tileset (I mean, some objects should probably handled differently within the same tileset)?

Report message to a moderator

Lieutenant

Re: Additional tile properties[message #331167] Mon, 10 March 2014 21:23 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
@mmm: At the moment no terrain requires combination of different types of camo, it's just possible to use it without penalty or with specified penalty on certain surfaces.

@smeagol: Depends on your definition of tileset. Same properties are set for all objects based on same .sti and .jsd (code considers that a single tile surface, every tileset consists of 151 tile surfaces). If you want to set properties for specific structures in the same tile surface, it would require some rewriting. All structures in same tile surface are logically connected (same type of floor, same type of grass, same type of cupboard with minor differences), so it didn't seem neccessary to specify different values for every single one, at least with existing properties - camo and stealth modifiers.

Report message to a moderator

Master Sergeant

Re: Additional tile properties[message #331289] Sat, 15 March 2014 15:07 Go to previous messageGo to next message
mmm is currently offline mmm

 
Messages:63
Registered:May 2013
Yeah, I just realized it was not... I was thinking in terms of the requirement to achieve perfect camo(which I always do, by whatever mean possible) on a specific tile, which necessitate more than a perfect camo on a single terrain. Then I realized it is actually a penalty for mixed terrain types, which require a greater total sum of total camo index to achieve the same level of concealment. It's not "boosting" multi-terrain camo so to speak, rather it was the opposite, only by differing amount.

I see some implications though, considering it is in fact making certain terrains outright "harder", without necessarily encouraging the use of multi-terrain camo(one type is still more effective than others, unless you're maxing out the camo index sum above 100%, which is not possible through camo kit). It does not make a lot of sense to me, since I believe with the right mix of camo, it is still possible to hide no less effectively than on a simple, single type terrain.

I thought it would be wonderful to rather "cap" the maximum amount of "cover" granted by a single camo type on a certain tile. So say a 70% wood terrain will give you full benefit for wood camo, up to a wood camo index of 70%. The remaining 30% will have to be made up by another type of camo. So the total sum of camo index required achieve a certain level of "cover" is not necessarily increased, rather a right mix will be required. A perfect solution IMHO.

And that brought me to another idea: maybe introducing a cap(totally optional, adjustable, of course) for camo index granted by camo kit, too. In real life one could at most paint camo to exposed body parts. That should only represent a small fraction of total camo, say maybe 20%?

Edit: may I have you to clarify what exactly "stance partially ignored in camo calculations" means? Standing and crouching more effective?

[Updated on: Sat, 15 March 2014 15:10] by Moderator

Report message to a moderator

Corporal
Re: Additional tile properties[message #331294] Sat, 15 March 2014 19:35 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
Update:

Alternate Multi Terrain Camo Calculation
Set under Tactical Cover System Settings > COVER_SYSTEM_ALTERNATE_MULTI_TERRAIN_CAMO_CALCULATION in Ja2_Options.INI.
Camo affinities will be used as caps not multipliers (suggested by mmm). It will be possible to achieve perfect camo on mixed terrain using mixed camo types. Works only if COVER_SYSTEM_ADDITIONAL_TILE_PROPERTIES = TRUE.

Example 1:
Merc's camouflage: 80% desert, 0% wood
Tile's affinities: 50% desert, 100% wood
Merc's effective camouflage: 0.8*0.5 + 0.0*1.0 = 40%
Merc's effective camouflage with alternate calculation: min(0.5, 0.Cool + min(0.0, 1.0) = 50%

Example 2:
Merc's camouflage: 50% desert, 20% wood
Tile's affinities: 50% desert, 100% wood
Merc's effective camouflage: 0.5*0.5 + 0.2*1.0 = 45%
Merc's effective camouflage with alternate calculation: min(0.5, 0.5) + min(0.2, 1.0) = 70%

Example 3:
Merc's camouflage: 70% wood, 30% desert
Tile's affinities: 70% wood, 30% desert
Merc's effective camouflage: 0.7*0.7 + 0.3*0.3 = 58%
Merc's effective camouflage with alternate calculation: min(0.5, 0.5) + min(0.3, 0.3) = 100%

Source
Toggle Spoiler

Ja2_Options.INI
Toggle Spoiler


@mmm:
Cap for camo from camo kit is already in, check under CAMO_KIT_USABLE_AREA in .ini. It's only 5 (%) by default, rest of camo is taken from worn equipment.

Max amount of camo is scaled according to merc's stance, where stance value can be from 1 (prone), 3 (crouch) or 6 (stand). Final value of scaler is (7-stance)/6, so for different stances it's:
// stand = 7-6 => 10%, crouch = 7-3 => 66%, prone = 7-1 => 100%;
Stance modifier decreases value of current stance (still limited between 1-6), so camo on given tile is less penalized due to merc's stance, e.g. in the thick bushes (modifier + 2) merc can crouch and be as well camouflaged as if he was prone in the open.

Report message to a moderator

Master Sergeant

Re: Additional tile properties[message #331305] Sat, 15 March 2014 22:29 Go to previous messageGo to next message
mmm is currently offline mmm

 
Messages:63
Registered:May 2013
Wow, that was fast. Guess the idea is simple to start with. You've made my day, anv. Thanks.

anv

@mmm:
Cap for camo from camo kit is already in, check under CAMO_KIT_USABLE_AREA in .ini. It's only 5 (%) by default, rest of camo is taken from worn equipment.

Guess I'll need to switch to a less outdated build.

Thank you for explaining the effect of stance mathematically.

One more favor I can't help asking. It seems that the F key will not display the exact amount of affinity for a tile, will you consider make it do that? Sound modifiers too if possible. I feel a lot more secure when I have the complete info of a tile.

[Updated on: Sat, 15 March 2014 22:30] by Moderator

Report message to a moderator

Corporal
Re: Additional tile properties[message #331319] Sun, 16 March 2014 20:39 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
COVER_TOOLTIP_DISPLAY_DETAILED_TILE_PROPERTIES under [Tactical Cover System Settings] set to true will let "f" cover tooltip to present detailed information about tile. Only relevant (non-zero) info will be shown.

https://farm4.staticflickr.com/3827/13197251983_b69457446e_o.png

Also fixed bug causing trap level to be ignored and limited final maximum and minimum camo of given map grid between 0 and 100.

Diffs include previous (alternate calculation) changes.
Source
Toggle Spoiler
Master Sergeant

Re: Additional tile properties[message #331322] Sun, 16 March 2014 21:13 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Committed in r7073 and GameDir r1988.

Report message to a moderator

Captain

Re: Additional tile properties[message #331486] Mon, 24 March 2014 20:35 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
One possible application for this feature:
add random items to empty lockers based on locker type - med kits, civilian clothes, small amounts of ammo, other random useless stuff.

Useful for those maps and mods with lots of empty lockers.
Good for scavenging and craft-happy people.

Report message to a moderator

Lieutenant

Re: Additional tile properties[message #331842] Mon, 21 April 2014 00:42 Go to previous message
CptMoore

 
Messages:224
Registered:March 2009
Thank you anv! I was the guy making the comment in LOS.cpp, happy you changed the mechanics and made it work.

Report message to a moderator

Sergeant 1st Class
Previous Topic: Externalised taunts
Next Topic: Description Box enhancement: Compare Items
Goto Forum:
  


Current Time: Fri Apr 19 22:36:23 GMT+3 2024

Total time taken to generate the page: 0.07174 seconds