Commit Graph

5783 Commits

Author SHA1 Message Date
Paul Chote
178b6b658d Remove broken DEV_VERSION warning.
This (before it was broken) was hardcoding upstream policy-specific
conventions into the core engine.
2018-05-20 13:55:10 +02:00
Paul Chote
9073249fe4 Fix player connection notifications.
New player notifications are now never reported to the joining player,
and always reported in the dedicated server output.
2018-05-20 13:55:10 +02:00
Paul Chote
c77051790a Fix spurious "This isn't a server order" logging on player disconnect. 2018-05-20 12:35:58 +02:00
Paul Chote
82e2595beb Enable comment and whitespace parsing where it is useful. 2018-05-12 16:42:54 +02:00
Paul Chote
df31690332 Extend MiniYaml parser with new features:
- Add support for escaping '#' inside values
- Add support for escaping leading and trailing whitespace

And when discardCommentsAndWhitespace is set to false:
- Add proper support for comments
- Persist empty lines

Whitespace and comment support requires an explicit opt-in because
they produce MiniYamlNodes with null keys.  Supporting these through
the entire game engine would require changing all yaml enumerations
to explicitly check and account for these keys with no benefit.

Comments and whitespace are now treated as real nodes during parsing,
which means that the yaml parser will throw errors if they have
incorrect indentation, even if these nodes will be discarded.
2018-05-12 16:42:54 +02:00
reaperrr
45ee4ad4cf Move IOccupySpace interface right above IPositionable in TraitsInterfaces 2018-05-07 19:40:07 +02:00
reaperrr
3c34330925 Skip check for ITemporaryBlocker entirely if rules don't contain any temporary blockers
This benefits all mods without temporary blockers like gates or energy walls.
2018-05-04 19:40:18 +02:00
reaperrr
a52e83ca49 Add Locomotor lint check 2018-05-03 10:49:21 +02:00
Paul Chote
bf4b91741a Ignore unused frames when loading Sequences into Sheets. 2018-05-02 09:59:03 +02:00
Paul Chote
d9fd0f272c Add support on-demand sprite frame loading.
Passing the getUsedFrames argument will cause frames to be buffered
locally (and not added to the SheetBuilder) until they are explicitly
requested. This allows unused frames in sprite files to be skipped
instead of wasting space in GPU memory.
2018-05-02 09:59:03 +02:00
Paul Chote
91295f9c68 Add IReadOnlyFileSystem.IsExternalModFile. 2018-05-01 00:46:57 +02:00
Voidwalker
0c30a1d670 Fix projectiles to use IRulesetLoaded properly 2018-05-01 00:16:58 +02:00
Paul Chote
952f41b4e4 Add --dump-sequence-sheets Utility command.
This can be used to debug and optimize the texture
data that is uploaded to VRAM.
2018-04-30 02:05:43 +02:00
RoosterDragon
7bc5bd5791 Force buffered sheets to commit data to a texture on buffer release.
Previously ReleaseBuffer did not immediately null out the buffer, instead the releaseBufferOnCommit flag allows it to be nulled when the texture is next access and the pending changes from the buffer are committed to it. Now the texture is committed immediately, thus the buffer is null once ReleaseBuffer returns.

Once loaded, we force a GC to reclaim temporary memory used during loading. Previously the buffer would not be null as it was pending commit to the texture and thus could not be reclaimed. As soon as we rendered the first frame, the buffer is nulled but we are now in a low GC state - and the buffer will not be reclaimed until the next gen 2 GC which may be dozens of minutes away.

This change ensures the buffer is null in time for the post-load GC, and thus can be reclaimed before we start rendering.
2018-04-29 18:11:48 +02:00
reaperrr
ccd070afd6 Make IRenderModifier require explicit implementation 2018-04-29 11:59:49 +01:00
reaperrr
06dbf71461 Make IStoreResources require explicit implementation 2018-04-29 11:59:49 +01:00
reaperrr
cc4c5a5492 Make IVoiced require explicit implementation 2018-04-29 11:59:49 +01:00
Paul Chote
da29250711 Move PlayerResources to Mods.Common. 2018-04-28 20:42:10 +02:00
reaperrr
18ed04eab5 Only use largest blocker instead of largest actor for projectile blocker overscan
Before this, we unconditionally used the largest OuterRadius of all actors inside a mod for overscanning of blockable projectiles.
However, in many mods the only blockable actors are 1-cell walls, and even if there are gates like in TS, they usually aren't the largest actors in terms of hit-shape.

So this measure should save a bit of performance by reducing the overscan radius of blockable projectiles, especially in mods where walls are the only blocking actors.
2018-04-22 10:55:23 +02:00
abcdefg30
dd080eb882 Fix bridges not being targetable by enter activities 2018-04-12 17:04:57 +02:00
Chris Forbes
dddd057e3d Add IPositionable.CanExistInCell
This is like CanEnterCell, but doesn't take into account conflicting
actors, etc.
2018-04-10 01:01:53 +02:00
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