Jump to content

0abc mod


Nescio
 Share

Recommended Posts

Regarding the damage variance, I just had a thought: Do you want it to be normally distributed or just as you have it now (50% - 150%)?

On 6/21/2019 at 1:19 PM, Nescio said:

resource consumption for attacks; e.g. everytime a stone-thrower shoots, you pay 1 stone

Spoiler

In "Attack.js" you need an optional element in both melee and ranged attack schemas (if you want that):


				"<optional>" +
					"<element name='ResourceCost' a:help='Let an attack cost resources.'>" +
						Resources.BuildSchema("nonNegativeDecimal") +
					"</element>" +
				"</optional>" +

(and add the element in a template).

And you need a new function:


Attack.prototype.GetResourceCost = function(attackType)
{
	let amounts = {};
	if (this.template[attackType].ResourceCost)
		for (let resType in this.template[attackType].ResourceCost)
			amounts[resType] = this.template[attackType].ResourceCost[resType];

	return amounts;
};

Which you call in "CanAttack" in the iteration over the attack types:


		if (cmpEntityPlayer.GetNeededResources(this.GetResourceCost(type))) 
			continue;

Then the actual subtraction in "PerformAttack":


	// Subtract resources after a succesfull attack.
	if (this.template[type].ResourceCost)
	{
		let cmpPlayer = QueryOwnerInterface(this.entity);
		cmpPlayer.TrySubtractResources(this.GetResourceCost(type));
	}

I put this behind everything, so as the last lines of the function.

I have no clue as to how the AI will behave with this, but that is up to you I guess ;) Let me know if this works for you.

Link to comment
Share on other sites

just a note,

you should substract it before dealing damage and possibly stop attack right after resources are exhausted to not play next round of attack animation for nothing, because damage is dealt at the end of every animation cycle not at the start

Link to comment
Share on other sites

On 7/9/2019 at 11:38 PM, ethanray94 said:

not of fan of the sling for stone idea

Slingers and other soldiers have free attacks; I only intend to implement a minor cost per shot for artillery, e.g.:

  • scorpio and polybolos: 1 metal per shot
  • oxybeles: 3 metal per shot
  • lithobolos: 4 stone per shot
  • Roman ballista: 5 stone per shot

The reason I want this is because I think siege units are simply too expensive (e.g. the stone thrower costs 400 wood and 250 stone; for comparison, a large tower costs 100 wood and 100 stone, a large wall segment only 28 stone). In my mod structures are more expensive and siege engines are cheaper, but still, it's weird purchasing a wooden machine costs stone; having a stone per shot cost is more realistic.

On 7/21/2019 at 8:08 AM, Freagarach said:

Regarding the damage variance, I just had a thought: Do you want it to be normally distributed or just as you have it now (50% - 150%)?

What I have right now is good enough for me. A normal distribution makes sense for e.g. arrow spread but is not really necessary for damage variance.

On 7/21/2019 at 8:08 AM, Freagarach said:
  Reveal hidden contents

In "Attack.js" you need an optional element in both melee and ranged attack schemas (if you want that):



				"<optional>" +
					"<element name='ResourceCost' a:help='Let an attack cost resources.'>" +
						Resources.BuildSchema("nonNegativeDecimal") +
					"</element>" +
				"</optional>" +

(and add the element in a template).

And you need a new function:



Attack.prototype.GetResourceCost = function(attackType)
{
	let amounts = {};
	if (this.template[attackType].ResourceCost)
		for (let resType in this.template[attackType].ResourceCost)
			amounts[resType] = this.template[attackType].ResourceCost[resType];

	return amounts;
};

Which you call in "CanAttack" in the iteration over the attack types:



		if (cmpEntityPlayer.GetNeededResources(this.GetResourceCost(type))) 
			continue;

Then the actual subtraction in "PerformAttack":



	// Subtract resources after a succesfull attack.
	if (this.template[type].ResourceCost)
	{
		let cmpPlayer = QueryOwnerInterface(this.entity);
		cmpPlayer.TrySubtractResources(this.GetResourceCost(type));
	}

