Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Apr 19, 2024 12:07 am
All times are UTC + 0
Random Map Generator doesn't like 3rd and 4th factions
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [22 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Wed Nov 05, 2014 10:39 pm    Post subject:  Random Map Generator doesn't like 3rd and 4th factions Reply with quote  Mark this post and the followings unread

Hi!

Since a long time I am trying to figure out why exactly the civilian slider, bridges, lifeforms and transitions crash my mod.

Today I finally found it out, and it's not really easy to fix.

This is the problem:

Code:
[Houses]
0=GDI
1=Nod
2=CAB
3=FORG
4=Neutral
5=Special


Neutral and Special moved down the list. RMG needs 3rd and 4th value to get properly working civilian slider, bridges and lifeforms.

Now we already know which hex values to edit to allow AI to choose more factions. So it uses not only 0 and 1 but also 2,3,4 and so on depending on what value is set.

But we may need a hex edit to move the offset for the Civ/Neutral faction too. So RMG reads offset  4 and 5 instead 2 and 3.

The problem is I don't have the abilities to find that out, so I thought I pass this information here for all. Maybe someone with the proper skills can have a look on it.

PS: Another way could be adding all that civilian/neutral stuff to the 3rd and 4th faction, but I am not sure if that would work 100%.

_________________


Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Thu Nov 06, 2014 6:47 am    Post subject: Reply with quote  Mark this post and the followings unread

For me RMG with all options work with Neutral/Special pushed down in [Houses] and hex hack for
3rd AI playable side.

Back to top
View user's profile Send private message
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Thu Nov 06, 2014 12:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite wrote:
For me RMG with all options work with Neutral/Special pushed down in [Houses] and hex hack for
3rd AI playable side.


You didn't tried with 4th too I bet. As I get no crashes with only one new faction. Add just an additional dummy one and try, it will crash.

EDIT:

Ok it looks like Neutral have to be 3=Neutral to work properly with the RMG.

This works:
Code:
0=GDI
1=Nod
2=CAB
3=Neutral
4=FORG
5=Special


But yeah, now AI chooses Neutral instead Forgotten.

_________________


Back to top
View user's profile Send private message
Crimsonum
Seth


Joined: 14 Jul 2005
Location: Fineland

PostPosted: Thu Nov 06, 2014 12:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Have you checked if the RMG correctly places civilian units and buildings under Neutral house, now that you've changed the order?

Also, if you enable day/night transitions, don't the light posts placed around starting points normally belong to Special? They can't be attacked without force-firing, but it could be that they simply have LegalTarget set to no. I'm curious if this new order would affect the light posts too.

_________________


Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Thu Nov 06, 2014 1:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

Playable sides have to be before Neutral and Special, it is known for a long time.

Just created a dummy 4th side similar to the first post and tested. It crashes. But it is able to create
galite with owner Special for transitions. Only Neutral is not able to get in (cities/lifeforms) and
maybe vegetation option as well.

Probably you can disable the UI elements in RMG screen for those specific fields using RescHacker.

It crashes with Eip:0062E6F6.



except.txt
 Description:

Download
 Filename:  except.txt
 Filesize:  20.75 KB
 Downloaded:  8 Time(s)


Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Nov 06, 2014 5:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

^^that IE also happens when you create a multiplayer map and place an object belonging to a normal playable house (a house without MultiplayPassive=true) on the map.
I think this confirms that the RMG tries to place an object belonging to the new house instead of Neutral.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Thu Nov 06, 2014 5:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite wrote:

Probably you can disable the UI elements in RMG screen for those specific fields using RescHacker.

It crashes with Eip:0062E6F6.


I already did that in my mod, but it's still annoying that no random maps with bridges would work. Fixing that would fix the others too (civilian and lifeforms).

I just checked, that RMG does not need a specific order for units/buildings in the rules list. It works even on my Crystllized Doom rules.ini which has the list completly reordered. If I remove Cabal and Forgotten from houses, sides and contry, then all sliders work 100%.

So it's just the house what is causing this problem. Now I try if I can bypass this with adding all Civilians and neutral units to Cabal/Forgotten faction.

But I guess MultiplayPassive=true will destroy my plan.

_________________


Back to top
View user's profile Send private message
Iran
Pyro Sniper


Joined: 23 Mar 2011

PostPosted: Thu Nov 06, 2014 10:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Can you upload your complete mod game folder (don't have a vanilla TS install). I'll look into it with a debugger.

Back to top
View user's profile Send private message
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Thu Nov 06, 2014 11:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

I send you a PM.

_________________


Back to top
View user's profile Send private message
Iran
Pyro Sniper


Joined: 23 Mar 2011

PostPosted: Fri Nov 07, 2014 10:10 am    Post subject: Reply with quote  Mark this post and the followings unread

Okay so you can fix the issue with a hex editor. What Westwood did is hard-code the offsets for the housetypes in the init code for the RMG (even though in at least most of the rest of the RMG code it grabs the array index offset via the HouseType name, using a helper function which iterates over the whole HouseType list and checks a HouseType name, .e.g. "Neutral").

The reason it most likely crashes at the moment is because the RMG init code doesn't create Neutral and Special if they're not in the 3rd and 4th position of the HouseTypes array, other RMG code tries to grab the Neutral and Special houses using that helper function which takes the housetype name as argument to grab the index for the Neutral and Special houses in the code, but because the init code doesn't create Neutral and Special if they're not in the 3rd and 4th position of the list that falls and it crashes.

Seems like the code only tries to get the Special housetype index when a certain option related to light posts or lightning is enabled.

Does the RMG also use the houses GDI and Nod (the first two houses?), the RMG creates 4 houses based on the HouseTypes in the list (using the offsets for the first 4 houses), which means it creates the GDI and Nod houses.


The byte at 0x13E50D should currently be 0x08 (this byte is for the Neutral house index in the HouseTypes array)

The byte at 0x13E542 should currently be 0x0C (this byte is for the Special house index in the HouseTypes array)

The byte values you need for every index into the HouseTypes Array:

Offset * 4 in hex (e.g. 1 *4 = 0x04)

0= (byte 0x00)
1= (byte 0x04)
2= (byte 0x08)
3= (byte 0x0C)
4= (byte 0x10)
5= (byte 0x14)
6= (byte 0x18)
7= (byte 0x1C)
8= (byte (0x20)
etc...

So in your mod Neutral is 4= (byte 0x10) in the list and Special is 5= in the list (byte 0x14). You need to patch:

The byte at 0x13E50D from 0x08 to 0x10

and

The byte at 0x13E542 from 0x0C to 0x14

----------------------

In IDA/debugger (notes for myself):

Neutral HouseType array index:

0053E50B   8B51 10          MOV EDX,DWORD PTR DS:[ECX+0x08]

0x08 = 8


Special HouseType array index:

0053E540   8B4A 14          MOV ECX,DWORD PTR DS:[EDX+0x0c]

0x0c = 12

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Fri Nov 07, 2014 11:04 am    Post subject: Reply with quote  Mark this post and the followings unread

Nice. On a quick test, it works for 4 playable sides also now.

Back to top
View user's profile Send private message
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Fri Nov 07, 2014 11:07 am    Post subject: Reply with quote  Mark this post and the followings unread

Wow you are quite fast at doing this Smile

I have to check this out, once I get home from work!

_________________


Back to top
View user's profile Send private message
Iran
Pyro Sniper


Joined: 23 Mar 2011

PostPosted: Fri Nov 07, 2014 11:13 am    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite wrote:
Nice. On a quick test, it works for 4 playable sides also now.

Should work with an unlimited amount of sides now.

Astor: Only took about 15 minutes to find the issue. It's pretty silly because Westwood could have just coded it to grab the array indexes for housetypes named 'GDI', 'Nod', 'Special' and 'Neutral' for the init code, instead of just hard-coding the first 4 indexes in the HouseTypes array. I could patch the game to the same thing but I don't feel like spending time on it.

Back to top
View user's profile Send private message
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Fri Nov 07, 2014 11:46 am    Post subject: Reply with quote  Mark this post and the followings unread

Iran wrote:
E1 Elite wrote:
Nice. On a quick test, it works for 4 playable sides also now.

Should work with an unlimited amount of sides now.

Astor: Only took about 15 minutes to find the issue. It's pretty silly because Westwood could have just coded it to grab the array indexes for housetypes named 'GDI', 'Nod', 'Special' and 'Neutral' for the init code, instead of just hard-coding the first 4 indexes in the HouseTypes array. I could patch the game to the same thing but I don't feel like spending time on it.


hmm why doesn't surprise this me at all? WW did quite a lot of stuff which doesn't make a lot of sense.

Wow only 15min? You know your work for sure!


Btw: Could you have a quick look on the savegame bug (loading game crashes game)? I got it since Beta4 again and I can't find the problem since two weeks. I am afraid that I need help with it.

_________________


Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Nov 07, 2014 11:56 am    Post subject: Reply with quote  Mark this post and the followings unread

Astor wrote:
Btw: Could you have a quick look on the savegame bug (loading game crashes game)? I got it since Beta4 again and I can't find the problem since two weeks.

Do you use firestrm.ini in your mod and changed the [Animations] list?

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Fri Nov 07, 2014 12:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Lin Kuei Ominae wrote:
Astor wrote:
Btw: Could you have a quick look on the savegame bug (loading game crashes game)? I got it since Beta4 again and I can't find the problem since two weeks.

Do you use firestrm.ini in your mod and changed the [Animations] list?


No firestrm.ini is empty. Addon animations are added after 707=INVISO (or something similar like that) then mod animations are added. I am still far away from the max allowed animations.

I am not at home right now, so I can't check it. Do new walls have to be added to OverlayTypes too? As I added Cabal and Forgotten walls only to TerrainTypes. I may guess it could be a warhead maybe. As the last build which works with saves has not set the new walls in OverlayTypes, they are just in TerrainTypes.

_________________


Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Nov 07, 2014 12:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

Astor wrote:
I am still far away from the max allowed animations.

AFAIK there is no max.
TI has 926 animations
DTA has about 1150 animations

When you have an empty firestrm.ini (make sure all are empty, not that one in e.g. patch.mix is overriding your real one), the order of the anims is also irrelevant (except for the first few hardcoded ones in rules.ini Animations list and a few others which need to be present, but don't have to be at a certain position).
Only when you have animations in firestrm.ini, you have to add these to the end of rules.ini animations list, which are then followed by your new anims.

Astor wrote:
I am not at home right now, so I can't check it. Do new walls have to be added to OverlayTypes too? As I added Cabal and Forgotten walls only to TerrainTypes. I may guess it could be a warhead maybe. As the last build which works with saves has not set the new walls in OverlayTypes, they are just in TerrainTypes.

definitely. Walls are Overlays only, never TerrainTypes.
The only thing WW did, was adding walls to both Overlays and Buildings, so they can share the same [section] in rules.ini and art.ini.
When checking the section for the Building case, it ignores the Overlay keys and when it needs it as Overlay, it ignores the building keys.



Do you added new vxl debris in rules.ini? check if they all have a hva. Without a hva you can get the savegame bug too (and other weird effects).

Do you added more dummy infantry for weedguy hack similar Cluster/Splits weapons? Check if all these dummy infantry have a proper image/sequence (Image=E1 in rules.ini or a proper set up section in art.ini with a working Sequence=). Even if you can never build the dummy infantry ingame, if it has no sequence, you get the savegame bug.

Do you added new warheads and forgot to add them to the warheads list?

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Iran
Pyro Sniper


Joined: 23 Mar 2011

PostPosted: Fri Nov 07, 2014 4:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

It's pretty interesting how Westwood supports them as overlay and building, because the RAED editor for RA1 (which as far as known was fan made), has walls listed in both its overlays and buildings selection menus, and when you place the walls as buildings on the map with the editor the map will crash ingame.

@Astor: CChyper could have done it faster, I had to rename a bunch of RMG related functions so I could check HouseType array accesses done in RMG related functions, after I did that I saw the hard-coded offset index accesses in the init code and saw what was going on.

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Fri Nov 07, 2014 4:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

In TS the game automatically converts any structure walls that have been placed on the map to overlay when the map is loaded; I'm guessing that RA1 just doesn't have this function.

_________________

Back to top
View user's profile Send private message ModDB Profile ID YouTube User URL Facebook Profile URL
Astor
Cyborg Soldier


Joined: 01 Jan 2010
Location: Austria

PostPosted: Fri Nov 07, 2014 5:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is the Except.txt the EIP is the same like the one I posted in the IE help thread some time ago.

Looking ATM on how to fix this.



EXCEPT.TXT
 Description:
Bytes at CS:EIP (0060DC0D) : F7 7C 24 10 89 44 24 10 85 ED 7F BF 8B 56 04 8D 4E 04 FF 52 0C 8B 46 1C 8D 4E 1C FF 50 0C 5F 5D

Download
 Filename:  EXCEPT.TXT
 Filesize:  20.68 KB
 Downloaded:  7 Time(s)


_________________


Back to top
View user's profile Send private message
Crimsonum
Seth


Joined: 14 Jul 2005
Location: Fineland

PostPosted: Fri Nov 07, 2014 5:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

LKO wrote:
definitely. Walls are Overlays only, never TerrainTypes.


Interestingly, Firestorm lists NAWALL and GAWALL as terrain types, what's with that? A mistake on their part?

_________________


Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Nov 07, 2014 6:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

yes, WW made a mistake when adding walls to terraintypes.

@Iran:
Walls are buildings for the sidemenu buildoption access (cameo etc), cost, foundation and other building specific parts.
When placed down ingame, the art.ini key ToOverlay turns them instantly from a BuildingType into the set OverlayType (in WW case, they use the same section). This also happens when a map is loaded with preplaced walls as buildings.
At least that is what i think how it works from observation.

One thing however, that i don't understand, is how the walls as Overlays can remember their owner.
Overlays have no owner information and when a wall is placed down, all building related keys become useless and the game only reads the keys that work for Overlays (basically only Strength). Armor, Cost, Owner, Prerequisite, Power etc become all useless.
So how can units still see them as friendly objects and rather move around them, than attacking and move through them?

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [22 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.4810s ][ Queries: 13 (0.2784s) ][ Debug on ]