Renegade Projects Network Forums
Patching extra functionality into <gamemd.exe> - Printable Version

+- Renegade Projects Network Forums (https://forums.renegadeprojects.com)
+-- Forum: Inject the Battlefield (https://forums.renegadeprojects.com/forumdisplay.php?fid=60)
+--- Forum: Ares General Discussion (https://forums.renegadeprojects.com/forumdisplay.php?fid=19)
+--- Thread: Patching extra functionality into <gamemd.exe> (/showthread.php?tid=16)



- Bobingabout - 02.03.2005

probably does, thats probably why my 4th side wasn't building walls. although, are you sure its on ALL of those tags? BTW, BaseUnit= is used for moret han 1 thing, first thing is assigning a building status to a unit, thats restricted to 3 units, it also sets that side to always get listed unit free if no other unit in that list has been used for the side. I've had this working for 4 units, so no restriction there.


- pd - 02.03.2005

@Comrade:
No, the game doesn't recognize two commas only.
It's like this:
The first comma is hardcoded. So there HAVE to be AT LEAST two entries.
After that, only one comma is in code, because there's a loop.
That loop splits the tag at comma positions until there are no commas left.
I debugged that: The fourth BaseUnit is being loaded properly.
But there has to be something which makes the unit not being recognized as a baseunit, and that's what I can't find Unhappy

I found some data storing stuff a bunch of lines below that loop.
It stores 3 variables (!Wink, and it's the SAME storing algorithm as used for HarvesterUnit, VeteranUnits and SecretUnits (which is why I asked whether they are limited to 3 also, but that's false).
I dunno if that one's the thing I'm searching for, but I'm sure I'll find out.

@Bobing:
Adding countries was very easy in fact, the only data which was really stored was the flag PCX file.
The loadscreen stuff is being loaded only when the loading screen is being built, that means after the user clicked on "Start Game".
Then the game checks what country and side the player has and loads its loading screen stuff.
So storing data wasn't that problem there.

But storing data was something important when making new infantry deaths.
So countries were easier, I just made them later because I made some before, and that would have been boring Wink


- CannisRabidus - 02.03.2005

Countries are countries, but sides are sides.
Where did the Yuri 3rd-side country (hack probably) addition come in? Maybe your answer is there.


- pd - 02.03.2005

I don't need any answer, I know how to add a new side, it's just that the game's data storage is built so that three sides fit exactly in it.
That's the point, storing data at the right place and getting it work in game.
Reading values from INI files is no problem, WW created a nice INI engine which I just have to call Big Grin (should I say "thank you, WW"?)

If you mean the baseunit, that's the thing I'm looking for.
Where is PCV stored? I don't even know where AMCV is stored, it's a pretty weird code actually.
But as I just said, I'll continue when I got internet (probably tomorrow),
because when I can chat with people while hacking, it will extremely speed up the progress.


- CannisRabidus - 02.03.2005

What I'm saying is, this 3-baseunit limitation is exactly the same as the 2-baseunit limitation that existed in RA2. So from RA2->YR they went from 2 to 3. If you want to go to 4, well then I thought figuring how they went from 2 to 3 might be helpful.

Related topics: AIBasePlanningSide=? The side flag in the AI triggers?


- Marshall - 02.03.2005

Hey pd, got an Internal Error today that may have been caused by the patch:

InfDeath 5 (ELECTRO) was caused by some weapon.
My opponent got an Internal Error.
I didn't.
Both of us are using the same version of the patch.

InfDeath 5 gave me problems before when using an earlier version of the patch.
Given that this InfDeath seems to be hardcoded to use the animation called ELECTRO, I reason that the problem could very well be caused by the patch.

Attached to this post is my opponent's <except.txt>.



EDIT: In a subsequent game, InfDeath 101 did not play any animation (in previous games InfDeath 101 worked okay).
InfDeath 8 (VIRUSD) worked okay. Other InfDeaths were not tested.


RE: Patching extra functionality into &lt;gamemd.exe&gt; - Bobingabout - 02.03.2005

CannisRabidus Wrote:What I'm saying is, this 3-baseunit limitation is exactly the same as the 2-baseunit limitation that existed in RA2. So from RA2->YR they went from 2 to 3. If you want to go to 4, well then I thought figuring how they went from 2 to 3 might be helpful.

Related topics: AIBasePlanningSide=? The side flag in the AI triggers?

i did some testing, I've had a 4th side working with AI using AIBasePlanningSide=3 and 4 in the sides flag on AI triggers. just incremented by 1 from yuri, and so on.

game works basicly the same as 4 sided emulation like whan you add your 4th side you yuri, with a few other extra bugs, no crew from destroyed sold buildings, soviet paradrop, etc.

so in conclusion, no extra hacking is required to enable you to create a 4th side, only the extra data to make it work properly, such as powerplant, crew, paradrop, stolen 4 tech structure. in these cases its just knowing where to store the data, reading it from tags, then storing it there.


1 thing that does trigger my curiocity though is, if an array is hardcoded to store a certain amount of values, and PD breaks that limit by allowing you to add more, is he shifting everything after that point to make room? because if he isn't, then it is very likely that you could be overiting data from something else...

my guess is he is doing that, but if he isn't :o thats 1 VERY unstable hack...

@PD he has a good point there though, RA2 limited you to 2 baseunits, YR limits you to 3, wouldn't it be a good idea to look at RA2 code here and compaire some of the differences relating to BaseUnit? and probably everything else relating to limitation of 3 for sides.


- Bobingabout - 03.03.2005

internal error.


- Speeder - 03.03.2005

Hmmm I wonder why does BobingAbout's except have same beginning... :blink:

Anyway, PaD, are you going to fix that bug I told you on MSN? I mean the one with 'Unable to read scenario' if LoadSpecialYuriUI= is set to yes, and there is no sidec03.mix in YR direct? And last thing, I haven't follow whole discussion, but have you planned enabling more sidecs? With your latest patch, my forth side reads sidec04.mix I have added... :huh:


- Bobingabout - 03.03.2005

game already reads sidec04 properly for a 4th side, and it just so happens that more sides is the next thing he's working on, that and breaking the 100 unit bug, and 74 units bug. I've helped do a lot of research into adding more sides.


also, i seem to be wrong about something to do with powerplant=. it doesn't carry over from side3, its very strange... CDA currently have no powerplant listing anywhere, but still build 2 powerplants to begin with. they don't seem to build any more after than, but thats probably because they don't need too, the power refinary gives power, which they build more than 1 of anyway, and they have an advanced powerplant. also, they don't seem to want to build base defences, which tells me that you are definitly going to need a BaseDefences04= tag.

EDIT: I've got it now!

ThirdPowerPlant= and equivalnt for each side, specifies which powerplant to build when they have low power, i beleave theres also an advanced powerplant for soviets, which seems to do nothing.
BuildPower= specifies the first powerplant to build, in the build powerplant, barracks, refinary, powerplant sequence they always build in the begining.

also, the side a country is on and the Side= tag on the country listing arn't so seperate after all, when i had CDA on thirdside and set Side= to GDI, i got an internal error. however setting it to thirdside while CDA is the 4th side works fine. maybe it has to be side, or 1 either way. I've noticed the game has some leverage on such matters, but with limits...


still, like i said, 1 either way, I've had CDA as 4th side with yuri GUI, and CDA on yuriside with 4th gui before. although they not working 100%, i have had them


RE: Patching extra functionality into &lt;gamemd.exe&gt; - FS-21 - 03.03.2005

Bobingabout Wrote:CDA currently have no powerplant listing anywhere, but still build 2 powerplants to begin with

Always AI needs build powerplants from "xxxxRegularPower=" & they will build powerplants of the side that you selected. If your emulated side has soviet tags the emulated AI will build soviet powerplants, the same if you used Allied or Yuri tags :blink:

Bobingabout Wrote:ThirdPowerPlant= does do something, but what i'm not too sure on yet. because adding TAPOWR to the end breaks yuri.

You can't add a second building on these PowerPlant tags or you will break the AI sides (AI only will build 2 powerplants of the side that I said before & buildings/defenses until AI use all the energy of the power plants)... 1 or 2 years to discover this stupid bug :unsure:

NodRegularPower=
NodAdvancedPower=
GDIPowerPlant=
ThirdPowerPlant=

These tags are linked with only 1 side (I don't how) & you only can add 1 building per tag. Need to be done a new cloned powerplant tag linked with a new side.
Well, I'm not sure if is necessary a new side to inlude a new tag of this type because Soviets have linked 2 Powerplant tags, but the NodAdvancedPower is harcoded to produce only 1 building ingame.


- Bobingabout - 03.03.2005

yes, thats basicly what i said in my edit, i'm resuming you were typing this up while i was editing my post...

thats also what i discovered, i actually discovered most of it last summer, but using only my memory, its kinda hard to remember it all when typing stuff.

yes, ThirdPowerPlant=, and the others can only have 1 building listed, and is always used for that side. but not in the first case.

very first powerplant is selected from the BuildPower= list for that country, as can be seen by my CDA building 2 CDA powerplants, then building only yuri powerplants after that.

NodAdvancedPower= seems to do nothing. yes they build 1 of them, but only if they are allowed to build it, but, the AI builds 1 of everything it can build anyway. like i said, nothing special.


i still say look at my list of things needed, or the quickguide if you know what all the existing tags do.

Full list
Quick Guide


- Bobingabout - 03.03.2005

this file is the result of my 4th side's CDA country having Side=ThirdSide set instead of Side=ForthSide.

I'm just thinking this might help you figure out how to give any side any GUI set


- pd - 04.03.2005

Whoo, back to the internet again!
So I think I'll continue working when I finished setting up my computer again (do stuff like reordering etc Wink )

@Bobing:
Quote:internal error.
What and when? :blink:

@Speeder:
The game already read sidec04.mix, sidec05.mix etc.
I'm also getting the "Scenario unreadable" when sidec03.mix doesn't exist but LoadSpecialYuriUI=yes.
So either set it to no, or make a sidec03.mix.

@Cannis:
OK, disassembling RA2 will cost me 2 hours Shift eyes but it's the best idea I believe...


- Bobingabout - 05.03.2005

:blink: :o :blink: :mellow: Unhappy Unhappy

this is confusing as hell...

i know some BASIC, i know some C, i know some PASCAL.
i know some PICs assembly, and motarola 68k assembly.

but a dis-assembled exe is just plain confusing. :blink:

:huh:


its going to be some time before you get any help from me on that PD...

:blink: