Jump to content

R&D XCOM Map Alterations


Amineri

Recommended Posts

  • Replies 473
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 months later...

The last few days I did some experiments with map streaming and here are the results: An empty map created with the udk loads fine and if there is kismet logic implemented it runs! I used a simple kismet "play sound" on level load. However, I was unable to compile xcomgame object stubs :sad: even if I cleaned the sourcefiles leaving only declarations,needed enums and types and removing the functions , the default constructor doesn't compile (i used decompiled code from UEEditor).

Also, including 2 or more streams in the map load process they both run, the objects of each are placed in the world and the kismets of each one start (try loading exalt capture and hold and bomb stream ). Creating and editing stubs is a nightmare ,as I am completly new to unreal script and kismet.. it even gave compile errors on file containing an interface just because there was an "abstract" word before the ";"! Could some one englighten my why the default contsructors don't compile? it gives me errors about nested class declarations and object redefinitions

 

edit: sigh, it's the ueexplorer that's writing part of the code incorrectly.. like "object end" instead of "end object"

Edited by LiQuiD911
Link to comment
Share on other sites

LiQuiD911, amazing progress here! Congrats!

 

You don't need any of the functions for map objects to work. Map objects are archetypes and operate on properties (i.e. member variables) only. So all you need to do is create a bunch of classes with member variables definition. And, again, you don't need all of these variables, as not all of them are used to define map object. And yes, UEE code is incorrect in some cases. Furthermore, compiled packages do not need DependsOn specifier, but uc sources do.

 

You can create github projects with current data so the others could see the progress and contribute to dummy sources.

 

UPD: In fact, I decided to set an example :smile: and uploaded my current sources I used to compile XCOM Randomized mutator project. Hope this helps a little at least with general idea on how to make those.

Edited by wghost81
Link to comment
Share on other sites

In fact , your mutator page is my main source of stub building knowledge :smile: Later I'll write a quick guide based on my little experience with unreal script on how to tacke with the compiler errors I've stumbled upon. I'll post my code but I can't garantee it's done in the right way.. I cannot instanciate a plain LevelActor because it crashes the UDK. HOWEVER in the stream packages I founda VERY interesting volume about reconstructing cover elements after the level is loaded.. I think that's how exalt antenas get their cover.

 

Here is an detailed explaination on what I did to make a spawnpoint:

 

 

Note: Place all source files containg our stubs in UDK-2011-09/Development/src/XComGame

This is a lighter version than my previous one because it doesn't require the creation of stubs for XComBuildingVolume and it's dependencies

Open XComGame.upk with UE Explorer
Select Tools->Exporting->Export Classes
Open the folder containing the classes and search for XComSpawnPoint.uc
Open XComSpawnPoint.uc and remove all functions and the struct CheckpointRecord (I'm pretty sure this struct won't be needed at compiletime)
Leave the defaultproperties
comment out the line "var XComBuildingVolume m_kVolume;" since it's not required to place a spawnpoint
Notice that there is an enum EUnitType defined in XGGameData
Save in our src folder and close XComSpawnPoint.uc and search for XGGameData.uc in the class folder
Delete all functions leaving the enums, structs and defaultproperties

XComSpawnPoint extends the class XComSpawnPointNativeBase so well'need that one too
Find it, open it and remove the functions


compile errors:

XComSpawnPoint.uc() : Error, Unrecognized type 'EUnitType' within 'XGGameData'

add dependson(XGGameData) to the class definition

class XComSpawnPoint extends XComSpawnPointNativeBase
hidecategories(Navigation)
placeable
dependson(XGGameData);


XGGameData.uc() : Error, Duplicate enumeration tag ENumPlayers

The enum XGGameData.ENumPlayers has duplicate values

enum ENumPlayers
{
ENumPlayers,
ENumPlayers,
ENumPlayers,
ENumPlayers,
ENumPlayers_MAX
};
I just add a number to make them different
enum ENumPlayers
{
ENumPlayers,
ENumPlayers1,
ENumPlayers2,
ENumPlayers3,
ENumPlayers_MAX
};
XGGameData.uc() : Error, Unrecognized type 'XGUnitNativeBase'
The easiest way to solve this for now is to remove the definition of the struct

struct native XGUnitVisibilityInformation
{
var XGUnitNativeBase kUnit;
var int kVis[EUnitVisibilityInformation_CoverPoint];

structdefaultproperties
{
kUnit=none
kVis[0]=0
kVis[1]=0
kVis[2]=0
kVis[3]=0
}
};

because we don't need it at the moment.

Compile the scripts with UDK and open UnrealEd, open Content Browser and go to the Actor classes tab, search for XComSpawnPoint,
select it and minimize the content browser, rightclick and press Add XComSpawnPoint here. Open it's properties and edit it's position.
Save the map, cook and rename it's extension from udk to upk then stream it trough the defaultmaps.ini settings (take note that the LZ mod moves these points so test without it or on a map no supported by it)

 

 

 

Recreating a unit archetype is not an easy task... there is a web of dependencies between classes an it's required to distinguish the needed ones from the useless. I'd propose to make a diagram of class dependencies and start compiling from the leaf classes but still it's hard to cut down the complexity

the following is just a quick sketch:

 

http://i61.tinypic.com/34gn3g5.png

http://i60.tinypic.com/jtpf5s.png

 

 

 

Edit2: I figured out how to refactor the defaultproperties in classes like XComLevelActor
here's before and after

 

 

