Author Topic: Balanced ore deposits  (Read 6704 times)

Offline Harky

  • Newbie
  • *
  • Posts: 43
Balanced ore deposits
« on: February 04, 2015, 11:30:06 PM »
I have heard from a few people that they are unhappy with the ore in some OP2 maps. Enough so to make people want to redo all the maps and balance them. Would it be easier to add an "ore steady" check box that would just make all the ore all balanced (such as all 2 bars)?

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Balanced ore deposits
« Reply #1 on: February 05, 2015, 03:56:55 AM »
Hmm, interesting proposal. That might not actually be too difficult. Not dead simple though either, and it wouldn't fix placement problems.

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Re: Balanced ore deposits
« Reply #2 on: February 07, 2015, 04:27:32 PM »
While you're at it there's all kinds of things that'd be nice to add to the game lobby :P It'd be nice to incorporate the game type dropdown into the lobby itself instead of on the create game window, so you don't have to leave and rehost the game to switch game type. Or at least do it the lazy way and just have all maps always show on the map dropdown, but that would be pretty cluttered I'd imagine. Ideally extra custom option checkboxes would be determined by the selected mission (defined by some mission DLL export I'd imagine) but that could be tricky to implement.

But yeah, the problem with the ore is, it'd be up to the mission DLL itself to implement support for the new option, just like you have to actually implement a code check for disasters/day and night/etc. checkboxes in custom missions. And you'd somehow have to update all the Dynamix mission DLLs, which would presumably involve reverse engineering and reimplementing all of them. which while it would be nice to do that, it can easily be quite painstaking to even reverse engineer one mission, and there are quite a few of them. But I suppose LOS MP missions are a generally lot simpler than campaign missions.

I once experimented with making "wrapper" mission DLLs that would call LoadLibrary("real mission.dll") and just call the real mission's InitProc, AIProc, etc. from the wrapper mission's and return the result. That would allow you to do more or less whatever you want on top of the original's compiled code (barring that you can't actually modify or insert your own code in the middle of the code in the real DLL's functions without injecting it). This is how BlackBox's old replay playback DLL worked. However, I always had problems with strange inconsistent desyncing in multiplayer, even when I tried a completely barebones wrapper. BlackBox's replay playblack DLL had all kinds of weird problems of its own. It's making me think that maybe OP2 just doesn't like it when you load another mission DLL from within a mission DLL for whatever reason.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Balanced ore deposits
« Reply #3 on: February 08, 2015, 11:56:08 PM »
How possible are all of these suggestions through just hacking/patching the game? Wouldn't a rewrite/clone be better suited?

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Re: Balanced ore deposits
« Reply #4 on: February 09, 2015, 02:49:49 PM »
A rewrite would combine the painstaking effort of (most likely) rewriting all the MP missions with that of rewriting all the other things too, so I'd say this is somewhat more possible via hacking than rewrite :P

Offline Harky

  • Newbie
  • *
  • Posts: 43
Re: Balanced ore deposits
« Reply #5 on: February 09, 2015, 08:38:10 PM »
Arklon, sorry if I have taken this the wrong way. I don't understand why you would want to edit any of the campaign missions to have Balanced ore deposits or any single player missions for that matter. They were likely programmed like that for game play. I was only talking about multiplayer missions. I've heard that a few maps have issue with ore deposits being unfairly placed or the grade being unfair. This may or not be a huge problem, but people were talking about remaking entire maps or even new maps to fix this. I was just curious if it was possible to "fix" some issues with those maps simply (I don't claim that this would be simple or even be an easy fix. Just an idea that came to mind). Also original gameplay would be maintained if desired. That way if people wanted to play Build and Trade they could have Unbalanced ore for variety etc. If people wanted to play a competitive game style.  They could select a balanced ore checkbox which gives everyone an equal playing field.


Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Re: Balanced ore deposits
« Reply #6 on: February 09, 2015, 09:36:26 PM »
I don't think they're talking about remaking the missions, Harky.  I think they're talking about remaking OP2 from scratch.  You obviously wouldn't want to redo each mission if possible.  I imagine a toggle like this wouldn't even need to change any mission data at all; just go into the code that spawns mining beacons and set everything to 0 (for 3 bar, high-yield).  But there are other issues that came to mind when I complained about map balance, like terrain that favors one colony over another or the infamous Dynamix base layouts.

Also, nice to see you again.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
Re: Balanced ore deposits
« Reply #7 on: February 10, 2015, 05:28:07 PM »
It might be possible to create a mod that alters the function which spawns the mining beacons so that it only spawns one type, regardless of the parameters that are passed to that function. Adding an interface to the multiplayer lobby to switch that behavior on/off is likely more difficult, but would be safer than the ini-switch which is part of the mod-loader.

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Re: Balanced ore deposits
« Reply #8 on: February 10, 2015, 05:53:49 PM »
Arklon, sorry if I have taken this the wrong way. I don't understand why you would want to edit any of the campaign missions to have Balanced ore deposits or any single player missions for that matter. They were likely programmed like that for game play. I was only talking about multiplayer missions. I've heard that a few maps have issue with ore deposits being unfairly placed or the grade being unfair. This may or not be a huge problem, but people were talking about remaking entire maps or even new maps to fix this. I was just curious if it was possible to "fix" some issues with those maps simply (I don't claim that this would be simple or even be an easy fix. Just an idea that came to mind). Also original gameplay would be maintained if desired. That way if people wanted to play Build and Trade they could have Unbalanced ore for variety etc. If people wanted to play a competitive game style.  They could select a balanced ore checkbox which gives everyone an equal playing field.
Er, wha? No, I wasn't talking about the single player missions - the only point where I did mention the SP missions was when I said the MP missions would be generally less difficult to rewrite than SP missions as they tend to be less complex. Everything I talked about has been in relation to MP and the game setup screen.

toggle like this wouldn't even need to change any mission data at all; just go into the code that spawns mining beacons and set everything to 0 (for 3 bar, high-yield).
The hiccup is that a random beacon may or may not be created at all. Dealing with that means a more involving approach than simply intercepting or modifying TethysGame::CreateBeacon() calls is needed.
« Last Edit: February 10, 2015, 06:04:55 PM by Arklon »

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
Re: Balanced ore deposits
« Reply #9 on: February 11, 2015, 05:55:21 PM »
The hiccup is that a random beacon may or may not be created at all. Dealing with that means a more involving approach than simply intercepting or modifying TethysGame::CreateBeacon() calls is needed.
Yea, thats true. So, I guess, the best solution for people who want absolutely fair matches would be to create special maps. I remember that there has been talk about fair maps in the past.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Balanced ore deposits
« Reply #10 on: February 19, 2015, 07:32:37 AM »
I think Sirbomber and TH300 have the right implementation idea for a steady ore mod. Change the interface into the game engine in just one place, rather than update each level DLL.

You could possibly update the game setup window to add a new checkbox. That's starting to be a lot of work though. Adding options to the interface also means you'd need support in the network layer to send the new options to other clients. It also opens the door to adding a lot of simple options that could quickly clutter up the interface.

Allowing the game type to be selected after creation would be very nice. I was thinking of doing that early on in the NetFix patch, but then I realized that's a lot of extra work, and just re-using the existing pre-game window would save a heck of a lot of time and effort. If I'd held up the release to do that part too, people might never have seen the patch.

As stated, having steady ore does not fix unfair map layouts. Making symmetric multiplayer maps with consistent ore as a design feature might be the best way to allow fair games. It's probably more work than a simple mod to ignore beacon creation parameters and just set them all to zero though.

I think leeor_net might be right about effort though. If we'd taken the reverse engineering and patching effort we've put into the game already, and instead spent that effort on rewriting the game, we'd probably have a new game by now. But the problem with that is the long delayed gratification where there is little to see immediately, which tends to kill enthusiasm to keep up with a project.

Ignoring the recreation idea, and continuing with the reversing and patching concept....

I had given some thought to automating recreating existing levels. Basically create a new executable file that mimics the same exports as Outpost2.exe, and have it load the level DLLs and call the appropriate functions. The fake exported game engine functions would be simple stubs that would record the parameters they were called with. The recorded parameters could be emitted as a data structure describing the level, or perhaps as source code to make equivalent calls. You'd have to special case calls for random number generation though. Treat calls to rand like a branch point, and re-run level setup, stepping through the possible return values for rand, and accumulating the data. The idea was mostly for initial level setup, but it could be extended a little for run time changes, such as disaster creation. Once level setup was done, there should be a list of trigger callbacks available, which could be used to record information on disaster creation functions. At this point though, the project idea starts seeming a bit big. The calls to rand, and run time modifications really muddy the waters. But, the bulk of level code is in the initial game setup, not the run time modifications.

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Re: Balanced ore deposits
« Reply #11 on: September 20, 2015, 09:36:09 AM »
Multiplayer map balance has always been a issue with Outpost 2 along with the two race's balance. This has caused users to mostly play a small number of maps and to play as Plymouth.

The main issues:
  • Random nature of mines in a lot of maps
  • Not the same mines outside of the main base for all players
  • Base placement/layout including distance from your first mine to your smelter
  • Maps not being balanced in terms of terrain
  • The fact that the smelter dock is on the bottom right of the structure also needs to be considered
  • I am unsure on this one but is their variation in each of the bars? Eg can you get a 2bar 240 yield and a 2bar 300 yield? Are there infact 6 or 9 types of mines?

In balanced maps:
  • The distance from first smelter dock to first mine should be the same for all players
  • The expansion/outside mines/rest of the mines of the map should be the same for all players
  • The base layout should be similar and or mirrored

I have most likely missed some points..


Randomization can be ok in some situations but mostly to makes for a unfair playing field which is not fun for all players. RTS gamers are used to fair and balanced maps, multiplayer maps should be balanced, or at least there should be the option to play balanced maps. I have worked to do this with my work on the Nostalgia, Enter The Dragon and Improved/New Pie Chart maps.

Here is the mini map for Nostalgia. The map divided into four quadrants with the same mine spawning for each player. Starting with a familiar 2 bar inside the base and then just outside another 2 bar and a 1 bar rare.


Re-doing the maps is one option. Personally I think it would be easyier to make new DLL's for various maps and leave the .map files alone apart from maybe some minor tweaks like I have done to the Pie Chart map over the years. Also making all mines spawn as 2 bars is a nice idea for a mod.

I did also have a question for Hooman but I seam to have forgotten it..

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Balanced ore deposits
« Reply #12 on: October 06, 2015, 03:15:43 PM »
I vote new maps. I've never really delved into it much but I don't think it would be very difficult. Leviathan and I have chatted a bit about how we could make it easier for non programmers to make maps and my best guess is in having a map editor that has an integrated compiler and pre-built snippets of code that can be easily pieced together for standard maps. Any specialty scripting, etc. would need to be tuned by the map developer.

Again, I haven't really looked into what it actually takes to make new maps... maybe I'll try my hand at creating a few multiplayer maps and see what kind of tasks would be needed to make it work.

Offline lordpalandus

  • Banned
  • Hero Member
  • *****
  • Posts: 825
Re: Balanced ore deposits
« Reply #13 on: October 06, 2015, 03:56:32 PM »
If you look at the mines.txt (within sheets.vol) you'll see that there is indeed three variations for each ore yield (ie the number of bars 1, 2 or 3). It would be a relatively simple manner to simply change it so that ore yield was consistent among all of the same bar categories. If you edited this file then when you find a 2 bar it will always produce the same as any other 2 bar.

As for race balance, some tweaks could be made into the various .txt files available:

-> Could test out how much damage pure penetration damage and pure concussion damage deals against targets of varying armor strengths. Since the Laser is 40 Penetration and the Microwave is 20/20 and the Microwave appears better, it would be a good idea to see how the two damage types are utilized ingame. (I'd try it myself, but every time I've tried to modify the text files, on a Win7 computer, the game refused to load afterwards) Perhaps penetration damage means it deals more damage against armored targets, while concussion does more damage against lightly armored targets. If that was the case then that would be why Microwave dominates Laser in early game (as Lynxes start out with Light Armor). (Yes I know Plymouth also gets the faster rate of fire tech earlier than Eden which also has an effect too). Once it is determined which damage type deals more in the early game, modifications to the tech tree could be made. Perhaps in early game both weapons deal 20/20 damage to be on equal playing fields, but in late game with the damage upgrade, maybe Lasers deal 40/20 and Microwave deals 20/40.

-> If Eden is supposed to be the powerhouse of weapons technology, then all of its weapons could be tweaked, either giving them better range, better damage values, shoot over walls, better rate of fire, etc. Unfortunately that would take a lot of balancing to get the numbers right without making them too overpowered. The key problem with Eden is that the Laser doesn't compare to the Microwave and if the Plymouth player has the upperhand then Eden cannot get to its higher tier of weapons tech. Hence why Eden is almost never used.

-> While at the same time, if Plymouth is supposed to be the best at Morale, maybe change it so that morale granted far greater benefits if kept at maximum morale, thus encouraging some colony development in multiplayer. If morale was better then it might be worth the risk of building morale structures over combat units.

Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Re: Balanced ore deposits
« Reply #14 on: October 06, 2015, 04:53:50 PM »
leeor you should indeed take a look at Outpost 2 mapping, at least get to grips with it so you understand it and hopefully you can help to improve the process :)

So even with the balanced maps I have made two 2bars are not made equal. This does not create a balanced playing field. Maybe it should be addressed in the next update? Would like to do some testing first.. but yes. As far as I remember.. the mine starts with a set yield,, then after 80 marks or something it settles down.. and the settle down value is what is different between the mine variants.

Race balance has been discussed a lot and its a topic maybe for another thread.

These seam like reasonable suggestions lordpalandus, its along the right lines. Laser's need to deal more damage at the start of the game. To tweak the race's ideally it would be best to do minimal edits and avoid research edits if possible.

Morale is not a issue.. as competitive style multiplayer games are played with morale set to steady.

Any balance edits need some serious testing, Its not something I have time for currently and I need at least one other top player to test it with. I hope it can be done in the future.

Offline lordpalandus

  • Banned
  • Hero Member
  • *****
  • Posts: 825
Re: Balanced ore deposits
« Reply #15 on: October 06, 2015, 09:18:30 PM »
Actually I think I see the problem with the Laser.

If you look at edentek.txt and multitek.txt you'll notice that when researching Independent Power Systems it does DIFFERENT things.

In the campaign, researching that tech replaces the Laser damage with 45 Concussion Damage. In Multiplayer, researching that tech replaces the Laser damage with 45 Penetration Damage.

The other reason is because the Microwave deals 20/20 as base damage and with Independent power systems, it then deals 30/30. This is consistent with both campaign and multiplayer.

So I suppose the better question is: Which deals more damage to a Light Armor Lynx? 45 Penetration or 45 Concussion?
Currently working on Cataclysm of Chaos, Remade.
Link to OPU page = http://forum.outpost2.net/index.php/topic,6073.0.html

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Balanced ore deposits
« Reply #16 on: October 07, 2015, 06:14:40 PM »
Hmm, editing mines.txt would be an easy way to implement such a mod.

As for the 3 different variants of each bar, that's controlled by a parameter when creating the mine. If the parameter is -1, it will randomly select one of the variants. If the bar value is -1, it will also randomly select the number of bars. If it's a level under your control, just set a specific value for the variant (and bar yield), and it will be consistent between runs.


Off topic, but:
Penetration damage was not blocked by armor, while concussion damage was partially blocked, depending on armor level.
See: http://forum.outpost2.net/index.php/topic,3482.msg56142.html#msg56142