Outpost Universe Forums

Projects & Development => Outpost 2 Add On Missions => Topic started by: Vagabond on March 13, 2016, 12:47:38 PM

Title: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on March 13, 2016, 12:47:38 PM
Hey everyone,

I'm releasing a new Starship Colony Game for Eden. Attached to this post are the 3 required files to play, Ashes.map, c_ashes.dll, and multitekNoLavaWalls.txt. Just place the 3 files in your root Outpost 2 directory and the scenario should be available in your colony games selection screen.

There is a briefing screen in game before the map loads to explain the situation. You can Expect a basic AI mining colony and off map Plymouth attacks as explained in the briefing. For technology, expect normal colony game tech tree, except for the removal of Lava Walls. The briefing from the screen is below for reference.

The mission is included in the Outpost Universe copy of Outpost 2, but may also be downloaded from: https://github.com/Brett208/OP2MissionRisingFromTheAshes/releases

The scenario is compatible with Windows and WINE. Thank you Hooman for testing on WINE multiple times.

Source Code
The mission code is hosted on Github at https://github.com/Brett208/OP2MissionRisingFromTheAshes. For Development specific comments, check out http://forum.outpost2.net/index.php/topic,5797.0.html.

Bonus points if anyone can guess the background map I based this one on.

Mission Briefing

Resources on this planet can no longer support our operations. Our last chance for survival is launching a starship before the last resources are depleted. We have established our new base at the northern end of Haise Valley. Plymouth has taken control of a mineral rich area 120 kilometers outside of the valley and off your local map display. Plymouth also recently established a small, secondary mining outpost in the southern part of Haise valley.

Both our colony and Plymouth’s colony suffer from the lack of resources. However, Plymouth’s colony still has better resource access than our new base. Your orders are to construct an evacuation starship for 200 colonists and if possible prevent open warfare with Plymouth. So far, we have avoided harsh combat. However, do whatever you must for our survival.

What few usable minerals remain in the region are located near Mount Swigert in Haise Valley. Unfortunately, Mount Swigert is an active volcano and a catastrophic eruption is expected in the near future. Expect light to moderate earthquakes throughout the valley associated with the volcanic activity. The full Geological survey report has been uploaded to your Savant for review.

Relations with Plymouth remain icy. Based on Plymouth’s aggression toward our initial scouting units, we assess with strong confidence that activity in the vicinity of Plymouth’s mining outpost will certainly be attacked. Do not expect significant military action against our colony unless first provoked. A character profile of Rachel Borges, the outpost’s commander and satellite imagery of the outpost’s facilities have been uploaded to your Savant for review.

Good Luck Commander,
Failure is not an option

EDIT: Updated attachment with WINE compatible version of DLL.
EDIT: 28MAR15 - Updated attachment with smaller DLL. Editing briefing.rtf in Microsoft Word added a lot of unneeded metadata bloating the DLL size. Editing in Notepad++ or wordpad are better options for RTF size.
EDIT: 15APR15 - Updated attachment with a DLL no longer requiring Microsoft Visual C++ Redistributable 2015. File size is a bit bigger.
EDIT: 20APR15 - Updated attachment with a new DLL. Fixed bug preventing Lava from spreading. Increased difficulty when playing on hard.
EDIT: 05OCT16 - Updated attachment with a new DLL. Fixed victory condition bug preventing game from being winnable.
EDIT: 07APR19 - Updated tech tree to make lava walls unavailable.
EDIT: 08JUN19 - Moved release downloads to github
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Sirbomber on March 13, 2016, 06:02:08 PM
It's Twin Valleys (2P, Midas) with the middle cliffs removed and an ominous volcano added in their place.

Never underestimate my OP2 knowledge.  :P
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on March 13, 2016, 07:07:36 PM
Sirbomber nailed the map and ominous for the volcano is correct.

