Outpost Universe Forums

Outpost Series Games => Outpost 2 Divided Destiny => Topic started by: Crow! on March 03, 2019, 03:44:17 PM

Title: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 03, 2019, 03:44:17 PM
A while ago, I put together a hard difficulty speed run through Plymouth's campaign.  Recently, I've turned my attention to Eden.

So far, my best time is 2:20:08 (https://www.twitch.tv/videos/388871898?t=14m03s).  Follow my Twitch channel (https://www.twitch.tv/iicrowii) for future attempts; I'll be trying to bring the time below 2 hours in the next week or so.

Attached to this post are the notes I made while designing my strategies for the run.  I assume the reader is already familiar with the structure and spaceship part cloning techniques; the Eden campaign benefits from (and indeed relies upon) these glitches far more than the Plymouth campaign did.  Whereas the Plymouth campaign was consistently limited by its population and therefore its researching rate, Eden is instead usually limited by its metals income, which is exactly the problem that cloning solves.

One non-obvious decision I made: I intentionally skip Acid Weaponry.  Although Acid Clouds are probably the best weapons in Eden's arsenal in a head on army vs army engagement, that is simply not what the game sends your way in the campaign.  Plymouth swarms you with units from all directions, and the campaign has you push past a variety of objects that you have no need to take out but which the acid cloud units will gladly inflict friendly fire upon your own units as they target them automatically.  In the unit missions, not researching Acid Clouds seems to cause the units that would otherwise have had that weapon to instead have something you actually possess, rather than them not spawning at all.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Hooman on March 03, 2019, 11:36:20 PM
Very interesting note about the Acid Cloud weapon. And you're right, the attack waves in the campaign aren't really something you need Acid Cloud to fend off.

Might I suggest also posting the contents of your text file inline in the message, for ease of reading? If it's too long, you can split it over multiple replies.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 16, 2019, 01:02:02 PM
A strategy change:
In mission 10, I no longer make an RLV.  If you do have a living RLV (it does track whether it dies or not), then you are awarded one at the start of mission 12.  However, for some reason, Plymouth's biggest attack (the very first one, oddly enough) in mission 12 seems to have an occupied launch pad as a prerequisite, so by denying myself the RLV, I can delay that attack until after I've already developed my economy, rather than having to interrupt my economic setup with defenses right at the start.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 17, 2019, 09:56:28 AM
During yesterday's attempt, I learned that:
- In the raid on Plymouth's base, if just one garage is alive, that garage spawns all 24 reinforcement lynxes, not just the 6 that were supposed to be associated with it.  It can even be a garage that got rebuilt after all the vehicle factories were already dead.
- In the second starship part collection mission (mission 9), there exists a possible enemy reinforcement pattern that I cannot reasonably deal with.  It is extremely rare, from what I've seen.  Most of the time, there are no reinforcements whatsoever, so when 8 units appear on top of a truck at the end of the mission, I'm not really sure what to do about it.  It would be great if I could know what triggers reinforcements to appear in that mission.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Hooman on March 17, 2019, 01:08:48 PM
Very interesting observations. I wonder how you discovered the occupied launch pad as a trigger. If you get the RLV right away, but keep launching it (empty) right away each time it lands, does that also delay the attack?

I took a quick look at Eden mission 12 in OllyDbg, to see if I could verify the launch pad idea, though I don't see anything obvious to check specifically. It has quite a few trigger exports. Too many to check all of them. Here's a quick list of exports:
Code: [Select]
Names in e12
Address    Section    Type       Name                                                         Comment

; Required exports
11001130   .text      Export     GetSaveRegions
11001150   .text      Export     InitProc
11001210   .text      Export     AIProc
11001230   .text      Export     StatusProc

; Trigger callbacks
11003090   .text      Export     EnemyArrive
11003190   .text      Export     NoResponseToTrigger
110031A0   .text      Export     Tornado
11003240   .text      Export     TornadoStop
11003260   .text      Export     StormStart
11003340   .text      Export     StormStop
11003360   .text      Export     Storm1
11003390   .text      Export     Meteor1
110033C0   .text      Export     Meteor2
110033F0   .text      Export     MeteorStart
11003460   .text      Export     MeteorRepeat
110034D0   .text      Export     Quake1
110034F0   .text      Export     Quake2
11003510   .text      Export     Quake3
11003550   .text      Export     KidsInSpace
110035D0   .text      Export     KidsArrived
11003680   .text      Export     KidsDead
110036D0   .text      Export     BringInKids
11003870   .text      Export     RestartKids
11003950   .text      Export     SetPiece
11003970   .text      Export     StartEnemies
11003B40   .text      Export     StartEMP3
11003C50   .text      Export     FireEMP1
11003CC0   .text      Export     FireEMP2
11003EF0   .text      Export     FireEMP3
11003F00   .text      Export     Wave1
11004000   .text      Export     Wave2
110042A0   .text      Export     Reinforce1
11004350   .text      Export     ToggleRe
11004380   .text      Export     ReinforceArrive
11004520   .text      Export     CheckForFail

; Required data exports
11008090   .data      Export     MapName
110080A0   .data      Export     LevelDesc
110080B8   .data      Export     TechtreeName
110080C8   .data      Export     DescBlock

; Other data exports
1100AAF0   .data      Export     Units3Hard
1100AB78   .data      Export     Units4Easy
1100AC00   .data      Export     Units1Norm
1100AC88   .data      Export     GroupType2NormB
1100AD10   .data      Export     GroupType2NormA
1100AD98   .data      Export     Units4Hard
1100AE20   .data      Export     Units1Easy
1100AEA8   .data      Export     GroupType2Easy
1100AF30   .data      Export     Units2Norm
1100AFB8   .data      Export     GroupType2Hard
1100B040   .data      Export     Units1Hard
1100B0C8   .data      Export     Units2Easy
1100B158   .data      Export     Units3Norm
1100B200   .data      Export     GroupType1
1100B288   .data      Export     Units2Hard
1100B368   .data      Export     Units3Easy
1100B3F0   .data      Export     Units4Norm

If I was more familiar with the mission, I might have a better sense of which trigger callbacks did what.

I also took a quick look at Eden mission 9 in OllyDbg. Here's a quick summary of the exports for mission 9. Again, if I was more familiar with the mission, I'd have a better sense of what was worth looking at.
Code: [Select]
Names in e09
Address    Section    Type       Name                                    Comment

; Required exports
110010B0   .text      Export     GetSaveRegions
110010D0   .text      Export     InitProc
11001210   .text      Export     AIProc
11001220   .text      Export     StatusProc

; Trigger callbacks
11002EC0   .text      Export     Located
11002ED0   .text      Export     CheckForEnd
11002FF0   .text      Export     NoResponseToTrigger
11003000   .text      Export     Quake1
11003020   .text      Export     Quake2
11003040   .text      Export     Quake3
11003120   .text      Export     Tornado
11003160   .text      Export     TornadoHard
110031A0   .text      Export     Storm
110031E0   .text      Export     Lava
11003200   .text      Export     EnableAmbush
11003260   .text      Export     DoAmbush1
110033E0   .text      Export     DoAmbush2
11003560   .text      Export     DoAmbush3
110036E0   .text      Export     DoAmbush4
11003860   .text      Export     ReinforceE
110038C0   .text      Export     ReinforceP
110038F0   .text      Export     ToggleP

; Required data exports
110070F0   .data      Export     MapName
11007100   .data      Export     LevelDesc
11007110   .data      Export     TechtreeName
11007120   .data      Export     DescBlock

; Other data exports
1100A080   .data      Export     Ambush3BEasy
1100A108   .data      Export     Ambush1BHard
1100A190   .data      Export     Ambush4AHard
1100A218   .data      Export     Ambush4BEasy
1100A2A0   .data      Export     Ambush2BHard
1100A328   .data      Export     Guard3Easy
1100A3D0   .data      Export     Ambush2BEasy
1100A458   .data      Export     Guard1HardB
1100A4E0   .data      Export     Guard1HardA
1100A568   .data      Export     Ambush1BEasy
1100A5F0   .data      Export     Reinforce2
1100A678   .data      Export     Reinforce1
1100A700   .data      Export     Ambush3AHard
1100A788   .data      Export     Ambush3AEasy
1100A810   .data      Export     Ambush1AHard
1100A898   .data      Export     Ambush2AHard
1100A920   .data      Export     Ambush3B
1100A9A8   .data      Export     Ambush3A
1100AA30   .data      Export     Guard2
1100AAB8   .data      Export     Ambush4B
1100AB40   .data      Export     Ambush4A
1100ABC8   .data      Export     Ambush1B
1100AC50   .data      Export     Ambush1A
1100ACD8   .data      Export     Ambush2B
1100AD60   .data      Export     Ambush2A
1100ADE8   .data      Export     Ambush4AEasy
1100AE80   .data      Export     Ambush2AEasy
1100AF08   .data      Export     Ambush1AEasy
1100AF90   .data      Export     BonusTok
1100B018   .data      Export     PatrolY
1100B0A0   .data      Export     PatrolX
1100B128   .data      Export     TowersEasy
1100B1B0   .data      Export     Scout1
1100B248   .data      Export     PBase
1100B2D0   .data      Export     Reinforce2Easy
1100B358   .data      Export     TowersHard
1100B3E8   .data      Export     Ambush4BHard
1100B470   .data      Export     Guard1EasyB
1100B4F8   .data      Export     Guard1EasyA
1100B5B8   .data      Export     Guard3Hard
1100B640   .data      Export     Ambush3BHard

Edit: I looked more specifically at EnableAmbush. It uses a Rect trigger. The Rect appears to be:
Code: [Select]
x = 110  (0x6E)
y = 96  (0x60)
width = 8
height = 9
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: lordpalandus on March 17, 2019, 02:13:05 PM
When you say they spawn ontop of a truck... is it the last part you acquired? I generally send my trucks back to the rally point immediately so that a patrol doesn't lynch them, the moment they grab their haul.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 18, 2019, 01:16:55 AM
When I say "right on top of the truck", I'm talking about when the last part I take is the western one, and reinforcements appear from the western entrance.  If the western ambush happens, 3 out of the 4 part locations are not positioned somewhere that I could escape without a fight.

My current strategy is to avoid triggering the volcanic eruption and associated earthquakes by delaying the pickups of the western and northeastern wreckage locations.  The quakes and volcano get scheduled once you take the third out of four starship parts.

Hmm, the rectangle Hooman mentioned appears to be around one, but only one, of the possible locations for the "could be virtually anywhere" starship part.  I've identified 6 locations for that part, so the odds I absolutely have to enter it are pretty low.  Avoiding that box while scouting might be hard, though - there's an ESG turret nearby and some other locations I need to check.  I guess I could bring a couple combat units along the west side of the map to take it out.

I'll have to test what that trigger actually cares about.  Does it cause ambushes if I enter the area after I've collected all the parts, or does entering it at any time enable an ambush in the future?

I took a look at the OP2 coding tutorial, and unfortunately the description given for rects is "Use the Escape trigger instead.", which doesn't help me much here.

Attached to this post is my current understanding of the map.  The colored squares are the possible wreckage sites, while the green box is the rect trigger Hooman described.  One wreckage site is placed among the green squares, one among the red, etc.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Hooman on March 18, 2019, 05:43:52 AM
Hmm, interesting. Very helpful to see a visual.

This makes me wish we had an easy way to visualize initial units on a map, rather than just an empty bare map.

Perhaps I'll find some time to look more into the triggers. Quite likely the trigger will activate as soon as anything player owned enters the rect. I believe it's used as an enable trigger, so there may be some time delay between activation, and when you see the results.

Curious question, since you're looking into the mission coding tutorials, did you have any interest in learning to use OllyDbg?
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Hooman on March 18, 2019, 07:54:52 AM
Ok, I went over a bit of code in more detail. I analysed the function at address 0x11003D00 in e09.dll. This method is called from InitProc, and seems to setup the triggers and victory/failure conditions for the level.

Slight correction over my earlier post. There are 4 rects, each of which leads to an ambush. The rects are initially disabled. They are enabled by a CountTrigger. If you have greater than or equal to 4 cargo trucks carrying wreckage, the ambush rects are enabled.

The 4 rects, and the corresponding trigger callbacks are:
Code: [Select]
//Rect(x, y, width, height)
Rect(110, 96, 8, 9) => Ambush1
Rect(147, 78, 3, 8) => Ambush2
Rect(41, 94, 15, 19) => Ambush3
Rect(112, 16, 3, 4) => Ambush4

Both players have a reinforce VehicleCountTrigger. It is a one-shot trigger.
If Player 0 has fewer than 8 units, call "ReinforceE"
If player 1 has fewer than 8 units, call "ReinforceP"

In addition to those triggers, there is a CountTrigger for player 0:
If player 0 has greater than or equal to 4 cargo trucks with wreckage, call "ReinforceE".

That should imply player 0 can get two sets of reinforcements, once when low on units, and once after picking up all 4 pieces of wreckage.

There is a "ToggleP" trigger. It is called periodically by a repeating TimeTrigger. The frequency depends on difficulty setting:
Easy = 5000 ticks
Medium = 3000 ticks
Hard = 1200 ticks

The "ToggleP" callback has some code involving FightGroups. It uses DoGuardRect, and SetRect. There seems to be a static Rect variable, which is initialized elsewhere with the values (81, 115, 101, 126). The method makes use of the player difficulty setting and random numbers. It references "Reinforce1", "Reinforce2", and "Reinforce2Easy". I've not looked at this method in much detail.

The main trigger setup function also sets up disaster triggers for various disaster types, at various intervals. A few looked interesting.

If player 0 has 3 or more cargo trucks with wreckage, call "Quake3".

Tornadoes vary by difficulty setting:
Easy, Medium = 12000 ticks to 18000 ticks
Hard = 5000 ticks to 6000 ticks

Storm: 5000 ticks to 11000 ticks

Quake1: 8400 ticks

Quake2: 24000 ticks

Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 18, 2019, 09:34:03 AM
How many ticks are in a mark?

Is ambush 2's rect data correct?  The map is 128x128.  Do rect dimensions wrap around the map?  Maybe that ambush box was directly translated from Plymouth's map and they didn't double check it?  IIRC the Eden and Plymouth versions of this map are the same, but shifted east/west by like 64 tiles or so.

Attached is an update with the other two in-bounds ambush boxes.  I'm actually not sure on the exact position of the yellow wreckage; I placed the squares by memory, and my notes don't have the exact coordinates of the wreckage that I found easy to locate.  It would make sense if the part is inside the ambush box.

In any case, this may explain my problem.  If they assumed that your forces were going to move together through the map as one big ball, they may have looked at the NE corridor as a friendly place to create the ambush on the west side.  However, since I'm spreading out through the map to clear it all at once, I'm sometimes, but not always, passing through that area when I claim the last part.  So, I may actually avoid the ambush by delaying the western part pickup until after the other trucks are through the NE ambush trigger.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Hooman on March 18, 2019, 09:52:12 AM
There are 100 ticks / mark.

I double checked the Rect coordinates. They are correct. They are however internal values lifted from the code, not what is displayed in game. The game internally stores maps shifted by 1 column of 32 tiles (unless it's an around-the-world map). It also uses 0-based indexing internally, but displays coordinates at 1-based. Hence you may need to translate the coordinates to get what shows up in game.

I forgot about that coordinate conversion mess. Sorry about that. To convert back to the game's display coordinates, I think you need to do something like (x - 31, y + 1).

That would seem to make sense given the second Rect, and the map you've displayed.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 18, 2019, 10:27:08 AM
OK, with that update, it appears that the only part that is actually inside an ambush box is one of the locations for the western part.  Meanwhile,  the NE corridor ambush trigger is much further toward the return location, raising the possibility of dodging it by going around the northern middle tier of the central mountain.  The previously out of bounds box is covering the SW exit from the advanced lab base on the east.  It's a common place for my heavy units to wind up at the end of the mission, so I'll have to make sure they clear that zone.

This makes getting the parts home safely a bit of a graph theory problem, but at least I now know the rules.  I'll still have to check which angle of attack is triggered by which zone; some of them may be defendable without losing time getting units into position.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 18, 2019, 01:28:37 PM
OK, here is my final revision of the Eden Mission 9 map.

Triangles represent guard posts, while diamonds represent enemy combat units.  White lines indicate patrol routes.  As before, there will be one wreckage site of each color.

Once you have all 4 wreckage parts, having a unit of any type in a box of a given color will summon reinforcements from all arrows of that color.  If a given reinforcement wave was already sent, it will not be sent again, not even from touching a different box.  The two southern reinforcement options are also mutually exclusive; though they spawn from different locations, triggering one will block the other.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Hooman on March 18, 2019, 01:39:19 PM
Curious, the red rectangle looks to be in the same place as the previous image. Should that one be shifted?

And thank you very much for posting these maps with diagrams. These could be really useful to people looking for a strategy guide. I'm wondering now if there's some way we could tool things to help automate producing such images. I would love to see more like this.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 18, 2019, 01:41:06 PM
The red reinforcement trigger zone has shifted slightly.  I apparently did my math wrong the first time I drew that rectangle, so not as much of a shift was needed as should have been.

As for automation, I suspect that, for 24 total campaign missions, the effort needed to make an automatic map generator is probably on the same order as making them manually.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Vagabond on March 19, 2019, 10:16:36 PM

The images with arrows and rectangles are pretty cool. Did you just pull those from the wiki pages, or did you render them with OP2MapImager? I tried to chose decent size without getting crazy for the wiki, but custom sizes can be rendered.

Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Crow! on March 19, 2019, 10:54:31 PM
I used the Wiki's map images, and just did arithmetic to convert from map coordinates to image locations.  I considered using the mapping tool I had downloaded a while ago to get a full resolution image, but decided it wasn't necessary.  I'm not familiar with a specific image creating tool, though.
Title: Re: Speedrunning Outpost 2: Eden edition
Post by: Hooman on March 20, 2019, 01:32:57 AM
Insert plug here:  ;)
(It produced the wiki images)

We started a bit of work on the backend code to load sprites (unit images). Maybe at some point we can find a way to image initial units.  :)