I posted my nearly completed Eden Starship Colony Game to the repository under
https://github.com/Brett208/OP2MissionRisingFromTheAshes.
The scenario isn’t finished yet. However, it is playable and mostly complete with fairly balanced gameplay (in my opinion). I’m looking for a code review plus some specific help if someone has some time to dig through what I uploaded.
In particular- Am I following best practices using C++, and suggestions to improve
- Am I following best practices using the Outpost 2 SDK, and suggestions to improve
- Specific help with the problems outlined below (listed in order of importance to me)
Critical Mission Objectives BugSolved by Hooman & ArklonIf you save a scenario and then reload it and check the mission objectives tab, the game will crash. I would really like to see this fixed, but I’m unsure what is causing it. I am guessing something is happening with the save data not capturing something that it needs to about the mission objectives. Also, when you launch the evacuation module and complete the starship, fulfilling the final victory condition, you lose the game instead of winning.Showing a Mission BriefingFinally have briefing screen working. Closely followed angellus' code in the Mission within the repository (which is in turn heavily based on BlackBox's code). I have a lengthy mission briefing which you can read in the level’s root directory in the file briefing.rtf. (If anyone wants to proofread and make suggestions, I wouldn’t mind) I want this to appear in a pop-up window before the scenario starts like BlackBox’s Cold War scenario does.
Unfortunately, I have been defeated by the process and am requesting a major assist. BlackBox appears to have used a combination of Resources, Win32 API, and a Dynamix DLL calls to ODASL to make the window appear. I am coming from zero experience with Resources and Win32 API besides spending a few hours reading about them online. Programming Outpost 2 scenarios is very humbling for a hobbyist programmer. I’m encountering a lot of stuff I’ve never touched before.
I have a dialog box described in the resource script file. Although I’m not sure I’ve identified all the required properties in the resource.h file from the dialog box.
Whenever running the scenario in Outpost 2, it just skips the briefing screen and goes straight to the scenario, probably just failing gracefully since my code isn’t opening a dialog box correctly.
Okay, so the next issue is that I cannot find a built in resource type for a rich text document. I decided that it might be easier just to load the briefing from an rtf file that wasn’t an embedded resource. I have a separate project that can open an rtf file and load it into the richedit2.0 Control that is part of the resource dialog box. See BOOL FillRichEditFromFile(HWND hwnd, LPCTSTR pszFile). Unfortunately, it requires MFC (Microsoft Foundation Classes), which I think I would rather avoid if possible. Although I think using the control RichEdit2.0 requires MFC anyways?
So to summarize, can someone walk me through opening a dialog before the mission starts with a mission briefing, or go into my source code and tweak it to work. Please back-fill me if you tweak yourself so I know what is going on.Tech TreeI’m using Multitek.txt with the exception of disabling Lava Defenses for Eden. I created a new tech tree (multitekNoLavaWalls.txt) and removed Eden’s ability to research Lava Walls. I would rather not create a whole new tech tree just to disable Lava Walls. Is there an accepted way to restrict an individual technology for a player through the API, or am I stuck keeping a new tech file?
AI Base Repair BugsI had difficulty nailing down good repair code for the AI’s base. I ended up just designating an AI convec as their repair vehicle. I enumerate through all the AI’s buildings and check if a building is damaged enough to need repairs and then send the convec. The only problem is, the convec goes off and tries to repair buildings that are under construction. I cannot find a way to differentiate between buildings having low health due to being under construction vs post construction damage. Some help here would be appreciated. The AI colony does fine with this erratic repair behavior, it just looks a little odd.
Also, if you destroy the AI’s vehicle factory and construction convec, then the repair convec will not switch roles and construct a new vehicle factory, basically stalling out the AI’s base. This isn’t too big a deal because if you have penetrated the AI’s defenses far enough to destroy both one of the convecs and the vehicle factory, the AI is probably done for anyways. I think I could hack a solution for it, but when I started, the code became very ugly and gory fast. This probably stems from my poor hack at repair code. I think I’ll leave this bug in place unless someone has a simple easy solution.
To summarize the repair bugs, if someone knows how to do this better, please let me know, but I’m not too worried since the scenario is very playable even with these quirks.
Project Admin NoteThe post build events assume your Outpost 2 install is
C:/Outpost 2 Divided Destiny using the GameDownload directory of the repository. The DLL, MAP file, and tech tree will all be copied on successful build of the project.
The 3 required copy commands are remarked out by default so no files will be copied into a directory on someone's computer unless they want them to and remove the remarks from the post build event.I think everything needed is loaded into the SVN, but I am new to subversion, so let me know if I missed something.
Sorry for the long post, hopefully some people can help with my laundry list. :|
----
Edited to reflect changes in project's post build events.
Edited again to cross out fixed problems. Thanks to Hooman for finding the fix!