Ancestors Legacy

Ancestors Legacy

Ancestors Legacy Modding Kit
Welcome to Ancestors Legacy modding community.
 此主题已被置顶,因此可能具有重要性
DC_vipeout 2019 年 8 月 26 日 下午 10:12
Mod Creation FAQ
If you do not have editor working on your PC start with this topic.

Here you will find tips on how to actually get stuff done using our custom module, or some tips on how to get something done using UE4 that is not trivial or obvious. Feel free to ask questions either through PMing me or asking on forums / discord. I'll keep adding questions as they come up so there's something to base on and point new modders to.

I don't see a point in repeating the documentation therefore I will link to it often.

The best way to see how something is done is to look it up in the actual working maps. It's not always a perfect solution, but at least it's an acceptable one. In most cases. I hope. I haven't seen everything ;)

Alternatively, you can always ask. I'd really enjoy not being spammed with the same, already answered questions over and over again, but I'm more than certain that it will happen. So I reserve myself the right to reply with links to answers in one of my topics.

We've also decided to make several guides for you - to ease up getting into all that.

For those more or less familiar with UE4 this is going to be a great help on actually doing stuff the way it's supposed to be done in our game. For those who just start with UE4 I suggest to take it slowly - you're not going to make the perfect map on the first try. Nonetheless, both those groups will need this FAQ, as it proved out after initial testing. So, let's start with list of contents ;)

Contents:
  1. General
  2. Map Pack related
  3. Total Conversion (TC) related
  4. Performance
  5. Debugging

Useful links:
UE4 Documentation[docs.unrealengine.com]
UE4 Wiki[wiki.unrealengine.com]
UE4 Answer Hub[answers.unrealengine.com]
UE4 Forums[forums.unrealengine.com]
最后由 DC_vipeout 编辑于; 2019 年 10 月 13 日 下午 11:43
< >
正在显示第 1 - 15 条,共 16 条留言
DC_vipeout 2019 年 8 月 26 日 下午 10:19 
General

Q: Can I modify a single blueprint?
A: Yes. Either just do it and cook as TC, or for map packs, copy the blueprint you want to modify to the map pack folder, modify the blueprint and replace the blueprints existing on the map with the modified version.

Q: I can see my maps inside the plugin folder in windows explorer but not in the Content Browser. Why is that?
A: Things break. Happens. Reopen the editor and pretend it never happened.

Q: Why my map name does not update inside the DC Workshop window after renaming?
A: You have to hit 'Refresh'.

Q: How to change the Game Mode on a map?
A: Make a new blueprint that is a child of our gamemode, save it, move it to plugin content if doing Map Pack, set the Game Mode on map world settings, recook. Changing Game Mode allows you to change several other general BP's that are capable of changing tons of things.

Q: Do mods work in multiplayer?
A: Yes they do. You must have the same set of mods enabled in order to properly connect, though. Also, please keep in mind that if you're making some custom logic in your mod and you want it to work in multiplayer scenario - that's additional layer of complexity that you have to deal with. Replication and different network scenarios make creating working stuff much harder. Dedicated servers do not support mods though, so you have to host yourself.

Q: How to test my changes without cooking every single time?
A: You can test almost everything right from the editor. Open up the map you wish to test, or a vanilla map if the changes you've made are global. Make sure to open up the _P sublevel. It should contain and load all the other required sublevels. Play from the editor and simply test the changes. Do not use the main menu in editor to launch maps, it will not work.

Q: What's all that config per map stuff?
A: In order for the game to know some basic things about your map, you need to enter it somewhere. We don't want to load all the maps in main menu to read the data from the map itself, so we need something else. Configs are clean and load very fast, they get the job done.

IMPORTANT NOTE: How to actually add the map is described in TC / Map Pack sections.

Each map must have it's own section, below an example of one of the base game maps:
[sp_ger_map_07_P_LS AncLevelSummary] LocalizationDataHandler=(DataTable=DataTable'/Game/Blueprints/Datatables/DT_LevelLocalizationData.DT_LevelLocalizationData',RowName="SPGer07") PlayerStartPositions=(X=0.753991,Y=0.678442) PlayerStartPositions=(X=0.472783,Y=0.492251) PlayerStartPositions=(X=0.343944,Y=0.361436) VillagesPositions=(X=0.782087,Y=0.434458) Screenshot=None Intro=/Game/Movies/Germans/sp_ger_map_07_p_src.sp_ger_map_07_p_src Outro=None LoadingScreen=None MapNameShort=sp_ger_map_07_P MapNameFull=/Game/Maps/sp_ger_map_07/sp_ger_map_07_P EnglishMapName="Reclaiming Styria" MapSeason=Summer BlockingMapNameShort=sp_ger_map_06_P

