Jump to content

How to modify 0 A.D.?


Nescio
 Share

Recommended Posts

44 minutes ago, Nescio said:

35. Which files do I have to edit to change minimap colours (terrain, resources, etc)? Finding a blue unit (player) on a blue background (water) is occassionally challenging. Furthermore, I'd like darker colours for mines to improve their location visibility.

 

You can look at binaries/data/mods/public/simulation/data/settings/player_defaults.json and to the templates related to your needs, see for example https://code.wildfiregames.com/rP19819 (but I don't know if it's exactly what you want, perhaps you'll have to look to hardcoded things in cpp code).

Link to comment
Share on other sites

Thank you for your quick reply! Yeah, I've already discovered and edited the player_defaults.json file about two weeks ago; I didn't know some colours were defined in templates, though, thanks for pointing this out. However, is it also possible to change the minimap colours of terrain textures? E.g. I'd like to have water show up in a fainter shade to increase contrast between background and actors.

Link to comment
Share on other sites

That complicates things, because I want to change minimap colours only in my mod, not in the default distribution, and if I touch MiniMap.cpp file (supposing I would understand it; I haven't worked with C++ for years), it will affect the whole game, right?

Ideally I'd want something like this:

MiniMapExample.png.21f727ebf6e98d940460bdf9a33cc14e.png

Yes, I know it's ugly (I'm not a map designer nor a graphical artist), and no, not *exactly* like this, it's just an example. That image is merely to visualize the concept. Legenda:

  • #000000 black: unexplored areas
  • grey-ish: map background
    • blue-ish #8080A0 blue-ish: water
    • green-ish #80A080 green-ish: normal land
    • red-ish #A08080 red-ish: inaccessable terrain
  • dark colours: resources:
    • #800000 maroon: fauna (meat and fish)
    • #808000 olive: fruit trees
    • #008000 office green: wood trees
    • #000080 navy: metal mines (ore)
    • #606060 dark grey: stone quarries (rock)
  • bright colours (red, blue, green, yellow, cyan, magenta, orange, purple): players (1, 2, 3, 4, 5, 6, 7, 8)
    • #FFFFFF white: gaia (player 0)

In the current 0 A.D. distribution I have serious difficulty with distinguishing resources from the terrain background. Although changing resource colours is possible and easy to do, the effect is limited, because the minimap background terrain colours seem to depend on the specific texture, and thus vary from map to map.

Edited by Nescio
ce
Link to comment
Share on other sites

27 minutes ago, Nescio said:

Two more structure template questions:

36. How does “TerritoryInfluence/Weight” work? (Is a higher weight better or not? Does it decrease with distance? etc.)

 

37. What does “ResourceSupply/DiminishingReturns” (template_structure_resource_field) do?

37. It was simplified some months ago. Currently the diminishingreturn is the factor applyed to each added gatherer on that resource (intended to be <1 but >1 works too).

So if you have a DR of 0.5. The first gatherer gather at full rater, the 2nd at 0.5 rate, the 3rd one at 0.25 rate, ...

  • Like 2
Link to comment
Share on other sites

3 hours ago, Nescio said:

36. How does “TerritoryInfluence/Weight” work? (Is a higher weight better or not? Does it decrease with distance? etc.)

It decreases linearly with distance, starting with the weight at the territory tile containing the building's center and going to zero at the territory radius. At a given tile, the weights of the buildings are added up for each player and whoever has the highest total owns that territory. See CalculateTerritories() in source/simulation2/components/CCmpTerritoryManager.cpp.

(I have a patch D840 to change this.)

  • Like 1
Link to comment
Share on other sites

38. What is the correct place to post art requests? A few examples of things I'd like to have:

  • A Ptolemaic civil centre without obelisks
  • Cavalry stables for all factions
  • Town walls for all factions (which fit somewhere in between palisades and city walls; cf. Roman siege walls)
  • A gastraphetes (Greek crossbowman) unit
  • Faction icons for new factions in the same style as those of the existing civilizations
  • Existing unit portrait icons in different colour
  • New unit portrait icons in the same style

 

 

39. Where to post feature requests? E.g.:

  • Units can have different garrison sizes (e.g. infantry occupies one slot, cavalry two, elephants six, siege towers twelve)
  • The possibility to directly specify a tech/civ/aura requirement inside a template's production queue
  • Amphibious, flying, helicopter, leaping, and submarine movement types (instead of either walking or sailing)
  • Triangular splash damage
Link to comment
Share on other sites

Any suggestions on how to implement the following ideas?

40. If you use an ally's dropsite, you tribute 10% of the resources (and obtain the remaing 90%), and if an ally uses yours, you receive 10% of the resources.

 

41. Domestic animals trained at the corral (goat, sheep, pig) start at e.g. 40% of maximum food capacity and slowly fatten over time.

  • Like 2
Link to comment
Share on other sites

Your mod is becoming more interesting and imo have so many features very good for MP. It’s really really nice on SP tbh. The balancing seems good. With metal requirements for most if not all combat units make you more cautious as to what units you want to train. The original wild animals lure is still in place(very good for SP, I love it!). The dropsites can be placed in neutral territory and might decay but garrisoning keeps it not turning to Gaia(very nice!).

I haven’t gone through all the meta changes but the AI behavior retains most vanilla meta which is really good when you want them to keep on attacking heavily. They produce cavalry since only barracks is required to train it.

The promotion is a bit harder to distinguish quickly but really awesome!

One thing that I noticed is the mod might have problems when using the new maps (it’s not loading with Danubius so far). 

I have to read the readme file...

 

Edited by Servo
Link to comment
Share on other sites