defaultproperties
{
begin object name=FloorComponent0 class=XComFloorComponent
OwnerMeshComponents(0)=StaticMeshComponent'Default__XComLevelActor.StaticMeshComponent0'
object end
// Reference: XComFloorComponent'Default__XComLevelActor.FloorComponent0'
FloorComponent=FloorComponent0
VisibilityBlockingData=(bBlockUnitVisibility=true)
bAlwaysConsiderForCover=true
bCanClimbOnto=true
bIsValidDestination=true
begin object name=StaticMeshComponent0 class=StaticMeshComponent
WireframeColor=(R=193,G=255,B=6,A=255)
ReplacementPrimitive=none
bReceiverOfDecalsEvenIfHidden=true
bForceDirectLightMap=false
object end
// Reference: StaticMeshComponent'Default__XComLevelActor.StaticMeshComponent0'
StaticMeshComponent=StaticMeshComponent0
begin object name=StaticMeshComponent0 class=StaticMeshComponent
WireframeColor=(R=193,G=255,B=6,A=255)
ReplacementPrimitive=none
bReceiverOfDecalsEvenIfHidden=true
bForceDirectLightMap=false
object end
// Reference: StaticMeshComponent'Default__XComLevelActor.StaticMeshComponent0'
Components(0)=StaticMeshComponent0
begin object name=FloorComponent0 class=XComFloorComponent
OwnerMeshComponents(0)=StaticMeshComponent'Default__XComLevelActor.StaticMeshComponent0'
object end
// Reference: XComFloorComponent'Default__XComLevelActor.FloorComponent0'
Components(1)=FloorComponent0
bStatic=false
bStaticCollision=true
bTickIsDisabled=true
m_bNoDeleteOnClientInitializeActors=true
bConsiderAllStaticMeshComponentsForStreaming=true
bPathColliding=true
begin object name=StaticMeshComponent0 class=StaticMeshComponent
WireframeColor=(R=193,G=255,B=6,A=255)
ReplacementPrimitive=none
bReceiverOfDecalsEvenIfHidden=true
bForceDirectLightMap=false
object end
// Reference: StaticMeshComponent'Default__XComLevelActor.StaticMeshComponent0'
CollisionComponent=StaticMeshComponent0
}

defaultproperties
{
begin object name=StaticMeshComponent0
WireframeColor=(R=193,G=255,B=6,A=255)
ReplacementPrimitive=none
bReceiverOfDecalsEvenIfHidden=true
bForceDirectLightMap=false
end object

begin object name=FloorComponent0 class=XComFloorComponent
OwnerMeshComponents(0)=StaticMeshComponent0'
end object

FloorComponent=FloorComponent0
VisibilityBlockingData=(bBlockUnitVisibility=true)
bAlwaysConsiderForCover=true
bCanClimbOnto=true
bIsValidDestination=true


Components(0)=StaticMeshComponent0
Components(1)=FloorComponent0
bStatic=false
bStaticCollision=true
bTickIsDisabled=true
m_bNoDeleteOnClientInitializeActors=true
bConsiderAllStaticMeshComponentsForStreaming=true
bPathColliding=true
CollisionComponent=StaticMeshComponent0
}

 

 

 

Here's a temporary link until I setup a github repository

https://www.dropbox.com/s/p90rkuv63jdtssw/map%20stub%20classes.zip?dl=0

with the classes we have at the moment we could make an evac volume using a levelbuildingvolume with a boolean set to dropzone.. the problem is that we don't have any art assets, any idea how to get those?

Edited by LiQuiD911
Link to comment
Share on other sites

So what do we do? bruteforce create all stubs? Another thing, would these archetypes be compattible with LW's unit abilities,inventory ecc? Does LW modify XComGame.upk?

 

edit: This would involve publishing decompiled xcomgame code which violates the EULA, I hope nobody from the legal department will shut down this

Edited by LiQuiD911
Link to comment
Share on other sites

It does. I strongly recommend to keep vanilla compatibility for a start. This will make it easier to debug. On the other hand, I don't think LW modifies any of the map related object properties.

 

I have four vanilla XCOM versions on my hard drive, plus test version with plenty of mods, plus Long War version. :smile: I also have two different UDK installs for EU and EW. :smile:

 

Bruteforcing all stubs can take ages. I usually re-create only the parts I need for my current work.

Edited by wghost81
Link to comment
Share on other sites

Ok, I'm switching to vanilla.

In the code there is a chain of dependencies from Spawn unit to a inventory of that unit but I guess it's not possible to modify it's inventory trought the stream.

 

update: all the volume classes should have a "placeable" attribute to be usable in UDK. the dropvolume works fine on standard maps but for an unknown reason it doesn't on the MP_Blank map, I think it's a matter of level floors. I spawned a static mesh on the map but I can't make it solid and usable as cover for now. Placing a textured mesh from the default udk ones unsuprisingly crashes the game since the textures are put in a tfc

 

Hey! I just noticed my stubs get cooked in the map.. is there a way to prevent them from beeing included? I don't think I can use an uncooked map because the static mesh doesn't show.

Edited by LiQuiD911
Link to comment
Share on other sites

All the map objects should have 'placeable' attribute for you to be able to actually place those on the map.

 

You mean your script packages are cooked into the map? Have you added those to Engine.ScriptPackages section of UDKGame\Config\DefaultEngine.ini? Like this:

[Engine.ScriptPackages]
+NonNativePackages=UTGame
+NonNativePackages=UTGameContent
+NativePackages=XComGame
+NativePackages=XComStrategyGame
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...