Outpost Universe Forums

Projects & Development => Projects => Topic started by: Crow! on April 07, 2019, 12:12:09 AM

Title: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Crow! on April 07, 2019, 12:12:09 AM
[EDIT] Watch the GitHub for current releases of PhaseShift: https://github.com/iICrowIi/OP2PhaseShift/ (https://github.com/iICrowIi/OP2PhaseShift/)


After playing the Plymouth, then Eden campaigns so much in the past year, I had some thoughts about what could be done within the game's engine to push out some more dynamic gameplay.  In my ideal scenario, the game will go through more different phases in the strategy, in terms of both military and base construction.  So, I spent some time yesterday and today trying to get those ideas as fleshed out as possible.

Most of the changes - including all of the military ones - can be done exclusively via changes to the tech tree file.  To that end, I have attached to this post my first attempt at making this work.  There are probably some balance issues that would have to be dealt with.  I also was limited from doing a couple small things I'd have liked to do (such as increasing the pre-upgraded Panther HP and changing the blast radius of some weapons via upgrades) due to technical limitations of the tech tree parser.  If anyone knows how to squeeze more out of it, let me know.

Below is a summary of the changes, and a description of what I think the net result of these changes would be for a scenario (whether single or multi player) where Eden and Plymouth square off against each other.  The first two changes are major game rules changes that, as far as I know, can't be implemented via the tech tree alone.

-------

Game rules changes that can't be done via tech tree alone:
Spent mines fall down to nearly zero output, requiring expansion to new, presumably harder to defend mining beacons as the game progresses.
Morale has a maximum permitted level based on how many morale relevant structures have been researched:
   - Base maximum: 45
   - Nursery: +5
   - University: +5
   - GORF: +5
   - Consumer Goods / Forum: +5
   - Medical Centers: +10
   - DIRT: +10
   - Recreational Facilities: +15

Both Colonies:
Tokamak cost up to 1500 (was 1100), MHD cost down to 800/400 (was 1000/500).
DIRT Procedural Review now changes Worker/Scientist requirement from 2/1 to 1/1 (was from 2/1 to 3/1 as a net downgrade).
Robo-Miners no longer become more expensive as new mining tech is researched.
   I believe the only reason they even did this was that SOME property of a unit must change for the upgrade text to show up on it.  The "change" will now be "The cost now = what it was before already."
