Commit Graph

24379 Commits

Author SHA1 Message Date
Arular101
b71b2ad523 Upgrade rules for increasing HP and damage by 100x for the TD mod 2017-12-12 22:18:41 +01:00
Arular101
7ad989fc43 Adjust values in custom maps and missions 2017-12-12 22:18:41 +01:00
Arular101
4e62531b11 Adjust values to match current damage 2017-12-12 22:18:41 +01:00
Arular101
2e681ba674 Increase damage and HP by 100x 2017-12-12 22:18:41 +01:00
Arular101
917d6b7627 Upgrade rules for increasing HP and damage by 100x for the RA mod 2017-12-12 20:50:27 +01:00
Arular101
261126194c Balance changes from #14471 2017-12-12 20:50:27 +01:00
Arular101
8069247726 Adjust values in custom maps and missions 2017-12-12 20:50:27 +01:00
Arular101
a429a62bf9 Adjust values to match current damage 2017-12-12 20:50:27 +01:00
Arular101
e049452f22 Increase damage and HP by 100x 2017-12-12 20:50:27 +01:00
RoosterDragon
7760c41bd9 Avoid array resizing in OpenAlAsyncLoadSound.
- Where it is accessible, use the length of the stream to presize the MemoryStream to the correct size.
- Instead of copying out the result via ToArray, grab the underlying buffer via GetBuffer and use that to create the sound source.

This avoids extraneous copying of the array containing the audio.
2017-12-12 00:01:04 +01:00
RoosterDragon
0899d02377 Avoid allocations when generating RadarSignatureCells.
The RadarWidget can supply a reusable buffer to each trait to avoid individual traits having to return new enumerables. Additionally, this allows the two traits to avoid LINQ and further allocations as they can manually enumerate and populate the buffer themselves.
2017-12-12 00:00:51 +01:00
Mustafa Alperen Seki
c69df4eedf Make subfactions use UI for their main faction
So it won't crash if a human player uses them.
2017-12-11 23:43:10 +01:00
Paul Chote
6633483d12 Increase infantry mouse bounds to improve usability. 2017-12-11 19:45:07 +01:00
Paul Chote
55b6084b60 Add a lint test for conflicting Interactable and Selectable. 2017-12-11 19:45:07 +01:00
Paul Chote
c87409ed1a Remove legacy bounds code. 2017-12-11 19:45:07 +01:00
Paul Chote
bf57eceeec Select highest priority actor when not drag selecting. 2017-12-11 19:45:07 +01:00
Paul Chote
ff5b4b15b3 Introduce IDecorationBounds to replace Actor.SelectionOverlayBounds. 2017-12-11 19:45:07 +01:00
Paul Chote
6f5d035e79 Introduce IMouseBounds and split/rework mouse rectangles.
The render bounds for an actor now include the area covered
by bibs, shadows, and any other widgets. In many cases this
area is much larger than we really want to consider for
tooltips and mouse selection.

