Author Topic: OP2 Mission Editor  (Read 3178 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4873
Re: OP2 Mission Editor
« Reply #50 on: January 25, 2020, 04:22:26 PM »
I was just thinking, the OP2Helper library allows defining a ResourceSet, which consists of 3 levels of Resources. A resource level within a set may be selected based on the difficulty setting, and specifies the exact values for each resource. That allows a developer to set starting resources for all difficulty levels, without doing math in their head. That might be a little easier to use than a base resource level plus modifiers.

Offline TechCor

  • Full Member
  • ***
  • Posts: 118
Re: OP2 Mission Editor
« Reply #51 on: January 25, 2020, 07:04:18 PM »
There's an issue where units/structures/tubes/walls are all considered "resources", and obviously those have to have unique positions. That means they must be duplicated per player for each difficulty (and possibly per variant, if we are talking about that, too). This has all sorts of negative side effects for ease of use and file size. Duplication was how I first implemented difficulties.

To put things in perspective, I imagine a typical mission might have 3 variants with 3 difficulties per player. That's 9 different settings per player. 6 players = 54 resource sets to modify if they decide to tweak the numbers (or units!). Consider that standard multiplayer maps aren't the only use-case and resources could be different per player (ex: AI).

By using base + modifiers it becomes easy to quickly adjust multiple settings at one time, especially units. You maintain the flexibility of being able to modify all variants/difficulties individually without sacrificing the ease-of-use of just setting everything at the base level.


I understand it's not intuitive in its current form. I'm thinking that this is more of a presentation issue. Perhaps a label next to the input field with "+500" and/or "1500 total" on modifiers would be acceptable, which solves the "math in the head" issue. Maybe changing the input field color could indicate that you are on a modifier vs the base.

For units, the editor already "grays out" units that will be spawned for a difficulty/variant but belong to "all difficulties/variants" when a specific modifier is selected.

Finally, I will be adding a "help" menu option with documentation at some point that covers important topics like this.


Side note: I appreciate the feedback. This was very helpful even if I don't agree with the specific solution offered.


EDIT:
Here's a diagram if it helps people understand a bit better without reading a wall of text!



NOTE: Disasters and triggers will probably run through this same system.
« Last Edit: January 25, 2020, 09:04:52 PM by TechCor »

Offline TechCor

  • Full Member
  • ***
  • Posts: 118
Re: OP2 Mission Editor
« Reply #52 on: January 29, 2020, 07:29:38 AM »
Added ability to paint walls and tubes, and structures now render bulldozed terrain and tubes to more accurately represent the appearance in the game.

Version 0.5.0:
https://github.com/TechCor8/OP2MissionEditor/releases/tag/0.5.0


Changes:

    - Made terrain pane tiles same size as vehicles/structures
    - Windows will sort to top when clicked
    - Menus will activate on mouse over if another menu is already open
    - Added Help menu with links to Outpost Universe, the forum, and the editor GitHub repository
    - Added About Dialog with version information
    - Added Walls/Tubes pane
    - Added bulldozed tiles and tubes for structures

Upcoming:

Slowly rolling towards feature complete. The next major feature is the trigger system. This is going to be set up using an "Event, Condition, Action" style and will be applied per variant/difficulty using the same rules shown in the previous post. Aiming for maximum flexibility while still being easy to use. The intent is to be something like:

Event:
On Game Mark [50]
On unit entered region [Name]

Condition:
[CurrentPlayer] food [less than] [5000]
[CurrentUnit] health [greater than] [50] percent.
Game Mark [greater than] [35]

Action:
Kill [CurrentUnit] (Could also be a unit ID)
Kill units in region [Name]
Spawn [UnitType] in region [Name]
Add [1000] food to [CurrentPlayer].
Wait [25] Marks
Repeat Trigger

I'll have to come up with a comprehensive list. DotNetMissionSDK doesn't have this system set up yet, so that will get done first before the editor.

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 953
Re: OP2 Mission Editor
« Reply #53 on: January 30, 2020, 09:43:10 PM »
I'll have to try it out again here soon. I like the idea of auto painting walls and tubes. That is something the previous map-maker does not allow.

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4873
Re: OP2 Mission Editor
« Reply #54 on: February 02, 2020, 07:57:29 AM »
Sounds pretty neat.

I'd sort of like to give this a try, though not really sure how or if it can be done from Linux.

Offline TechCor

  • Full Member
  • ***
  • Posts: 118
Re: OP2 Mission Editor
« Reply #55 on: February 02, 2020, 09:14:10 AM »
I can build the editor to Linux, but the OP2UtilityForC project needs to be built as a Linux library. However, I don't know how to compile to Linux, or if it can be done from Windows. Without it, the editor can't render or modify .map files, which is kind of essential...

Although rumor has it that Linux can run Windows DLLs through some kind of interpreter. WINE or something.

Here's a Linux version of the editor. I dropped the OP2UtilityForC dll in the root directory, but it probably won't work.
https://github.com/TechCor8/OP2MissionEditor/releases/download/0.5.0/OP2MissionEditor_Linux64.zip

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 953
Re: OP2 Mission Editor
« Reply #56 on: February 02, 2020, 06:12:57 PM »
I can't tell if you are serious or joking about the WINE comment! Most Linux users run Outpost 2 using WINE and it seems to do a decent job. You might actually be able to run this in Wine. It would maybe help to target older versions of the .net framework in case WINE lags some from the most recent release...

If you want to formally support Linux, I would recommend adding an automated build using circleci. It would require crafting a makefile first though. Maybe Hooman could help with the initial setup. At the conclusion of a successful post build script you can have circleci save the build artifacts, which would give you access to the Linux build. OP2Utilty has a sample circleci setup you could use as a template if interested.

I'd be curious to see how the .net core Linux build goes. I have some .net core experience, but not with a Linux build.

-Brett

Offline TechCor

  • Full Member
  • ***
  • Posts: 118
Re: OP2 Mission Editor
« Reply #57 on: February 03, 2020, 02:16:18 AM »
I can't tell if you are serious or joking about the WINE comment!
I'm half-joking. I've met hardcore Linux users before (maybe all Linux users are hardcore?), Wine always comes up as the way to get Windows apps running on Linux. It makes sense for it to be a big deal since the Linux market share is too small to get dedicated development support for major applications. Personally, I've only dabbled with Linux to check some cross-platform applications. Never used Wine.

If you want to formally support Linux, I would recommend adding an automated build using circleci. It would require crafting a makefile first though. Maybe Hooman could help with the initial setup. At the conclusion of a successful post build script you can have circleci save the build artifacts, which would give you access to the Linux build. OP2Utilty has a sample circleci setup you could use as a template if interested.
I have no idea what you are talking about here. Seriously.

I'm sure a Linux expert could get this up and running in about 15 minutes because technically the editor core already builds to Linux, and OP2Utility seems to already build to Linux, so the only thing that needs to be done is build the OP2Utility C wrapper to Linux and drop it into the editor.

The OP2 Utility C# wrapper might need to be tweaked to read .so instead of .dll, but I think I have it set up right.

EDIT:
Just want to add that the editor runs on Mono, which takes care of the C# stuff.
« Last Edit: February 03, 2020, 02:20:07 AM by TechCor »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4873
Re: OP2 Mission Editor
« Reply #58 on: February 03, 2020, 07:23:43 PM »
I don't know how well Wine works with newer .NET stuff, though that may be a possibility.

I know a lot of C# stuff can be compiled natively for Linux. I would like to go that route if possible. I'm no expert on C# though, so I'm not sure what the process is. I don't even see a project file for OP2MissionEditor.

Any sense of how the project might be built outside of the IDE on Windows?

If I can get it working, I wouldn't mind trying to configure a CircleCI build for you. We have that, and AppVeyor, setup for other projects. Just push changes to GitHub, and it'll compile the code on all configured platforms, and let you know about any build failures. We even started adding artifact uploading and automatic GitHub releases. Push a git tag, and the Continuous Integration builds will automatically create binaries and upload them as a new GitHub release.

Offline TechCor

  • Full Member
  • ***
  • Posts: 118
Re: OP2 Mission Editor
« Reply #59 on: February 03, 2020, 09:07:25 PM »
The OP2MissionEditor already builds to Linux through Unity. We can come back to this later, but you can't build "outside the IDE". Although I think they have a Linux IDE now. Not 100% certain.

Let's focus on the critical part of why it doesn't work. The project you should be looking at is OP2UtilityDotNet. Specifically, the project in the folder "OP2UtilityForC". This is just a C wrapper for OP2Utility. I need a Linux library (.so) generated from this project.

That library gets dropped into the OP2MissionEditor project as a plugin.

EDIT:

If you are interested in Unity for Linux:

https://blogs.unity3d.com/2019/05/30/announcing-the-unity-editor-for-linux/
« Last Edit: February 06, 2020, 05:22:52 AM by TechCor »