Garage cost down to 900 (was 1500), construction time down to 1000 "points" (was 1500).
Guard post HP up to 750 (was 500) and explosion damage down to 200/200 (was 750/750).
Reinforced Panther Construction raises HP more 500->850 (was 500->750; Tiger is 800).  Research cost and scientist count increased to match new higher value.
Tiger chassis cost up to 1000+400 (was 750+250).
Advanced Robot Manipulator Arm tech's bonuses for Earthworker and Robo Dozer improved to 128->64 (was 128->96).
Hypnopaedia effect improved, for Eden 5000->3500, for Plymouth 5000->4000 (was 5000->3750 for eden, 5000->4500 for Plymouth).
Advanced Construction Materials research added: increases Wall HP 300->600.  Prereq = Enhanced Defensive Fortifications and Advanced Robot Manipulator Arm.  (I'm actually not sure what happens if two players with different wall HP amounts build walls that connect into each other...)

Plymouth:
Legged Robots tech has no prereqs.
Scorpions are a prereq for microwaves, rather than the other way around, and can be researched from the Standard Lab.
New upgrade: Scorpion Mobility.  Increases Scorpion movement speed from Fast to Very Fast.  Prereq = Arachnid Weaponry.  Researched at the Advanced Lab.
Scorpion Power Systems also increases range 2->4.  Requires Scorpions and Advanced Vehicle Power Plant.  Available from the Advanced Lab.
Arachnid Durability now upgrades Spider HP 100->150, and Scorpion HP 125->200 (was 100->125 and 125->150).  Now available at the Standard Lab.
Various research time costs have changed to support the new ordering: Legged Robots 1800->1600, Arachnid Weaponry 1800->1200, Scorpion Power Systems 1800->1600, Arachnid Durability 1800->1600.
ESG turning speed slower to 2 (was 11).
Electromagnetic Reverberations research added: EMP Penetration "damage" 255->320, for a better chance to land the disable.
Scout Class Drive Train research is now Plymouth only.  Eden gets a Lynx HP upgrade instead.
Extended Range Projectile Launcher upgrade is now Plymouth exclusive, while Grenade Loading Mechanism is Eden exclusive.

Eden:
Heat Dissipation Systems renamed to Thor Heat Dissipators.  Only affects Thors, and the effect is improved to 120->90 (was 120-100).
   This is to make room for newer, cooler upgrades for the other weapons.
Railguns no longer require Advanced Combat Chassis. (Still requires Independent Turret Power Systems, though.)
Increased Capacitance Circuitry now increases damage 80/40->120/60 (was 80/40->100/50).  Also, it gains Advanced Combat Chassis prereq to return that upgrade to its normal timing.  Also, it reduces the weapon's turning speed to 3 (was 11).
   The turning speed nerf is something I'd rather put into the weapon's base form, but I can't do that via tech tree changes alone due to the "only two techs can change a given unit or weapon" limitation.
Railgun Rifling research added: Range 6->8.  Prereq = Increased Capacitance Circuitry.
Light Tank Part Redundancy research added: Lynx HP up to 400 (from 300).  Prereq = Mobile Weapons + Reinforced Vehicle Construction.
Diode Lasers research added: Common cost 450->275.  Prereq = Efficiency Engineering + Heat Dissipation Systems.
Meteor Defense construction time down to 1100 (was 1800).
Precision Trajectory Projection Software's upgrade is now automatic with Meteor Defense's base research, but the base research takes longer.
Improved Launch Vehicle research cost 6000->4500

Tech tree cleanups:
Hot Cracking Column Efficiency removed.
Vulcanology awarded for free when Seismology researched.
Robotic Image Processing is removed, and its effects built in to the Scout and Light Post.
Consumerism research correctly identifies itself as having unlocked the Consumer Goods Factory structure kit instead of the University structure kit in the post-completion description.


Summary of new combat flow:

In low intial resource games, Plymouth can potentially get the first strike in if it sacrifices vehicle factory tech to rush scorpions.  However, unupgraded scorpions are so weak that the defender can probably survive until combat units are out with a combination of running away and scuttling units.  (Even a scout can kill a scorpion with proper micromanagement.)
Either way, Plymouth has to decide whether to commit to the new scorpion technologies or to skip that in favor of more traditional weapons.
Eden gets the next technological edge with the early completion of Railguns.  Though overcosted for their DPS, these weapons are longer range than anything else in the game until after a lot more research has been completed.
Next up should be the usual oppressive Plymouth midgame.  Stickyfoam has remained untouched, and in a long range battle, the ESG's turn rate nerf should have minimal impact.
As the game progresses, Eden will gain more cost efficiency in slow moving battles in the form of the railgun range upgrade, higher HP totals (whether from the lynx upgrade or from low-cost Laser Panthers), and the slight improvement to the Thor.  Plymouth will have more mobility, superior crowd control options, and more single-target dps once combat reaches short range.
EMP Missiles are still extremely opressive once Plymouth gains them, and with Eden's loss of the Lynx speed upgrade, dodging them is harder than ever.  Eden will have to use its power to secure positions for new Meteor Defense structures.
The Railgun and the ESG should do far worse if the enemy manages to get right on top of them, but both are extremely powerful in a stalemated situation.
It is my intention for more combat-relevant construction to occur.  Guard posts are better in both durability and liability (they'll do far less damage to your own units when destroyed, for example), walls can be upgraded, and garages and meteor defenses are easier to set up.
I expect Plymouth to be using garages to be more cost efficient with its hit and run missions, with ESG turrets behind walls when it needs to deny an area.  Eden will more likely put Railgun turrets in front, with meteor defense behind that.
Another major point: the total size of end game armies will likely be smaller due to the smaller amount of resources available in the first place.
Speaking of resources, I expect Plymouth will in general have an easier time moving its combat lines around to a secure a new mining location, but Eden might be better at actually assaulting an existing location.
Title: Re: OP2 Game Flow Redesign
Post by: Sirbomber on April 07, 2019, 11:29:32 AM
Have you checked out the files in sheets.vol that control mining and morale?  Not sure you'll be able to accomplish everything you want, but it would be a start.  You can also edit some of the other things you wanted to do (base Panther HP, for instance).  You just need Excel or an equivalent program capable of opening a comma/tab (I forget which one) separated spreadsheet file.
I do have some concerns about your proposed changes, though.  First of all, they really seem to favor Plymouth, which is already the "better" colony.  You've nerfed the Tokamak and buffed the MHD Generator, which makes sense for Plymouth, but the Tokamak is Eden's only reliable power structure as fumaroles aren't available on every map and, even if they are, they're often in the front of the base, where they're vulnerable to attack.  The only other option is the Solar Power Array, and let's look at the cost of that:Total: 6400 research points, 5500 common, 1700 rare.

Compare to Plymouth's MHD requirements:Total: 2200 research points, 800 common, 400 rare.
I'm also not exactly thrilled that you want to give Plymouth yet another early game rush option (bringing the total up to 3 options for weapons, while Eden is still stuck at 1).  I like the idea of Plymouth getting Scorpions early on, but I think it should be instead of getting the Lynx, rather than in addition to.  Instead, you're creating a scenario where Plymouth can research Scorpions immediately (since most maps have the player start with a Standard Lab), rush out an Arachnid Factory (which is cheaper and builds faster than a Vehicle Factory), and hit an Eden player before they've even got their Advanced Lab finished (which they need to research their own mobile weapons).  Sure, an Eden player can try to get a ton of Guard Posts very quickly, but any player worth their salt is going to run past those and head straight for the Command Center.  Futhermore, your balance changes do nothing to the most imbalanced thing in the game, Plymouth's EMP Missiles.

I'm not sure how I feel about mines "drying out" over time...  A lot of the existing maps aren't really set up to support that.  I wonder if it would be better to reduce the population requirements of smelters and factories to encourage players to build more Vehicle Factories, thereby requiring more Smelters?
I think some of the ideas here are good, but, and I mean no disrespect, while reading through them it was obvious to me you don't have a ton of multiplayer experience.  It might be a good idea for you to get in a few games with some of the veterans around here to get a better idea of where some of the pain points are for each colony.


As a final note, your wall HP change will desync a multiplayer game.  Walls aren't owned by anyone, and they don't really have HP so much as a chance to get degraded/destroyed with each hit.  If you change the HP value, you change that degrade chance, but only for the local player.  Long story short, if you upgrade your walls and I don't, on my game I'll shoot a wall 5 times and break through; on your game the wall will still be intact.
Title: Re: OP2 Game Flow Redesign
Post by: lordpalandus on April 07, 2019, 06:09:51 PM
Plymouth tends to be the better colony overall, so nerfing Eden moreso than it already was makes it even less likely players will play Eden.

The microwave weapon is far superior to the laser, even if the laser has independent power systems and microwave is still the default. Concussion damage is far more effective against lightly armored targets and lynxes are lightly armored in the early game. So, it generally takes 1.5 laser vs 1 microwave. Also, if you check the Morale.txt file, Plymouth has a higher upper limit on it's maximum morale than Eden does (believe eden max on easy is 100 and Plymouth 110).

In order to justify some of Eden's nerfs, I'd have to see some extra benefits for them as well. ie:

Eden's Tokamaks have stable and more reliable fusion. Their reactors do not degrade over time and produce +50 more power per reactor (or +100 with high temperature superconductivity). Then, that would make tokamaks are better early power generation and will help tide them over until they reach geothermal or solar.

Or another: Eden can build solar power plants without requiring a Spaceport. However, they only function during the day and auto-deactivate when it is nightfall. Launching a solar satellite will ensure it remains operational at all times.
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 07, 2019, 08:07:44 PM
Regarding other files in scripts.vol, my understanding is that the player has to externally swap out any changes to those files before the mission starts, except for the tech tree file, which the map itself points to.  If I'm wrong on that, or if there's a practical workaround, let me know; that would let me implement the mining beacon change and have more control over weapons and vehicles.

I kind of assumed that fumaroles would be available in most or all maps; if this is not correct, then I'd probably back off of the Tokamak cost increase.  It is true that I haven't played much multiplayer, so I'm not sure what the maps people use are like.  Solar power is so bad I forgot it even existed.  I'll give it a cost reduction for sure.

Something I guess I should highlight more clearly than the change list did: Plymouth's normal military gets delayed considerably because Microwave tech is blocked until Scorpion tech is done.  Scorpion attacks can probably come out sooner than Microwaves could have, but unupgraded scorpions can be killed by any self destructing unit (Scouts are the obvious choice) and noncombat vehicles can avoid like 80% of the incoming damge by simply moving away.  I think the rush can be held until lasers or microwaves come out without too much damage being taken.  I could be wrong.

I was actually under the impression that I was giving Eden's military significant improvements - early access to a passable weapon in the form of the Railgun, a later game role for Lasers (Laser Panthers in particular will be insane HP per metal spent), a later game role for Railguns (having the longest range weapon in the game is usually a huge deal in RTSes), a buff to the already good Thor weapon, and changes to make it more practical to set up Meteor Defenses to mitigate EMP missiles.  I could well be overestimating the usefulness of any or all of these things with their present numbers, but suffice it to say that I am aware that Eden is much worse than Plymouth, and addressing that was one of my design goals here.

Regarding morale, I noticed that Plymouth generally had higher morale, but never really knew why.  As a general rule, Plymouth's research topics take ~10% longer than Eden's do, possibly intended as a way to offset the morale difference.

Thanks for the information regarding wall upgrades.  I hadn't tested how walls interacted with multiple players yet.
Title: Re: OP2 Game Flow Redesign
Post by: Vagabond on April 07, 2019, 08:45:46 PM
Crow,

You are correct that each mission can specify a different tech tree. Some missions reference the same tech tree though. So if you are editing an existing tech tree it may affect multiple missions. Creating a one off tech tree for a new mission is easy and safe though.

To handle updating the game-wide sheets files, you can use the module manager built into op2ext (which is bundled with the official Outpost Universe release). Basically, the module manager allows adding modules by adding a command line argument specifying which mod is in use or through adding the mod's information to the Outpost2.ini file. Check out the op2ext readme on the repository for details: https://github.com/OutpostUniverse/op2ext

Basically, you can override the default location where Outpost 2 looks for game resources such as the sheets file. If you want the effects to be semi-permanent, you should embed it in the .ini file. If you want it to be quickly exchangeable, you should add it is a console module. I would recommend a console mod for what you are looking to do.

Check out sirbomber's multitek2 for an example of a console mod. While multitek2 is pretty cool, I'm not aware of any missions designed to use it that were fully implemented. There is a save bug in angelus' mission that uses it, not related to multitek2 at all and I always had trouble with the sandbox missions working for some reason, I think maybe they target an earlier version or I don't know what I'm doing, both possible.

You could even overwrite how tech trees work when the mod is loaded. So you could change the campaign tech tree or something. When the mod isn't loaded, Outpost 2 would default to the original tech tree(s) and sheets.

Hope that helps.

-Brett
Title: Re: OP2 Game Flow Redesign
Post by: lordpalandus on April 07, 2019, 09:16:52 PM
Something I forgot about Scorpions, that would make the Plymouth player nastier in the early game with them, is their EMP immunity. So, if the scorpions rushed your tokamaks, they could blow them up safely without getting emped. Whereas lynxes would get emped if too close, which is usually the case with laser/microwave. That would allow the player to obliterate all your power generation and effectively kill you.

The command center produces 50 power. Enough to power either the structure factory or the common smelter, or a structure factory and a common storage. If you had no common storage, you would be doomed as the moment you shut off the smelter, you'd lose all your stored common metals. If the Plymouth player noticed this, they might split off some of their scorpions to destroy your storages, while the rest focused on your tokamaks.

I believe in terms of costs, 300 common makes a Scorpion. 750 common makes a Laser Lynx. You could produce twice as many scorpions as lynxes, for the same price. Then have them split into two groups, with one as fodder for the lynxes to keep them busy and the other group to go after power and storage.

EDIT:

I do like many of the ideas you propose Crow!, but the issue is that Eden in Multiplayer rarely survives to mid-game, when they might be able to field Panthers. Plymouth generally will stickyfoam their lynxes, then circle wide around them and go straight for the Command Center. Any vehicle that approaches to try to kamikaze, would get stickied. Yes, Eden can be very powerful in the campaign and in colony missions, but that is because the Plymouth AI doesn't attack the player when they only have Laser Lynxes to defend theirselves with. They wait until you have Railguns, EMP, Panthers, and independent power systems. If they attacked when you lacked any of that, you'd get slaughtered.

A good case in point is Mission 3 in the Campaign for both factions. Both factions have unupgraded lynxes with base weapons. You encounter the same number of enemy lynxes. The Plymouth player can breeze through that mission, as their lynxes easily overpower the laser lynxes. But the Eden player has severe difficulty with their lasers, as they are on equal ground. The microwave weapon is superior to the laser, until the Laser gets heat dissipation, then lasers have higher rate of fire and thus have more damage per second than microwave, even if their microwave also has heat dissipation.

The only real way that Eden could survive to mid-game is to make Stickyfoam a mid-game weapon. Stickyfoam gives Plymouth a massive early advantage that has no counter, and once the enemy lynxes are stickied, just drive around them to get to your intended target. Base sticky lasts for at least 15 seconds, possibly longer... certainly long enough for 15 microwave lynxes to flatten your command center.

Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 08, 2019, 11:10:23 AM
All the downloads for multitek2 point to some Japanese website that says the domain was expired or suspended.  Does it exist somewhere else so I can poke around in it?
Title: Re: OP2 Game Flow Redesign
Post by: Sirbomber on April 08, 2019, 12:02:02 PM
We used to have 3 different URLs: outpostuniverse.net, outpost-universe.net, and outpost2.net.  It's a long story.  We only have outpost2.net now.  Just replace whichever variant the MT2 URL points to with outpost2.net; it should work.

Edit: I got the most recent MT2 files off an old laptop.  Check them out here (https://forum.outpost2.net/index.php?topic=6265).
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 08, 2019, 01:11:50 PM
https://forum.outpost2.net/index.php?act=Attach&type=post&id=65158 is not working, either.
Title: Re: OP2 Game Flow Redesign
Post by: leeor_net on April 08, 2019, 01:29:52 PM
And link rot strikes again. Let me see if I can get a URL for you.

https://forum.outpost2.net/index.php?action=dlattach;topic=4409.0;attach=246

Hoping this is the version you want -- shows as last modified by Sirbomber in December, 2008.

While I'm at it, there's also this image that appears to go with it:

(https://forum.outpost2.net/index.php?action=dlattach;topic=4925.0;attach=329)
Title: Re: OP2 Game Flow Redesign
Post by: Hooman on April 10, 2019, 11:06:12 AM
This is getting to be a rather interesting discussion.

As a side note, it might be interesting to develop a way for levels to load customs sheets other than the tech tree. Something that is mission specific, and doesn't require restarting the game with new modules.

Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 10, 2019, 02:13:52 PM
What if OP2ext added a button to the main menu called "Load Mod", which brought up a drop-down list of available mods, and when you select one it called Outpost2.exe /loadmod [modname] then closed the current process?

Anyway, I was kind of confused for a while as to how OP2ext was used, but apparently it's way simpler than I thought.  This should give me control over everything I want except for capping morale.


Another question: I've been following the stock multitek.txt's example and have been including dummy versions of the tech topics I've removed.  Is there a reason this is done, or can I completely delete the unused techs?

Title: Re: OP2 Game Flow Redesign
Post by: Sirbomber on April 10, 2019, 03:15:38 PM
You should be all set removing them completely so long as nothing else in the techtree file or sheets.vol references that tech ID.
I've done my fair share of techtree work and can hop on IRC for the next hour or two if you want to chat about things.
Title: Re: OP2 Game Flow Redesign
Post by: Vagabond on April 10, 2019, 08:41:24 PM
Crow!,

I think a dropdown menu would be generally well received. One could specify in the .ini file which console modules were available. Were you interested in implementing?

Adding a way to overload standard sheets data per mission seems reasonable to me as well but not sure of the technical challenges involved in implementing.

If you have any issues with op2ext, I'll try to help. I've become fairly familiar with it over time. Attached is a tech tree syntax highlighter designed for use with notepad++. I like using it because it helps prevent errors with the syntax. It lives in the SVN repo (when it is online).

-Brett
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 10, 2019, 11:16:19 PM
Thanks for the help so far, guys.  I am intrigued by the idea of implementing a more user friendly mod selector, but I have no idea where to start with hooking stuff into the OP2 main menu.  Obviously some work has been done there already - NetFix certainly wasn't in the original game release! - but I'm not sure where to start looking there.

I've picked a name for this mod - it is now called Phase Shift.

I have implemented the changes to mining beacons, and I did a test playthough in the Plymouth Population colony game map.  I got up to about 300 population, exhausting 7 mines along the way with 3 more recently established before I quit.  It played out more or less how I wanted it to, though it did teach me that Cargo Trucks should have their price reduced to match the longer distance mining that this encourages and requires.

Below is an update to the intended change log, along with a ZIP of the mod's current state.  The only thing in the below list that I haven't found a way to implement yet is morale.  Things that are different from the previous list are in bold.
[EDIT: I forgot to actually attach the file mentioned above.  Now it is here.]


----------------

Spent mines fall down to nearly zero output, requiring expansion to new, presumably harder to defend mining beacons as the game progresses.
   All below numbers are for non-upgraded common mines.
   1-bar mines give out about 16,000 ore before falling to 20 per load.
   2-bar mines give out about 24,000 ore before falling to 30 per load.
   3-bar mines give out about 32,000 ore before falling to 40 per load.
   All mines now reach their peak at 2/3 of the way through their normal output period.  This way, the player can check if a mine is losing output, and if so, know that it is close to the end of its rope.
   Mine variants within a bar may give about 10% more or less ore total.  The ones that give more ore at the start will eventually award less ore total.
   
Morale has a maximum permitted level based on how many morale relevant structures have been researched:
   - Base maximum: 45
   - Nursery: +5
   - University: +5
   - GORF: +5
   - Consumer Goods / Forum: +5
   - Medical Centers: +10
   - DIRT: +10
   - Recreational Facilities: +15

Both Colonies:
Cargo Truck common/rare cost down to 600/0 pre-reinforced vehicle tech and 375/75 after (was 800/0 before, 500/100 after).
   This change goes hand-in-hand with the mining beacon change.  This is to support the idea that you do not always have to make a new set of smelters every time you switch to a new mine.

Tokamak cost increased slightly, to 1250 (was 1100).
Solar Panel power output increased to 600 (was 400), building common/rare cost reduced to 200/200 (was 500/500), satellite common/rare cost reduced to 500/100 (was 1000/200).
DIRT Procedural Review now changes Worker/Scientist requirement from 2/1 to 1/1 (was from 2/1 to 3/1 as a net downgrade).
Robo-Miners no longer become more expensive as new mining tech is researched.
   I believe the only reason they even did this was that SOME property of a unit must change for the upgrade text to show up on it.  My "change" will now be "The cost now = what it was before already."
Earthquake concussive / penetration damage swapped to 25/50 (was 60/25), so it works better vs buildings (which tend to have high armor) and less well against vehicles than at present.
   The game would benefit from a "bonus vs buildings" damage type, but that would require a pretty extensive coding change.

Garage cost down to 900 (was 1500), construction time down to 1000 (was 1500).
Guard post explosion damage down to 200 (was 750), HP up to 750 (was 500).
Panthers have more HP both pre and post upgrade, to 600->850 (was 500->750; Tiger is 800).  Research cost and scientist count increased to match new higher value.
Tiger chassis cost up to 1000+400 (was 750+250).
Extended Range Projectile Launcher upgrade is now Plymouth exclusive, while Grenade Loading Mechanism is Eden exclusive.
EMP's base reload time slowed to 155 (was 140).
   Eden still gets the original post-upgrade reload time of 120.
Scout Class Drive Train research is now Plymouth only.  Eden gets a Lynx HP upgrade instead.
Advanced Robot Manipulator Arm tech's bonuses for Earthworker and Robo Dozer improved to 128->64 (was 128->96).
Hypnopaedia effect improved, for Eden 5000->3500, for Plymouth 5000->4000 (was 5000->3750 for Eden, 5000->4500 for Plymouth).

Plymouth:
MHD cost down to 800/400 (was 1000/500).
Legged Robots tech has no prereqs.
Arachnid Weaponry can be researched from the Standard Lab and only requires Legged Robots tech.
New upgrade: Scorpion Mobility.  Increases Scorpion movement speed from Fast to Very Fast.  Prereq = Arachnid Weaponry.  Researched at the Advanced Lab.
Scorpion Power Systems also increases range by 2.  Requires Independent Turret Power Systems and Advanced Vehicle Power Plant.
Arachnid Durability now upgrades Spider HP 100->150, and Scorpion HP 125->200 (was 100->125 and 125->150).  Now available at the Standard Lab.
Focused Microwave Projection now requires Arachnid Weaponry, thereby delaying the Plymouth research tree by two topics.
Various research time costs have changed to support the new ordering: Legged Robots 1800->1600, Arachnid Weaponry 1800->1200, Scorpion Power Systems 1800->1600, Arachnid Durability 1800->1600.
ESG turning speed slower to 2 (was 11).
Electromagnetic Reverberations research added: increases EMP Penetration "damage" to 320 (from 255), for (as I understand it) a better chance to land the disable.

Eden:
Improved Launch Vehicle research cost 6000->4500.
Geothermal Power Plant output 500->650 baseline; Heat Mining research topic removed.
Laser damage up slightly both pre- and post- upgrade, now 40->50 (was 35->45).
Heat Dissipation Systems renamed to Thor Heat Dissipators.  Only affects Thors, and the effect is improved to 120->90 (was 120->100).
   This is to make room for newer, cooler upgrades for the other weapons.
Shrapnel Shaping research added: increases Starflare concussion/penetration damage to 500/1500 (from 500/1000).
Railguns no longer require Advanced Combat Chassis. (Still requires Independent Turret Power Systems, though.)
Railgun turning rate slowed to 3 (was 11).
Increased Capacitance Circuitry now increases Railgun damage 80/40->120/60 (was 80/40->100/50).  Also, it gains Advanced Combat Chassis prereq to return that upgrade to its normal timing.
Railgun Rifling research added: Range +2.  Prereq = Increased Capacitance Circuitry.
Acid Cloud turning speed up to 9 (was 6) and AoE increased to 64 (was 48) to better match graphics and handle high speed targets better.
Corrosive Catalysts research added: increase Acid Cloud concussion/penetration damage from 15/10 to 25/10.
Light Tank Part Redundancy research added: Lynx HP up to 400 (from 300).  Prereq = Mobile Weapons + Reinforced Vehicle Construction.
Diode Lasers research added: Cost 450->275.  Prereq = Efficiency Engineering + Lasers.
Meteor Defense construction time down to 1100 (was 1800).
Precision Trajectory Projection Software's upgrade is now automatic with Meteor Defense's base research, but the base research takes longer.

Tech tree cleanups:
Hot Cracking Column Efficiency removed.
Vulcanology awarded for free when Seismology researched.
Robotic Image Processing is removed, and its effects built in to the Scout and Light Post.
Consumerism research correctly identifies itself as having unlocked the Consumer Goods Factory structure kit instead of the University structure kit in the post-completion teaser.
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 11, 2019, 10:34:28 PM
Tried to make a multiplayer scenario to implement as close to the revised morale system as I could figure out how to.  The results are summarized in the comments.  I probably did something really dumb; I'll try again later.

Code: [Select]
void AIProc() 
{
if (TethysGame::UsesMorale())
{
//only calculate the below stuff every so often, to avoid excessive load on the system.
//This is causing the below code to NEVER fire, so apparently there's something I don't understand here.
//if ((TethysGame::Tick() & 0x1F) == 0)
//{
//The below code is causing the host's game to instantly exit, and causing the other player to report "CHEATED GAME!".
for (int i = 0; i < 2; i++)
{
int moralePoints = 0;
if (Player[i].HasTechnology(3301)) //DIRT
moralePoints += 2;
if (Player[i].HasTechnology(3303)) //Med Centers
moralePoints += 2;
if (Player[i].HasTechnology(3304)) //Nursery
moralePoints += 1;
if (Player[i].HasTechnology(3305)) //University
moralePoints += 1;
if (Player[i].HasTechnology(3306)) //Rec Facility
moralePoints += 4;
if (Player[i].HasTechnology(5108)) //Forum
moralePoints += 1;
if (Player[i].HasTechnology(5101)) //Consumer Goods
moralePoints += 1;
if (Player[i].HasTechnology(03302)) //GORF
moralePoints += 1;

//out of 12 possible points, you need 11 or more for Excellent, 7 or more for Good, and 3 or more for Fair morale.
//If your morale exceeds what you're allowed to get, you get brought down to the previous level, forcibly.
if (moralePoints < 3)
{
if (Player[i].MoraleLevel() == moraleOK || Player[i].MoraleLevel() == moraleGood || Player[i].MoraleLevel() == moraleGreat)
{
TethysGame::ForceMoralePoor(i);
TethysGame::FreeMoraleLevel(i);
}
}
else if (moralePoints < 7)
{
if (Player[i].MoraleLevel() == moraleGood || Player[i].MoraleLevel() == moraleGreat)
{
TethysGame::ForceMoraleOK(i);
TethysGame::FreeMoraleLevel(i);
}
}
else if (moralePoints < 11)
{
if (Player[i].MoraleLevel() == moraleGreat)
{
TethysGame::ForceMoraleGood(i);
TethysGame::FreeMoraleLevel(i);
}
}
}
//}
}
}
Title: Re: OP2 Game Flow Redesign
Post by: Sirbomber on April 11, 2019, 11:18:10 PM
The ForceMoraleXYZ() functions won't do what you want it to do... they lock the player's morale at that level, as in, it won't go up or down.  Calling any morale functions past mark 0 (with the exception of FreeMoraleLevel, and only if it's called for all players) will cause the CHEATED GAME! behavior you're seeing.


I'd suggest breaking your morale hack into its own function (for example, Export void MoraleHack()), which you then call on a repeating time trigger initialized in InitProc, rather than... whatever you're trying to do with counting ticks.


Something like this:
Code: [Select]
Export int InitProc(){   ...   CreateTimeTrigger(1, 0, 5000, "MoraleHack");   ...}
Export void MoraleHack{   ...}
Edit: Ugh, that looked better before the forum removed all my return characters and whitespace.
Title: Re: OP2 Game Flow Redesign
Post by: Hooman on April 11, 2019, 11:23:44 PM
Triggers and AIProc aren't called every tick. The condition to check is:
Code: [Select]
00403249  CMP AL,3  ;  Check if ((tick MOD 4) != 3)
0040324B  JNZ Outpost2.00403506  ;  -> Return

Try changing your code to:
Code: [Select]
if ((TethysGame::Tick() & 0x1F) == 3)

Edit: Or use Sirbomber's suggestion. That might be more natural for Outpost 2 level code.



If Morale is set after game start (after the tick has incremented past 0), you'll get "CHEATED GAME!". The only thing you can do with morale after game start is to call FreeMoraleLevel. This is part of more general code to set GameOpt. Only a handful are allowed after tick 0 without causing the "CHEATED GAME!" message to appear. Details: Forced Exports (renamed OP2Internal) (https://forum.outpost2.net/index.php/topic,4249.msg64375.html#msg64375)

You can try setting the memory locations directly if you want to bypass the "CHEATED GAME!" message. That project should contain details for the memory addresses.

Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 12, 2019, 01:26:00 AM
I'll figure out triggers sometime tomorrow.  Scheduling a check every 32 ticks or so should do what I was attempting with the AI proc thing.

According to DataStructure Player.txt, the offset of the morale number within the player is 0x040, while the morale level is 0x034, so does this work?

Code: [Select]
//after doing stuff to determine maxMorale
int* morale = (&Player[i]) + 0x40;
int* moraleLevel = (&Player[i]) + 0x34;
if (*morale  > maxMorale)
{
    *morale = maxMorale;
    if(*morale >= 90)
        *moraleLevel = 0;
    else if(*morale >= 70)
        *moraleLevel = 1;
    else if(*morale >= 45)
        *moraleLevel = 2;
    else if(*morale >= 25)
        *moraleLevel = 3;
    else *moraleLevel = 4;
}

Having done stuff with more safe/modern computing environments for a long time now, I feel uncomfortable just pointing at some memory and saying "I'm pretty sure this is data type X.  Now go execute some code that could to terrible, horrible things if I'm wrong."


-------

Edit: The above didn't work for a couple reasons.  First, I had to explicitly cast the pointer as being a (int*).  Second, it appears that Player[] does not point to the structures documented in DataStructure Player.txt, so I had to move the pointer.  After dealing with that, though, it seems to be working.  Also, getting the repeating trigger to work wasn't too hard, though referring to a function name by a string whose contents happen to match the name of the function kind of freaks me out.  What is this, DOS batch file programming?
Title: Re: OP2 Game Flow Redesign
Post by: Hooman on April 12, 2019, 12:52:11 PM
Quote
Having done stuff with more safe/modern computing environments for a long time now, I feel uncomfortable just pointing at some memory and saying "I'm pretty sure this is data type X.  Now go execute some code that could to terrible, horrible things if I'm wrong."

Ahh, welcome to the joys of casting.  :D

Who needs type systems and safety checks anyways. The data is what I say it is. Trust me. ;)



Pointer addition in C/C++ is kind of message up. When you add a const to a pointer, it actually calculates an offset that is const * sizeof(pointerBaseType). Hence if you declare or cast a pointer as int* and add 1 to it, you'll actually add sizeof(int) to the address. It relates to how C/C++ does array indexing, though I don't think there is any good reason for the behaviour.
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 13, 2019, 12:10:44 PM
OK, here's a release with a test multiplayer mission.  I'll be around on chat this weekend looking for games, both of the original to get a better feel for that, and if anyone's up for it, tests of how this works out.

The mission is a 2 player Space Race scenario based on the map for the Plymouth Colony Builder II Starship game, with a player starting in the NE and SW bases.  There is a 2-bar and a 1-bar common in each of the two "tiers" of the initial base, and a 2-bar Rare mine is in the second tier.  3-bar mines lie shortly outside the easily defended area, and there's a "pocket expansion" available to each side with a 2 bar common and rare mine, which should be easy to defend but is a long distance from the base. I didn't notice until I had already worked on the map for a while that the NE base has a second entrance; I plugged the hole with some concrete walls, but the map is still pretty asymmetric as a result.

A couple new changes in the mod itself:
Command Centers cost 1800 common and build in 2200 "points" (was 2800 for both), to better facilitate remote bases.
Concrete Walls have 450 HP (was 300).
Recreational facility technology is worth +20 extra maximum morale (previous post said +15)

---------

EDIT: updated to v0.3.1, fixing a crashing bug that somehow slipped into the mission.
Title: Re: OP2 Game Flow Redesign
Post by: Vagabond on April 13, 2019, 10:05:43 PM
Crow!,

I can be online around 8PM Eastern time on Sunday. I'll stop in the forums and see if you are around.

Be ready for some gymnastics trying to get the games to talk over the internet, including possibly downloading and using Hamachi. I would probably ask you to use the current development build of op2ext, NetFix, and NetHelper, which I would have to prep and send you somehow.

Fractured Alliance by Sirbomber is a pretty good coop scenario to cut your teeth with. It is bundled with the current download. I'm not much of a challenge  in deathmatches (nor do I particularly enjoy them).

-Brett
Title: Re: OP2 Game Flow Redesign
Post by: Highlander on April 14, 2019, 05:17:32 AM
Very interesting concept with mines that runs "dry"


I don't like many of the changes to weapons though :P
Title: Re: OP2 Game Flow Redesign
Post by: Vagabond on April 14, 2019, 07:00:37 PM
Crow!,

Just jumped onto IRC if you are available.

-Brett
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 18, 2019, 05:03:41 PM
In Phase Shift maps, I want to have the map alert the player when a mining beacon is running low on resources.  I see the ollydbg notes list the memory location of how many loads a beacon has put out so far, relative to the start of that beacon's unit data.  How can I identify the start address of each beacon's unit data?

I'm also looking to have the multiplayer Phase Shift map(s) self identify whether the Phase Shift mod is active, so it can turn on the Phase Shift specific triggers only when Phase Shift is on.  Does anyone know a way to achieve this?

In other news, I've cut back the scorpion's strength slightly by downgrading its armor class from light to none - this should be especially noticeable with Acid Cloud and ESG attacks, but less so for, say, the Thor.
Title: Re: OP2 Game Flow Redesign
Post by: Vagabond on April 18, 2019, 08:06:20 PM
Crow!,

We are discussing adding the ability to query which mods are active on GitHub. I would like to start coding it this weekend so you have it available. Feel free to comment if you have any suggestions. The query must be c compliant sense we try to honor the C ABI for cross-dll communication.

https://github.com/OutpostUniverse/op2ext/issues/69

You could probably bring up a dialog telling the player they need to load the phase shift module and then exit the scenario instead of just disabling if you want.

I'm no help on the beacons, but that sounds like something that would belong in HFL if it existed. We added 3 functions to OP2Helper to improve posting messages if you are interested in using them. They have been pushed into the current master OP2MisionSDK repo.

-Brett
Title: Re: OP2 Game Flow Redesign
Post by: Hooman on April 19, 2019, 01:12:46 AM
I believe you can use a building enumerator to find the unit record for the mine. I'm not sure if you want the mine building, or the mining beacon. Try either of:
Code: [Select]
PlayerBuildingEnum(Player6, mapMiningBeacon); // Gaia

PlayerBuildingEnum(playerNum, mapCommonOreMine);
PlayerBuildingEnum(playerNum, mapRareOreMine);

From there, you could use a bit of HFL style memory hacking to access the value at the offset you want.
Title: Re: OP2 Game Flow Redesign
Post by: TechCor on April 19, 2019, 01:31:12 AM
I don't think I found beacons through PlayerBuildingEnum, but I could be wrong.

Try it with PlayerUnitEnum(Player6, mapMiningBeacon)


For getting beacon data, there is a solution I use in my own HFL library that you can find on my GitHub.

Here's the key parts:

Code: [Select]
struct BeaconData
{
int numTruckLoadsSoFar;
int barYield;
int variant;
char oreType; // [0 = common, 1 = rare]
char unknown1;
char unknown2;
char surveyedBy; // [player bit vector]
};

and to get the data for the struct:

Code: [Select]
BeaconData* p = (BeaconData*)((int)(*unitArray) + (unitID*120) + 0x58);

Credit goes to some awesome poster from 2011 or so.
Title: Re: OP2 Game Flow Redesign
Post by: Hooman on April 19, 2019, 01:47:11 AM
Yes, that should work, provided you have a way of finding the correct unitID / unitIndex.

If you really need to, you can implement your own enumerator class. A few people have done that before. If you can't use an existing enumerator as a base, then you can always try looping over the unit array manually and determine the unit type. The game usually determines the unit type in a bit of a roundabout way:
Code: [Select]
unitRecord.GetUnitTypeInfo().unitType;  // enum map_id

The GetUnitTypeInfo() method is the first method in the virtual function table. The unitType field is at offset 0x4 in the UnitTypeInfo class (the first field after the virtual function table pointer).
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 19, 2019, 11:12:49 AM
I think I'm following all this unit record navigation stuff except for the (*unitArray) part.  Is that one array global to the game, or something created by our enumeration, or what's the deal?  And, more to the point, where will I find it?
Title: Re: OP2 Game Flow Redesign
Post by: TechCor on April 19, 2019, 06:20:36 PM
unitArray is in UnitEx of HFL.

Here is an implementation of beacon data with accessor methods:

https://github.com/TechCor8/OP2DotNetMissionSDK/tree/master/NativeMissionSDK/NativeSDK/HFL/Source

The two important files are UnitEx.h and UnitEx.cpp.
Title: Re: OP2 Game Flow Redesign
Post by: Vagabond on April 22, 2019, 09:05:20 PM
Crow!,

I've partially implemented the changes required by op2ext for detecting which module(s) are loaded. Hooman is providing code reviews and technical guidance on how to implement, which will really improve the final product.

I'm hoping to be far enough along to provide you a test build this coming weekend. The code will be partially unit tested, but would be looking for feedback from you on usability and any bugs you might find.

While you are testing, I may continue to rewrite the backend of op2ext to allow more through unit tests.

-Brett
Title: Re: OP2 Game Flow Redesign
Post by: Crow! on April 24, 2019, 04:01:48 PM
Phase Shift v0.4.0 is done, and is attached to this post!  A summary of the changes is here, too.

A couple outstanding coding issues remain, both regarding the hookup with op2ext:
- op2ext did not replace savnt213.wav, even though it was in the mod folder.  I might be misunderstanding how a .wav file replacement is done.  I want the mine depletion alert to say "Mining location diminishing," but instead it will just make the smelter selection noise.
- As noted by Vagabond above, there is some new functionality I'm waiting on; once it is ready, there should not need to be the separate vanilla vs phase shift versions of Ohana.  (For now, the PhaseShift download only contains the PhaseShift version of the map.)


Change log:
PhaseShift specific maps will now alert the player when a mine is running out.
A map specially designed for PhaseShift, Ohana, is now included with the mod!  (Bundled map version is 0.3)
Minor edits to Mine.txt to make it work better with the way the above mentioned alert is implemented.
Slight increase to mine "trickle" output after it has been depleted.
Initial maximum morale reduced; Medical Centers and the colony-specific morale topic effect on max morale increased.
   The important thing to know is that you must get something other than just Nursery and University tech to get beyond Poor morale.
Guard Post base price reduced.
Scorpion armor class is now None instead of Light.
Reduction of some buffs to Scorpion-related research rates.
EMP missile research cost and maximum scientist count increased.
Observatory's Scientist cost lowered.
Meteor Defense common metal, worker, and research costs lowered.

[EDIT] Replaced attachment with PhaseShift v0.4.1, which updates the Ohana map to version 0.4, which fixes an issue where Ohana's SE base's N wall wasn't solid.
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: Vagabond on April 24, 2019, 08:22:16 PM
Crow!,

Could you post your new sound effect for troubleshooting? I've never attempted to replace a sound effect before so would need to look at it to give advice. Unsure if op2ext will pickup the new sound effect without testing.

Thanks,
Brett
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: Crow! on April 24, 2019, 10:18:24 PM
Sure.  Here's the file.  I placed it in with the other files in the PhaseShift folder, and I told the mission to play sound sample 167 along with the message, but I got "Struture Lost", the unmodified version of the sound sample, instead.
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: Crow! on April 29, 2019, 05:52:58 PM
I wasn't able to do any multiplayer tests of PhaseShift this weekend, but I did get some vanilla games in, and earlier today, I did an offline test of PhaseShift.  I found a couple things that needed changed, so here we go:

-----------

Phase Shift v0.4.2 updates:

Fixed a bug that prevented the Diode Lasers upgrade from being researched.
Structure Factory cost reduced to 1600, and building time reduced to 2000 "points" (was 2500 for each).
   This is for the same reason, and to about the same degree, as the Command Center change.

Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: Hooman on April 30, 2019, 07:08:41 AM
Hmm, seeing as how you've got evolving versions, have you thought about putting this work up on GitHub? Have you used Git before?

Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: Crow! on April 30, 2019, 11:00:50 AM
Sure, why not.  I usually avoid using git for releases of my work because it scares off the not-technically-inclined, but I think the OP2 community can handle it.

https://github.com/iICrowIi/OP2PhaseShift
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: leeor_net on April 30, 2019, 11:41:06 AM
So I see that there's no actual source code for the mission itself. ;)
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: Hooman on May 01, 2019, 08:51:04 AM
Oh yeah, you've got the compiled DLL, but no source for it. And a zip file, which I assume is mostly just the contents of the repository?

That stuff could be packaged as a Release on GitHub:
https://github.com/iICrowIi/OP2PhaseShift/releases

Admittedly I still haven't figured out how the Release section works, though Brett has been making good use of it with his projects.

As you've said, it might also make sense to repost the release package on the forums for the less technically inclined. It's much harder to sort through old releases on the forums though. GitHub is a bit more organized in that regards. Same if anyone wants to use a prior version of the tech tree edits or something.

Anyway, thanks for putting it on GitHub. :)
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.4.0 released!)
Post by: leeor_net on May 01, 2019, 12:12:26 PM
Release on GitHub is pretty simple. Create a tag, then make a release based on the tag. If you don't provide binaries it'll still provide a tar and zip of the repository sans binaries. You can then add release notes (markdown style) and it's good to go.
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Crow! on May 01, 2019, 02:17:17 PM
SirBomber and I had a game yesterday.  After some thoughts on how it played out, here's the result:
https://github.com/iICrowIi/OP2PhaseShift/releases/tag/v0.5.0

