[engine] Spring update February 2016

[engine] Spring update February 2016

Happenin' news on what is happening in the community. Content releases, new tutorials, other cool stuff.
Post Reply
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

[engine] Spring update February 2016

Post by hokomoko »

What's that? an update? about spring? yes it is!
So let me give you a taste of what happened lately and what you can expect in the next version:

Graphics
This release had huge amount of graphic improvements and changes both visible and under the hood.
Amongst the neat things you can expect are splat detail normal textures for maps (thanks Beherith!):
Image
(Image from Zed by The Yak)

No less exciting is a grand overhaul of features and unit drawing by Kloot, allowing the use of custom shaders with features and other new and powerful possibilities open to Lua.

Lua
Lots of new things here as well, I'll mention the new ability to change the damage table of a unit’s weapons (previously only possible in the WeaponDefs) or even projectiles in flight!

Bug fixes
During the past month a record breaking 63 mantis issues were marked as resolved!
In other words we're currently fixing bugs much faster than new ones are introduced :)

Forecast
Spring is coming :D
An RC is expected soon, but as far as I am aware the latest test versions are remarkably stable and testing would be appreciated.


Interesting bits that I did lately
A few years ago spring had ellipsoid collision volumes. Back then explosion damage was calculated according to the distance between the explosion centre and the centre of the damaged unit. In that system, when projectiles hit highly eccentric ellipsoids far from their centre a unit could be hit but receive no damage!
The obvious solution was to change damage calculation to check the distance between the explosion centre and the surface of the damaged unit. While that's very easy to calculate for boxes, cylinders and spheres it's surprisingly hard to do so for ellipsoids!
This problem had an obvious solution as well: Removing the option to use ellipsoid collision volumes.
Anyway, a few months ago I decided to research this issue. While calculating the exact distance from an ellipsoid is difficult, there are several method of getting a decent approximation. After comparing a bunch of them I've found a promising one based on Newton's method, which in layman’s terms means that you make an educated guess on what's the closest point on the ellipsoid's surface to the explosion centre and then you improve this guess over a few iterations.
Image
How accurate is it? In tests with random points and ellipsoids the mean relative error is ~0.5% after only 2 iterations!
Less than 1% of the test cases require more than 6 iterations and the engine currently caps it in 10 iterations.
How fast is it? While it's pretty fast, especially when considering it's an approximation of a very complex computation, other collision shapes are significantly faster so try to use them if possible.
How cool is it? 10/10 would implement again :)

That’s it for this update, contact me in the lobby if there’s something you’d like me to write about next time.

gl&hf,
hoko.
Attachments
zed.jpg
(172.98 KiB) Downloaded 5 times
ellipsoid.jpg
(43.51 KiB) Downloaded 5 times
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: [engine] Spring update February 2016

Post by jamerlan »

Awesome! Thanks to all devs!
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: [engine] Spring update February 2016

Post by Super Mario »

No mention of improvements on the windows side when it comes to development?
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: [engine] Spring update February 2016

Post by PepeAmpere »

Promising news :) What I miss is expected date of the release.
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: [engine] Spring update February 2016

Post by lamer »

Lua
Lots of new things here as well, I'll mention the new ability to change the damage table of a unit’s weapons (previously only possible in the WeaponDefs) or even projectiles in flight!
Any pitfalls for native AIs?
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: [engine] Spring update February 2016

Post by hokomoko »

lamer wrote: Any pitfalls for native AIs?
I don't think I've made the functions to grab that info, but essentially that depends on the game and how often it makes use of this feature.
If the game doesn't use it, current AIs should function the same in that regard.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: [engine] Spring update February 2016

Post by Jools »

Awesome. Thanks also for writing this post to keep us other downstream á jour with what's happening on the front.
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: [engine] Spring update February 2016

Post by lamer »

I don't think I've made the functions to grab that info, but essentially that depends on the game and how often it makes use of this feature.
That'll make AIs utterly blind to dynamic units. Consider Zero-K and its dynamic commanders.
If the game doesn't use it, current AIs should function the same in that regard.
I'm sure those abilities were added not because games won't use it (was there a request to ignore/break (Unit|Weapon)Def?).

Any idea how to keep AI interface in sync?
The problem is new OO AI interface wrapper is a burden (imho) to support: WeaponDef and Weapon can't return same Damage object/table. So it should break into:
1) WeaponDef::GetDamage -> Damage (unchanged)
2) Weapon::GetWeaponDamage - >WeaponDamage (same as Damage, only name differs)
3) Unit::GetExpDamage -> ExpDamage (dynamic bombs? same as Damage, only name differs)
4) Unit::GetSelfdDamage -> SelfdDamage (same as Damage, only name differs)

And a specific event EVENT_UNIT_ATTRIBUTE_CHANGE:

Code: Select all

struct SUnitAttributeChangeEvent {
  int unitId;
  enum {WeaponDamage, ExpDamage, SelfdDamage, Range, Speed, Autoheal, Whatelse} attribute;
};
Hmm, but maybe i overreacted and should wait for some other opportunity to break existing AIs.

WRT other 101 changes: Awesome, great, missing "lol +1" button!
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: [engine] Spring update February 2016

Post by hokomoko »

lamer wrote:That'll make AIs utterly blind to dynamic units. Consider Zero-K and its dynamic commanders.
Making the functions should be trivial, and I think AIs could poll to get an updated damage table a frame after the commander is created (morphs kill a unit and create a new one)
raaar
Metal Factions Developer
Posts: 1094
Joined: 20 Feb 2010, 12:17

Re: [engine] Spring update February 2016

Post by raaar »

Good work.
Post Reply

Return to “Community Blog”