That is a good sign the scenario can be opened on other computers.  :D
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Sirbomber on March 13, 2016, 07:22:28 PM
Thoughts so far (note that I'm playing on hard):
There's one mining beacon on the entire map.  Would it kill you to have us start with a mine instead of just the miner?
It's mark 550 and I just barely have 50 people.  Could we start with a Standard Lab so that our scientists have something to do?  I think we start the game with unoccupied colonists at 50%.  Morale plummets hard and stays there, causing mass die-offs.
AI ConVecs try to repair buildings that are still under construction.
Disasters are WAY too common.  I had two electrical storms over my base at the same time.  Not fun.
The Plymouth outpost is laughably weak.  Its ESG Guard Posts aren't enough to offset the sheer quantity of Laser Lynx I can spit out.  Make the base stronger and get rid of this "reinforcements from off the map" nonsense.  What fun is that?  An enemy AI should be an obstacle to overcome, not a nuisance you have to deal with every 30 marks.
Seriously?  The only rare ore mine on the entire map is a 1 bar and you expect me to build the entire starship off of that?  This is the point when I stopped playing.  I'm not going to sit around for 4 hours just waiting until I have enough ore to win.  I wanted to be challenged, not bored.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: dave_erald on March 13, 2016, 08:05:11 PM
I've downloaded it just haven't played it yet
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on March 13, 2016, 09:34:04 PM

Thanks for trying it out.

Mild Spoilers below about how the map is played, but most can be gleaned from the mission briefing anyways...

The map is supposed to focus on resource management over combat, so I guess it isn't going to be a fast paced dual with the AI and is meant to be a slower paced scenario. The AI base is intentionally mediocre since they must be defeated to pick up rare ore. The off map attacks keep some pressure on the player through the end of the game regardless of defeating local AI and should ramp up as the player ramps up their space program.

If you pick the scenario back up, I'd be curious to know the resource/military state of your colony end game. If I am going to adjust the difficulty, I'd rather not ramp up the beginning and make the end game unplayable. I'm not a crack Outpost 2 player, so my version of hard may not be appropriately difficult for some.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Hooman on March 13, 2016, 10:57:57 PM
Thank you for releasing this.

I gave it a quick try under WINE and got a "Could not initialize game" error message. I also found the level DLL unloads right away when trying to load it in OllyDbg (also under WINE). I suspect the level depends on a runtime DLL that is not installed. There's probably some runtime pack that can be downloaded and installed for WINE. There might also be a way to adjust the build settings to reduce dependencies. Maybe something to look into at some point.

A virtual machine will of course work.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Highlander on March 20, 2016, 12:10:02 AM
I got this when trying to play the scenario
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Hooman on March 20, 2016, 04:14:32 AM
@Highlander: You can download the Microsoft Visual C++ 2015 Redistributable (https://www.microsoft.com/en-us/download/details.aspx?id=48145)

@Vagabond: You can try doing a static compile so the level doesn't link to an external runtime. This will make the DLL bigger of course, since any needed runtime functions must then be compiled in to your DLL. If you give this a try, it'd be nice to know the size difference. This would also likely fix the Wine compatibility issue.
Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library: Multi-threaded (/MT)
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on March 20, 2016, 08:51:40 AM

When I set Multi-Threaded Static Library (/MT), compiling the code generates a LINKER ERROR and LINKER WARNING. Errors Below

ERROR LNK2001 unresolved external symbol __except_handler4_common.
WARNING LNK4098 defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
MSDN artile concerning LNK4098: https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k%28LNK4098%29&rd=true

Attempting to ignore specific default libraries through the linker
I cannot get the code to compile using the instructions provided by the MSDN article by trying to set /NODEFAULTLIB. Although, I'm a little confused by the instructions.

When trying to set the project up for Single-Threaded, I place /NODEFAULTLIB and then specify /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib, I get about 17 Unresolved external symbol Linker Errors.

Adding vcruntime.lib as an additional dependency via the linker
So I cleared out /NODEFAULTLIB back to defaults, and instead internet searched the symbol __except_handler4_common. This apparently comes from the file vcruntime.lib.

I can add vcruntime.lib to Linker -> Input -> Additional Dependencies. Additional dependencies now reads vcruntime.lib;%(AdditionalDependencies). Now the DLL compiles, however it does kick back 4 LINKER WARNINGS. Three of the WARNINGS are LNK4049 locally defined symbol XXXX imported. The fourth warning is the original LNK4098 default defaultlib 'MSVCRT' conflicts with use of other libs.

The 3 imported symbol warnings all come from HFL, 2 from PaneGFXSurface.obj and 1 from UnitInfo.obj. The symbols causing the warning are _strcpy_s, _malloc, and _free. Here is the MSDN article on LNK4049 https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k%28LNK4049%29&rd=true. It seems that the warning is stemming from use of __declspec(dllexport) and __declspec(dllimport).

New DLL Results
The new produced DLL using /MT is 170KB in release mode. The older DLL was 93 KB. I briefly loaded the new DLL via Outpost 2 on a Windows 7 machine and it worked.

The new DLL is attached. If someone wants to try it using WINE, I would appreciate it. Of course, you will still need to download the ZIP file from the first post and include the .MAP and tech tree .TXT file with the DLL to run with Outpost 2.

I guess if it works for Hooman and Highlander, we can go back and try to clear the linker warnings out.


What operating system are you using to play Outpost 2?
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Hooman on March 20, 2016, 11:53:37 AM
I've just confirmed the new DLL works under WINE.

I think these linker errors will be worth looking into. It would be good if we had more knowledge on how things works, what exactly the compiler options do, what error messages mean, and how to go about debugging problems. This is the kind of thing that seems to come up when upgrading to newer versions of Visual Studio, so it would be good to have a nice article written on this.

Here's some info that might be useful:

Linker Tools Warning LNK4098 (https://msdn.microsoft.com/en-us/library/aa267384(v=vs.60).aspx):
This contains some of the info you mentioned. In particular for a non-debug single-threaded compile it mentions using options:
Code: [Select]
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib
Note that the link appears to be for VS 6.0, which is quite old now. (~20 years)

An interesting point on that page was:
You can use the linker’s /VERBOSE:LIB switch to determine which libraries the linker is searching.
That might really help with understanding and debugging the problem.

It might also be nice to get some details on the comment:
The run-time libraries now contain directives to prevent mixing different types.

/NODEFAULTLIB (https://msdn.microsoft.com/en-us/library/3tz4da4a.aspx):
Documentation for VS 2015 that explains what exactly the option does. Specifying the option without a library name should remove all defaults. I believe the Visual Studio 6 version of the SDK removed all default libraries, and then added in a custom C Runtime library, so this might be a good starting point. Level code is quite restricted, so there shouldn't be many dependencies by default. Another option might be to somehow specify a library compatible with older versions of Visual Studio.

CRT Library Features (https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx):
Some more info about the C-Runtime library. Dependence on the CRT, and it's different versions, seems to be where all this trouble stems from.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on March 22, 2016, 06:57:50 PM
I just tested the new DLL on my wife's computer running Windows 10, and it wouldn't work until I installed the Visual C++ 2015 Redistributable (x86). Outpost 2 would throw ERROR: Could not initialize Game until the pre-req was installed.

I updated the first page of post to reflect this. I also updated the first post's download to include the new WINE compatible DLL.

@Highlander, if you are willing to download the Redistributable, I would like to know if it fixes your problems.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: leeor_net on March 24, 2016, 04:39:08 PM

I didn't think I'd set up the new SDK with the VS2015 CRT dependencies. But I guess I have. Will need to look at that and see what flags I need to set in order to get it to work without needing that if it's even possible. Not sure if VS2015 would simply link in the CRT functions it needs if we opt for a non DLL approach.

/me scratches head
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Hooman on March 25, 2016, 08:20:48 AM
A Visual C++ 2015 project is naturally going to depend on the Visual C++ 2015 runtime. That's just how it is. If it's dynamically linked, then the runtime needs to be installed separately. Often newer versions of Windows will already have the runtimes installed. Certainly the developer will have it installed after installing Visual Studio. It's easy to miss things like this. It worked in the development environment after all.

If the example projects are switched to statically link the CRT, this problem should go away. Due to the restricted nature of Outpost 2 level DLLs, I don't foresee any problems with mixed duplicate CRT copies between the executable and the level DLL. At least not unless someone is going far out of their way to do something fancy and unusual, in which case they're probably able to debug any problems they cause.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on April 15, 2016, 04:52:55 PM
Hey everyone,

Thanks to some help from Hooman, I have eliminated any dependency on Microsoft Visual C++ 2015 Redistributable. The scenario should work on Windows or WINE with nothing special required. Also, issues I mentioned earlier about compiler warnings due to using different versions the CRT were resolved by standardizing the build process for all the library dependencies. The code in the repo will be updated with the changes by the end of the day.

The download link on the first post in this topic contains the new download.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Highlander on April 17, 2016, 01:07:09 PM
It worked fine now - without me downloading anything extra.

I ran through the scenario on hard without any difficulties - I didn't read beforehand how the scenario would play out, so I almost got myself dead in the end, when a big group of tigers suddenly emerged - good thing I didn't research Starship modules earlier I guess.

Anyways - I took my time setting up my base, spent time doing most research except weaponry. Eventually when my population got close to 100, I was operating 3x smelters and 3 vec facs and within 2 waves took out the AI using Laser Lynx. I sent a pair of convecs with a CC and Struc Fac down south and set up with 3x Vec fac's + 3 x Smelters on the mining location in what remained of the Plymouth base.
Mostly I was surviving using a 3:1 combo of Laser/EMP lynx. They could hold off any attacks until the Tigers arrived - which point it was a loosing battle, and quite a surprise when the first wave occured, around mark 1700. However, some quick production of reinforcements and eventual delay with EMP Lynx only saved the game - my Rare ore smelters filled up just in time to build the Rare ore module and I could let go of my southern outpost and launch the Evac Module before losing colonists to the tigers :)

A couple of points:
- There was a volcanic eruption, but not much Lava.. intended ?
- Like Bomber mentioned, the lack of ore makes things a bit slow (I didn't know about the scaling of attacks and how it works, but now that I do, it simply becomes a waiting game to stockpile Rare ore, build up Tiger defenses, then eventually when all is set, research Spaceship Modules for some last action)

Otherwise, thanks very much for making a scenario! :D
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on April 19, 2016, 07:13:43 AM

Thank you for trying the scenario out!

The lava was supposed to wipe out all mining beacons on the map before you are able to complete the starship, forcing you to use stockpiled ore for the starship project/build up metals storage in your base. The lava should advance fairly slowly but by mark 1700 it should have been covered the beacons. It sounds like a bug occurred that stopped it from spreading. I'll have to test that some more and see why the lava isn't spreading.

The mid wave panther attacks are triggered by constructing your spaceport, so you can indeed 'game' it some by delaying construction of your spaceport. On hard, I could attach their arrival to either the construction of the spaceport OR a specific mark, that way they will come no matter what. Perhaps I could force there arrival by mark 1100? I could also bump up the number of panthers in the mid range attacks by maybe 4 per wave on hard or so?
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on April 20, 2016, 02:58:42 PM
Okay, found the bug with the lava. When refactoring a function, I forgot to add back in the +31 X and -1 Y necessary to align the lava area to the map. I fixed this bug and Upped the difficulty when playing on hard. On hard, the 3 middle wave squadrons have more tanks and if you delay your space program, they will eventually start attacking anyways.

I played the scenario through on the new hard setting and was unable to launch the starship. I think perhaps I could have played better and maybe beaten it. I was resorting to recycling structures at my GORF to keep my common ore supply up by the end, but came up short on rare ore. I didn't research RLV, which may have helped with the ore issue.

the scenario should prove adequately challenging even to a veteran player now. If not, let me know and I'll see about upping the difficulty even more. I intend to leave the scenario at a slower pace though. The download attached to the first email has been updated.

Highlander, thanks again for playing and the feedback.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Exidoous on October 03, 2016, 11:59:59 PM
Played on Normal. Fun colony game, tight time and resource demands by my relative incapability. First time playing, I didn't get Rare Ore mining going fast enough, and with only one smelter for most of the time. The lava eating the ore is a good surprise, and it cost me that game. On reload I planned for it, and got everything done. I was unable to complete the mission because the objective flags were not satisfied. Skydock worked, but the Rare/Common/Food storage flags did not turn green when I launched them. When I launched the evacuation module, I was down 200 colonists but the scenario did not end. Still though, got to enjoy the entire scenario, getting on the high score list isn't my concern.

My install is based on 1.34, so that may be the problem.

Thank you for doing this project!

Other suggestions:

The volcanic threat is pointed out in the briefing, but it was still surprising that it cost all ore supplies. One absurdly labor intensive idea I had was to use the "smooth" black terrain to indicate the eventual spread of the lava, the way the Dynamix maps did. In the colony games, the regular "matte" black terrain that you used would not always end up with lava on it, but the "smooth" black lowlands within it would. Had I seen the same around the enemy mines, I would have had a better hint what was coming.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on October 04, 2016, 01:35:18 AM

Welcome to the Outpost forums!

Thank you for the feedback! I doubt that playing with 1.34 would affect the victory conditions not being fulfilled, so it is probably a bug on my part. I remember the winning conditions being a problem for another person who played, which I thought that I had solved. I'll replay the scenario and see if I can reproduce/fix the winning issue. What difficulty were you playing on when the victory bug occurred?

I'm glad to hear that I fixed up the lava properly and it destroyed all the mines! You are right that I got a little lazy with my map making which is why the smooth black lava rock didn't make it all the way down. I had a lot of trouble finding and matching the tiles that transitioned from the smooth lava rock to the matte/grayer lava rock.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Exidoous on October 04, 2016, 11:04:51 PM
Thanks for the kind welcome, I'm very glad you folks are keeping this great game going.

I played the scenario again, this time on Hard. Same starship objective bug.

The lava seemed to arrive much earlier, or maybe I was just slower, but that makes me think my first games were on Normal difficulty.

I've attached my save file, but if I remember correctly that may not be of much use with this game.

If it does work, while you're launching the last couple starship components, uh, remember to distract the Plymouth Tigers with the Scout...

Regardless, thanks again.
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on October 05, 2016, 04:08:21 AM

Thank you for the clarification. You are right, the lava does come significantly earlier when set to hard difficulty. Unfortunately when trying to load your saved game, I received an ERROR box. Outpost 2 did draw the mini-map with your units on the right of the save screen, so it recognized the file to some extent. Not sure if saves are supposed to be compatible between 1.3.4 and 1.3.5 and I was testing with 1.3.5. No worries though because I reproduced the bug on my machine and then fixed the problem. When refactoring (i guess?) I somehow set Boolean values wrong when initializing 4 of the 5 victory conditions.

The download in the first post of the forum has been updated to include the newer DLL. Since victory conditions are initialized when the scenario is first loaded, I doubt that it will 'let you win' with your current saved games and the scenario would have to be restarted.

Ignore the rest unless you are reviewing source code
In regards to the source code besides fixing the victory conditions, I added a function that grants massive resources and research to the player if enabled for debugging purposes. The function call is commented out for the release version. I also added a preprocessor directive that ignores the function call if not built in debug mode in case someone forgets to comment it out in a release build in the future. The changes have been pushed to the repository.

Back to zero downloads on the mission files again.  Version 5. :)
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Exidoous on October 11, 2016, 05:10:28 PM
Downloaded and tested. Completed on hard. Great job and thanks again!
Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on April 07, 2019, 08:57:13 PM
Quick update. Thanks to discussion and playtesting by lordpalandus, Crow!, and pente it was brought to my attention that lava walls were available at scenario start. I had intended to disable this feature. Apparently deleting the lava defenses tech from the tech tree makes it available at game start. I just added the Lava Defenses tech back in and made it only available to Plymouth which fixed since the starting player is Eden.

Added a Ver6 download on the first post. You only have to add the tech tree to the root directory to fix as it is the only new file. (Or you could just not build lava walls :) )

Will try to update on the master game download when the subversion repository is restored.

Title: Re: Colony Game - Eden Starship, Rising From the Ashes
Post by: Vagabond on June 08, 2019, 08:21:37 AM
I pulled the source code for Rising from the Ashes out of the SVN repository and started hosting it on GitHub. See links in the first post for where to find the source code and releases.

The release listed on GitHub is Ver1.0.7, which contains small improvements to the codebase, but no new functionality. This release is to sync with a new PDB for debugging and the source code on GitHub with what will be contained in the official Outpost 2 download from Outpost Universe.