ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Hardcoded: Difference between revisions

From ModEnc
Jump to navigation Jump to search
No edit summary
 
(16 intermediate revisions by 8 users not shown)
Line 1: Line 1:
The term "hardcoded" describes functions that are coded directly into the [[Engine]] and cannot be changed/expanded by [[INI-editing]]. Examples for this are the number of unique [[MCV]]s in the game, the number of [[Houses]] and the multiplayer-color-menu.
The term "hardcoded" describes functions that are coded directly into the [[Engine]] and cannot be changed/expanded by [[INI-editing]]. Examples for this are the number of unique [[MCV]]s in the game, the number of [[Houses]] and the multiplayer side colours menu.
 
 
== HARD-CODED STUFF: (by DeeZeL)==
Credits:
* Tratos for bringing up some ideas
* Kravvtiz for some editing, bringing up and explaining some stuff.  


== Hardcoding ==
=== What is hardcoding? ===
=== What is hardcoding? ===


Basically its the things that controlling it is out of your hands...hardcoding is the rules set by [[WW]] to keep somethings as they are..sometimes for safety issues, sometimes to show us, modders whos the boss .  
Hard code is code held in the binary executable. Basically it's the things that are out of your hands when it comes to C&C modding. Reasons why some stuff has its behaviour handled purely by the binary code are likely varied and are probably due to time constraints or a lack of necessity for [[Westwood]] to actually ever vary some behaviour.
 


=== Why do I need to know this stuff? ===
=== Why do I need to know this stuff? ===


well there are 2 benefits from knowing the hardcoded suff:  
There are two benefits from knowing the hardcoded stuff:  


a. saves time an energy in your mind . <br>
#Saves time and energy in your mind.
b. if you even tried to ask about them in the editing community you'll be flamed to death.  
#Stops you irritating more experienced modders by asking about features that are impossible.


=== Interesting, so what are the hardcoded stuff, and what will happen if I tried to edit the hardcoded codes? ===
== Features that are hard coded ==


Many people have tried that, some people succeeded and some didnt..BUT, their methods main idea wasnt EDITING the hardcoded but to TWEAK or EMULATE its presence. For example, [[Psycho]], one of the most talented members in the CnC: RA2/YR editing community, managed to do more superweapons rather than replacing them. He's writing a tutorial about it, and I hope that I can host it.  
# [[Superweapons]]: basically, superweapons can ONLY be replaced by altering the art assets and warheads that they use and the scope for modifying their behaviour (how they do their damage) is generally limited. All though it is possible to add more superweapons to the list, the {{f|Type|link}} value controls what behaviour that super weapon will use. This would allow you to make multiple versions of the same superweapon so you could charge and fire more than one at a time were it not for the fact that every superweapon needs a unique {{f|Action|link}} to give it a cursor and targeting. Via some clever ini editing, some members of the editing community have succeeded in creating superweapon like behaviour for some new weapons, but their targeting is handled differently from true superweapons.
# [[Sides]]: Depending on the C&C title, there are either two or three playable sides with two additional sides for neutral units and structures. For the playable sides they represent the main factions in the game and are often sub divided into countries (though internally they are called houses for the most part). In RA2/YR, the number of countries is also limited by code in the [[executable]] that identifies what art assets are assigned for loading screens. The playable sides are always 'GDI', 'Nod' and where applicable 'ThirdSide'.
# Multiplayer [[Colors|Color]] Selection Menu: The colours that are displayed are fixed, even though you can change what they result in in [[rules.ini]].
# Adding a new type of unit missile: if you are planning to add a new missile that will act as the '[[Unit:V3|V3]] Rocket Launcher' or the '[[Unit:Dreadnought|Dreadnought]]' or the '[[Unit:Boomer|Boomer]] sub' missiles, you will fail. If you tried to add one, the rocket will launch until it reached a certain altitude and will do one of the 2 actions:
#* will reverse its destinated direction and travel to nowhere.
#* will reverse its destination and head straight back to the 'Launching vehicle'. Similar behaviour can be created however; please see [[Spawned Missiles]] for further information.
#The [[100 Units Bug]]. It is more of a bug than a hardcoded issue and is to do with the xxxtypes section, which lists of all the units in the game. The list looks like this:
#: <tt>[InfantryTypes]<br>1=E1<br>2=ENGINEER<br>3=SENGINEER<br>4= ...etc.</tt>
#:If any player buildable units are numbered to exceed 100 (after considering vacant numbers) then the list causes some kind of overflow error for the AI and it will constantly build the last unit on the list as though it were the only unit available to it.
#:See Also:
#:*[[How Object Arrays Work]]
# Infantry CANNOT repair vehicles: Any true infantry as listed in the [{{f|InfantryTypes|link}}] list cannot repair a unit from the [{{f|VehicleTypes|link}}] list. That is it cannot use a weapon that does negative damage against them, though it can do against infantry. Similarly a vehicle cannot heal infantry. You can generate a similar effect using a [[particle]] or by using negative {{f|Verses|link}} values on a [[Warhead]] but the targeting behaviour is different to a true repair unit; please see [[Infantry Mechanic]] for further information.
# Number of [[Campaign|Campaigns]] in RA2/YR: In RA2 there are the Allied, Soviet and Tutorial campaign, a total of 3, in YR there are the Allied and Soviet campaign, a total of 2. You can re-enable the tutorial campiagn in YR, so that you can add a third campaign however, but it involves modifying the executable using a resource hacker and creating some alternate art assets. This means that you cannot add any extra campaigns beyond three in these games. Strangely however TS/FS do not suffer from the same problem. They have a list box that lists all campaigns from [[battle.ini]].
# [[Cursors]]: Cursor animations are held in the file [[mouse.shp]] (mouse.sha in YR) and certain frames are hardcoded to each action. Some actions however (particularly in RA2/YR where they are left over from TS) all share the same frame so even altering the [[shp]] file will not give unique cursors for these actions.
# Disk Name for RA2/YR: The names for the data/install disks are hard coded in both the games and their installers. In RA2, they must either be named RA1 or RA2, yet strangely enough YR accepts RA3 and YR1 as valid disk names.


