Author Topic: OP2 Mission SDK Version 4.1.0 in development  (Read 4970 times)

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
OP2 Mission SDK Version 4.1.0 in development
« on: December 01, 2019, 09:46:26 PM »
Hooman and I have been integrating some minor enhancements to Outpost2DLL, HFL, and OP2Helper that should at some point culminate into a formal release. All three projects have been touched so far. I will try and post a change log in the near future with what has been done to date.

If there are any community inputs (fixes that have been made, unreported bugs, or feature requests), it would be nice to express them soon before it firms up.

I know TechCor had some updates to HFL in his own repos that would be nice to open pull requests on to review. I think sirbomber may have had something as well and we were trying to get it setup on GitHub or something, but my memory of the details is hazy now.

I think this will be a non-breaking change with only one deprecation, so should be easy to slide into anyone's current mission development (if any is happening right now outside of a couple of my own pet projects)?

Also related, Hooman has written up Readmes for most of the projects. If you are looking to get started on programming a new mission, it would be a good read. The Level Template has been overhauled a bit as well.

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #1 on: December 02, 2019, 12:27:09 AM »
Yes, feedback would be very useful. In particular, the LevelTemplate project has updated instructions on how to use it. That should cover the software needed, with links, and the general workflow to get code compiling and testing new levels in game.

So far most recent improvements to the MissionSDK are pretty minor convenience changes. They have been starting to accumulate though, so they will eventually result in a new release. If anyone is doing any level development and they find rough corner cases, or things that are awkward or unpleasant to use, we'd love to hear about it so we could improve the experience. These can be really minor things, such as missing or poor documentation of a particular method, or awkward multiline code constructs for something you feel should be expressed as a single line, or functions with hard to remember parameters that are hard to read at the call site.

For an example of a recent change, to load a vehicle in a garage, it used to look something like:
Code: [Select]
truck.PutInGarage(0, garage.Location().x, garage.Location().y);

The first parameter, the 0, is not very self documenting as to what it means. It's actually the bay index. To improve readability we've introduced an enum for the bay index so the code can instead be written as:
Code: [Select]
truck.PutInGarage(Bay0, garage.Location().x, garage.Location().y);

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #2 on: December 13, 2019, 08:11:16 PM »
I was kicking around resolving an open enhancement in Outpost2DLL and snapping a chalk line on the next release.

Add static size checks https://github.com/OutpostUniverse/Outpost2DLL/issues/6

There is a proposal to merge OP2Helper into Outpost2DLL here: https://github.com/OutpostUniverse/OP2Helper/issues/22

Maybe it is best to make a smaller release before the major movement unless we are ready to dive into the major change.

Outpost2DLL
 * Bug: Fix documentation of RecordVehReinforceGroup to prevent a hanging bug within Outpost2.exe
 * Add a readme
 * Deprecate AllPlayers constant
 * Improve C++ standards compliance and readability of source code

OP2Helper
 * Add a readme
 * Add function CenterViewOn
 * Represent building bays as an enum

HFL
 * Improve Readme
 * Improve example level code to prevent save/load bug and use modern features of Outpost2DLL
 * Improve C++ standards compliance and readbility of source code

Now that I write it out, there are not as many changes as I thought, but it is something.

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #3 on: December 16, 2019, 06:46:14 PM »
Modest? I suspect there are quite a few changes hidden in those generic compliance and readability update points. Though to be fair, many of those are more about internal maintenance, rather than something the end user would see. A few things do update example code for end users though. Some of those changes may seem visually minor, but are perhaps significant in result. The HFL init change would be one of those.

Outpost2DLL:
There have been a few internal header improvements, making the individual header files more standalone. In particular, the OP2 macro now works for independent files. The enum definitions are now being included, rather than using a non-standard forward declaration.

HFL:
Remove excessive internal casting (fixes a few warnings flagged by Linux compilers)


I suspect if more people were developing levels, we would quite quickly produce a good number of small refinements.

Offline TechCor

  • Full Member
  • ***
  • Posts: 141
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #4 on: December 31, 2019, 08:10:21 AM »
Hey guys,

I created a pull request for HFL. I'd like to make it a sub-module for DotNetMissionSDK now that I know how to do that.

Also, if anyone has the spare time, it would be really useful to be able to get/set the guard post weapon type for kits in a convec. This seems like a very useful thing that doesn't appear to be possible right now.
« Last Edit: December 31, 2019, 09:57:13 AM by TechCor »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #5 on: December 31, 2019, 02:41:25 PM »
Oh sweet. Looks promising.

Would be useful to be able to set the weapon type for a kit in a convec. I sort of thought something like that already existed, though perhaps never merged to HFL.

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #6 on: January 01, 2020, 08:35:20 PM »
Thanks for adding the pull requests.

I added an issue to HFL for the requested feature of GET/SET for a guard post with paired turret in a ConVec. Might be beyond my skill to address, but I may take a crack at it at some point.

I had just finished preparing release 4.1.0 before all the activity in HFL started.

---

EDIT: Hooman, I tried adding Issues for HFL based on the discussion in the new PRs. For those issues, feel free to edit my posts if you want to clarify or better word what I jotted down.

Offline TechCor

  • Full Member
  • ***
  • Posts: 141
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #7 on: January 15, 2020, 01:24:50 AM »
I made OP2MissionSDK a submodule in DotNetMissionSDK.

Everything looks good!

Thanks for the merge, guys!

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #8 on: January 15, 2020, 05:50:17 PM »
I'm glad it worked out!

-Brett

Offline TechCor

  • Full Member
  • ***
  • Posts: 141
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #9 on: February 03, 2020, 08:15:18 AM »
Any way to teleport units / set their position?

If not, might be worth extending HFL to support this. There are many ways such a function could be useful.

This came up while I was creating a master trigger action list, and I don't see any way to do this.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: OP2 Mission SDK Version 4.1.0 in development
« Reply #10 on: February 03, 2020, 07:26:37 PM »
I'm not aware of anything specific. I assume just change the unit coordinates. Though I wonder if that might have unintended effects on weapons fire that was already in the air.