LocalizationDataHandler - DataTable with row containing localized title and description for this map. You probably won't localize the map names into all languages, but filling this is still going to make things better (assuming that the row has stuff added). Please note, that if you use the original DataTable we use, you have to cook as TC for the change to work. When making map pack, please create a new DataTable based on FMapSummaryLocalizationData in the mod folder and use it.
PlayerStartPositions - do not modify manually, MapDesigner does that. Do "util check map status" and then "util world data save summary config".
VillagesPositions - do not modify manually, MapDesigner does that. Do "util check map status" and then "util world data save summary config".
Screenshot - Texture presenting the map. Not really used for single player maps, but for multiplayer ones this is the minimap screen. See
/Game/UI/Maps/t_ui_mp_14_01_d.t_ui_mp_14_01_d
Intro - path to media player source file to play when the map is loading (this is the 2D hand drawn cutscene that plays before campaign missions)
Outro - path to media player source file to play when the map finished (this is the 2D hand drawn cutscene that playes on campaign endings)
LoadingScreen - Texture that is shown after the intro ends (or when it's None). There is always a fallback in loading screen blueprint, so this may be empty. Really used only for multiplayer maps, singleplayer have background per nation.
MapNameShort - do not modify manually, MapDesigner does that. Do "util check map status" and then "util world data save summary config".
MapNameFull - do not modify manually, MapDesigner does that. Do "util check map status" and then "util world data save summary config".
EnglishMapName - the map name in English. Some scripts operate on strings and we need to have a name per map, not per map per locale. Sometimes used for fallback when the LocalizationDataHandler is not specified (but we don't really have any maps that do not have it so no promises).
MapSeason - That's not really a season of the map. Or at least no longer after Saladin DLC. Think of it as a mood or scenery for the map. Multiple various things are altered when this is changed - weather, building materials, decals, effects, landscape and so on. Available values:
  • Spring - not really used by the game. You could theoretically add your own scenery type here (you cannot expand this list by new entries). You would have to find all places this is used however, and that's a lot.
  • Summer - default scenery
  • Autumn - used by the game
  • Winter - used by the game, changes rain to snow on top of everything else
  • Desert - used in Saladin DLC
BlockingMapNameShort - if this is set, the campaign map will be blocked until this map is finished. Does nothing for multiplayer maps. I don't think it will work properly for mods, but you may give it a try.


Back to top
最后由 DC_vipeout 编辑于; 2019 年 10 月 25 日 上午 1:01
DC_vipeout 2019 年 8 月 26 日 下午 10:25 
Map Pack related

Q: What can you do with a Map Pack?
A: You have to add a map. Then, you can add custom mechanics and scripts to them. Add new objects and use them on those maps. Audio, textures, characters, all possible, but only on the added maps.

Q: What cannot you do with a Map Pack?
A: Modify the base game content. You can use it in your map, but if you modify it then after cooking, your mod will not use the modified base content, but the original one. Copy the content you want to modify into the mod folder, then modify it and use on your map.

Q: If you have to add a map, then modding campaign is only possible through TC?
A: Not really. While cooking as TC will allow you to change everything, you can also copy all the campaign maps to the plugin content and then add all the modified blueprints, animations and models that you wish. Cook as Map Pack. Works the way you'd expect, thing is you have to launch it from a different menu. You can make a modified campaign map without destroying someone's main experience. See the question below on how to achieve this result.

Q: How to copy campaign map into plugin content so I can modify it?
A: Do not do it through the OS (explorer / total commander / etc ). It really will not work. Anything you do with the engine you do through the engine unless you really know what you're doing or there's a bug / need for a hack / etc. Since this is not as straightforward as one would think, I've made a guide for it. It uses Hatred map as an example, but this is identical regardless of the map.

Q: How to fill the config data for map?
A: With the map opened in editor open the "World Settings" window. Find section "Level Summary" and simply enter all the details that you want. Please make sure to remember that some are autimatically filled. Please remember to regularly run the script to fill those in when making changes. MapDesigner's "Util Check Map Status" function. You do not touch the DefaultGame.ini file at all. It's base content and you will not cook it in a map pack.

Q: Do I need the"_AI" sublevels vanilla maps have when creating a multiplayer map?
A: If you want the map to work properly with the skirmish AI then yes. Otherwise, if it's a strictly PvP map, you can ignore it. All you really need to do is to add a new sublevel and set the markers similarly to how it's done on the vanilla maps.

Back to top
最后由 DC_vipeout 编辑于; 2019 年 10 月 18 日 上午 2:13
DC_vipeout 2019 年 8 月 26 日 下午 10:32 
Total Conversion (TC) related

Q: What can you do with a Total Conversion?
A: You can modify everything, everywhere and it will work. Audio, textures, characters, all possible on all the maps in content.

Q: What cannot you do with a Total Conversion?
A: Things that we have not exposed to blueprints, that are done purely on C++ side. Please let us know what would you like to achieve if you think that it's impossible. Surprisingly many things are doable.

Q: How to add a map to a Total Conversion?
A: That's much trickier than in a Map Pack, but doable. Generally my first advice is to use a map pack if you want to add a map (like, seriously). It's even trickier for a multiplayer map and may not even work. There are cases where you could want to do that in TC, though. So:
  1. Add the map somewhere in the Maps directory, create a new folder for it similarly to how the base game maps are done. Make absolutely sure that it starts with proper prefix (sp_ or mp_) and ends with _p or _P. It won't work otherwise.
  2. Create the map section in the DefaultGame.ini (found in Anc/Config). More details on that.
  3. Actually do what you want to happen on the map. You can normally play it from the editor.
  4. When you want to cook it, navigate to "Anc\Programs\cook_TC_maplist.txt". MAKE A BACKUP COPY. Append your map at the end after a '+' sign, exactly as the remaining maps in this file. If for whatever reason you break this file, use the backup. You really do not want to ask me what the alternative fix is.
  5. This solves the problem of having the map inside the mod, but does not let you launch it. Campaign menu will not magically know there's a new map.

Singleplayer map:
  1. Somewhere in the menus (Blueprints/HUD/Menus) you need to make a button that will launch your new map. It can be in main menu, can be in the campaign menu, maybe even in the single player mods menu.
  2. When the button is pressed you have to launch DCTravelToMap found in AncGameInstance. There is a GetAncGameInstance node that gets you there.
  3. This is the magic part. The URL for your new map named "sp_newmap_01_p" in folder "sp_newmap_01" should look like
    /Game/Maps/sp_newmap_01/sp_newmap_01_p?game=SP?ForceMapData=1?PlayersNum=1
  4. Leave the checkboxes in default, this function does some heavy stuff and you can easily mess a lot.
  5. Players will use this button to launch your game once they activate your TC mod.

Multiplayer map:
Should magically appear in all the dropdowns where multiplayer maps are chosen (skirmish and host game). If it does not, you can make sure you really properly added it to the map list txt file. If you are really, really sure, then you have to make a map pack anyway. Don't tell me I didn't warn you :)

Conclusion:
This could be improved, but we didn't have the time to do this for this game. Generally speaking, map packs are supposed to be used in this case.

Q: When can many TC mods be safely enabled together?
A: Generalizing, the engine upon start with TC enabled, loads all the content from the base game, and then overrides those with each asset found in the TC mod. You may modify a weapon blueprint, but it is relying on some functions in the character blueprint, which relies on materials for burning, particles, animations and so on. Things do reference one another.

Then when loading another TC which modifies character blueprint it may work (because modders happened to make the exactly same change, or made sure their mods are compatible and they shared the file between them before cooking) or it may break. We're unable to tell what kind of things you may want to change in the character blueprint. It may break both mods entirely in the worst case and the game would crash.

Long story short, if any two TC mods modify the same asset, they are in conflict. This may crash or may work without you noticing, depending on what kind of asset this is. If it's just a texture, then one of them will be picked up and nothing should crash, unless there's a very special shader someone added that uses this texture. If that asset is a blueprint, the chances of things going south are very high.

How do you know which mod changes which files? You don't. We haven't implemented a feature that would list all the conflicted files, or all files for a given mod. We wanted to... but reality kicked in. So either:
  • Launch and see
  • Roll with "graphical mod and logic mod will not conflict in general"
  • Ask modders nicely to list all the files they've changed in their mod descriptions
We seriously apologize and realize how much this sucks. It's still better than our previous games, where only 1 TC could ever be active. We're making progress ;)

