Jump to content

Hyrule Conquest


Recommended Posts

EDIT: I Reinstalled Blender, and the skeleton imported properly now. Must have been a setting I tweaked when I used blender awhile back. Point is, it works!

8wAGmHv.jpg

Thank you so much for your help and this tutorial. I think I'm convinced to port to 0AD, now that I can bring in my animations without much hassle.

 

A small question though, since 0AD uses props that you can attach to models and I plan on tweaking me weapons to be attachments: Do the weapons have to be skinned to the joints they shown up on, or are they just placed at 0,0,0 and locked on the joint defined the xml file?

Can props have their own skeletons? For example if I wanted a flowing cape, would the unit have to have a skeleton with the cape or could the cape have it's own separate skeleton?

Edited by The Undying Nephalim
Link to comment
Share on other sites

  On 24/07/2017 at 5:54 AM, stanislas69 said:

No they don't have to be skinned. To see how you have to place your weapon just import one from the game.

Yes you can animate pretty much everything. There are animated capes in 0ad.

Expand  

Very awesome, I'm liking this engine more and more. It seems so much more modder friendly than Medieval 2.

I have a string of questions I'd like to ask, just so I can gauge what is and what isn't possible in the engine before I start porting over rosters of units from the TW version of the mod. Any answers are greatly appreciated:

  Reveal hidden contents

 

Link to comment
Share on other sites

1)    It’s possible, but it hasn’t been coded I think.
2)    Corpses are by default made unelectable, but I think that might be overridable. Not sure if C++ or simple template editing
3)    Not yet, there are tickets about it but it hasn’t been implemented yet.
4)    It’s doable but not implemented.
5)    Same codable adding a component such as stunnable, which adds a particle effect to the unit, and set their move speed to 0 or trigger a flag that would prevent them for moving.
6)    Yes, just add a particle props, see the blacksmith building for instance.
7)    Yeah, there is a tech that does that, you could auto research it.
8)    It has been done for capturing, so it would have been somewhat an extent of that, then again it’s not natively supported
9)    I’m not sure but I think towers can do that not the bouncing though
10)    Adding new resources is possible, Wowgetoffyourcellphone, and MuteLovestone did it. Restricting it to civs, I don’t know
11)    You can define the range of the attacks
12)    You’d have to add a new component for dodging. Maybe an aura could do the trick but I’m not sure
13)    See current implementation of temple auras
14)    If you set the aura radius to be the size of the territory it could work, but won’t be precise
15)    You can only add decals to buildings (as props), so if it is big enough, it could do what you want.
16)    You need an extra js component to do that.
17)    Not yet, but there is a patch
18)    This would require change to how capturing works but it could be done
19)    This requires changes to the pathfinder, I’m not sure it can be done as is
20)    I’m not sure.
21)    This is planned, not sure the ticket has been issued
22)    Same as being dealt damage when attacking special unit, it has to be in attack.js, or in another component
23)    Tweaking a component could do the trick, and it could be mutualized with the spawn unit on death.
24)    Might work by adding resources to a building, but I’m pretty sure that isn’t that easy
25)    Needs a new component, but it could be done
26)    I think you could set a building to ignore trees obstruction, but I think that requires pathfinder changes.
27)    No I don’t think it’s implemented. There is a patch for multiple attacks somewhere, you could also make your unit upgrade to a new one that casts fireballs and then somehow on the first attack make it upgrade back. Nice way would be to add another type of attack
28)    Would maybe work with a special component, not sure.
29)    Every debuff can be achieved through auras
30)    
31)    Needs change to the attack.js file
32)    Not sure, but I guess that’s related to 28
33)    Could be done but it’s not implemented. Adding repairable to a unit, and making it so it collapses from let say 10% of the health, could work
34)    That’s the purpose of ticket #2577 which I was never able to finish.
 

  • Like 1
Link to comment
Share on other sites

That's pretty awesome that a majority of these seem possible.

Another question, is it possible to scale the size of a model and animation in an xml file?
Say I have two units that use a Biped skeleton, but on is three times larger. Can I just simply scale up the skeleton in an xml, or will I have to import animations that have been scaled up in blender?
 

  On 24/07/2017 at 1:11 PM, stanislas69 said:

27)    No I don’t think it’s implemented. There is a patch for multiple attacks somewhere, you could also make your unit upgrade to a new one that casts fireballs and then somehow on the first attack make it upgrade back. Nice way would be to add another type of attack

Expand  

So what you are saying is Unit A switches to Unit B, which has a different attack, and then is forced to somehow switch back to unit A? Maybe a hidden ability that causes the unit to switch back when a timer goes off? I'm not familiar enough with abilities to know if things like auto count down timers work or not.

Link to comment
Share on other sites

  Quote

1) Is it possible for a ranged attack to spawn a new unit upon impact? Ideally, could it be made to have a random chance of spawning as opposed to 100% of the time? I have some siege weapons that launch units at enemies and over walls, this would be really handy if possible.
Expand  


Needs a small amount of code. This is related to the other damage tickets (which by now provide a relatively nice basis for this) #1909 #1910 #1911 #1912, which are being worked on by a contributor, so having a user for a few of those things will help with getting this written.

  Quote

2) Is it possible to interact with corpses of dead soldiers in any way? There are a lot of undead in Hyrule, and being able to raise undead from fallen enemies would be great. In addition, units being able to "eat" corpses in order to regenerate health would be great.
33) Can units return a dead unit back to life before the corpse vanishes? Could a unit "repair" a dead unit back to life, such as the Atlantean Automatons from Age of Mythology?
Expand  


  Quote

2) Corpses are by default made unelectable, but I think that might be overridable. Not sure if C++ or simple template editing
33) Could be done but it’s not implemented. Adding repairable to a unit, and making it so it collapses from let say 10% of the health, could work
Expand  


Ah, #2951 paying off. You just have to change what a corpse is. Corpses are "corpse|template" template names, which means the special corpse filter (the file named corpse.xml) in templates/special_filter defines what happens with the original template. So to make them selectable just add

<Selectable merge=""/>


to that template.

For repairing/raising them from the dead you could take some inspiration from the foundation template and play with the initial health in addition to some health decay (negative regeneration or something).
For eating this sounds like something that was done at some point in the past, however that code was more of a quick hack to get it working and might need some updates to actually work. Also it has the limitation of preventing those units from gathering at all, possibly more limitations it has been a while.

  Quote

8) Is it possible to give units a second health bar that can regenerate? Think Protoss Shields from Starcraft.
Expand  


  Quote

8) It has been done for capturing, so it would have been somewhat an extent of that, then again it’s not natively supported
Expand  


Adding another bar is easy. Having some shield should also be somewhat easy if the health component does check if that is present and first does damage to the shield and only afterwards decreases health.

  Quote

9) Is multi-target (not splash damage) attacks possible? For instance a projectile hits an enemy and then bounces to the nearest enemy, or multiple projectiles that attack multiple targets.
Expand  


For just firing multiple projectiles that is what buildings and ships do. But the code that does that is somewhat hacky. So currently doable by using workarounds. Projectile bouncing would need code.

  Quote

10) Adding new resources seems very possible, but is it possible for specific resources to only show up for specific civs instead of all civs?
Expand  


If showing up for specific civs means just them being able to gather it, then yes, just don't specify any other resources in those ResourceGatherer tags for that civ.

  Quote

12) Is it possible to make it so that a unit has a chance to "dodge" attacks or rather avoid taking any damage from an attack?
Alternatively, is it possible to make it so enemy units also take damage from attacking certain units?
22) Can a unit gain health from attacking an enemy unit?
Expand  


If we care just about not taking damage this could be doable by modifying cmpDamageReceiver to just ignore a few attacks randomly.
Or we modify it to also get some information about who is causing the damage, which would allow some more fine grained possibilities, then implement a custom cmpDamageReceiver (eg cmpDodgingArmour or something) and use that for those dodging units.
With that slight modification to the DamageReceiver interface to pass the attacker information along another implementation can just do a few fancy things: attack back (though one would have to directly reduce the health, else two such units fighting with each other might cause strange issues), something vampire style, etc.

  Quote

14) Is it possible for an ability that heals all units over time within a player's territory?
Expand  


With a little code, yes.

  Quote

15) It is possible for all of the terrain withing a player's territory to be replaced with new terrain or a decal?
Expand  


I guess one could place actors there that have some decal based on territory. That seems like a somewhat strange approach, however currently there is no (or maybe no nice) way to set the terrain texture.

  Quote

16) Can buildings and units spawn more units on death?
Expand  


There's cmpHealth's SpawnEntityOnDeath. That's just for a single unit though.

  Quote

20) Is it possible for the worker units of a player to be uncontrollable and the AI automatically makes them seek out the nearest resources?
Expand  


In some way, but it would most likely run into lots of issues and be a bad experience.

  Quote

24) Can a unit generate resources from attacking enemy buildings?
Expand  


There is a Loot component that in conjunction with the Looter component does something when an entity is destroyed, though that isn't quite what you asked for.

  Quote

25) Can workers pray or otherwise interact with a building in order to generate resources, like in Age of Mythology?
Expand  


Delenda Est might have a hacky way to do something like that. A nice implementation might need some work.

  Quote

26) Can a building be set to immediately destroy or knock down all trees within a certain radius of itself?
Expand  


Could be done with a trigger and a range query. So not right now but the code for that (apart from figuring out how to nicely hook that to the rest) should be quite simple.

  Quote

27) Are there any targetable abilities (I've not noticed any on my playthroughs yet)? For example a unit has a Fireball ability. You click the ability, select a target, and your unit launches a fireball at the target.
Expand  


One of the early patches that added healing worked like that. So it depends on what abilities you'd want, and if actually having buttons for those is the best way (which it might be if there are a few).

  Quote

28) Sort of tied to the last question, can units be given an ability that allows them to teleport? If so, can it be limited to only the player's territory?
Expand  


if (cmpTerritoryManager.GetOwner(pos.x, pos.z) == cmpOwnership.GetOwner())
   cmpPosition.JumpTo(pos.x, pos.z)


Or something along those lines, and with proper checks for conditions that should be handled.

  Quote

29) Is it possible to decrease enemy units' line of sight when they are in a player's territory? What about slowing down their movement speed, attack rate, or other negative de-buffs?
Expand  


There currently are no auras based on territory, if that gets added this should be quite easy, for now you might have to make do with range auras on territory roots.

  Quote

32) Is it possible to make it so that a unit instantly spawns at a building's rally point, rather than from the building and then they move to the rally point?
Expand  


Should be a roughly 3 line diff, maybe slightly more to make that behaviour changeable based on templates.

  • Like 1
Link to comment
Share on other sites

Thank you for some more answers! Seems like almost everything I want is possible in some way.

To specify one bit: 

  On 25/07/2017 at 1:05 AM, leper said:

If showing up for specific civs means just them being able to gather it, then yes, just don't specify any other resources in those ResourceGatherer tags for that civ.

Expand  


I mean showing up in the UI at the top left. Say I want faction A to have a Gold resource but faction B to not have any Gold, I don't want the Gold icon or numbers to show up in the top left. Is this at all possible in the engine?

 

Link to comment
Share on other sites

  On 25/07/2017 at 1:05 AM, leper said:
  Quote


25) Can workers pray or otherwise interact with a building in order to generate resources, like in Age of Mythology?

Expand  


Delenda Est might have a hacky way to do something like that. A nice implementation might need some work.

Expand  

Well, in that case, all mods be a little hacky. ;) Although, I will pat myself on the back here and say that the way Glory works by praying at statues is quite ingenious in using the engine how it currently is to make something like that possible. In short, you just make the unit's capacity for that resource 1, and then make that statue a dropsite for that resource only. In practice, it looks instant when the "resource" is dropped off. You don't even see the resource show up as 1 in the UI, it just gets immediately dumped to the dropsite, the statue the unit is already at. So, in this way, praying for Favor at Temples, ala Age of Mythology, is already 100% possible in the game's engine as-is. In fact, all ways possible to gain Favor in Age of Mythology are already possible in 0 A.D.'s engine. I do all 3 for Glory. Praying at statues -- Greek Favor; Killing enemy units -- Norse Favor; Statue trickle -- Egyptian Favor. One could easily make an Age of Myhtology mod for 0 A.D. right now. The only major problems would be some UI stuff and the God Powers.

Edited by wowgetoffyourcellphone
  • Like 4
Link to comment
Share on other sites

Another question, how does one change the background images on the main menu? This is the closest I got to figuring it out, "sprite": "background-hellenes1-1" in a json file.

 

  On 25/07/2017 at 5:20 AM, wowgetoffyourcellphone said:

Killing enemy units -- Norse Favor

Expand  

So it would be possible for units to gain resources from attacking buildings, but only when the building is destroyed?

Link to comment
Share on other sites

  On 25/07/2017 at 6:23 AM, The Undying Nephalim said:

So it would be possible for units to gain resources from attacking buildings, but only when the building is destroyed?

Expand  

Right now, only when it dies. Though, there may be some promise with the way XP is gained, which is damage inflicted each strike divided into the XP available for the target structure -- or target unit. XP is quite different from a standard resource though, so @elexis or @leper will have to tell you how hard it is to mod.

Link to comment
Share on other sites

  On 25/07/2017 at 2:10 AM, The Undying Nephalim said:

I mean showing up in the UI at the top left. Say I want faction A to have a Gold resource but faction B to not have any Gold, I don't want the Gold icon or numbers to show up in the top left. Is this at all possible in the engine?

Expand  

That's some gui coding that should be relatively easy to do. Currently it isn't supported, but that is because so far nobody wanted different resources there. It might also need a few checks in the engine related to tributing resources, and possibly looting things. @s0600204 might be interested in improving the resource modding support even more.

  On 25/07/2017 at 5:20 AM, wowgetoffyourcellphone said:

Well, in that case, all mods be a little hacky. ;)

Expand  

But hacky solutions do have a tendency to break, I guess I don't need to tell you that. So striving for proper code does help with reducing the maintenance work going forward.

  • Like 4
Link to comment
Share on other sites

It seems in skirmish mode that game tries to replace the starting units I have defined with pre-set ones (4 workers, 4 soldiers, etc) 

Is there any way to disable this? I want my factions to start with specific units  that I define in their json files, and not be forced to use civ_support_female_citizen naming conventions. My factions are going to have radically different styles of workers, so being forced to use the civ_support_female_citizen convention will not do.

All my stuff shows up just fine in Atlas, just seems like Skirmish mode force-replaces the stuff I want factions to start with.

Link to comment
Share on other sites

The starting entities are just used in random maps. Skirmish maps use preplaced skirmish entities that get replaced by civ specific units. The generic replacements (including {civ} handling which replaces that with the civ code) is done in the skirmish templates (simulation/templates/skirmish/), and different replacements are specified in the civ.json files under SkirmishReplacements.

So I assume you might want to provide a different version of the skirmish templates (in case you want to be incompatible with the 0ad civs right now), or provide lots of replacements in the civ.json files. Assuming you don't want to follow the naming convention the game uses (which I guess is a sensible choice).

Link to comment
Share on other sites

  On 26/07/2017 at 3:03 AM, leper said:

The starting entities are just used in random maps. Skirmish maps use preplaced skirmish entities that get replaced by civ specific units. The generic replacements (including {civ} handling which replaces that with the civ code) is done in the skirmish templates (simulation/templates/skirmish/), and different replacements are specified in the civ.json files under SkirmishReplacements.

So I assume you might want to provide a different version of the skirmish templates (in case you want to be incompatible with the 0ad civs right now), or provide lots of replacements in the civ.json files. Assuming you don't want to follow the naming convention the game uses (which I guess is a sensible choice).

Expand  

I'm guessing this is the section in the civ json file?

    "SkirmishReplacements":
    {
        "units/hylian/hylian_citizen" : "units/hylian/hylian_citizen",
        "skirmish/units/default_cavalry" : "units/rome_cavalry_spearman_b",
        "skirmish/units/default_infantry_melee_b": "units/rome_infantry_swordsman_b",
        "skirmish/structures/default_house_10" : "structures/{civ}_house"
    },

Does Count work here like in other areas of the json file? Or if I wanted more of the same unit I'd just make copies like so:

    "SkirmishReplacements":
    {
        "units/hylian/hylian_citizen" : "units/hylian/hylian_citizen",
        "skirmish/units/default_cavalry" : "units/rome_cavalry_spearman_b",
        "skirmish/units/default_infantry_melee_b": "units/rome_infantry_swordsman_b",
        "skirmish/units/default_infantry_melee_b": "units/rome_infantry_swordsman_b",
        "skirmish/units/default_infantry_melee_b": "units/rome_infantry_swordsman_b",
        "skirmish/structures/default_house_10" : "structures/{civ}_house"
    },

 

Edited by The Undying Nephalim
Link to comment
Share on other sites

Yes, that's the section.

No, count does not work there, same as your proposal. This is an object or well set, so multiple definitions of the same key ("skirmish/units/default_infantry_melee_b") are either invalid or at the very least pointless since just one of them applies (depending on the parser the first or the last one).

If you want more units you will have to add other skirmish entities to the maps, and then just replace them with nothing for the civs that don't get extra units. Or we have to find a way to spawn units when a unit is spawned (I seem to recall someone running into issues with that and there is some ticket I wanted to look into related to that).

Link to comment
Share on other sites

However for reasons of sanity I guess you don't want

"units/hylian/hylian_citizen" : "units/hylian/hylian_citizen",


there, but rather something like

"skirmish/units/default_citizen" : "units/hylian/hylian_citizen",


where you'd need to create that skirmish/units/default_citizen template. Or keep the skirmish entities that currently exist and just replace them with what you want (might not work perfectly given what quantities you want though).

Link to comment
Share on other sites

  On 26/07/2017 at 3:57 AM, leper said:


there, but rather something like

"skirmish/units/default_citizen" : "units/hylian/hylian_citizen",

 

Expand  

It ended up being default_support_female_citizen, but yup it works! That's actually a pretty nice workaround for spawning faction specific units without having to place them on skirmish maps in Atlas.

Link to comment
Share on other sites

  On 26/07/2017 at 12:48 AM, The Undying Nephalim said:

Well I figure out how to get the main menu animations to work, check it out:

https://www.dropbox.com/s/n4b4r6wggoxg4u7/HyruleConquestMenu2.mp4?dl=0

Expand  

Looking good!

BTW from the video it looks you are using alpha21 (~6 months old). I'd suggest using the latest SVN code, see https://trac.wildfiregames.com/wiki/BuildInstructions , so that you can always be synced with the latest improvements.

  • Like 4
Link to comment
Share on other sites

Another question I had asked but didn't get an answer to, is it possible to scale the size of a model and animation in an xml file?
Say I have two units that use a Biped skeleton, but one is three times larger. Can I just simply scale up the skeleton in an xml, or will I have to import animations that have been scaled up in blender?

  On 26/07/2017 at 9:13 AM, fabio said:

Looking good!

BTW from the video it looks you are using alpha21 (~6 months old). I'd suggest using the latest SVN code, see https://trac.wildfiregames.com/wiki/BuildInstructions , so that you can always be synced with the latest improvements.

Expand  

Thanks I might look into that. For now I might stick with stables builds.

Link to comment
Share on other sites

Well some bad news, I downloaded the new version of 0AD and it pretty much broke all the work I've done. My main menu is frozen with tons of errors. I'm also locked out and cant disable the mod or exit the game, I have to end the process:

  Reveal hidden contents

I had gotten a new faction to work and everything, but it looks like the new version of 0AD has really messed around with some templates:

A9cYlxn.jpg

Edited by The Undying Nephalim
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...