Change summary:
Updated packaged Ohana map and scenario to version 0.5, which fixes some terrain, allows victory via either Starship launching OR Last One Standing conditions, makes the first common and first rare mine always the same variant, and replaces the backdoor 1-bar common with a 1-bar rare, and increases the initial metals for Medium and Low starting resources.
GitHub release now features Ohana's source code.
Common Ore Smelter, Rare Ore Smelter, and Robot Command Center costs reduced slightly.
Robot-Assist Mechanic tech removed.  Garage is now available with Cybernetic Teleoperation.
Advanced Robot Manipulator Arm's prerequisite is now Advanced Vehicle Power Plant.
Scout-Class Drive Train Refit research time slower and now requires Advanced Vehicle Power Plant.
All starship components (including the cargoes) cost 25% less common and rare metals.

-----

I had been dragging my feet on Ohana because it had some changes that weren't actually working yet.  Now they are, so its source is available now, too.

At some point I'll have to set it up in a way that makes the parts that need to be included in a PhaseShift map more easily portable; for now, the morale and the mine depletion alert repeating triggers and trigger handlers in main.cpp have to be copied.

-----

Outstanding PhaseShift issues:
Scorpions may be too strong in the period of time where Advanced Combat Chassis is blocking the next tier of weapons.
Advanced Armoring Systems messes up the idea that some weapons (especially Acid Cloud and ESG) are supposed to do better vs swarms of light units than against Tigers.  I want to remove it, but am not sure if it should be replaced with something else as that happens.

