Author Topic: Colony Games And Multitek Altering  (Read 5947 times)

Offline Warcaliptolf

  • Newbie
  • *
  • Posts: 11
Colony Games And Multitek Altering
« on: September 17, 2010, 04:29:50 AM »
I'm sure plenty have tried or broken the game doing stuff, but I was curious is there a way to see what's crashing a colony game if oh say...I were trying to use multitek2 with it but only eden colony(easy, norm, hard) and colony II plymouth starship(easy) crashed?(it relates to the multitek info, so I'm curious what's doing it so I can remedy it...or try to put a dummy research for it to avoid errors)

I remember SOMEWHERE there was a debugger but I lost track. And I think I read that colony games(defaults) are unchangable due to no source code, so I can't fix it change stuff that way.

Offline Angellus Mortis

  • Full Member
  • ***
  • Posts: 138
Colony Games And Multitek Altering
« Reply #1 on: September 17, 2010, 07:55:32 AM »
Here is a topic about removing disasters from the game. Read what Hooman said about OllyDbg.

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Colony Games And Multitek Altering
« Reply #2 on: September 17, 2010, 08:44:53 AM »
MT2 isn't backwards-compatible.  Use it with maps designed for use with MT2 only or it won't work.  I mean, duh.
"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 Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Colony Games And Multitek Altering
« Reply #3 on: September 17, 2010, 10:56:35 AM »
It might have to do with maps setting some initial techs, either for you, or for the AI. I assume that if it can't find a tech ID, it will crash.
"Nothing from nowhere, I'm no one at all"

Offline Warcaliptolf

  • Newbie
  • *
  • Posts: 11
Colony Games And Multitek Altering
« Reply #4 on: September 17, 2010, 02:58:34 PM »
yeah but I got it working with plymouth colony II starship last night(something research number related). so I think it can work for at least my enjoyment...and maybe breaking some things finding out why it pulls a "not responding" error.

which I remedied with colony II plymouth starship by changing the university, nursy and maybe another to old research values that the map wanted. eden population continues to resist BUT it errors with the game loaded, not before.(map shows and it begisn to say "command contrl initiated" but cuts off at COMM)

and that was the debugger I saw and went looking for again

EAX 00000000
ECX 01CEBE00
EDX 00000001
EBX 00000000
ESP 0012EE40
EBP 0012EE7C
ESI 180EAFAA
EDI FFFFFFFF
EIP 00472D78 Outpost2.00472D78
C 0  ES 0023 32bit 0(FFFFFFFF)
P 1  CS 001B 32bit 0(FFFFFFFF)
A 0  SS 0023 32bit 0(FFFFFFFF)
Z 1  DS 0023 32bit 0(FFFFFFFF)
S 0  FS 003B 32bit 7FFDE000(4000)
T 0  GS 0000 NULL
D 0
O 0  LastErr ERROR_SUCCESS (00000000)
EFL 00210246 (NO,NB,E,BE,NS,PE,GE,LE)
ST0 empty -??? FFFF 18C518C5 18A41CC5
ST1 empty -??? FFFF 000018C5 00001CC5
ST2 empty -??? FFFF 00000000 18A40000
ST3 empty -??? FFFF 00000000 0C621CC5
ST4 empty 44100.000000000000000
ST5 empty -??? FFFF 0000FFFF 0000FFFF
ST6 empty 0.2540932297706604004
ST7 empty 8661.1001610649909710
               3 2 1 0      E S P U O Z D I
FST 0121  Cond 0 0 0 1  Err 0 0 1 0 0 0 0 1  (LT)
FCW 027F  Prec NEAR,53  Mask    1 1 1 1 1 1

and the logging says Log data, item 0
 Address=00472D78
 Message=Access violation when reading [180E94B2]

00472D78  |. 8B5E 1C        MOV EBX,DWORD PTR DS:[ESI+1C]



I have no idea what I'm looking or what 180E94B2 is pointing to...and I'm hungry so I'll see later
« Last Edit: September 17, 2010, 03:38:09 PM by Warcaliptolf »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Colony Games And Multitek Altering
« Reply #5 on: September 18, 2010, 11:41:48 PM »
The instruction at that EIP is part of the function that checks if a player has completed a certain research. That particular instruction is trying to load a field from a struct containing information about a tech. The field at offset 0x1C is a bit vector of who has completed research for that tech.

The most likely cause of the crash is the function was called with a bad techNum value, which caused it to index past the end of the tech info array. After doing the array element address calculation, the result is probably outside the bounds of allocated memory, causing the crash when the game tries to load the field.

If you had the stack contents (at least a page or so of entries near the top), I could probably tell you more about where the error came from.
 

Offline Warcaliptolf

  • Newbie
  • *
  • Posts: 11
Colony Games And Multitek Altering
« Reply #6 on: September 19, 2010, 01:24:07 AM »
yeah I could re-do it, but it's very alien to me by sight of what to show or what's doing what(it's red let's see wher eit goes!). but if it's just research it sounds easy to fix if I find WHAT number it's searching for, because I got the ones I saw listed(default ini to check completed research). so I need to know exactly what to do to with the debugger. all I can see is: main thread, threads, executable modules, handles, windows, and ect. but I assume you want a specific portion and this likely isn't it. http://img94.imageshack.us/img94/5779/unknownsection.jpg

I'll use pastebin when I have an idea which area.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Colony Games And Multitek Altering
« Reply #7 on: September 19, 2010, 04:17:42 AM »
Ahh, that works. The top left is the code section disassembly. The top right is the register dump. The bottom left is the data segment dump. The bottom right is the stack segment dump.

Looking at the return address on the stack, it's being called from Trigger processing code. It's checking if a research trigger has fired. It's trying to check if player 0 has tech -1. Note that is an index into the array of techs, and not an actual tech id. The tech lookup code seems to have failed to find a tech by id (because you're using a tech tree with different id fields), and it returned -1 as a sentinel value to indicate the failure. The calling code never did any error checking against that sentinel value and just tried to use it as if the lookup succeeded.

I can't see the right data fields to tell you what the tech id was, but I can tell you how to find it. Follow the second value on the stack (the 021C91C0 in your picture, although the exact value shown might very well be different for each run). The tech id will be at an offset of 0x30 from wherever that second pointer on the stack took you. You'll probably want to right click on the data segment values, and choose a sensible display format, such as long->signed.
 

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Colony Games And Multitek Altering
« Reply #8 on: September 19, 2010, 01:12:45 PM »
Hey, how about you all listen to me when I tell you MT2 doesn't work with old maps?  Even if you can get it to load without crashing immediately, bad stuff is going to happen sooner or later.
"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 Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Colony Games And Multitek Altering
« Reply #9 on: September 19, 2010, 02:50:24 PM »
Perhaps. But then there is the question, why doesn't it work with old maps? And also perhaps, shouldn't it work with old maps? I've always found it a bit odd that a tech tree mod is that incompatible.

Besides, it's interesting debugging information. :P
 

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Colony Games And Multitek Altering
« Reply #10 on: September 19, 2010, 03:33:13 PM »
Quote
Perhaps. But then there is the question, why doesn't it work with old maps? And also perhaps, shouldn't it work with old maps? I've always found it a bit odd that a tech tree mod is that incompatible.

Besides, it's interesting debugging information. :P
MT2 modifies sheets.vol, so that units are unlocked by different tech IDs. Tech IDs that don't exist in the original tech files. It tries to find the tech with the tech ID specified by sheets.vol, and returns -1 when it doesn't find it, but then the game continues on using that invalid return value.
« Last Edit: September 19, 2010, 03:33:49 PM by Arklon »

Offline Warcaliptolf

  • Newbie
  • *
  • Posts: 11