I put this behind everything, so as the last lines of the function.

 

 

On 7/21/2019 at 8:49 AM, Angen said:

just a note,

you should substract it before dealing damage and possibly stop attack right after resources are exhausted to not play next round of attack animation for nothing, because damage is dealt at the end of every animation cycle not at the start

Thanks! Which lines exactly?

 

  • Like 1
Link to comment
Share on other sites

2 minutes ago, Alexandermb said:

@Nescio any alpha 24 version available? i would like to give it a try.

No, I modify only the latest stable (i.e. A23); I'll start an A24 version of this mod only after 0 A.D. A24 is officially released and work on A25 has started. In a development version basically anything can change overnight, breaking things.

  • Like 2
Link to comment
Share on other sites

39 minutes ago, Nescio said:

Attack resource consumption basically seems to work (thank you, @Freagarach); still to do:

  • get it changed by technologies (Roman ballista bonus is defined in this file, but in game it consumes only the default 4 stone per shot, not the desired 4+1=5)
  • display it in all tooltips

You're welcome!

I hope you don't mind I put you to work yourself ;)

- Techs: I should have done that in the first run but forgot (to be expected in 15 mins though). Take a look at the "GetRange"-function, therein "ApplyValueModificationsToEntity" is the function you need. If you get stuck just ask me again.

Best if you move the function to subtract resources to after the melee attack (after line 656) if you ever think about letting melee attacks cost resources as well (e.g. mercs paid extra per attack).

- Tooltips: Somewhat more changed needed, I'll try to look into it tomorrow.

Edited by Freagarach
Typo.
Link to comment
Share on other sites

On 7/21/2019 at 8:49 AM, Angen said:

just a note,

you should substract it before dealing damage and possibly stop attack right after resources are exhausted to not play next round of attack animation for nothing, because damage is dealt at the end of every animation cycle not at the start

Would perhaps be best indeed but CanAttack is called in UnitAI before PerformAttack, so I don't think it is really needed. (Same as the ToDo to handle target death immediately istead of after the timer has run again.)

Link to comment
Share on other sites

17 minutes ago, Nescio said:

No, I modify only the latest stable (i.e. A23); I'll start an A24 version of this mod only after 0 A.D. A24 is officially released and work on A25 has started. In a development version basically anything can change overnight, breaking things.

I'll guess i'll have to wait for proper mods to work with A24 :D, i want to play a good, deep and complicated singleplayer mod but i want to play with the A24 art improvements.

  • Like 2
Link to comment
Share on other sites

On 7/22/2019 at 10:06 PM, Alexandermb said:

I'll guess i'll have to wait for proper mods to work with A24 :D, i want to play a good, deep and complicated singleplayer mod but i want to play with the A24 art improvements.

It seems we both have something to look forward to then (I art, you a mod).

On 7/22/2019 at 9:47 PM, Freagarach said:

I hope you don't mind I put you to work yourself ;)

Certainly not; that's the whole idea of modifying, isn't it? I appreciate any help I can get, but don't expect anything to be presented on a silver plate. :)

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

Hi @Nescio! This is a great mod. It feels like a whole new game. Some features like garrisonable units on wall should be in the core game. I'm working on a mod that tries to emulate city building mechanics in 0 A.D, and a lot of my ideas turned out already implemented by you. I think I'm going to learn much from your code. Anyway here's my two cents:

  • GUI is amazing, now when I open vanilla 0 A.D. it feels cluttered. However may I suggest to move the Civ emblem to the right side? When you click the emblem it will open Structure Tree, where the emblem is placed on the right side. 
  • I always find 0 A.D build icons are too big. And I like the new size you set. But since you made changes to the icons using full bodied picture instead of half bodied icons like vanilla, they seem too small in my laptop that I have to rely on tooltips.
  • I see that in the beginning the only source of silver is Civic Center, while all units cost silver to train. What's the design decision behind this? I guess this is either to prevent early rush, or to force player to sell other resource to get silver. In my mod I'm implementing similar change with money resource, although I make houses and markets trickle money, since in real life taxes are paid by citizens and business. This ends up making money abundant and AI started buying everything with money since they are too lazy to gather.
  • Oh and also I still getting error when selecting Gaia Mercenary Camp. I don't know why.