-----

Oustanding Ohana issues:
Incorporate a way to ask op2ext whether PhaseShift is active or not so it can use a single .dll
Add Disasters when that check box is selected
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Vagabond on May 01, 2019, 08:38:00 PM
Crow!,

I did some research on your sound issue. Outpost 2 will not pick up individual sounds placed loosely. It looks like you have to bake the sound effect into sound.vol.

I recommend packing your sound effect into sound.vol. Then you can place the modified sound.vol into your mod directory. Outpost 2 will pick up and load your sounds instead of the default when the mod is detected. You can use OP2Archive to do the packaging. Beware that it has outstanding directory selection issues that I still need to clean up. So you might have to get creative and command the package from a relative or absolute directory or something to get it to work. Sorry, but I made some poor decisions on how XFile was coded and have been working other things instead of cleaning it up. If you have too much trouble, I'll focus on fixing it.

op2ext currently has 2 outstanding bugs that are in PRs. If these get merged in, we should be ready for you to take a beta build of it and test the ability to detect the module name. I'd like to continue beefing up the unit tests some more if I find some time.

Let me know how the sound effect integration goes. I suspect it may be coded incorrectly and play as static once you get Outpost 2 to detect it. I tested by overwriting the sound effect Tokamaks play when you click on them.
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Hooman on May 02, 2019, 05:49:58 AM
Ahh, sweet! Source code :)


