Author Topic: Forgotten Player/modder Returning After Hiatus  (Read 6098 times)

Offline Nim

  • Newbie
  • *
  • Posts: 5
Forgotten Player/modder Returning After Hiatus
« on: June 10, 2013, 11:24:33 AM »
A number of years ago I was working on a mod that was dedicated on making OP2 more challenging for a seasoned player. I changed the population: size, growth, moral. I changed the number of workers, scientists, resources, power requirements, and explosion types for buildings. I added new weapons and techs to the game. I gave near useless buildings new uses. The mod was heavily tested and was working great. Then I changed the techs more (as I had planned) giving more advantages to buildings later in game, and re-worked the tree and also allowed for a more fair and balanced Eden and Plymouth. I re-worked all the colors in the game to be more adult and threatening. I created a graphical tech tree for people to use with my mod and also for myself as to where I wanted to go with it. I gave the weapons more power later in the game but in a balanced way. I increased disaster damage. The mod added dozens of new techs and I was almost in the final month of work on it. That is when I found a fatal flaw in the research in multilayer. This rendered all my plans and effort useless. It is the bug in the tech tree wherein the research done on a item that modifies it creates issues for the non-host players if that research modifies that item more then 3-4 times. This made me leave. But I have returned because I want to finish my mod. I wanted to know if you guys have resolved the tech tree issue or not yet? Or if there is a possibility you will look into fixing it for me.  

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Forgotten Player/modder Returning After Hiatus
« Reply #1 on: June 10, 2013, 03:00:24 PM »
That's not a tech-tree issue, it's a display issue. It's built into the interface that units in the game can only have 4 upgrades listed on the interface (2 for weapon and 2 for chassis in the case of turreted vehicles/GPs). However, any additional upgrades still add up, they just don't get any improvement text on the unit.

Check out Sirbomber's multitek 2 for more details, as it does just that.

And welcome back, whomever thou may be.
"Nothing from nowhere, I'm no one at all"

Offline Nim

  • Newbie
  • *
  • Posts: 5
Forgotten Player/modder Returning After Hiatus
« Reply #2 on: June 10, 2013, 06:21:26 PM »
Sadly that is not what I am talking about. I was being vague on the issue as this is not a modding forum this is the intro portion of the forums. As I did not properly explain myself let me try to explain it a little better. I already know about the 2 improvements bug and figured that I would improve the vehicles, turrets, and buildings and not care about the IMPROVE_DESC variable being displayed. The problem arises when one attempts more then 3-4 modifications to a building.

For example I have 5 sets of researchable upgrades for the agrodome ultimately getting the agrodomes production up to 100 with some more workers and power. I did not change any other values on the agrodome. Everything works perfectly in single player. It also works perfectly for the host in multiplayer. That is where the good news ends. In multiplayer when any player reaches level 4 (different name of course) of my upgrade on the agrodome all non host players get a glitch whether or not they research level 4 agrodome. For some reason the agrodome costs +48 rare ore to produce for all non host players in a multiplayer game. This issues occurs with different numbers depending on the building. Some buildings with multiple upgrades (be it sight range or production improvements) will also cost rare ore of different numbers. For example upgrading the Med center to Level 4 improvment will cause it to cost +107 rare ore. Keep in mind that ANY player that reserches this level will make all the other players suffer save the host.

At level 6 ( from the sight range improvements of 2 to 3) the agrodome suddenly needs 109 scientists which is insane as I never wanted any scientists to be part of the agrodome let alone that many. Try doing this yourself and you will see that it occurs no matter what you do to change the research number or other variables.

So you see this is a game breaking glitch I cannot fix. To backtrack my mod and only have 2 upgrades per building would remove the mods point. I need some help fixing this issue that is inherent with the game itself. I called it the tech tree bug even though I know its probably a stack overflow or display issue with the IMPROVE_DESC variable to save time. I also wanted to point out that even if you dont add a IMPROVE_DESC in a buildings upgrade it the game still puts an invisible one in there.  

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Forgotten Player/modder Returning After Hiatus
« Reply #3 on: June 11, 2013, 12:55:15 AM »
Welcome back.


I don't remember hearing about any issues specifically for that many upgrades, although, I am aware of the display issue when more than 2 techs upgrade the same unit. I guess I've never bothered to try past 3 upgrades, simply because I knew 3 was sufficient to cause weird behaviour.

I don't remember the details very clearly, but I suspect there is a possibility the bug you're reporting has the same roots as the display bug.


I'm particularly busy as of late, but I am rather interested in looking into this. I don't suppose you can produce a reduced example that illustrates the problem? Perhaps a tech file with just 5 techs, that can all be quickly researched (cost 1), and possibly a bare bones level template using that tech file (if needed). If the problem can be quickly reproduced without having to play a level, or be distracted by other irrelevant details, I just may find the problem too interesting to pass over, despite my busy schedule.
 

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Forgotten Player/modder Returning After Hiatus
« Reply #4 on: June 11, 2013, 04:21:40 AM »
Wait, you're right. That reminded me that the same bug DID pop up with multitek 2. Some research would make the robo-miner suddenly cost rare ore.

