Commit Graph

5712 Commits

Author SHA1 Message Date
Paul Chote
4f0aa89c01 Remove TileSet.Palette and PaletteFromCurrentTileset. 2018-04-08 21:14:29 +02:00
reaperrr
0c52ff3ae5 Cache TargetablePositions in Actor
To speed up Target.Positions.
2018-04-07 17:24:13 +01:00
reaperrr
4c16e51f92 Add EditorPlayer to all mods
To prevent the editor from loading unnecessary or even incompatible
player traits.
2018-04-06 20:46:47 +02:00
Paul Chote
7be71eb381 Remove broken Server.ExternalPort setting. 2018-03-31 18:09:07 +02:00
IceReaper
12407ae995 Fix asset browser displaying wrong file
If multiple files with same filename are present.
2018-03-31 16:08:35 +02:00
RoosterDragon
f6471d411e Reuse set when rendering actors in the world to avoid allocations. 2018-03-22 23:32:03 -03:00
Paul Chote
8ea1da1046 Apply map upgrade rules without instantiating the Map object.
This avoids a crash that stops the maps from being updated
when the base mod ruleset is not valid (e.g. a trait is missing a
FieldLoader.Required property).  This also significantly improves the
upgrade performance.
2018-03-21 12:15:23 +01:00
Peter Antal
d2ff5b49fd Allow each caller on MergeOrDefault to discard nodes.
Use filtering ActorInfo's to drop template actors.
2018-03-21 12:10:31 +01:00
RoosterDragon
d0f7511a62 Add TrimExcess to TypeDictionary.
After adding is finished, this can be used to reduce the memory footprint of the dictionary.
2018-03-21 12:08:23 +01:00
RoosterDragon
e17ede34ef Add Int32Matrix4x4 struct.
This allows matrices to be represented as a value type, and additionally allows avoiding array allocations when calculating rotations.
2018-03-21 12:07:53 +01:00
RoosterDragon
5bd5a384b7 Use a BitSet for representing target types.
- Rename Bits<T> to BitSet<T>.
- Implement set based helpers for BitSet<T>.
- When representing TargetTypes of ITargetable in various traits, use a BitSet<TargetableType> instead of HashSet<string> for better performance & reduced memory usage.
- Fix FieldLoader to trim input values when generating a BitSet<T>.
- Require T in BitSet<T> and BitSetAllocator<T> to be a class since it's just a marker value. This allows the JIT to instantiate generic code for these classes once, as they don't benefit from specialized code for T. (Typically JITs will generate shared code for all reference types, and unique code for every value type encountered).
2018-03-21 12:07:44 +01:00
Peter Antal
8fa94c5301 -Perform null check and add exception logging in RuleSet.
-Explicitly recognize connection termination on ServerOrder.Deserialize()
-Use explicit exception type for SDL2HardwareCursor failures.
2018-03-21 01:55:42 -03:00
Paul Chote
e0bcfa918d Fix half-pixel offset in ColorBlock rendering. 2018-03-19 17:31:44 +01:00
David Wilson
9bc9ce4577 Color picker update with team color presets. Bots added will use available team color presets by default 2018-03-18 23:29:47 -03:00
RoosterDragon
d2f2029caf Add FirstNonEmptyBounds method for IDecorationBounds interface.
This provides a more efficient way of determining the bounds by avoiding LINQ. A helper that works directly on arrays prevents allocation of an enumerator when the collection is know to be an array.
2018-03-18 22:06:12 +01:00
RoosterDragon
3b642b1a79 Reuse TargetTypes collection in FrozenActor.RefreshState. 2018-03-18 16:50:20 +01:00
RoosterDragon
63810220e4 Improve some usages of Aggregate. 2018-03-18 16:44:17 +01:00
RoosterDragon
f2e270ce06 Return IRenderable[] rather than IEnumerable<IRenderable> for animations.
Since some callers now know they have an array, then can enumerate it more efficiently and without allocating an enumerator.
2018-03-17 17:51:16 +01:00
Paul Chote
ac7b6e42f0 Improve behaviour of Platform.UnresolvePath on Windows. 2018-03-11 16:32:10 +01:00
Peter Antal
3ce2417a06 Create SupportDirPrefix and IsPathRelativeToSupportDirectory() as members on Platform class. 2018-03-10 12:54:01 +00:00
abcdefg30
ed6a6b61de Throw a proper error when parsing an invalid int2 2018-03-09 23:32:07 +01:00
abcdefg30
56e7b1edc2 Fix int2 arrays not being parsed 2018-03-09 23:32:07 +01:00
Mustafa Alperen Seki
5e7e3bb011 Add DamageTypes to Kill() and make some traits use it. 2018-03-09 00:25:29 +01:00
Paul Chote
e69cf4fd5c Rename another Stream.Write(byte[]) extension method. 2018-03-07 22:29:35 +01:00
Paul Chote
42f1db0d4b Rename Stream.Write(byte[]) extension method to fix compatibility with newer mono. 2018-03-03 18:40:01 +01:00
Peter Antal
9ce0bcb0b7 Mop up active Stylecop nits.
Style consistency cleanup.
2018-03-03 11:45:35 +00:00
reaperrr
9107ca3bc1 Remove unused legacy IsWater flag
This was planned anyway, we had just forgotten about it when the last blocker was removed.
2018-02-22 11:51:10 +01:00
Alexis Hunt
08ad7d7f4e Refactor handling of hit radii in projectiles.
penev discovered that the RulesetLoaded functions of projectiles were
never being called, meaning that their blocking calculations were not
properly accounting for actors with large hitboxes.