Looks like you're using a slightly outdated level template. Nothing wrong with that. Just wanted to point out there is an updated version at:
https://github.com/OutpostUniverse/LevelTemplate

A few differences with the newer version:
 - A .gitignore file was added, as not all files need to be versioned (*.user, .vs/, Debug/, Release/ ReleaseMinSize/).
 - The old Visual Studio 6 project files were removed. (Version 6 is circa 1996).
 - Main.cpp was split into LevelMain.cpp and DllMain.cpp. Most people only care about LevelMain.cpp. The slow compiling Windows specific stuff usually goes in DllMain.cpp. There was a default HFL init call added to DllMain.cpp.
 - It's pre-setup with an AppVeyor config file for online Continuous Integration builds. (You'd need an AppVeyor account to enable it).
 - Updated APIs with numerous small additions, fixes, and renames.
 - APIs can be updated with a Git submodule update. No need for manual downloading and unpacking.

All of it optional. No need to upgrade, though some changes could potentially make your life a little bit easier.

----

The sound file thing is interesting and unexpected. For game data, I've seen Outpost 2 treat free files the same as stuff packed in VOL files. Not sure why sound would be any different, though this may warrant some investigation. In terms of repacking a VOL file, do you really need to repack the full VOL file, or can you add an additional VOL file?
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Vagabond on May 04, 2019, 06:49:46 AM
Crow!,