Yeah, that's an overflow-type bug. The amount of upgrades was not intended to go past 3-4, I assume by the game engine itself, hence the weird behavior. I'm pretty sure there's nothing we can do about it.
"Nothing from nowhere, I'm no one at all"

Offline Nim

  • Newbie
  • *
  • Posts: 5
Forgotten Player/modder Returning After Hiatus
« Reply #5 on: June 11, 2013, 06:11:19 PM »
I have the file. How would you like me to get it to you?  The forums dont seem to support pic and file posting. :unsure:  

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Forgotten Player/modder Returning After Hiatus
« Reply #6 on: June 11, 2013, 07:15:43 PM »
Use the File Forum, under General Interest
"Nothing from nowhere, I'm no one at all"

Offline Nim

  • Newbie
  • *
  • Posts: 5
Forgotten Player/modder Returning After Hiatus
« Reply #7 on: June 13, 2013, 02:53:40 PM »
Posted - Get the file here.

http://forum.outpost2.net/index.php?showtopic=5548

I set this up so it would be easy to test in multiplayer and single player colony games. If you do test this you will not see the bug in a single player colony game but you will see it as a non host player in a multiplayer game. I have highlighted the tech you need to research with a underline in game and reduced the time it takes to research it down to nil. The tech will tell you what kind of bugs you will expect to see and where to look when you research it. Usually you will just need to check the Building Factory and the Agrodome as a non host player to see the bugs. There are a total of 6 techs stringed together in sequence.

As an interesting note I would like to point out that while making this I found that the bug seems to vary in what it does depending on what kind of modifications you give the buildings from research. In my original mod I found at the end of the sequence you needed 109 scientists for the Agrodome but with this example tech with different variables you only need 30some scientists and less rare ore.

Anyways I hope this can get fixed so I can finish my Mod. I think I will post a few pics on here to show what I have done so far if people are interested.  

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Forgotten Player/modder Returning After Hiatus
« Reply #8 on: June 13, 2013, 06:55:19 PM »
I already told you, that bug is in the game engine, and we can't do squat to the game engine. Also, it's an overflow bug, in our case being that a static array's bounds have been exceeded and the extra data is overwriting some place in memory that is then read by a different function that did not expect those values there. But any value works, so the game doesn't crash and you get the resulting bug.

Now, while I might be wrong, I am fairly certain this is the answer.
« Last Edit: June 13, 2013, 06:57:19 PM by Hidiot »
"Nothing from nowhere, I'm no one at all"

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Forgotten Player/modder Returning After Hiatus
« Reply #9 on: June 16, 2013, 02:56:41 PM »
While it isn't possible to fix game engine issues, would it be possible within the mod itself to force a bypass? Perhaps tell it to use blocks x through y to reach the data limit and then force it to switch to a new segment outside the bounds that are currently in use by the game? I'm only an amateur web coder, so I don't really know a lot about memory allocation in code, but I do remember something about instructing the cpu on where to store the data in the C++ class I took for my undergrad.
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Forgotten Player/modder Returning After Hiatus
« Reply #10 on: June 21, 2013, 12:20:32 AM »
I've downloaded the file, but I'm afraid I don't have time for more than a quick glance tonight. It's already past my bedtime.  :o

If the problem is due to the display issue for the upgrade string, then perhaps future upgrade strings could overwrite older ones. Or at the very least, they could be ignored. There may be an issue beside the upgrade string limit though.

What you describe sounds very much like a memory corruption issue. I remember there was such an issue caused by a statically sized buffer that's being overflowed, and was related to the upgrade description strings. There may be other pointers and such with similar issues. Enlarging static memory buffers like this can be a major pain, so that might not be very feasible. Hence the suggestion about ignoring certain new values or overwriting old values.

It might also be possible to completely replace a game component if it's isolated enough. Such was the case with the network code. For code replacement, you basically sidestep the static buffer size issue by providing completely new data structures with either more space, or support for dynamic resizing. However, if too much of the tech tree code is hard linked in (constant memory addresses used throughout the executable), this approach isn't very feasible. I believe there was some degree of hard linking with that code, but I don't remember how much of a problem it would be.
 

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Forgotten Player/modder Returning After Hiatus
« Reply #11 on: July 03, 2013, 11:25:41 PM »
Quick update: I went back over my notes on the data structures, and it doesn't seem like any of the core research related data structures have any fixed sized buffers. That seems like a good sign. I remember there was a static buffer in the display code, but I'm not sure if that's what causes the problem described here. Hopefully I'll have a bit more time to look into it soon. (New job, business travel, so not much personal time lately).