Moving on, heres a list of hardcoded stuff:
== Contributors ==
 
* Blade for extensive re-write to a more formal language
1. [[Superweapons]]: basically..superweapons can ONLY be replaced..but as I said before, Psycho managed to emulate new ones..if u tried to add a new action to the superweapon that isnt recognized by the game code..your 'super strike' will recharge as any normal superweaon..but one you clicked the button to deploy it..it will re-charge again as if you already 'deployed' it. <br><br>
* DeeZel for original text
 
* Tratos for bringing up some ideas
2. [[Sides]]: For RA2, theres 9 sides and as for YR theres 10 sides..it is possible to make one of the sides 'feel' like a new side (well not TOTALLY, it will also used the graphics from the original side..as radars anims, buttons..etc.) but its IMPOSSIBLE to add new ones and
* Kravvitz for some editing, bringing up and explaining some stuff.
I quote from Blade (who is also one of the ELITE of the modding community): "You CANNOT add anymore sides. You could concievably add new countries by hacking the exe and altering the array data that the houses use, but the side stuff (AI mainly such as base planning side as well as different battle labs and such things) cannot be increased beyond 3 feasibly without the source code to the game."...in short, adding a 'new' side to the [Sides] section in the rules.ini will do nothing but to give you the 'Internall error' message. <br><br>
 
NOTE BY RENEGADE: These "Sides" are usually referred to as "[[Houses]]" while "Sides" is used for destinction between [[Soviets]], [[Allies]] and [[Yuri]]. That doesn't change the fact that you can't add new ones, though.
 
3. [[Colors|Color]] Selection Menu: Hardcoded also...you wont manage to change its code doesnt even exist in the rules.ini <br><br>
 
4. Adding a new type of missile: if you are planning to add a new missile that will act as the '[[V3]] Rocket Launcher' or the '[[Dreadnought]]' or the '[[Boomer]] sub' missiles, you can kiss this idea good bye...and if u tried to add one, the rocket will launch until it reached a certain altitude and will do one of the 2 actions: a) will reverse its destinated direction and travel to nowhere. b) will reverse its destination and head straight back to the 'Launching vehicle' lol . <br>
NOTE BY RENEGADE: This, however can be [[fake|faked]] as well; please see [[Spawned Missiles]] for further information.
<br><br>
 
5. the [xxxTypes] [[bug]]: xxx here stands for both of the word 'Vehicle' or 'Infantry'..its more of a bug than a hardcoded issue as you know the under the [xxxtypes] section theres a list of all the units in the game that looks like this
<blockquote>
[InfantryTypes]<br>
1=E1 <br>
2=ENGINEER <br>
3=SENGINEER <br>
.....and so on, so lets say your [InfantryTypes] list went that way for example: <br>
 
99=TROOPER1 <br>
100=TROOPER2 <br>
101=TROOPER3 <br>
102=TROOPER4 <br>
103=TROOPER5</blockquote>
....well that HUGE for the game to handle i suppose, nice job you've made about 70 new troopers with the ultimate codes..but what will happen when the game loads??? The AI will do this annoying thing by constantly producing the unit beyond the #100 unit in the list, disregarding what country/side it is...well people solve this by replacing some kind of civilians but you are limited so be carefull . <br><br>
 
6. Infanty CANNOT repair vehicles: well thats true..so don't even think of making them to do so..BUT if you played RA2:DeeZire it exists..well notice that he only 'pops out' of the soviet service depot..surprise! its not an infantry but DeeZire made the mechanic look like an infantry, but it's really an SHP vehicle. (DZ ur the best ) <br>
NOTE BY RENEGADE: This as well can be effect, using a [[particle]]; please see [[Infantry Mechanic]] for further information.<br><br>
 