I just posted a beta release of op2ext that allows checking which console modules are loaded.

https://github.com/OutpostUniverse/op2ext/releases/tag/ver2.2.0-beta

You should be able to check if your module is present by calling the following from within the mission's InitProc function:

Code: [Select]
if (!IsModuleLoaded("TestModule")) {
... WARN USER / CLOSE MAP / CHANGE MAP BEHAVIOUR ...
}

Let me know if you need any help setting up.

Thanks,
Brett
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Crow! on May 04, 2019, 12:18:19 PM
To be clear, if I implement this, will the map crash for anyone who hasn't downloaded this version of op2ext?
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Vagabond on May 04, 2019, 12:46:12 PM
Crow!,

You should not mix versions of op2ext when playing multiplayer scenarios. I would recommend making a dev copy of Outpost 2 and a regulary play copy of Outpost 2.

Since the function only exists in this new build of op2ext, if you call the new function from a mission DLL with the old op2ext DLL, the game will crash (As it should because it cannot find the function and the application must abort).

Hope that answers your question.

Also, if you return false from initProc, the mission will abort with the attached message. It would be better if a more descriptive dialog popped up saying the given module wasn't present. I have only used modal dialogs on mission startup with colony games. If you want me to play with a multiplayer modal dialog, let me know.
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Crow! on May 04, 2019, 04:13:47 PM
OK, the module loaded check in that build of op2ext seems to be working how I want it to for Ohana - the mission already had two different initial setups coded in, depending on a single bool I had been setting to a different value depending on whether I was building the vanilla or PhaseShift version.  So, initializing it with:

Code: [Select]
bool isPhaseShift = IsModuleLoaded("PhaseShift");
Is, in my local tests, correctly building the bases and applying new morale and mining rules according to whether the PhaseShift module is loaded.

It is possible I'd like to have a more understandable error message given to the player for a colony game if I have it refuse to load due to not having PhaseShift active, but I'm not sure if that necessarily has to involve op2ext.


As for the audio issue, I have confirmed that packing the replacement sound into voices.vol placed in the mod's directory causes static when the game attempts to play the sound.
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Vagabond on May 05, 2019, 01:02:03 PM
Crow!,

I just tested and you can load a modal dialog box into Outpost 2 before passing false back from InitProc. This would allow you to give a custom message. Rising from the Ashes contains a dialog box at the start of the mission that you can use as a template. You can check out Rising From the Ashes here: https://svn.outpostuniverse.org:8443/!/#outpost2/view/head/LevelsAndMods/trunk/Levels/RisingFromTheAshes. In the same repository is Plymouth Cold War, by Black Box, which would be another implementation to check out.

Also, you should read https://wiki.outpost2.net/doku.php?id=op2_sdk:textdialogbox. This article will spell out the basics on getting a dialog box to work (unfortunately, it is fairly complex if you are unfamiliar with resources and the rich text format (RTF).)