Back to top
最后由 DC_vipeout 编辑于; 2019 年 8 月 27 日 上午 1:26
DC_vipeout 2019 年 8 月 26 日 下午 10:34 
Performance

This is about mod performance (map / blueprints / etc), not the editor performance. For that look here.

Q: How to make my map run with more FPS?
A:
  1. Keep the radius of your lights as small as possible. You rarely need a light that covers half the map.
  2. Use spot lights instead of point lights where possible
  3. Disable shadow casting on lights that do not have to do so and on objects that are so small that their shadow will never be seen either way
  4. Use Cull Distance Volumes to make sure that objects you cannot see are not rendered. Keep in mind that this does not work for blueprints and you have to manually set the Max Draw Distance for each component of the blueprint.
  5. Do not overuse physics. Generally you want objects to be asleep and wake them when needed instead of keeping them awake 24/7.
  6. When creating custom blueprints, remember to clean up after doing the job - stop the timelines, disable lights, deactivate particles and so on.
  7. Try to not overuse 'Tick' function in the level blueprint. 'Tick' is called every frame and if you put something heavy in there your PC will feel it.
  8. More here[docs.unrealengine.com]

Q: How to see what is causing my FPS to be so low?
A: The topic is quite deep, but some easy to use things that can help you:
  1. Open up the cmd (~) and type 'stat raw' and 'stat fps'. This will let you determine what bounds your FPS and is the first step. Draw is CPU render thread (prepare data for GPU), Game is the actual stuff that CPU does (AI, physics, updating the game state, input). From here you just dig deeper and deeper to find the actual cause of the issue. Obviously keep in mind that this heavily depends on your rig, therefore on other people's PC's something else may be problematic.
  2. Documentation on the subject[docs.unrealengine.com]
  3. Example on a blog[www.unrealengine.com]

