![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
07-07-13, 10:53 AM
|
#1 | |
|
Black Magic
![]() |
Quote:
![]() Yes it's a very simple measure to add sensors to them via their .sns file. The question is will the game recognize them? There are many strange things coded in SH5, this could be one of them. I tracked down why the type 500 units (subnets and minefields) aren't recognized by the game and it's because the game doesn't store a list of them (the devs coded it so the game reads the files in but does nothing with them). That is why the mission editor says platform x not found in platforms library
|
|
|
|
07-07-13, 12:14 PM
|
#2 | ||
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
![]() Quote:
|
||
|
|
07-07-13, 12:36 PM
|
#3 |
|
Black Magic
![]() |
I setup a single mission with an airbase, one victory cargo, and one VIIC sub (me). Hit a bookmark in the code where it iterates over all the units in the game. I was thrilled to see that the there were 3 units in the list (all 3 I had defined in the single mission) and upon investigating the second one (the airbase) I saw it was missing a pointer in one of it's memory addresses (it's a pointer to a type of Commanders controller). Without this pointer it will never use any sensors it has (any of them defined in the .sns file) and it will probably never fire any weapons given to it in it's .eqp file because this controller is missing (this controller is responsible for detecting contacts). I opened up it's .dat file and sure enough there is no commander controller specified in the .dat file. That explains why this pointer is missing
![]() I let the game continue running till it hit the bookmark for checking for airstrikes. This is where I'm at currently and seeing if I can make the airbase spawn aircraft based on units in the area within a certain radius of the airbase having a contact. If the unit within the radius of the airbase has a contact then I'm going to try and make the airbase spawn a unit to investigate the contact. |
|
|
07-07-13, 01:10 PM
|
#4 |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
|
|
|
07-07-13, 02:04 PM
|
#5 | |
|
Black Magic
![]() |
Quote:
) and there is a LOT of memory eaten up by each commanders controller (over 200 bytes each + bytes for the support stuff it creates)I've come up with a clever solution! When the game checks for airstrikes it iterates over all the units and finds those units with airgroups defined. Every unit it finds that has an airgroup is added to a list. Then that list is iterated over and each item of that list is checked to every unit in the game: - comparing sides - comparing distances between them If they meet the parameters then the game unit is added to the unit with airgroup's defined list of units to do airstrike against. Then the unit with airgroup list of unit's to do airstrikes against is iterated over and airstrikes commence. I'm inserting some code in here that will check to see if unit with airgroup is an airbase. If so then each game unit to commence airstrike on will be checked against all units in game to see if any of them have this unit as a contact. If so then each one will be checked to see if it radioed about it's contact (random number). If the game finds it did radio about it's contact then an airstrike will commence on the unit (plane(s) will be spawned from the airbase and given the waypoint of the unit). If not then the normal airstrike will be done (which spawns a unit in a random location around the contact and gives it random waypoints). Elegant, simple, and brilliant if I do say so myself
|
|
|
|
07-07-13, 03:15 PM
|
#6 |
|
Captain
![]() Join Date: May 2011
Posts: 489
Downloads: 106
Uploads: 0
|
Can't wait to test this out!
![]()
|
|
|
07-07-13, 05:16 PM
|
#7 |
|
Ace of the deep .
|
Re: sending a scout plane . IN sh4 Uboat missions you click on an air base icon and that brings up the waypoint pen . Click the nav map to place a waypoint on the navmap and a plane travels to that spot and patrolls an area i guess . Everytime you click on the air base it shows the scout plane waypoint and you can change the planes waypoint . I can see the planes icon on the map updated every so often as it heads to its destination . If i click on the planes icon it shows up the planes type , course , speed . If i click a patrol location that is too far away a message will say not enough fuel to reach the waypoint for the scout plane . Message display when new scout sent or scout changes course . Now i am not sure what the waypont is for . The scout plane goes in the general direction of the waypoint i created but goes randomly around it . In the mission editor there is a german plane called a shipborne searchplane . What does RevealEnemyConvoys in the special abilities in SH5 do ?
Last edited by THE_MASK; 07-07-13 at 05:51 PM. |
|
|
07-07-13, 05:25 PM
|
#8 |
|
Black Magic
![]() |
I already have been
![]() All the code changes/additions were made and I began testing. I setup a single mission with a small airbase, a victory cargo, and a VIIC. I let the victory cargo detect me. When he did he radioed it in and sure enough the small airbase dispatched 3 fighters towards me ![]() A little more tweaking to do and I'll be releasing new version of the Generic Patcher. |
|
|
07-08-13, 09:59 AM
|
#9 |
|
Black Magic
![]() |
For electric engines this is how the game calculates theoretical maximum speed for given bell:
XMM registers can be thought of floating point registers for this discussion My sub was a VIIC. I asked for a forward bell (ahead slow - 1). I was submerged thus using electric engines. Engine ratios patch disabled. XMM0 set to 0.0 load 1.0 into XMM2 load value into XMM1 dealing with current engine type in use (for electrics this is 3.913995) multiply XMM1 by ordered bell (engine ratio asked for) load XMM1 into XMM0 add XMM2 to XMM0 divide XMM0 by engine type in use value (for electrics this is 559500.0) multiply XMM0 by engine type in use value (for electrics this is 7432.328) multiply XMM0 by XMM1 multiply XMM0 by XMM1 raise XMM0 to the power of 0.3333333 (XMM0^0.333333) multiply XMM0 by engine type in use value (for electrics this was 30.99133) XMM0 contains theoretical maximum speed for ordered bell (for this it was 7.56) for that engine (done for each engine) Actual speed attained ~ 1.5 knots I'll post a reverse bell on electrics in next post Last edited by TheDarkWraith; 07-08-13 at 10:19 AM. |
|
|
07-08-13, 10:17 AM
|
#10 |
|
Black Magic
![]() |
Reverse bell on electrics. Dead back slow - 1:
XMM0 set to 0.0 load 1.0 into XMM2 load value into XMM1 dealing with current engine type in use (for electrics this is 3.913995) multiply XMM1 by ordered bell (engine ratio asked for) load -1.0 into XMM3 load XMM1 into XMM0 change sign of XMM0 add XMM2 to XMM0 divide XMM0 by engine type in use value (for electrics this is 559500.0) multiply XMM0 by engine type in use value (for electrics this is 7432.328) multiply XMM0 by XMM1 multiply XMM0 by XMM1 raise XMM0 to the power of 0.3333333 (XMM0^0.333333) multiply XMM0 by engine type in use value (for electrics this was 30.99133) multiply XMM0 by -1.0 XMM0 contains theoretical maximum speed for ordered bell (for this it was 7.56) for that engine (done for each engine) Actual speed attained ~ 1.5 knots |
|
|
07-08-13, 10:24 AM
|
#11 | |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
|
|
|
|
07-08-13, 10:43 AM
|
#12 |
|
Black Magic
![]() |
|
|
|
07-08-13, 10:46 AM
|
#13 |
|
Black Magic
![]() |
v1.0.126.0 released. See post #1
Starting with v1.0.126.0 Revised the Engine ratios patch to fix bug of AI sub's battery capacity being incorrectly reported to the game |
|
|
07-08-13, 10:49 AM
|
#14 |
|
Count Dracula
|
__________________
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