7. Number of [[Campaign|campaings]]: well I quote this from Kravvtiz: "in RA2 there are the Allied, Soviet and Tutorial campaign, that's 3, in YR there are the Allied and Soviet campaign, that's 2. Blade supposedly has a way to re-enable the tutorial campiagn, so that you can add a third campaign to YR" meaning that you cant add any extra campaigns..Blade did it but I dont know how. <br><br>


8. [[Cursors]]: another quote from Kravvtiz:"for the cursors, certain frames are hardcoded to each action, unfortunately tote (the action that carryalls use) and heal and maybe others all use the same one frame".
[[Category:General_Editing_Information]]

Latest revision as of 14:43, 22 January 2015

The term "hardcoded" describes functions that are coded directly into the Engine and cannot be changed/expanded by INI-editing. Examples for this are the number of unique MCVs in the game, the number of Houses and the multiplayer side colours menu.

Hardcoding

What is hardcoding?

Hard code is code held in the binary executable. Basically it's the things that are out of your hands when it comes to C&C modding. Reasons why some stuff has its behaviour handled purely by the binary code are likely varied and are probably due to time constraints or a lack of necessity for Westwood to actually ever vary some behaviour.

Why do I need to know this stuff?

There are two benefits from knowing the hardcoded stuff:

  1. Saves time and energy in your mind.
  2. Stops you irritating more experienced modders by asking about features that are impossible.

Features that are hard coded

  1. Superweapons: basically, superweapons can ONLY be replaced by altering the art assets and warheads that they use and the scope for modifying their behaviour (how they do their damage) is generally limited. All though it is possible to add more superweapons to the list, the Type value controls what behaviour that super weapon will use. This would allow you to make multiple versions of the same superweapon so you could charge and fire more than one at a time were it not for the fact that every superweapon needs a unique Action to give it a cursor and targeting. Via some clever ini editing, some members of the editing community have succeeded in creating superweapon like behaviour for some new weapons, but their targeting is handled differently from true superweapons.
  2. Sides: Depending on the C&C title, there are either two or three playable sides with two additional sides for neutral units and structures. For the playable sides they represent the main factions in the game and are often sub divided into countries (though internally they are called houses for the most part). In RA2/YR, the number of countries is also limited by code in the executable that identifies what art assets are assigned for loading screens. The playable sides are always 'GDI', 'Nod' and where applicable 'ThirdSide'.
  3. Multiplayer Color Selection Menu: The colours that are displayed are fixed, even though you can change what they result in in rules.ini.
  4. Adding a new type of unit missile: if you are planning to add a new missile that will act as the 'V3 Rocket Launcher' or the 'Dreadnought' or the 'Boomer sub' missiles, you will fail. If you tried to add one, the rocket will launch until it reached a certain altitude and will do one of the 2 actions:
    • will reverse its destinated direction and travel to nowhere.
    • will reverse its destination and head straight back to the 'Launching vehicle'. Similar behaviour can be created however; please see Spawned Missiles for further information.
  5. The 100 Units Bug. It is more of a bug than a hardcoded issue and is to do with the xxxtypes section, which lists of all the units in the game. The list looks like this:
    [InfantryTypes]
    1=E1
    2=ENGINEER
    3=SENGINEER
    4= ...etc.
    If any player buildable units are numbered to exceed 100 (after considering vacant numbers) then the list causes some kind of overflow error for the AI and it will constantly build the last unit on the list as though it were the only unit available to it.
    See Also:
  6. Infantry CANNOT repair vehicles: Any true infantry as listed in the [InfantryTypes] list cannot repair a unit from the [VehicleTypes] list. That is it cannot use a weapon that does negative damage against them, though it can do against infantry. Similarly a vehicle cannot heal infantry. You can generate a similar effect using a particle or by using negative Verses values on a Warhead but the targeting behaviour is different to a true repair unit; please see Infantry Mechanic for further information.
  7. Number of Campaigns in RA2/YR: In RA2 there are the Allied, Soviet and Tutorial campaign, a total of 3, in YR there are the Allied and Soviet campaign, a total of 2. You can re-enable the tutorial campiagn in YR, so that you can add a third campaign however, but it involves modifying the executable using a resource hacker and creating some alternate art assets. This means that you cannot add any extra campaigns beyond three in these games. Strangely however TS/FS do not suffer from the same problem. They have a list box that lists all campaigns from battle.ini.
  8. Cursors: Cursor animations are held in the file mouse.shp (mouse.sha in YR) and certain frames are hardcoded to each action. Some actions however (particularly in RA2/YR where they are left over from TS) all share the same frame so even altering the shp file will not give unique cursors for these actions.
  9. Disk Name for RA2/YR: The names for the data/install disks are hard coded in both the games and their installers. In RA2, they must either be named RA1 or RA2, yet strangely enough YR accepts RA3 and YR1 as valid disk names.

Contributors

  • Blade for extensive re-write to a more formal language
  • DeeZel for original text
  • Tratos for bringing up some ideas
  • Kravvitz for some editing, bringing up and explaining some stuff.