Author Topic: Quick question on speed and target acquisition  (Read 3864 times)

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Quick question on speed and target acquisition
« on: April 17, 2013, 02:36:49 pm »
So I've been modeling ship combat for a re-balancing pass I'm working on and I came across two odd points:

1) Does it really take 4 seconds for something to acquire a target, if it has no target to begin with?  I had a MLRS Guard Post with nothing in range and I stuck a Mark II Heavy Bomber Starship right on the edge of its range.  Then I charged in and it took a full 4 seconds before the MLRS started shooting back.  It only took 8 seconds to get into range so needless to say acquisition reduced the free shots of the MLRS by 50%.  This was on Normal speed.

I did have about 50 other ships in the system pot shoting the random surviving AI units in the system, but there weren't more than 100 total ships, and no other fighting going on in any other system.

2) Just roughly measuring out the movement speed, the Heavy Bomber Starship has a Speed of 110 and a range of 2,500.  The MLRS Guard Post has a range of 15,500.  So total the starship needs to cross 13,000 units of space, which it did in 8 seconds.  That requires a slightly strange x14.77 multiplier to speed.  Does that sound right?  If I give myself a half second margin of error, the multiplier would be anywhere between 13.9 and 15.75.  At Normal speed, does that sound remotely close?  This was with no other speed effects in play.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick question on speed and target acquisition
« Reply #1 on: April 17, 2013, 02:44:52 pm »
1) Does it really take 4 seconds for something to acquire a target, if it has no target to begin with?  I had a MLRS Guard Post with nothing in range and I stuck a Mark II Heavy Bomber Starship right on the edge of its range.  Then I charged in and it took a full 4 seconds before the MLRS started shooting back.  It only took 8 seconds to get into range so needless to say acquisition reduced the free shots of the MLRS by 50%.  This was on Normal speed.
Target-list-requests are throttled to prevent slowdown but generally if there's no heavy combat then they go through pretty fast (as you can see when an AI wave emerges within attack range of a big pile of turrets, etc).

But it may be that the guard post already had a target list which did not include the bomber starship, and because it already had one it had a lower priority to get a new one, etc.  It's also conceivably possible there's some reason the guard post was unable to fire on the starship until it was closer than the post's listed range.  I don't know off hand if any of those conditions might have obtained in that case.


Quote
2) Just roughly measuring out the movement speed, the Heavy Bomber Starship has a Speed of 110 and a range of 2,500.  The MLRS Guard Post has a range of 15,500.  So total the starship needs to cross 13,000 units of space, which it did in 8 seconds.  That requires a slightly strange x14.77 multiplier to speed.  Does that sound right?  If I give myself a half second margin of error, the multiplier would be anywhere between 13.9 and 15.75.  At Normal speed, does that sound remotely close?  This was with no other speed effects in play.
Speed and range are in the same units (pixels, at max zoom which is a scaling of 1.0) but as you found the actual listed speed and how many pixels it moves per second have an... interesting relationship.  I don't have the code in front of me right now so I can't tell you off the top of my head how it gets from one to the other.

If I had to guess, I'd say the movement speed is per-frame at the default 20 frames per second, but maybe it's actually per turn (at the standard 4 turns per second, 5 frames per turn) and it's the 2x movement speed multiplier on Normal Combat Style that's chipping in.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Quick question on speed and target acquisition
« Reply #2 on: April 17, 2013, 02:46:12 pm »
Hang on, you are working on a model for combat?

Is it by hand, or are you writing a program?



As for point one, I'm not certain, but some of the "throttling" in terms of stuff like target acquisition seems in part reliant on the performance profile set.
Again, not sure, you will need dev info about what goes into these types of "delays".

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick question on speed and target acquisition
« Reply #3 on: April 17, 2013, 02:50:07 pm »
As for point one, I'm not certain, but some of the "throttling" in terms of stuff like target acquisition seems in part reliant on the performance profile set.
Actually it isn't, the only thing that changes is the number of frames per turn and the number of turns per second.

Btw, if you're actually working on some kind of simulation, feel free to link against the C# dll in the game if that helps you in any way.  I doubt you'd be able to get the simulation itself going but the stats are all in there, etc.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Quick question on speed and target acquisition
« Reply #4 on: April 17, 2013, 03:02:05 pm »
Specifically it's Assembly-CSharp.dll in the AIWar_Data/Managed folder.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: Quick question on speed and target acquisition
« Reply #5 on: April 17, 2013, 03:17:21 pm »
Actually, that would be amusing to do, but I'm just using Excel to compare unit-vs-unit performance while I rescale it all to a new baseline (10,000 health Fighter is my base), reworked Armor system, reworked Hull bonus system including splitting hull size out from hull type.  If I have time, I'll crank in the old system because I'd like to do a comparison of how each ship match-up goes under each.  I'm trying to keep stuff reasonable close.  There is also an economic rework I'm playing with, but it is independant of the combat rework.  It is just kinda fun, so I'm entering the data for it in the same spreadsheet.

By the way, what is up with the build time multipliers for Marks, specially Mark V?  I got these to go from Mark I build time to Mark V:
I x1.000, II x2.000, III x3.985, IV x5.970, V x8.209.  It's odd that II isn't x4 and IV isn't x6, but its only a second or two different.  But V just seems way off.  Again, this is on Normal Speed/Normal Caps.

Here is an example of my WIP combat results page:


PS: Bah on not having number of shots in the debug export.  It's in the CSV export from the reference so I'm cross-referencing.  But that's pretty annoying.  Also sad there isn't anything that marks if a ship type scales with different cap settings.  I'm having to set that data by hand.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick question on speed and target acquisition
« Reply #6 on: April 17, 2013, 03:21:23 pm »
The build times are computed from the m+c costs for stuff built from a dock.  For "self-building" stuff (where you place it and it builds up to 100% before actitvating) we set that manually.

On the shots-per-salvo numbers I thought that would be present in the reference export (from the reference tab of the stats window) but perhaps not.  Anyway, if you give me a list of columns to add to the ref export it's not usually hard to add.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline orzelek

  • Hero Member Mark III
  • *****
  • Posts: 1,096
Re: Quick question on speed and target acquisition
« Reply #7 on: April 17, 2013, 05:56:02 pm »
Specifically it's Assembly-CSharp.dll in the AIWar_Data/Managed folder.

It would be actually tempting to use that to make some combat simulations.
I would have a question tho - from what I know you need to have parameters of dll functions to actually import them from dll. How I would get these?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick question on speed and target acquisition
« Reply #8 on: April 17, 2013, 06:01:03 pm »
Specifically it's Assembly-CSharp.dll in the AIWar_Data/Managed folder.

It would be actually tempting to use that to make some combat simulations.
I would have a question tho - from what I know you need to have parameters of dll functions to actually import them from dll. How I would get these?
I think .NET Reflector can probably read that dll pretty well: http://www.red-gate.com/products/dotnet-development/reflector/

It's got a free version, iirc, as it began as freeware.

You should be able to get method signatures, at least.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline orzelek

  • Hero Member Mark III
  • *****
  • Posts: 1,096
Re: Quick question on speed and target acquisition
« Reply #9 on: April 17, 2013, 06:07:08 pm »
Specifically it's Assembly-CSharp.dll in the AIWar_Data/Managed folder.

It would be actually tempting to use that to make some combat simulations.
I would have a question tho - from what I know you need to have parameters of dll functions to actually import them from dll. How I would get these?
I think .NET Reflector can probably read that dll pretty well: http://www.red-gate.com/products/dotnet-development/reflector/

It's got a free version, iirc, as it began as freeware.

You should be able to get method signatures, at least.

After a bit of clicking... I found an option in VS2010 named "Add reference...".
It pulls out much more than I expected. I'll take a look at the .NET reflector also.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick question on speed and target acquisition
« Reply #10 on: April 17, 2013, 06:12:31 pm »
After a bit of clicking... I found an option in VS2010 named "Add reference...".
Oh, right.  Sorry, I figured you were already to that point :)

Anyway, yea, there's not any special obfuscation, iirc.  Pre-Unity we actually shipped the .pdb symbols file with it too so that the game could give line numbers in error messages (the lack of that nowadays costs me a lot of time hunting things down, and some bugs just never get fixed because I can never find it in some of the non-reproducible cases), so the source code was basically right there if someone cared to see it.  I forget if the symbols file is in there currently.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Quick question on speed and target acquisition
« Reply #11 on: April 17, 2013, 06:22:02 pm »
Keep in mind that many of those functions will require Unity's stuff to be around for it to load up. However not all of them do, like some of the basic data stuff.
In fact, this technique is was I used to extract the reinforcement and defensive multipliers for each AI type.

Offline orzelek

  • Hero Member Mark III
  • *****
  • Posts: 1,096
Re: Quick question on speed and target acquisition
« Reply #12 on: April 17, 2013, 06:23:27 pm »
Actually mdb file is present. Not that I know how to get some info out of it :D

I'm usually coding not trying to see code made by others ;)
(ForegroundUnitType/ForegroundUnitTypeImmutable and associated enum :o )

Using above I think all the statistics would be available. I was actually looking to check if one could pull out actual function that calculates attack damage. That would actually make some simple simulated fights (like x ships vs y ships) possible and quite easy to do. Trying to involve range in all of that would be more involved I guess.
« Last Edit: April 17, 2013, 06:25:51 pm by orzelek »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Quick question on speed and target acquisition
« Reply #13 on: April 17, 2013, 06:27:52 pm »
Keep in mind that many of those functions will require Unity's stuff to be around for it to load up. However not all of them do, like some of the basic data stuff.
In fact, this technique is was I used to extract the reinforcement and defensive multipliers for each AI type.
Yea, ForegroundUnitTypeImmutable is what you're probably mostly interested in for balance purposes; just create an object of that type with the desired ForegroundObjectType and it will be populated with the values you probably care about.  In theory there could be some gotchas trying to do that without the rest of initialization having already been done, though.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Quick question on speed and target acquisition
« Reply #14 on: April 17, 2013, 06:32:57 pm »
ForegroundUnit is the base class that handles pretty much all of the "tooltippable" (mostly ships and structures, though things like the exo wormhole on AI homeworlds are also under this category) stuff you see "in the field". I am guessing the XType, XTypeImmutable, and X pattern is a way to simulate the typesafe enum pattern for "types of X"?
(the XType enum holding all the types, XTypeImmutable holding all of the "constant troughout the game" data associated with each type (max HP, weapon power, display name ID for the xml string lookup, etc), while the X holds each individual instance of the "ship" or whatever)

Anyways, yes, the ForegroundUnitType enum contains an entry for every "ship" type in the game.
Yea, there are a lot of them.  ;)