faforever / fa Goto Github PK
View Code? Open in Web Editor NEWLua code for FAF
Lua code for FAF
When you mass stall (And possible when E stall too), nukes and anti-nukes building missiles get hit much harder by the way resources are shared out. They appear to get 1/10th the resources they should get.
The spread attack feature should be improved to include this functionality.
It's possible to get infinite economy by using assisting engineers.
The problem appears to be with UpdateResourceConsumption in Unit.lua, which when called causes bad economy events for the unit.
It crashes when running AssignRandomStartSpots (I don't know why it is being run) on launch when players have team '-' (no team).
I don't seem to be able to change teams in 'Manual' autoteams mode as well.
Error
WARNING: Error running OnRelease script in <deleted object>: h:\.faforever\bin\test\lua\ui\lobby\lobby.lua(1297): table index is nil
stack traceback:
h:\.faforever\bin\test\lua\ui\lobby\lobby.lua(1297): in function <h:\.faforever\bin\test\lua\ui\lobby\lobby.lua:1169>
h:\.faforever\bin\test\lua\ui\lobby\lobby.lua(1650): in function `LaunchGame'
h:\.faforever\bin\test\lua\ui\lobby\lobby.lua(1676): in function <h:\.faforever\bin\test\lua\ui\lobby\lobby.lua:1485>
h:\.faforever\bin\test\lua\ui\lobby\lobby.lua(1582): in function <h:\.faforever\bin\test\lua\ui\lobby\lobby.lua:1581>
h:\.faforever\gamedata\lua.nx2\lua\ui\uiutil.lua(946): in function `OnClick'
...d alliance\gamedata\mohodata.scd\lua\maui\button.lua(133): in function <...d alliance\gamedata\mohodata.scd\lua\maui\button.lua:122>
My lines are different, so here's the actual offending code:
gameInfo.PlayerOptions = {}
for _, r in best.result do
local slot = r['slot']
local player = r['player']
local team = r['team']
LOG(repr(r)) -- INFO: { player=2, rating=0, team=1 }
gameInfo.PlayerOptions[slot] = table.deepcopy(orgPlayerOptions[player]) -- <-
gameInfo.PlayerOptions[slot].StartSpot = slot
gameInfo.PlayerOptions[slot].Team = team
end
This happens, because the teams table which is made by this code:
teams = {}
teams[1] = {}
teams[2] = {}
for i = 1, numAvailStartSpots do
if gameInfo.ClosedSlots[i] == nil then
if gameInfo.GameOptions['AutoTeams'] == 'lvsr' then
local midLine = GUI.mapView.Left() + (GUI.mapView.Width() / 2)
if(not GUI.markers[i].marker) then return end
local markerPos = GUI.markers[i].marker.Left()
if markerPos < midLine then
table.insert(teams[1], i)
else
table.insert(teams[2], i)
end
elseif gameInfo.GameOptions['AutoTeams'] == 'tvsb' then
local midLine = GUI.mapView.Top() + (GUI.mapView.Height() / 2)
local markerPos = GUI.markers[i].marker.Top()
if markerPos < midLine then
table.insert(teams[1], i)
else
table.insert(teams[2], i)
end
elseif gameInfo.GameOptions['AutoTeams'] == 'pvsi' then
if i == 1 or i == 3 or i == 5 or i == 7 or i == 9 or i == 11 then
table.insert(teams[1], i)
else
table.insert(teams[2], i)
end
end -- TAG 1.
end
end
-- shuffle the array for randomness.
teams[1] = table.shuffle(teams[1])
teams[2] = table.shuffle(teams[2])
teams = table.shuffle(teams)
Autoteams needs fixes.
Original report here.
We should track down what is causing the instigator to be nil in the first place.
The system currently in place to make units forget targets that have left intel is rather broken. Performance issues aside, it's an open exploit.
We need this fixed ๐ฑ
A micro thing that doesn't affect balance.
Would need to be documented in tooltip.
ACU/SCU which have active consumption like shields / stealth can upgrade other enhancements for free
Pip told me that setting MuzzleVelocity to a high value makes beam weapons aim properly.
This needs to be done for all beam weapons, and it opens up the following improvements:
When a commander being repaired starts an upgrade the engineers assist it while not using extra resources. It seems to not progress as much when stalling but goes full speed when not stalling.
replay ID: 2678703
Hypos:
Poch showed me this.
https://www.youtube.com/watch?v=lUGABr5Vm6E#t=106
The Seraphim ACU sometimes explodes when you unload it from a transport. It is thought to be something to do with the unit being turned the wrong way when it is loaded or something.
Original issue here: FAForever/client/issues/95 by @jnorthrup:
to reproduce -
start final rush pro (v3) lobby.
set something in the custom game like "survival hard".
save a preset.
launch game.
get annihilated.
return to lobby and create match from new preset.
launch.
ctrl-alt-del + task manager to end FA.
"Cycle through all of the available fire states." is a key binding option which can be found under "Orders" when you press F1 in game.
Right now it has a delay of a second on it each time you use the key binding. However, when you change fire mode by clicking on it with the mouse it'll happen instantly.
The delay can be annoying when microing a bomber which already takes a lot of time and effort.
Lobby needs to be updated to support the Shared Armies mod.
The JSON headers of downloaded replays are missing one player name.
portion of local replay file 2679856-RoLa.fafreplay: {"featured_mod_versions": {"11": 3634, "13": 3634, "12": 3634, "15": 3634, "14": 3634, "17": 3634, "19": 3634, "18": 3634, "20": 3634, "1": 3634, "3": 3634, "2": 3633, "5": 1, "4": 1, "6": 1, "9": 1, "8": 1, "21": 3634}, "num_players": 8, "game_end": 1412885102.758, "uid": 2679856, "version_info": {"lobby": "0.10.121"}, "game_time": 1412885010.329131, "game_type": 0, "host": "janpol", "sim_mods": [], "teams": {"1": ["tropodator", "RoLa", "janpol", "EiS"], "2": ["iswearshewas18", "Slartibartfast", "BlackBirds", "Greataxe"], "-1": ["B3stEc0EU"]}, "access": "public", "state": "playing", "options": [], "command": "game_info", "featured_mod": "faf", "title": "600-1100", "recorder": "RoLa", "mapname": "gap of rohan.v0001", "max_players": 8, "complete": true}
downloaded faforever.com/faf/vault/replay_vault/replay.php?id=2679856 {"num_players": 8, "featured_mod_versions": {"1": 3634, "2": 3633, "3": 3634, "4": 1, "5": 1, "6": 1, "8": 1, "9": 1, "11": 3634, "12": 3634, "13": 3634, "14": 3634, "15": 3634, "17": 3634, "18": 3634, "19": 3634, "20": 3634, "21": 3634}, "game_end": 1412885108.918998, "uid": 2679856, "title": "600-1100", "game_type": 0, "teams": {"1": ["tropodator", "RoLa", "EiS"], "2": ["Greataxe", "Slartibartfast", "iswearshewas18", "BlackBirds"]}, "mapname": "gap of rohan.v0001", "featured_mod": "faf", "complete": true}
Sheeo - The fix for this is in Patch-Z, but I left it out of my commits because it's the one with classes double-deriving, and you said you'd need to figure out a way to clean that up better.
I've had reports from numerous players today, one of whom I absolutely trust, that the Cybran T1 MAA and T2 Cruiser, units with weapon toggles, are bugging out. For example, apparently the Cruiser will fire both guns at ground targets without being toggled. I've not had a chance to test this yet, but I've checked the unit scripts and they appear to be in order.
One of them gave me a possible lead. He thinks this only began happening in the same update as my unit description changes went live.
Making this issue as a final one to visit before we release 3636.
Requirements here:
When you move attack units they move too close to targets before initiating attacks. For instance, a T1 artillery unit moves too close to T1 PD.
This is controlled by GuardScanRadius, which is currently not used for many units. The value is also used to decide if a unit should deviate from its patrol / assist ground order and initiate attack / reclaim / repair.
AI = {
GuardScanRadius = 25,
},
We should set this value to a unit's weapon range + some buffer. This should be possible with some blueprint hooks I guess?
Currently hover and air units sink to the bottom with a slider, straight down.
I want to let the physics engine take care of it instead by attaching the dead unit to a dummy projectile. This will make it somewhat more realistic.
Also going to change the real position of the wreckages to the sea bottom instead of surface, making it easier to target when reclaiming.
The final goal is to DRY(remove all the duplication of code) defaultunits.lua in regards to wreckage and kill effects. Instead this will be general code in Unit.lua which all units use.
Okay so, in the current state of this repository we cannot release the code under GPLv3, since we don't have the rights for all of the code (Some of it is verbatim GPG code).
I'm opening this issue to discuss ways to get to a state where we can change the license to GPLv3.
Would be nice with some lua-coding conventions for contributors .
At the moment the indentation is mixed between spaces, tabs and just incorrect indentation.
Also, using double slash (--) for comments is probably better than hash (#) due to syntax coloring / linter reasons, even though # is allowed as comment in lua 5.0
(Sublime seems to have some trouble with lua-indentation and handling #-comments which is unfortunate)
Projectiles currently don't collide with wrecks in general.
At the moment, the lobby code has grown out of proportion.
There are 7.200 lines of ill-formatted and inconsistent lua code. This needs fixing.
Both DataPath lua files import files from the CWD instead of the InitFileDir.
Change:
dofile('init_faf.lua')
to
dofile(InitFileDir .. '\\init_faf.lua')
The files are missing from this repo and they are actually something the server sends to the clients. Since both of them are directly related to this "featured mod", I report this issue here.
I use a windowed mode command line toggle when launching my test branch. It gets to the lobby fine windowed, but hitting launch it jumps to fullscreen mode for the in-game. This did not happen prior to the most recent merge.
Random spawn should be autobalanced teamwise, alot of effort goes to just trying to make balanced teams in lobby.
I will make a pull request which contains some autobalance stuff, it could always be tuned (adding it as an option etc) but will work for now
Original bug report here
Basically.. If you use the Auto upgrade hotbuild key on a factory.. it upgrades it to a factory regardless of whether or not you have one present.
Can you change it so that It detects if there is a HQ present and so upgrade to a support factory?
Regards. Kal~
Replay 2702646 crashes with an unknown sim bug.
Range overlays are a huge performance bottleneck, especially "Selection" and it is enabled for all users as default.
The toll is taken on the GPU so people with fast cards notice less impact but the problem is that if someone is running a low-end gfxcard (like me for the moment), the result is stall / stutter in a network game. The sim and render side isn't decoupled enough :/
For someone wanting to test the impact you can create say, 200 asf and then select those with selection range overlay enabled. As long as you have them selected on screen it will cause a huge fps drop, It is probably the "merge overlay circles" code which is crap.
My suggestion is to remove Selection-overlay as an option in the UI completely and make sure it starts disabled. The only time it should be on is if you select a single unit (which is already the case). It is useless anyway for the multi-unit select case.
I will put up a pull request with some other performance improvements at the same time.
Not entirely sure this issue belongs in FA, but there doesn't appear to be a misc section.
BannanaHammer has made good progress towards fixing Issue #23 properly. The theory is correct and adding a new bone is the way forwards. However, the importer used with Blender is currently broken, not importing Normals properly and making the entire process far, far harder than it needs to be.
I think we need to put a long-term goal in place to either find out what program(s) GPG used to create models in the first place, contact as many of the old/current modellers as we can, and get documentation together on how to do this, and how to avoid or solve the common problems.
It is also worth, I think, writing a new importer or whatever it takes to make editing models as easy and painless as possible, if such an endeavour is even achievable.
How it's meant to look: http://snag.gy/WvyIV.jpg
How it looks post-edit: http://snag.gy/euISO.jpg
Full bug report here: http://www.faforever.com/forums/viewtopic.php?f=3&t=8435
build a star topology game protocol.
Would be good to have a scripted map which can test certain balance aspects of the game. This will of course not cover all scenarios but could be an indication if a change tilts the balance too much.
Preferably each test would be in it's own function and the total results of it written to a textfile or similar, then you can have CI on it automatically.
It has been stated that the fix for this has been ready for awhile now. I'd like to remind you guys about it so it would likely be implemented soon. I have noticed a large influx of foot traffic in the coop recently, and i'd hate for people to lose interest, as the story is brilliant and playing it with friends is nice.
-Turnus
Nombringer came up with this one: "Not sure if this is inside the scope of this patch, but I think it would be a great improvement if mass extractors had a higher target priority than mass storage."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.