Back to top
最后由 DC_vipeout 编辑于; 2019 年 8 月 26 日 下午 11:00
DC_vipeout 2019 年 8 月 26 日 下午 10:36 
Debugging

Q: How to see values of variables in run-time (when the game runs)?
A: There are several ways to achieve this:
  • Put a 'Print String' node in the blueprint and print the variable you want to know each tick - but this one will heavily spam the log
  • Have the blueprint opened when you launch the game and put a breakpoint on the node that uses the variable (default F9). The execution will stop once it arrives at the node, letting you see the current state.
  • Use displayall / getall command. Open up the cmd (~), syntax is as follows:
    displayall classname variablename
    • "Classname" for blueprints is the name of the blueprint with '_C' suffix.
    • "Variablename" is the name of your blueprint variable, or in case of a *.cpp variable - the way it is named in code. To get it's name modify that parameter in the actor, copy the actor (CTRL+C) and paste into notepad. There you can find it's real name. Keep in mind this displays only the modified values - the default ones are not stored for every actor.

Back to top
最后由 DC_vipeout 编辑于; 2019 年 8 月 26 日 下午 11:00
Dork 2019 年 10 月 15 日 下午 7:31 
E
Owlcoholic 2019 年 12 月 14 日 下午 10:17 
Quick question regarding AI.
You said to 'add the markers similarly to how it's done on the vanilla maps' but could we get some specifics? What do the markers do exactly? Are they areas the AI should focus on? Are they areas of danger/contact? Are they used to help guide AI in moving troops around in general?
DC_vipeout 2019 年 12 月 15 日 下午 11:03 
I think I've explained this somewhere before but can't find it atm. Generally, those points should be placed at crossroads and hill entry/exit points. All you need to do with those points is to generate a mesh that the Ai will navigate around the map. So every path that the units can take should be visualized on that graph.
Only Hardcore 2020 年 1 月 26 日 上午 10:04 
Can i create new units here?? I want to create gods (perun, thor, odin, veles and others)
DC_vipeout 2020 年 1 月 26 日 下午 11:44 
Yes, you can.
Only Hardcore 2020 年 1 月 29 日 上午 9:28 
引用自 DC_vipeout
Yes, you can.

And i can create a new attack effect? When they will strike the enemy they must fly away))
DC_vipeout 2020 年 1 月 29 日 下午 11:13 
During combat, when 2 soldiers fight, they play animations so that it can be seen that they indeed fight. Those animations send events through a system called "AnimNotify". In our game, Anim Notify is called per each hit dealt. You can do something in those moments.

Also, when the fight between 2 soldiers end and one of them dies, we play different animations, executions so to speak. You can also detect that and in the execution animation add a new AnimNotify that you will react to in the blueprint.

You can make them fly either by changing the current animations, or by adding a physical impulse at the appropriate time. Physics during animation is a tricky thing to do, so the easiest way of achieving this would be stopping the animation at the point of the Anim Notify and then enabling physics simulation and adding the impulse.
Only Hardcore 2020 年 1 月 29 日 下午 11:21 
Hmm, thanks!!! And can you give me link to guide, when i can find all for this mod?)
DC_vipeout 2020 年 1 月 30 日 上午 12:40 
They are all linked in the OP. Some are made by us, some are links to UE4 general information sites.
Only Hardcore 2020 年 1 月 30 日 上午 10:31 
引用自 DC_vipeout
They are all linked in the OP. Some are made by us, some are links to UE4 general information sites.

thx very much for help!!!
< >
正在显示第 1 - 15 条,共 16 条留言
每页显示数: 1530 50

发帖日期: 2019 年 8 月 26 日 下午 10:12
回复数: 16