Colony Games And Multitek Altering
« Reply #11 on: September 19, 2010, 05:28:14 PM »
yeah it's just the old games want the old research IDs, but I've used it before and eden population is the only one left erroring(aside from colony II plymouth starship that a few research IDs fixed). how ever it doesn't bother the AI at all, as they just build as before(even if way ahead this time). and hey bomber it can't get worse than renegades errors that kept coming due to lava or some unit command I had to deal with(I re-installed and tried to do something different REPEATEDLY to make it quit it). I understand it's not made for these maps, but I wanna make it work if it's JUST research numbers doing it(I'm not forgetting of the other ini files I may change to match).

also I am using the original sheets.vol with multitek2 without the 2 in the folder as well as the other ini files and not using the bat file(I can always change it back later).

0012EE44   01E39300
is what became of that 021C91C0(by the first set of numbers anyway and I can't find  021C91C0 again). but you mean to use "Follow in Dump" to find the value to change the view to signed->long? this is what I got from doing so.

00210246                                            65536(the one below the error success)

01E39300      5072320   33      1    31691584(this is the new 0012EE44 since I can't find the one 021C91C0 related to)
« Last Edit: September 19, 2010, 05:31:45 PM by Warcaliptolf »

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Colony Games And Multitek Altering
« Reply #12 on: September 19, 2010, 07:12:03 PM »
Also, any techs that are given to you automatically by missions, as well as research trigger-related things (mainly mission objectives involving research) will cause crashes as well, or abnormal behavior at best.

Oh yeah, using the original sheets.vol also won't work. The tech IDs specified by the original sheets.vol to unlock units don't necessarily exist in the MT2 tech file, so OP2 gets all confused when it goes looking for those IDs. Not to mention you'd be breaking the initial stat changes by not using the MT2 sheets.vol.

Due to the extensive amount of differences between MT2 and the original techs, there's always going to be at least some degree of incompatibility with regular-tech missions in general. You'll have to reverse engineer the original mission DLL, and rewrite it to accommodate the MT2 techs and game mechanic changes.
« Last Edit: September 19, 2010, 07:16:35 PM by Arklon »

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Colony Games And Multitek Altering
« Reply #13 on: September 19, 2010, 07:46:21 PM »
Quote
I've always found it a bit odd that a tech tree mod is that incompatible.
It's not a mod, it was built from the ground up to be completely different from the original one.  There are also the sheet changes Arklon mentioned, and the different unit stats.  Not to mention the need for the Basic Lab.  And don't forget that Laser/Microwave Lynx are end-game units.  So enjoy getting blasted by uber Microwaves while you're stuck with those puny Rail Gun Panthers.
"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 Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Colony Games And Multitek Altering
« Reply #14 on: September 20, 2010, 01:03:47 AM »
My main point is there isn't really a great reason for there to be a fundamental incompatability. Why change the tech ids that drastically? Aside from the hardcoded associations of certain units with certain tech ids, they're just arbitrary labels. Why not select them to match up better? Sure, original levels might play odd, especially if you've changed the other files for the initial stats, but I don't see why levels couldn't at least not crash.

Or, another approach might be to make MT2 levels responsible for loading and unloading the modified base stats. You could use the DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH events in DllMain. It might be a bit of work, but it's generic library code that any MT2 level could use, and would make the levels more easily playable. You wouldn't have to start up OP2 specially just to play them.


Warcaliptolf: You need to look further to find the needed value. It's offset from the pointer you're following, so the value you need will be a few lines down after you've followed it. Use an offset of 0x30 from whatever the second value on the stack is. It shows the addresses on the left, and data to the right. It should be about 12 entries down from where the follow command will take you.
« Last Edit: September 20, 2010, 01:06:24 AM by Hooman »

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Colony Games And Multitek Altering
« Reply #15 on: September 20, 2010, 08:53:30 AM »
Quote
My main point is there isn't really a great reason for there to be a fundamental incompatability. Why change the tech ids that drastically? Aside from the hardcoded associations of certain units with certain tech ids, they're just arbitrary labels. Why not select them to match up better? Sure, original levels might play odd, especially if you've changed the other files for the initial stats, but I don't see why levels couldn't at least not crash.
Hooman, you want MT2 to be compatible with old maps?  Then go hack all the old DLLs and make the necessary changes.  In general/for multiplayer, Standard Labs need to be replaced with Basic Labs.  You'll also have to change Guard Posts from Laser/Microwave to Rail Gun/RPG.  You'll need to do the same for initial vehicles, and also change them from Lynx to Panther.  You'll also need to change the list of techs given to you at the start of each match, as well as starting resources.  You should also change Structure Factory cargo and possibly even base layout due to MT2's research order and unit stats.

Once you're done with that you can work on the campaign and colony games!  You'll need to do mostly the same thing as you did in multiplayer, but you'll also need to change the objectives to match MT2's research.  Don't forget to completely rewrite all of the game's AIs, since it will need to use different timing, attack with different units and weapons, and build different structures.  Don't forget to also do this for multiplayer maps with AIs, like La Corrida and Caught in the Crossfire.

So now you have a list of what needs to be done.  And until you've done it I'd like you to kindly shut the **** up about my inadequacies, 'cuz I'm really getting tired of hearing it from you.
"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 Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Colony Games And Multitek Altering
« Reply #16 on: September 20, 2010, 01:21:58 PM »
Quote
My main point is there isn't really a great reason for there to be a fundamental incompatability. Why change the tech ids that drastically? Aside from the hardcoded associations of certain units with certain tech ids, they're just arbitrary labels. Why not select them to match up better? Sure, original levels might play odd, especially if you've changed the other files for the initial stats, but I don't see why levels couldn't at least not crash.

Or, another approach might be to make MT2 levels responsible for loading and unloading the modified base stats. You could use the DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH events in DllMain. It might be a bit of work, but it's generic library code that any MT2 level could use, and would make the levels more easily playable. You wouldn't have to start up OP2 specially just to play them.
Again, due to the drastic changes that MT2 makes, it's not even really practical to allow the original missions to load, since they still wouldn't actually work properly without lots of changes to starting structures/vehicles, AI, etc.
As for loading a different sheets.vol, the only thing available that has to do with loading a sheets is the HFL ReloadSheets (or something or other) function, which just reloads the regular sheets.vol (which effectively just undoes any changes to unit stats caused by research, or via memory hacks of the UnitInfos), you can't load a different sheets using that. I think I'll look into making a hack for doing just that; that way the MT2 mod wouldn't be necessary.

Offline Warcaliptolf

  • Newbie
  • *
  • Posts: 11
Colony Games And Multitek Altering
« Reply #17 on: September 20, 2010, 03:37:28 PM »
Now when I said I was using the old vol and inis, the inis are tek2 overriding it. This is so I can exclude them to try to find out what may have been the cause of this start-of-the-map research error it's looking for. The last noticable "game could not initialise" error was before I remedied the residences to the old number requiring the tek2 research for it(though only the nursery and university research seems to be shown as completed for eden population, but it could be a dummy tech it wants). The errors I've had at first: a loading outpost2 is not responding error(research numbers got past this one), a could not initialise the game error(not sure how I made this one happen but I got past that too) and the last error that loads the map and tells me outpost2 has stopped responding.

I understand what he was saying about incompatible since the old maps have no source code and that the AI will use the same units(which are better with tek2). But who's to say I wasn't bumping it in shortened research so it could match up a bit. It can only get worse than normal outpost2 on hard. Arklon and sirbomber know why it's incompatible in the AI's order of buildings, units and more. But I don't care of that as long as I can find the research part I need to get past the error/s that stop me so I can goof around with it.

I still don't have much idea with this debugger either, since I'm trying to understand how to put into practice what hooman says. A lot of it is purely like getting told to put furniture together without instructions or an idea how it's meant to look. But I found Follow-into-dump leading me towards what he said the other day, which is one more thing I understand. I have to look up stuff to try and get what 0x30 is and how to input it 0x30 #1 for 0x30. I Even looked at 0x30 #2 to maybe get an idea how to input 0x30 into the program to find the tech that's doing it.

This is as far as I can see or go from what I understand: Jargon

If I have to I'll just go into the ini files and cross reference what to change to old research IDs and so forth to match them up and link them to at least the vehicle, building, weapon, space and multitek files UNTIL it works...or still errors and requires the debugger to locate my real problem.
« Last Edit: September 21, 2010, 03:50:35 AM by Warcaliptolf »

Offline evecolonycamander

  • Hero Member
  • *****
  • Posts: 602
Colony Games And Multitek Altering
« Reply #18 on: September 20, 2010, 08:10:03 PM »
I'm not being mean when i say this. please use hyperlinks in place of your links.
here's how:
Code: [Select]
[URL=<LINK GO'S HERE>]<TEXT GO's HERE>[/URL]
now back to the subject
cant you just rename the "multitek2.txt" file to "multitek.txt"?
it's always worked for me...
''The blight cant get us up here!''
-famous last words
--------------o0o--------------
Outpost 2: EoM project status: Re-planning

Offline Warcaliptolf

  • Newbie
  • *
  • Posts: 11
Colony Games And Multitek Altering
« Reply #19 on: September 21, 2010, 03:49:07 AM »
I do re-name it, that's why I'm not using the bat file that came with angellus's map that uses multitek2 files. Also sure, I'll fix that.
« Last Edit: September 21, 2010, 03:55:46 AM by Warcaliptolf »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Colony Games And Multitek Altering
« Reply #20 on: September 22, 2010, 12:06:06 AM »
Warcaliptolf: The value you're looking for is 10102.
Look at the addresses column on the left. You followed the second entry on the stack to 01E59300 in the data window. If you look down a few rows, you can see the address incrementing until it gets to 01E59330. ("30" greater, in hexadecimal, which often have the prefix 0x to denote they are not the usual decimal numbers). The first entry on that line is the tech id you are looking for.

Note that each line increments by 0x10 hex = 16 decimal. Each "long" value is 4 bytes, hence 4 entries per line. As long values are typically aligned on 4 byte boundaries, you'd expect to find values at offset 0x0, 0x4, 0x8, 0xC (the 4 columns on each of the lines).


Sirbomber, you seem to misunderstand me. I never suggested modifying original levels to make them playable. I was merely suggesting two options that could prevent crashes. One idea was to modify the tech tree to use similar tech ids, so there are no crashing issues with invalid tech ids. This would not make the original levels play well with the modified rules, but it would probably go a long way to prevent crashes. The modest concept being a level that will likely play oddly is better than one that doesn't work at all. Who knows, there might even be some setups where a level works well with both rule sets, like say starting with 1 of every unit, like in the tutorials. Of course, Arklon seems to suggest compatible levels are unlikely due to the large number of changes. Sure. A lot of levels probably will be ruined, even if they don't crash. So maybe this isn't the best option.

The other idea, which Arklon seems to have gone more into, is that the mod loader might not be the best way to play MT2 levels. I think this is probably the better point I was trying to make. Now I know there is currently no other code to do what you want, but I'm saying such code could be developed. After all, the mod loader was written that lets you load custom data, so why not build that logic into the MT2 levels themselves rather than use the mod loader to change things globally. This is definately the more sensible alternative if original levels couldn't be expected to be playable even if they didn't crash. There would be no special startup requirements. MT2 levels would play as MT2, and regular levels would play as they always have. The downside of course is that such custom data loading code would need to be written into a nice library, and existing MT2 levels would need to be changed to use such a library and recompiled. But, at least the source code to those levels should be accessible. Also, I don't believe the amount of code that would need to be written is all that large, and much of the relevant internal functions of Outpost 2 are probably fairly well documented. Actually, I wouldn't be terribly surprised if Arklon was able to figure it out himself, given his recent achievements with similar tasks. I suspect you could also probably figure it out yourself, although, I'm a little less certain about your level of comfort with such tasks since you are sometimes a little secretive about your code and what it is you've been up to.
 

Offline Warcaliptolf

  • Newbie
  • *
  • Posts: 11
Colony Games And Multitek Altering
« Reply #21 on: September 22, 2010, 01:03:40 AM »
I see it now, though I dunno what to do with it

NEVER MIND I KEPT RELOADING AND LOOKING AT THOSE NUMBERS....THEY WERE FREAKING RESEARCH IDs FROM THE BACKED UP ORIGINALS. But strangely it was the railgun, thors hammer, acid, and emp research IDs and nothing plymouth related. It started up no errors on all the original colony maps. BOOYAH, now to....uhh....goof off and at the same time see if no errors.....THE HARD BUT FUN WAY. Thank you hoomans, even if I still don't get the 0x30 ...but I assume it's the first column of each set to match the 0x00 to 0x40 middleman.
a not game-exploding error
all that's left and I DON'T HAVE TO BOTHER WITH THAT ONE SINCE IT RUNS
« Last Edit: September 22, 2010, 01:09:21 AM by Warcaliptolf »