One anecdote: In one of my games I forgot to find more food, causing food to be negative. Then my scout found an apple tree at the edge of my territory border. I asked them to build farmstead near the tree so they can eat fast. but turns out these guys would rather walk all the way to Civ Center just to piss me off than build something for their own good. It's funny how petty some citizen can be.

 

  • Like 1
Link to comment
Share on other sites

54 minutes ago, azayrahmad said:

Hi @Nescio! This is a great mod. It feels like a whole new game. Some features like garrisonable units on wall should be in the core game. I'm working on a mod that tries to emulate city building mechanics in 0 A.D, and a lot of my ideas turned out already implemented by you. I think I'm going to learn much from your code.

Thanks for the interest and feedback! There are many things I've tried out since I started this mod in 2017, too many to list. Some things have been subsequently reverted, others kept. Feel free to take what you like.

I've seen your forum posts, but haven't tried out your new mod.

57 minutes ago, azayrahmad said:

GUI is amazing, now when I open vanilla 0 A.D. it feels cluttered. However may I suggest to move the Civ emblem to the right side? When you click the emblem it will open Structure Tree, where the emblem is placed on the right side. 

What do you mean exactly? The civ emblem is displayed on the right in game.

58 minutes ago, azayrahmad said:

I always find 0 A.D build icons are too big. And I like the new size you set. But since you made changes to the icons using full bodied picture instead of half bodied icons like vanilla, they seem too small in my laptop that I have to rely on tooltips.

Again, I'm not quite sure what you mean—there are so many icons in the 0 A.D. GUI.

59 minutes ago, azayrahmad said:

I see that in the beginning the only source of silver is Civic Center, while all units cost silver to train. What's the design decision behind this? I guess this is either to prevent early rush, or to force player to sell other resource to get silver.

Yes, I don't like rushing and prefer a slower pace, which is also why I've increased technology research and unit training times. At game start silver (and wood) is indeed the limiting factor; later population and time. Military units cost silver, but you can also build houses and train women from there, they cost only food. Or build a market quickly and barter resources or start trade routes.

1 hour ago, azayrahmad said:

In my mod I'm implementing similar change with money resource, although I make houses and markets trickle money, since in real life taxes are paid by citizens and business. This ends up making money abundant and AI started buying everything with money since they are too lazy to gather.