42. The GUI of units (and structures) has a maximum of three rows of eight slots, which means a maximum of 24 structures. This is problematic (e.g. Carthage already has 24 structures in my mod), because I intend to add more structures in the long run.

Also, the Structure Tree does not accept more than twelve structures per phase (and all factions have eleven or twelve different ones in the village phase), nor more than four units per trainer unit.

Any suggestions on how to solve this?

Link to comment
Share on other sites

38. Dunno, try the Art Development subforum, maybe you'll find someone interested there.

39. Either the Game Dev subforum or trac.
About the specific suggestions:
We had different garrison slot sizes once, it was a mess, didn't really add anything and was removed.
Not going to happen, templates are cheap use them. Amphibious is working already (well in SVN that is), it is lacking swimming animation support though (check a certain art request, or find someone else to work on that).
Flying is already working, check the plane.
Helicopters are currently working if you ignore that they can land, if you don't want to do that you might have to write a little code.
Leaping like those Egyptian jackal things from AoM, as opposed to something that's always doing that? Might need a little code for the former, but that shouldn't be too hard.
Submarine, already working, same caveat as helicopters.

40. Check UnitAI where CommitResources is used, pass the entity id of the dropsite to it, then in ResourceGatherer decide if the owner of that entity is the same as the current entity owner, if not pass some fraction (add to the schema and read from there) to the owner of the dropsite.

41. Add a new component (or extend ResourceSupply) to have some MaxAmount and GrowthRate (possibly with better names), then check if there is a rate set, then start a timer, kill that one upon reaching MaxAmount and increase the amount.

42. Fix the appropriate gui xml (within gui/session/) to have a higher number for the repeat attribute. You might have to tweak a few sizes since otherwise things are not going to fit. Similar for the structree, except there you have another xml file.

  • Like 1
Link to comment
Share on other sites

Thank you for your helpful replies!

On 18/10/2017 at 5:22 PM, leper said:

42. Fix the appropriate gui xml (within gui/session/) to have a higher number for the repeat attribute. You might have to tweak a few sizes since otherwise things are not going to fit. Similar for the structree, except there you have another xml file.

Well, I already tried editing gui/session/selection_panels_right/construction_panel.xml:

Spoiler

<?xml version="1.0" encoding="utf-8"?>
<object name="unitConstructionPanel" size="10 12 100% 100%">
  <object size="0 0 100% 100%">
    <repeat count="60">
      <object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 30 30" tooltip_style="sessionToolTipBottom">
        <object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 27 27"/>
      </object>
    </repeat>
  </object>
</object>

 

Unfortunately, this does not allow more icons to be displayed, it only makes them smaller:

Screenshot_from_2017-10-20_13-17-36.thumb.png.dd5bd7991fe69fb0e06bf163069a3298.png

I'm at a loss how to remove the 3×8 limit, especially since both cart and ptol have now 26 available structures in my 0abc mod (and I intend to add more).

Link to comment
Share on other sites

Add a new file (that is loaded after selection_panel.js) that contains


g_SelectionPanels.Construction.getMaxNumberOfItems = function()
{
return 60 - getNumberOfRightPanelButtons();
};


You might want to do the same for a few other things that hard-code 24 there. Of if you want to make this nicer for everyone you should try to replace that 24 hardcoding with some calculation based on how many children those panels actually have.
Link to comment
Share on other sites

Thank you for your quick reply! I've replaced the occurence of “24” with “60” in the gui/session/selection_panels.js file. It's partially working:

Screenshot_from_2017-10-20_18-08-10.thumb.png.31f793d1ecf48f8dcbaa9686aefe79ad.png

Building icons #25 and #26 are now displayed. Unfortunately it's still limited to eight items per row (how to increase that to e.g. 12?). More annoyingly, I get this error:

ERROR: JavaScript error: gui/session/unit_commands.js line 179 TypeError: Engine.GetGUIObjectByName(...) is undefined
  hideUnitCommands@gui/session/unit_commands.js:179:3
  updateSelectionDetails@gui/session/selection_details.js:475:5
  updateGUIObjects@gui/session/session.js:895:2
  onSimulationUpdate@gui/session/session.js:824:2
  __eventhandler62 (simulationupdate)@sn simulationupdate:0:1

 

Link to comment
Share on other sites

Specify


g_SelectionPanels.Construction.rowLength = 12;

or something like that. It defaults to 8 if that is not specified.

For the other error I doubt that is the actual first error, post the first one and it should be easier to find out what breaks (see https://trac.wildfiregames.com/wiki/GameDataPaths for where to find the logs).
Link to comment
Share on other sites

Thanks again for your quick reply! You're right, there was indeed an earlier error message; after solving the other errors also disappeared. And specifying the rowLength also worked.

However, is it also possible to increase the size of the panel, instead of decreasing the the size of the icons? It looks quite ugly if unit, building, and research icons are not the same size; and making all of them smalling isn't visually pleasing either.

 

And any recommendations how to solve:

ERROR: "maur" has more structures in phase phase_village than can be supported by the current GUI layout

#13, the elephant stables, is not displayed, even though there appears to be enough space:

Screenshot_from_2017-10-20_19-47-38.thumb.png.a2241101842b5f04dd540cc76fea5bbf.png

I've looked at all files in gui/reference/structree/ however, I couldn't find where the maximum of twelve items per row is defined.

Link to comment
Share on other sites

Look for the object named unitCommands in session.xml (you might have to adjust the size of the parent too.

gui/reference/structree/rows.xml the repeat on line 6, at least that is what is most likely causing the error. I'm not sure if there is something broken there or not, ask s0600204 for details.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...