see the attached screenshots for examples. The downside is it would produce 2 dialogs. Not sure if you could suppress the second dialog, but I think it would be okay either way?

The quote below is pulled from OP2Archive's Readme. It explains how specific music tracks must be encoded to get working with Outpost 2. I wouldn't be surprised if there were similarly complicated rules for Sound Effects. Unfortunately, I'm not aware of anywhere that the information is stored about the exact format. Maybe you could reverse engineer the settings from an existing sound or maybe someone else could help. Sorry. I do know that Outcasters used custom sound effects, so it is possible.

Outpost 2 audio tracks must be formatted as WAV files with the following settings:
 * Frequency = 22050 Hz
 * Channels = 1 (Mono)
 * BitsPerSample = 16

The file size of each WAV audio track (the actual wav data) must be zero padded to a multiple of 32768 bytes (0x8000).
Output 2 fills the music buffer in 0x8000 size chunks and will not zero fill if a chunk at the end of a file is too short.
If the file is not a multiple of 32768 bytes (0x8000), some garbage data will be played in Outpost 2 before switches to the next track.


Hope this helps,
Brett
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Crow! on June 07, 2019, 12:24:43 PM
Hey guys, just wanted to give an update since I vanished for a while here.  RL stuff has been pretty wild for me in the past month, but the light at the end of the tunnel is in sight.  I'll probably get back to this project and start thinking about single player scenarios for it in two weeks or so.
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: leeor_net on June 13, 2019, 03:07:17 AM
Pretty much the same boat I've been in. Kinda sucks but RL kinda takes precedence. :D
Title: Re: OP2 Game Flow Redesign (PhaseShift v0.5.0 released!)
Post by: Vagabond on October 15, 2019, 09:22:56 PM
Crow!,

quick update on op2ext. We are removing 2 functions from the public API:

Code: [Select]
OP2EXT_API bool IsConsoleModuleLoaded(const char* moduleName)
OP2EXT_API bool IsIniModuleLoaded(const char* moduleName)

Instead of using these functions, you would just call:

Code: [Select]
OP2EXT_API bool IsModuleLoaded(const char* moduleName)

We believe the 2 functions being removed were a mistake to add to the API in the first place. A user should not care if the module is loaded via console or Ini file inclusion. Since the update to the API is still pretty fresh, we thought it was best to correct instead of deprecating in this case.

Hopefully this doesn't cause you any development concerns. If so, please let us know.

-Brett