-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lava: includable in mapconfig, new config options, some refactor #3964
base: master
Are you sure you want to change the base?
Conversation
Also move voidWaterMap parsing to lava.lua.
…fectAmbientSounds. - effectDamage: controls the damage ceg effect - effectBurst: controls the ambient bursts ceg effect - effectBurstSounds: to define sounds for bursts - effectAmbientSounds: to define lava ambient sounds
…minhealth can be combined with either direct or proportional modes.
properly update resource values.
How often is map lava config modified in comparison to the rest of map file? I assume this feature also means that texture will need to be distributed inside every map file so that it's all self contained? The one thing I care about is that map files will become only more and more pure structured data, no code, no logic. |
No idea, but giving the map makers options to include the lava config will likely help them in tweaking it more.
It can be distributed inside the map file if it's not available inside bar already, yes.
This is just some structured data so I guess it's ok but let me know if you have any specific concerns. |
make game map configuration loaded from common/configs/LavaMaps with files for every map.
Moved all map specific configuration to common/configs/LavaMaps/. I'm introducing While doing this I noticed the following:
|
Actually, thinking about this, then maybe the config should be provided in the map as json files or similar, instead of lua files? Thing is I don't see mapfiles using json files atm, so that should likely be done as a separate project to remove all lua from maps. Also maybe the project wants to use a different format instead of json if it ever goes in that direction. |
Map files don't have incremental updates, you have do download whole new file, so if lava config is updated often, we might not want to have it in map files. Looking at the file history it doesn't seem to change very often, at least not the per-map values. Also
It kinda doesn't. There aren't really repos for maps AFAIK, definitely not for majority of them. I don't know how mappers are managing their maps, but it's not like we can send a PR somewhere to change particular map. Mappers are directly uploading the map archives themselves, so I think bulk change is you download map archive, modify values, pack it, upload, notify mapper to update their local files... or spam mappers... But it's also ok to just require it for new maps, but for old ones still keep them in the game.
The map was released but then reverted because there were issues with it.
Yes, but as you say that should be separate project, for now I care there is no logic, so the question is effectively "Is it possible to put this into JSON", if the answer is "no", then IMHO it should not live there. Anyway, I think moving away from per-map configuration inside of the game is good. It is problematic for all sorts of reasons:
The alternative is to put this information in the out-of-mapfile maps metadata so just like start pos suggestions are done (passed in via modoption), how we want ffa startpos to be (currently also in game repo), how startboxes are configured etc. IMHO it needs Beherith input. The more dynamic this data is, the better it fits into maps metadata, the more static it is per map version, the more it belongs in the map files. |
Fuck I totally forgot about this one: https://github.com/beyond-all-reason/Beyond-All-Reason/commits/Lava-Rework/ |
Regarding map/game metadata My smartest approach so far was done for map_grass, where the config load order, from mapinfo.lua is:
The new cegs, while welcome, look strange as white/purple, @icexuick ? |
Exactly what I'm doing. I think it's best too.
They're not new XD, I just tried with random cegs I found around the codebase (scavenger spawn and commander spawn I think). What I did is just allow maps to specify some available ceg to use instead of the default one through config. |
lol, I can take a look and merge any changes into a branch if this gets merged, if you want, shouldn't be a problem |
Nah, I merged the main part of it in the commits above, namely the reload and fps smoothing |
I think it would be better to consolidate all of a map's config code into a single file, with one file per map. We can create a dedicated directory e.g. This would be better than splitting a single map's config across multiple files. |
Are there other configs around? Or should I just place the ones here under maps/ ? edit: Ok I see there are others but imo joining those should be done as a separate PR since that will require mangling a lot of files and possibly some code too. |
For the record, anyone adding a file into bar thats called |
I'm just gonna say this. I don't like some of these config options being available. The only configurable stuff should be the numbers, not the mechanics. Stuff like "damageMode" shouldn't be an option. damageMinHealth is outright against the design of lava - it should not allow units to stay in it alive for long. features should always be killed by lava. Why make that an option? |
I just implemented those options that seemed already there in the code but commented with (TODO make this configurable). That one tbh I think was just a bad (commented) implementation (that's why I also added the proportional damage, that seemed more in line with what the comment author maybe had in mind), anyways I can remove any of the options you don't like, I have no specific feelings about those. Also, those (damage and damageMinHealth) options are for units, not for features, for now I just left proportional damage system for features since that's also what was already commented, I just made the proportion amount per second configurable (through damageFeatures that also controls disabling damage to features completely -its actually disabled by default-). edit: that one is from Beyond-All-Reason/luarules/gadgets/map_lava.lua Lines 162 to 167 in d613f3c
|
Configurable probably means customparams. For example lava immunity can be useful for built-in map rocks that get flooded by dynamic lava but survive and are still there when it cycles back down. |
Done, removed the damageMode and damageMinHealth. |
luarules/gadgets/map_lava.lua
Outdated
local lavaDamageMode = lava.damageMode | ||
|
||
-- damage is specified in health lost per second, damage is applied every 10 frames | ||
local lavaDamage = lava.damage/3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to do
local DAMAGE_RATE = 10 -- frames
local lavaDamage = lava.damage * (DAMAGE_RATE / Game.gameSpeed)
and then if frame % DAMAGE_RATE == 0
somewhere below where the magic constant 10 currently lives
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
As suggested by @sprunk.
Work done
Test steps
You can try some of the new config options by editing modules/lava.lua directly, look for the
if
relevant to your map.Examples:
Discussion
Stronghold fix
Namespace
Including in maps
Config options
New shaders location
Others
Screenshots:
Before and after comparison:
(should look the same, both images taken at 1:50 in game time)
Destroyable features
Custom ceg damage effect
testing random cegs from around the codebase
Custom ceg burst effect
testing random cegs from around the codebase
Stronghold fix
This is how it looks in each version.
Detailed new options
damageFeatures
Enable damage to features and control damage speed. This works by setting it to true or a float. true will actually set 0.1. The value is the proportion of resources from the feature destroyed per second. So 0.1 means it will get destroyed in 10 seconds.
Default:
false
effectDamage
Set custom ceg effect for damage. This is the effect applied when a unit is damaged or destroyed.
Default:
"lavadamage"
effectBurst
Set custom ceg effect for bursts (or disable). A burst appears somewhere in the map every now and then.
Can be set to false and then no bursts will appear.
Default:
"lavasplash"
effectBurstSounds
Set custom sounds for bursts. An array of sounds with min and max volume, one of them will be randomly selected every time a burst happens.
Default:
{ {"lavaburst1", 80, 100}, {"lavaburst2", 80, 100} }
ambientSounds
Set of custom ambient sounds. An array of sounds with min and max volume. One of them will appear somewhere in the map every now and then. Can be set to false to disable ambient sounds.
Default: