Author Topic: op2ext major rewrite  (Read 9196 times)

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
op2ext major rewrite
« on: September 24, 2019, 06:19:45 AM »
Hooman and I have been tag-teaming a major re-write of op2ext (well actually mostly Hooman with myslef adding a bit of code here and there).

The most important change is the concept of built-in modules. These are modules baked into op2ext's source code as opposed to existing externally like the ini modules and console modules.

IPDropDown was rewritten to be the first built-in module.

I think new patches to Outpost2.exe will be made via built-in modules instead of direct patches to the executable. I'd like the garage fix required for the mission OnTheRun (as discovered by Pente) to be the next built-in module.

In theory, many of the existing hardcoded patches could be pushed into built-in modules and completed by real time edits to Outpost2.exe when loaded. This provides much better documentation on what is patched than the current method.

Also, whether built-in modules are in use or not can be toggled within the Outpost2.ini file. So if you no longer like the IPDropDown, you can just turn it off.

It looks like we may end up allowing multiple console modules to be loaded as well. Many other minor improvements are involved that most people won't care too much about.

Please use this thread or Github directly to ask questions or make comments on the work.

https://github.com/OutpostUniverse/op2ext

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: op2ext major rewrite
« Reply #1 on: September 25, 2019, 02:06:34 AM »
I was just looking at the GitHub insights page for that project. There has been a lot of activity:
https://github.com/OutpostUniverse/op2ext/pulse

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: op2ext major rewrite
« Reply #2 on: October 06, 2019, 05:18:07 PM »
Just a quick reply. Significant work towards op2ext has continued. It has basically turned into a rewrite of the entire project that is still ongoing.

With the benefit of unit tests that we laid in earlier and now 2 test module projects to test cross dll calls, we have hopefully retained the core functions of op2ext without breaking anything unexpectedly (caveat is some known issues are still peculating that we know need to be resolved).

I was hoping to see some more modules rewritten, but all the time has been spend on the core of op2ext. Not a bad thing, just not what I had expected.

We made our first use of std::string_view a new C++17 library item that seems to be handy in certain circumstances instead of passing a std::string.

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: op2ext major rewrite
« Reply #3 on: October 07, 2019, 01:55:19 AM »
Hmm, educational if a little confusing ???

Quote
pec·u·late
/ˈpekyəˌlāt/

verb  FORMAL
gerund or present participle: peculating
embezzle or steal (money, especially public funds).
"the people accused them of having peculated the public money"



As for the extensive refactoring, dare I say parts of that project are actually beautiful to look at now. Modern too, with good use of C++ features, rather than all raw C pointers.

At this point, the project has some reasonably extensive unit tests, so we can quickly check the quality of new changes. The code base also seems much more flexible about accommodating changes now.

Though that is a good point about writing more modules. We still need to write up the garage save/load bug fix. I believe there were others.

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: op2ext major rewrite
« Reply #4 on: October 07, 2019, 06:20:21 PM »
Ha ha, peculating was a major typo. I meant percolating.

I think the garage bug is the top on the list. Whether we get to re-writing the hard-coded changes as modules or not I'm not sure.

There is also the 'click the convec at the correct time to build a structure without tying up the convec bug' that could be investigated.

I've also seen some people recycle spacecraft parts without losing the spacecraft part that could be patched...

It is certainly better, although I'm not sure about beautiful. No one has ever described code I've worked on that way, (although a lot of the rewrite wasn't done by me, so maybe it is correct  :P ). The code could be more concise if we were not beholden to some of the initial design decisions, although I suppose most any project that has been around a while can claim this.

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: op2ext major rewrite
« Reply #5 on: October 13, 2019, 06:38:03 PM »
Those are all worth opening GitHub Issues to track. I see you've already added one for the Garage save/load bug. We may actually get to that soon. Most of the other important work seems to be winding down.