The best fix for this is to change FindActorsOnLine to always account
for the largest actor's hit radius, rather than forcing callers to pass
the largest radius. Per the comment in Util.cs, as a result, move this
computation to ActorMap. I decided to simplify by not making a separate
calculation for actors that block projectiles only; this may cause a
small performance degradation as the search space is a bit larger.

Similarly to this, I've removed the ability to specify a search radius
manually. Because this is only a search radius, setting a value smaller
than the largest eligible actor makes no sense; that would lead to
completely inconsistent blocking. Setting a larger value, on the other
hand, would make no difference.

CreateEffectWarhead was the only place in core code any of these search
radii were set, and that's because 0 was a mysterious magic value that
made the warhead incapable of hitting actors. I replaced it with a
boolean flag that more clearly indicates the actual behaviour.

Fixes #14151.
2018-02-21 23:26:41 +01:00
Paul Chote
222d1af706 Don't create invalid targets (dead actors) in UOG. 2018-02-04 15:46:36 +01:00
Paul Chote
234e6cc566 Prevent injected unpause orders from restarting a finished game. 2018-02-04 15:30:53 +01:00
RoosterDragon
a726b57367 Fix order serialization issues. 2018-01-28 15:41:28 +01:00
Paul Chote
3af6ffc017 Revert "Remove CreateGroup order as the ActorGroupProxy is gone." 2018-01-28 14:58:44 +01:00
Arular101
21504a774d Add missing copyright notice 2018-01-17 23:07:01 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
RoosterDragon
b1e2ee9b79 ScreenMap should TickRender, rather than just Tick.
This is as FrozenUnderFog.TickRender queues an update to the screen map. If this is not processed in the same tick, this results in screen bounds for the frozen actor being 1 tick behind. By making ScreenMap TickRender, it ensures changes from both Tick and TickRender traits are processed, rather than just Tick traits.
2018-01-06 15:16:59 +01:00
RoosterDragon
c60ca83751 Revert "Fix actors disappearing for a tick when swapping to the frozen actor."
This reverts commit 2eb090f153.

This fixes flicker for the actor->frozen transition, but then introduces the same flicker for the frozen->actor transition instead.
2018-01-06 15:16:59 +01:00
Paul Chote
36c3e07535 Remove CRLF from GameServer.cs. 2018-01-01 21:12:58 +01:00
Paul Chote
58547fda89 Guess mod titles based on other versions, if they exist. 2018-01-01 21:12:58 +01:00
Paul Chote
2eb090f153 Fix actors disappearing for a tick when swapping to the frozen actor. 2018-01-01 16:01:44 +01:00
Paul Chote
f8abd5d319 Serialize the correct player in FrozenActor-targeting orders. 2018-01-01 16:01:44 +01:00
Paul Chote
b3cde077fc Don't break the order stream if a frozen actor refers to a bogus player. 2018-01-01 16:01:44 +01:00
Andrii Yukhymchak
11db40a2b3 Fixed issue with unit ready when capturing 2018-01-01 12:52:47 +00:00
Paul Chote
3effa5cec4 Add a setting to disable version checks. 2017-12-29 02:56:50 +01:00
Paul Chote
3ba610b535 Implement new master server ping protocol. 2017-12-26 20:05:38 +01:00
Paul Chote
205c45198c Remove secondary AllowPortForward setting.
The global setting is fine, and this simplifies
both the code and the UI.
2017-12-24 01:47:44 +01:00
RoosterDragon
e42e766bb6 Prevent incorrect usage of ModelRenderer.
Force BeginFrame/EndFrame to be called correctly, and prevent calls to RenderAsync when outside of a frame.
2017-12-23 22:58:17 +01:00
Paul Chote
4c64a37e1d Reject invalid orders from unvalidated clients. 2017-12-23 21:48:59 +01:00
reaperrr
fbc18dfb18 Use HashSet instead of IEnumerable to pass actors to renderable lists 2017-12-23 17:56:11 +00:00
reaperrr
04fb0f209d Spatially partition some actor overlays 2017-12-23 17:56:11 +00:00
reaperrr
6ef95405bf Split overlay renderable generation to separate list
To make the code a bit more readable and consistent with normal renderables.
2017-12-23 17:56:11 +00:00