An optional Margin is added to Selectable to support cases
like infantry, where we want the mouse area of the actor
to be larger than the drawn selection box.
2017-12-11 19:45:07 +01:00
Paul Chote
8fcc80b05a Use IRender.ScreenBounds in ScreenMap.
Traits are now required to trigger a ScreenMap update whenever they
believe that their ScreenBounds have changed.
2017-12-11 19:45:07 +01:00
Paul Chote
fa65fef4d1 Add IRenderModifier.ModifyScreenBounds to support WithShadow. 2017-12-11 19:45:07 +01:00
Paul Chote
86bfe28ade Add ScreenBounds method to IRender interface.
This method is expected to return Rectangles that cover
the region where Renderables returned by Render may exist.
2017-12-11 19:45:07 +01:00
Paul Chote
46f6263061 Update ScreenMap state in a single pass at the end of the tick. 2017-12-11 19:45:07 +01:00
Paul Chote
373aaee004 Use World.(AddTo|RemoveFrom)Maps in Immobile/Building. 2017-12-11 19:45:07 +01:00
Paul Chote
9e18ec7314 Simplify ScreenMap bounds checking. 2017-12-11 19:45:07 +01:00
Paul Chote
cdc426d162 Add IActorPreview.ScreenBounds. 2017-12-11 19:45:07 +01:00
Paul Chote
29255c8e01 Add IModel.AggregateBounds and ModelAnimation.ScreenBounds.
The bounds define the smallest Rectangle that covers all
rotations of all frames within a model sequence.
2017-12-11 19:45:07 +01:00
Paul Chote
506b677527 Add ModelAnimation.IsVisible property. 2017-12-11 19:45:07 +01:00
Paul Chote
041431d966 Add ISpriteSequence.Bounds and Animation(WithOffset).ScreenBounds.
The bounds define the smallest Rectangle that covers all frames within a sequence.
2017-12-11 19:45:07 +01:00
reaperrr
85c5259361 Fix AI crashing when trying to make parachuted harvester search map for resources while mid-air 2017-12-11 01:55:18 +01:00
reaperrr
b5ffe17d60 Make AI skip harvester orders if map has no resources 2017-12-11 01:55:18 +01:00
reaperrr
9ad0d78cdd Make the AI only consider harvesters 'idle' if last resource search failed
Otherwise the AI would consider the harvester 'idle' in too many situations.
This way, the AI now only uses its own resource search algorithm if the next resource patch is too far away for the FindResources activity to find it.
2017-12-11 01:55:18 +01:00
reaperrr
4d553900cf Move up harv.IsEmpty check in HackyAI
This is a fairly cheap check, so we should perform it before the activity checks
2017-12-11 01:55:18 +01:00
RoosterDragon
70ffa99203 Fix some uses of Exts.IsTraitEnabled. 2017-12-11 01:46:41 +01:00
RoosterDragon
9241c0f8b7 Provide only one overload of IsTraitEnabled. 2017-12-11 01:46:41 +01:00
RoosterDragon
c75a866f0d Lazily allocate sheet builder in ModelRenderer.
Avoid allocating the sheet builder each frame until it is needed. For mods that do not need to render models, this avoids allocating a large buffer and backing sheet as it will never render to the sheet. For mods that do render models, but don't need any this frame, this avoids allocating a new SheetBuilder that will not be used.
2017-12-11 01:44:21 +01:00
RoosterDragon
ec84b61316 Reduce memory required in MovementClassDomainIndex
The number of distinct domains on a map is often dozens, or at most hundreds. We can use a ushort to represent this easily, and reduce the size of the backing storage required to track domain indicies over the whole map.
2017-12-11 01:41:07 +01:00
RoosterDragon
2dd1bd2d39 Initialize map inverse cell projections with capacity 1.
This prevents the capacity being set to 4 when the first item is added. For flat maps, the inverse projection will only ever be of size 1, thus this is sufficient capacity. For isometric maps, 1 is often sufficient, we only need more near height changes where the discontinuity means multiple cells may project back. We can pay for some reallocations to expand the size in these cases.

On flat maps, this reduces the memory required by the backing array 4x.
2017-12-11 01:38:17 +01:00
RoosterDragon
8ef8c60a1a Remove allocations when enumerating sync hashes on an actor.
Exposing Actor.SyncHashes as an array allows allocation free enumeration, we just need to adjust the SyncHash type to run the hash function.
2017-12-10 13:49:52 +00:00
RoosterDragon
5338784e45 Fix bad uses of FirstEnabledTraitOrDefault on TraitInfos.
These are not traits so this method does not work. We can use EnabledByDefault on the ConditionalTraitInfo instead.
2017-12-10 13:39:24 +00:00
RoosterDragon
7a7eed4fb7 Add FirstEnabledTraitOrDefault helper method.
This avoids the allocations caused by LINQ when using traits.FirstOrDefault(Exts.IsTraitEnabled). This is important in FrozenActorLayer.RefreshState which is called very often. We apply the new helper method to all areas using the old pattern. An overload that takes an array allows arrays to be enumerated without causing allocations.
2017-12-10 13:39:24 +00:00
Paul Chote
cb670d83b3 Set PredictedStance when changing stance from Lua. 2017-12-08 01:54:55 +01:00
reaperrr
1a20dd15cb Fix D2k hightech factory sprite offsets
To match original.
2017-12-08 02:41:11 +02:00
reaperrr
2218b1a078 Fix terrain type of d2k tile #401 2017-12-08 02:41:11 +02:00
reaperrr
ce88d50d9c Fix offset and animation speed of D2k refinery smoke overlay 2017-12-08 02:41:11 +02:00
Paul Chote
7ebea32be9 Remove hardcoded settings backend. 2017-12-08 01:29:15 +01:00
Paul Chote
eb3ab682e8 Remove unused hotkeys from each mod. 2017-12-08 01:29:15 +01:00
Paul Chote
b4c5346346 Migrate hotkey linter to HotkeyManager. 2017-12-08 01:29:15 +01:00
Paul Chote
74c390d1d0 Migrate input settings to HotkeyManager. 2017-12-08 01:29:15 +01:00
Paul Chote
2f79173044 Migrate hotkey consumers to HotkeyManager. 2017-12-08 01:29:15 +01:00
Paul Chote
35a3df3736 Duplicate default hotkeys in yaml. 2017-12-08 01:29:15 +01:00