In modern life; not in Antiquity. Taxation was haphazard, economic growth and inflation were unknown concepts, and making profit was frowned upon (your gain is someone else's loss); the amount of money in circulation was limited by the availability of (rare) metals.

(Also, I named the currency resource in my mod silver on purpose, not money or coins, because money was weighed (adjusted for purity), not counted.)

59 minutes ago, azayrahmad said:

Oh and also I still getting error when selecting Gaia Mercenary Camp. I don't know why.

Please copy the errors and warnings from the `interestinglog.html` (see https://trac.wildfiregames.com/wiki/GameDataPaths ).

59 minutes ago, azayrahmad said:

One anecdote: In one of my games I forgot to find more food, causing food to be negative. Then my scout found an apple tree at the edge of my territory border. I asked them to build farmstead near the tree so they can eat fast. but turns out these guys would rather walk all the way to Civ Center just to piss me off than build something for their own good. It's funny how petty some citizen can be.

Perhaps you lost control? Economic structures no longer have territory influence, but they still have territory decay, so if you build a farmstead in neutral territory and don't garrison it (one unit is sufficient), it'll turn gaia.

Link to comment
Share on other sites

7 hours ago, Nescio said:

What do you mean exactly? The civ emblem is displayed on the right in game.

OMG I'm sorry I mean left side, it should have been on the left side.

Here's the Civ Emblem in your mod on the right side

Spoiler

screenshot0022.thumb.png.3cdd82717649b71fcb6146c8ffe2b548.png

Here's the Civ emblem when you click the button, on the left side

Spoiler

screenshot0023.thumb.png.323763073ce618179dafdb7f80c1d5b0.png

I suggested moving it to the left side for consistency sake. But I admit this was nitpicking. Also there's heroes icons on that corner.

7 hours ago, Nescio said:

Again, I'm not quite sure what you mean—there are so many icons in the 0 A.D. GUI.

I mean the Build icons, the icons that shows what kind of buildings can be built when you select a unit, or what kind of unit/technology can be trained if you select a building. Here is a comparison of original vs 0abc Gauls Civ Center

Spoiler

screenshot0025.png.0268b619cc8dc2dc7f6b290cfd2c7076.pngscreenshot0024c.png.9ac35a6deb40ba0d285a802bd3e9f779.png

Perhaps it's only my 1366x768 monitor, but I have a hard time distinguishing unit icons without tooltip. I can make out the swordsman because of the shield, but the other four is indistinguishable.

7 hours ago, Nescio said:

Yes, I don't like rushing and prefer a slower pace, which is also why I've increased technology research and unit training times. At game start silver (and wood) is indeed the limiting factor; later population and time. Military units cost silver, but you can also build houses and train women from there, they cost only food. Or build a market quickly and barter resources or start trade routes.

This is my impression too. As I am always too slow for Petra bot and thus get rushed when unprepared all the time, I feel this mod is more in tune with my pace.

7 hours ago, Nescio said:

In modern life; not in Antiquity. Taxation was haphazard, economic growth and inflation were unknown concepts, and making profit was frowned upon (your gain is someone else's loss); the amount of money in circulation was limited by the availability of (rare) metals.

 

You are correct. But tax is still raised from people. What I was trying to say is that tax revenue is based on population and not territory, which is why i asked about your decision to trickle money from civic center. But then I realized that in 0abc building a new civic center require certain amount of houses so it's the same purpose but different approach.

7 hours ago, Nescio said:

(Also, I named the currency resource in my mod silver on purpose, not money or coins, because money was weighed (adjusted for purity), not counted.)

Yes but the unique thing about money is that it can also be counted, because each coin is supposed to have the same weight. Although I imagine as a city governor counting an entire city's tax is a hassle and it's easier to put in on a scale.

7 hours ago, Nescio said:

In modern life; not in Antiquity. Taxation was haphazard, economic growth and inflation were unknown concepts, and making profit was frowned upon (your gain is someone else's loss); the amount of money in circulation was limited by the availability of (rare) metals.

I have played another game since I posted so it was replaced with newer log, because there's another bug that triggered error message after I destroy an enemy building of a Roman faction. I attached the interestinglog here, it's quite big. The gist is that there's this error

simulation/ai/petra/garrisonManager.js line 199 TypeError: this.numberOfGarrisonedUnits is not a function 

and this

WARNING: PlayerID 2 | Petra error in incrementBuilderCounters for structures/rome/xxxx with count < 0

is repeated numerous times with xxxx being structure names (centre, house, field, etc).

7 hours ago, Nescio said:

Perhaps you lost control? Economic structures no longer have territory influence, but they still have territory decay, so if you build a farmstead in neutral territory and don't garrison it (one unit is sufficient), it'll turn gaia.

I mean that in 0abc on negative food the citizen cannot build anything, including farmstead and field. But they are still able to gather food, even from a location far from base. So I made a funny interpretation about this event that the citizens refuse to build things out of pettiness, and in the end they have to walk longer because they still need food.

On the other topic, in my Ptolemy play I found out that Stable can be built in Village phase, but all the cavalry units are only available in either Town or City phase. All technologies are also still disabled, except one that upgrade cavalry, which will benefit exactly one starting cavalry guy. I wonder if this is intentional for some reason.

Thank you.

interestinglog.html

Edited by azayrahmad
formatting
  • Like 1
Link to comment
Share on other sites

On 8/10/2019 at 2:01 AM, azayrahmad said:

Also there's heroes icons on that corner.

Exactly. The reason I moved the civilization emblem to the top right is because it doesn't obscure anything else there. Top centre it conflicts with resources, top left with catafalque/hero/wonder panels, bottom centre with the minimap.

On 8/10/2019 at 2:01 AM, azayrahmad said:

I have played another game since I posted so it was replaced with newer log, because there's another bug that triggered error message after I destroy an enemy building of a Roman faction. I attached the interestinglog here, it's quite big. The gist is that there's this error


simulation/ai/petra/garrisonManager.js line 199 TypeError: this.numberOfGarrisonedUnits is not a function 

and this


WARNING: PlayerID 2 | Petra error in incrementBuilderCounters for structures/rome/xxxx with count < 0

is repeated numerous times with xxxx being structure names (centre, house, field, etc).

On 8/10/2019 at 2:01 AM, azayrahmad said:

Thanks, I'll try to reproduce and solve it.

On 8/10/2019 at 2:01 AM, azayrahmad said:

I mean that in 0abc on negative food the citizen cannot build anything, including farmstead and field. But they are still able to gather food, even from a location far from base. So I made a funny interpretation about this event that the citizens refuse to build things out of pettiness, and in the end they have to walk longer because they still need food.

Indeed, once one resource turns negative, you can't spend any resource on anything anymore, until all amounts are positive again.

On 8/10/2019 at 2:01 AM, azayrahmad said:

On the other topic, in my Ptolemy play I found out that Stable can be built in Village phase, but all the cavalry units are only available in either Town or City phase. All technologies are also still disabled, except one that upgrade cavalry, which will benefit exactly one starting cavalry guy. I wonder if this is intentional for some reason.

The reason is I've been making changes to all unit rosters; if one (ptol) doesn't have village phase cavalry at the moment, it's because I haven't decided what would be most appropiate. My mod is a work-in-progress.

On 8/10/2019 at 2:01 AM, azayrahmad said:

I mean the Build icons, the icons that shows what kind of buildings can be built when you select a unit, or what kind of unit/technology can be trained if you select a building. Here is a comparison of original vs 0abc Gauls Civ Center

  Reveal hidden contents

screenshot0025.png.0268b619cc8dc2dc7f6b290cfd2c7076.pngscreenshot0024c.png.9ac35a6deb40ba0d285a802bd3e9f779.png

Perhaps it's only my 1366x768 monitor, but I have a hard time distinguishing unit icons without tooltip. I can make out the swordsman because of the shield, but the other four is indistinguishable.

Oh, you mean the unit portraits. Yes, I standardized those a couple of months ago ( https://wildfiregames.com/forum/index.php?/topic/22779-0abc-mod/page/9/&tab=comments#comment-369147 ) so every actor has a corresponding icon. Those probably should have been cropped.

Alternatively, it might be better (and easier) to overlay a weapon icon on top of the unit portraits, similar to the rank chevrons.

@Lion.Kanzen, you made the archery range icon, didn't you? Do you think you could get me images with transparent background for the following?

  • javelin, bow-and-arrow, crossbow, sling
  • pike, spear, sword (gladius/xiphos), sabre (falcata/kopis), axe (sagaris), mace
  • aspis, peltê, thureos
  • horseshoe, horse head, dromedary camel head, elephant head (Chess_alt26.svg)
Link to comment
Share on other sites

1 minute ago, Lion.Kanzen said:

Pngs? With channel alpha...?

Some exist already. 

What you want exactly to do?

That's quick! Yes, png files. The technology and structure portraits have a background, so I can't use those; I don't know if it's possible to render them without, my graphical skills are rather limited.

Basically what I want is weapon icons with transparent background, similar to e.g. resource icons, e.g.food.png.7e7746ef46c4b342bdd649d47324505a.png

Link to comment
Share on other sites

5 minutes ago, Nescio said:

That's quick! Yes, png files. The technology and structure portraits have a background, so I can't use those; I don't know if it's possible to render them without, my graphical skills are rather limited.

Basically what I want is weapon icons with transparent background, similar to e.g. resource icons, e.g.food.png.7e7746ef46c4b342bdd649d47324505a.png

Yes I can split the background from the rest.

The weapon you needs is missing in the repository?  I make it from scratch , yes I can. Take a while.

Even I'm planning make a new variety of icons for modders.

Edited by Lion.Kanzen
Link to comment
Share on other sites

9 minutes ago, Lion.Kanzen said:

Yes I can split the background from the rest.

The weapon you needs is missing in the repository?  I make it from scratch , yes I can. Take a while.

Thanks, I appreciate your help! There are only a few useful portraits in the svn repository:

structures/range.png
technologies/horseshoe_metal.png
technologies/laurel_wreath.png
technologies/spear.png
technologies/sword.png

The others would have to be created from scratch. Take your time, there is no rush.

Edited by Nescio
laurel wreath
Link to comment
Share on other sites

Just now, Nescio said:

Thanks, I appreciate your help! There are only a few useful portraits in the svn repository:

structures/range.png
technologies/horseshoe_metal.png
technologies/spear.png
technologies/sword/png

The others would have to be created from scratch. Take your time, there is no rush.

Show me in pics your idea for each those are missing.

Link to comment
Share on other sites

On 8/17/2019 at 10:48 AM, Lion.Kanzen said:

Show me in pics your idea for each those are missing.

Melee weapons, to be orientated from bottom-left to top-right (similar to spear and sword):

sarissa/pike:

Spoiler

 

falcata/kopis/sabre:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/c/c4/Falcata_ibera_%28M.A.N._2003-114-51%29_01b.jpg

sagaris/axe:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/d/d5/Skythian_archer_Louvre_G106_full.jpg

mace:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/f/fe/Model_mace_MET_12.182.68.jpg

Ranged weapons, to be orientated from bottom-right to top-left:

javelin:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/3/32/Hilt_of_a_Javelin_MET_LC-36_3_206_EGDP026792.jpg

https://upload.wikimedia.org/wikipedia/commons/a/a1/Jabalinas_de_cobre_procedentes_del_Dolmen_de_la_Pastora_%28Castilleja_de_Guzm%C3%A1n%2C_Sevilla%29._2200-1800_a._C._-_M.A.N._01.jpg

crossbow:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/f/f5/200910311250MEZ_Saalburg-Museum%2C_Gastraphetes.jpg

https://upload.wikimedia.org/wikipedia/commons/3/3d/Qin_crossbow.png

sling:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/a/a5/Projectils_de_fona_de_plom%2C_s-_III_-_II_aC%2C_museu_arqueol%C3%B2gic_i_etnol%C3%B2gic_del_Comtat.JPG

https://upload.wikimedia.org/wikipedia/commons/9/92/Sling_made_of_leather..JPG

https://upload.wikimedia.org/wikipedia/commons/4/48/Ancient_sling_weapon.JPGhttps://upload.wikimedia.org/wikipedia/commons/0/07/Greek_slinger.jpg

fustibalus/staff sling:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/c/c7/Fustibale_1.5.jpg

https://upload.wikimedia.org/wikipedia/commons/6/63/Friezen_vallen_de_toren_van_Damiate_aan.jpg

https://upload.wikimedia.org/wikipedia/commons/e/ef/Liber3.jpg

https://upload.wikimedia.org/wikipedia/commons/9/93/%D0%A4%D1%83%D1%81%D1%82%D0%B8%D0%B1%D0%B0%D0%BB%D0%B5%D1%80.jpg

francisca/throwing axe:

Spoiler

https://upload.wikimedia.org/wikipedia/commons/3/3f/Franziska_Weingarten_Grab_510.jpg

https://upload.wikimedia.org/wikipedia/commons/8/8b/Franziska.png

https://upload.wikimedia.org/wikipedia/commons/5/51/Tomahawk_in_stump.jpg

Edited by Nescio
staff sling, throwing axe
Link to comment
Share on other sites

About the icons, my absolute favorite is unit cards from Rome II Total War:

35n25x3.jpg

It has 'ancient pottery' aesthetic I like and the mini icons on top can tell much about the unit in so little space. Although in 0 A.D unit icons are half Total War's size, so hopefully you can still make them visible in such little space.

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...