Jump to content

Hyrule Conquest


Recommended Posts

Hello,

I'm one of the on-off two members of "Hyrule Conquest Team," we haven't had much to do as with the engine switch neph is able to do most of its without needing any additional help, so I've been keeping myself busy trying to understand the 0 AD engine and help fix errors and bugs to the best of my ability.

I've noticed, at least in my game, the temporary hero selection screen has stopped working in single-player, with the attached error message. If anyone has any idea as to what problem with that GUI file is please let me know.

And thanks for all the help with Hyrule Conquest, it's nice to meet you all :D

@Lion.Kanzen That armor is being used for the Lanayru Zora faction, these Zora Neph is working on, the Dominion Zora, have a much fancier gold/sapphire aesthetic :P

 

 

 

Capture.PNG

  • Like 3
Link to comment
Share on other sites

Whenever you're experiencing any errors or warnings, please access the interestinglog.html file (its location typically depends on your operating system, see https://trac.wildfiregames.com/wiki/GameDataPaths), and copy the message from there; plain text is easier to read than a screenshot.

My guess is that if you fix whatever is wrong in the hero selection screen, the gui file error will disappear as a consequence.

And welcome to 0 A.D., darkinterloper! Hyrule Conquest seems to be a very promising mod :)

  • Like 2
Link to comment
Share on other sites

@darkinterloper hello and welcome to the forums!

4 hours ago, darkinterloper said:

I've noticed, at least in my game, the temporary hero selection screen has stopped working in single-player, with the attached error message.

As @Nescio correctly said, all the following lines are subsequences of the syntax error in civ_choices.js

The syntax error must be consistent (rather than depending on some data), so someone must have changed the file (comparing to its 'original' state in the civ choices mod ). So please share the file itself (or even better a repo where both the file and the changes history may be seen).

  • Like 1
Link to comment
Share on other sites

fcxSanya, the session.js copy sounds like trouble. It already misses out some of the recent changes to it. As far as I see its only use is calling initCivChoicesDialog.

We should find some mechanism to avoid that copy. If the file was renamed to be loaded after session.js, we could probably replace the init function with a new init function that calls the old one and the init function of the mod.

Afaics, that mod misses a session.xml copy loading that civ choices file until D619 is committed.

Link to comment
Share on other sites

1 hour ago, elexis said:

the session.js copy sounds like trouble <...>

We should find some mechanism to avoid that copy <...>

It was a proof-of-concept implementation, if Hyrule Conquest (or any other mod) is going to stick with it, we indeed shoud find a way to call initCivChoicesDialog without modifying session.js

1 hour ago, elexis said:

If the file was renamed to be loaded after session.js, we could probably replace the init function with a new init function that calls the old one and the init function of the mod.

Do you mean we need to modify the main game to call the new init method (under a new name) or we may name it 'init' too and somehow call the original with the same name?

1 hour ago, elexis said:

As far as I see its only use is calling initCivChoicesDialog.

Yes, I separated copying files from 0ad and introducing actual changes to make them easier to track.

2 hours ago, elexis said:

It already misses out some of the recent changes to it.

It's based on Alpha 22.

2 hours ago, elexis said:

Afaics, that mod misses a session.xml copy loading that civ choices file until D619 is committed.

If you are talking about civ_choices_window.xml then it's loaded by

<include directory="gui/session/dialogs/"/>

here

Link to comment
Share on other sites

53 minutes ago, fcxSanya said:

Do you mean we need to modify the main game to call the new init method (under a new name) or we may name it 'init' too and somehow call the original with the same name?

First all JS files are loaded and executed in alphabetical order. (i.e. first session.js can set the global init, then a file of your mod could replace that init with a new one that calls the previous one and your civChoicesInit). After that the engine calls the global init function, whatever it may now contain.

Basically

var oldInit = init;
function init(args)
{
     oldInit(args);
     modInit();
}

Not a beauty queen, but would avoid the duplication.

> it's loaded

Ah, good.

Link to comment
Share on other sites

48 minutes ago, elexis said:

var oldInit = init;
function init(args)
{
     oldInit(args);
     modInit();
}

 

By some reason I can't get this working, I tried disabling all mods and putting your example (with and without replacing "args" to "initData, hotloadData") into mods/user/gui/session/session2.js , but the game crashes on the session init without the crash logs or any useful messages in the logs:

image.png

Link to comment
Share on other sites

16 minutes ago, elexis said:

I can't reproduce it on unix unless that is a function calling itself indefinitely.

Yeah, something strange is happening.

17 minutes ago, elexis said:

Try "init = function" for the init overwriting instead of "function init" - that worked at least when doing it in the public mod in my test.

Works this way, thanks! Committed.

  • Like 1
Link to comment
Share on other sites

Observer fix and AI auto select for civ_choices.js

function initCivChoicesDialog()
{
	for(let player in g_Players)
	{ //unlock teck for AI
		if( g_GameAttributes.settings.PlayerData[ player ] ) //Observers have no player data
			if( g_GameAttributes.settings.PlayerData[ player ].AI != "" )
			{
				let aiPlayer = g_Players[player];
				let civChoices = g_CivData[aiPlayer.civ].CivChoices;
				if( civChoices )
				{
					let randomi = Math.floor( Math.random()* (g_CivData[aiPlayer.civ].CivChoices.length));
					Engine.PostNetworkCommand({ "type": "civ-choice", 
						"template": g_CivData[aiPlayer.civ].CivChoices[randomi] });
//warn(player +" AI choose: "+g_CivData[aiPlayer.civ].CivChoices[randomi]); //Unsure how to make petra unlock it though
					Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = true;
				}
			}
	}

	if( Engine.GetPlayerID() == -1) { //observers have no playerData
		return;
	}

	let currentPlayer = g_Players[Engine.GetPlayerID()];
//choice menu for players
	let civChoices = g_CivData[currentPlayer.civ].CivChoices;

	if (civChoices)
	{
		for (let i = 0; i < civChoices.length; ++i)
		{
			if( civChoices[i] == undefined)
				continue;
			let civChoiceButton = Engine.GetGUIObjectByName("civChoice[" + i + "]");
			civChoiceButton.caption = GetTechnologyData(civChoices[i]).name.generic;

			let size = civChoiceButton.size;
			size.top = 20 * i;
			size.bottom = 20 * (i + 1);
			civChoiceButton.size = size;

			civChoiceButton.onPress = (function(tech) { return function() {
//warn("playerSelected:"+tech );
				Engine.PostNetworkCommand({ "type": "civ-choice", "template": tech });
				Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = true;
			}})(civChoices[i]);

			civChoiceButton.hidden = false;
		}
		Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = false;
	}
}

Until petra is patched, which mimo seems to know everything needed to be done, the AI doesn't quite work well. Note: gerudo's won't train any sheep for some reason and I can't figure out why. It might be something wrong with the pig template. I don't know missing Unit tag?

I did edit petra to get hyrule to build farms and start building civcentres early. I'm impatient for a mod friendly AI. I don't know if mimo's edits will work with A22 as it is or not. I don't quite know how to download a folder from the tracbrowser anyway. He's seemed to have removed the mod breaking aspect of petra: which was using direct template names and not gathering them off the <Classes> tag (NOTE: VisibleClasses are completely different). You may want to revisit some files and make sure they have the proper tags. I had to add "Field" to the hyrule's farmstead/field combo for my petra edits to work properly.

 

Anyway: Hyrule Conquest Opinions - probably already addressed these in this forum somewhere.

Training times are 30 seconds. One minute for 2 soldiers... I don't like that really. You may have to edit petra's researchManager quiet a bit to get some of the techs to work for the AI. I'll look over them but I want to see if mimo's AI does this already. The building models are quite huge the AI (and people) will have trouble expanding with the small amount of territory influence they add ( and the 'must build in own territory' limitation). You can edit the limitation by adding neutral to the build restrictions territory tag. You may have to set the territory influence to 0. I'm not sure if petra really cares about the neutral tag though. I have yet to properly look over A23's future version to see if that's changed. They didn't seem to notice it or take advantage of it in delenda though.

 

UPDATE: ... -.- It doesn't seem to unlock the tech for the AI. It will pick one. I'm not sure how to force the tech to be unlocked.

Edited by SirPope
Moved fix from sessions to to civ_choices for easier implementation
  • Like 2
Link to comment
Share on other sites

7 hours ago, SirPope said:

Observer fix and AI auto select for civ_choices.js


function initCivChoicesDialog()
{
	for(let player in g_Players)
	{ //unlock teck for AI
		if( g_GameAttributes.settings.PlayerData[ player ] ) //Observers have no player data
			if( g_GameAttributes.settings.PlayerData[ player ].AI != "" )
			{
				let aiPlayer = g_Players[player];
				let civChoices = g_CivData[aiPlayer.civ].CivChoices;
				if( civChoices )
				{
					let randomi = Math.floor( Math.random()* (g_CivData[aiPlayer.civ].CivChoices.length));
					Engine.PostNetworkCommand({ "type": "civ-choice", 
						"template": g_CivData[aiPlayer.civ].CivChoices[randomi] });
//warn(player +" AI choose: "+g_CivData[aiPlayer.civ].CivChoices[randomi]); //Unsure how to make petra unlock it though
					Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = true;
				}
			}
	}

	if( Engine.GetPlayerID() == -1) { //observers have no playerData
		return;
	}

	let currentPlayer = g_Players[Engine.GetPlayerID()];
//choice menu for players
	let civChoices = g_CivData[currentPlayer.civ].CivChoices;

	if (civChoices)
	{
		for (let i = 0; i < civChoices.length; ++i)
		{
			if( civChoices[i] == undefined)
				continue;
			let civChoiceButton = Engine.GetGUIObjectByName("civChoice[" + i + "]");
			civChoiceButton.caption = GetTechnologyData(civChoices[i]).name.generic;

			let size = civChoiceButton.size;
			size.top = 20 * i;
			size.bottom = 20 * (i + 1);
			civChoiceButton.size = size;

			civChoiceButton.onPress = (function(tech) { return function() {
//warn("playerSelected:"+tech );
				Engine.PostNetworkCommand({ "type": "civ-choice", "template": tech });
				Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = true;
			}})(civChoices[i]);

			civChoiceButton.hidden = false;
		}
		Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = false;
	}
}

Until petra is patched, which mimo seems to know everything needed to be done, the AI doesn't quite work well. Note: gerudo's won't train any sheep for some reason and I can't figure out why. It might be something wrong with the pig template. I don't know missing Unit tag?

I did edit petra to get hyrule to build farms and start building civcentres early. I'm impatient for a mod friendly AI. I don't know if mimo's edits will work with A22 as it is or not. I don't quite know how to download a folder from the tracbrowser anyway. He's seemed to have removed the mod breaking aspect of petra: which was using direct template names and not gathering them off the <Classes> tag (NOTE: VisibleClasses are completely different). You may want to revisit some files and make sure they have the proper tags. I had to add "Field" to the hyrule's farmstead/field combo for my petra edits to work properly.

 

Anyway: Hyrule Conquest Opinions - probably already addressed these in this forum somewhere.

Training times are 30 seconds. One minute for 2 soldiers... I don't like that really. You may have to edit petra's researchManager quiet a bit to get some of the techs to work for the AI. I'll look over them but I want to see if mimo's AI does this already. The building models are quite huge the AI (and people) will have trouble expanding with the small amount of territory influence they add ( and the 'must build in own territory' limitation). You can edit the limitation by adding neutral to the build restrictions territory tag. You may have to set the territory influence to 0. I'm not sure if petra really cares about the neutral tag though. I have yet to properly look over A23's future version to see if that's changed. They didn't seem to notice it or take advantage of it in delenda though.

 

UPDATE: ... -.- It doesn't seem to unlock the tech for the AI. It will pick one. I'm not sure how to force the tech to be unlocked.

Hi Sirpope, I tried adding your altered civ_choices.js, it does seem to unlock techs for AI in some capacity, but may also unlock unique hero units for a player who is the same faction as said AI: for example, when playing as the Kingdom of Hyrule, with the hero Kazakk, versus an AI Kingdom of Hyrule of medium difficulty, I was able to train "Champion Knight", the Hero Link's unique unit as well as Kazakk's "Goldenclad Elite." Additionally, the AI began experiencing numerous error logs as I sent and attack force after it, which are attached, I can't make any sense of them not knowing anything about how Petra works.

interestinglog.html

20171109230619_1.jpg

Link to comment
Share on other sites

4 hours ago, fcxSanya said:

I don't think gui scripts are executed for AI. And in any case you should send that command from the AI itself.

Yeah I don't think they do either. I don't think the AI isn't actually set up or initialized until session.js is finished. I tried to get access to the AI but the player object hasn't even been assigned yet. I could turn it into a function and just call ResearchTech when petra starts. However, I'm not sure why player.js has an AddStartingTechnology function if you can't even access it before the game begins. I can't figure out how to get to the data at all. Moving it to shared.js might work. I'd have access to the AI there and the actual player I think it's also 'shared' between players as well so network play should work. I just don't know if it's only for sharing AI data. Will it run with 2 actual people and no AI?

@darkinterlooper

When you attacked? From what I can tell it's a combination of getBestBase and an improper template with 'getAttackBonus'. My edit doesn't do anything to the Attack or defence manager. Yeah, I think it will unlock it for the player now that you mention it. I was just testing it with gerudo vs hyrule... never thought of that. I'm glad someone tested it though. The function needs to get out of session.js anyways. That is ran when you join a game. If someone (like an observer) joins the game the dialog menu will pop up again for everyone. It's an easy way to troll.

Some of the template's obstruction radius is off a bit. I noticed that with the main CivCenter for hyrule. My guess is it tried to set a building checked the obstruction radius said 'it will fit', marked it as done, and then the foundation collision checker popped in. That's the best explanation I can give. Can't get units info from a building that can't be built. It's kinda neat to see a tree growing from a barracks. The Capture attack part of some templates might also be messed up.

 

Link to comment
Share on other sites

What I'm wondering is why does it change the civ name for the AI? I think it is unlocking it... it's just not researching it. Might have to create a separate tech and function. Just for AI's sake and then call that in petra depending on the AI's name? I don't know. I'm done trying to figure this out for the moment. If anyone knows how to get the gerudo to train animals let me know. Is it a template error on the pig side?? I got it to search for the actually template of the corral. I had to add the class Corral to the pigfarm and then search for the important classes. I also got hyrule to build farms. :) you might be able to force them to just by changing the hyrule_farmstead.xml to hyrule_field.xml might break something though. I got them to build them, corrals, civcenters, 'specialbuildings'... Not posting the whole code there was quiet a few annoyances along the way.

	for(let t in gameState.templates)
	{ //gameState.templates holds every template avaliable to all civs (including gaia)
		if( t.indexOf("structures/"+gameState.getPlayerCiv()) == -1 ) //we just want ours
			continue;
		let template = gameState.getTemplate(t);
		if( template )
		{
			if( template.hasClass("Field") )
				this.buildings.field.push(t);

			if( template.hasClass("Corral") ) //I did do a warning check and pig farm was added.
				this.buildings.corral.push(t);
//... everything other important class

I expanded this.buildings list in config.js:

"field": new Array(), "corral": new Array(), //all others - FYI all advanced building have the class SpecialBuildings...

//Why would you type them out or keep using applyCiv if you already know which is what? It's all stored for you.

Then everywhere in several files i do the below: ... I find anything labeled with {civ} and change it

let templateList = undefined; let temp_storehouse = "structures/{civ}_field";
templateList = gameState.ai.Config.getBuildingsOfType("Field"); //basically just returns template.buildings[field] //I toLowerCase it the value passed.
if( templateList )
        temp_field = templateList[0]; //default to first - needs a smarter way - sort them all by costSum()?
let template = gameState.getTemplate(gameState.applyCiv(temp_field));

 

Of course this is clunky and needs a better way to get the file. A simple function...

 

Link to comment
Share on other sites

Annnnddd the Mage heavy fully aquatic Zora Dominion army is done:

DqwAxMd.jpg

As usual, unit details:

Spoiler

Servant  

PnXDsVy.jpg
Civilians that operated as a skilled workforce under the Dominion, Servants were the backbone of any Zora undertaking. Harvesting resources, tending Coralmold gardens, and building the glorious structures of the Dominion were but a sample of their tasks.

Infiltrator 

Cnktuur.jpg
Undergoing years of extreme body shaping, Infiltrators could sneak into just about any place they needed to get the information they were after. Their warped frames allowed them to bend into just about any position, and squeeze through any crevice that their skeleton could get through. Such talents were used by the Dominion to scout and spy on their neighboring lands.

River Patrol

SX83wZc.jpg
Frequently seen travelling along the Zora's River, the police force of the Zora kept order within the Dominion. With their light spear and buckler they were able to handle all sorts of minor threats, from bandits to wild creatures, to criminal uprisings.

Blademaster

e0ENfNI.jpg
Armed with a curved falchion, Zora Blademasters marched in the front lines of their invasion forces on many occasions. They emphasized speed and form over brute strength and durability, preferring to disarm their targets.

Halberdier 

5oMipl7.jpg
Scores of Zora Halberdiers defended the borders of the Dominion for many centuries. Armed with their signature bladed polearms, Halberdiers were slow and clunky on land, but quite a force to face in the waters of their own cities.

Boomeranger

8yfpTTo.jpg
Boomerangs were a unique weapon created by the Zora, and these quick warriors were skilled in using them in combat. A Boomeranger did not have the range of most archers and mages, but the wide arc of their attack could hit multiple enemies and deal quite a bit of splash damage.

Healer 

Dg8hh1d.jpg
Nursing and healing the wounded is a large field of study among the Zora, and as such they have applied such knowledge to the battlefield. Zora Healers bring their medical talent to the frontlines, giving potions and magical aid to injured soldiers so they might fight on and survive longer.

Spark Mage 

SvyMFB2.jpg
Carrying an electrified crystal in one hand, the powerful Spark Mages could unleash a white-hot bolt of lightning from quite a distance. A single shot could stun its victim, and sometimes instantly incinerate a target. Spark Mages needed protection however; they were very vulnerable to damage and could do little to defend themselves in a melee.

Shock Trooper 

EikMnAd.jpg
The heaviest soldier in service of the Dominion, Shock Troopers are sent into battle when enemy forces begin to pose a serious threat. Armed with a falchion and durable coralmold shield, Shock Troopers can serve a variety of roles in the Dominion army.


Hyrdophant Lancer

EVdP8az.jpg
Riding on the back of a younger Hydrophant, these spear armed warriors served as cavalry for the Dominion. While Hydrophants were slower on land compared to mounts used by other races of Hyrule, they had quite an advantage when crossing into bodies of water.

Kyameron Master

6l6KmS6.jpg
A rare type of Mage found within the Zora Dominion, Kyameron Masters wield the power of animating and giving life to water. Their methods are kept secret to those outside of cults devoted to Malkorbagia, but they are more than willing to lend military aid to the Dominion during times of war. A Kyameron Master could summon autonomous blobs of living water to go forth and attack enemy forces.

Kyameron

FFjgAGJ.jpg
An animate blob of water that seemed to be able to act on basic orders from the master that summoned it. Kyamerons were not particularly powerful, but a large swarm of them could easily keep an enemy army distracted.

Morphite

uqXEq0j.jpg
A large and monstrous tentacle of water created by a group of powerful Kyameron Masters. A Morphite could cause much havoc on the battlefield, flailing widely and dealing damage to anything around itself.

Sapphire Warden

u9k87au.jpg
Zora Mages that have long been in study of magic, Sapphire Wardens could alter water and ice to the point of creating Blue Fire; a chilling flame that could then be used as a deadly weapon. Their attacks could dramatically slow the movement of approaching enemies, and the cold flames could persist for some time after landing on the ground.

Hydrophant Demolisher 

41IRUX2.jpg
Riding on an adult Hydrophant, these large beasts could use their massive weight to ram into other large targets. The Dominion frequently used Demolishers to break through enemy walls and knock down towers and buildings. They were somewhat less effective against smaller and mobile targets, seeing as Hydrophants have a difficult time focusing on movement below their heads. 

Floodmaster

jzN7U8I.jpg
Floodmasters represented some of the most powerful Mages in not only the Dominion, but the entire land of Hyrule. Though it took a lifetime to master, their abilities to warp and control water rivalled that of the Sage of Water herself. A lone Floodmaster could summon forth a surge of rushing water, knocking back enemies much larger then the mage quite a distance.

Domain Supreme

8fiMnZ3.jpg
Veterans in the Dominion's army, Domain Supremes were both skilled warriors and commanders. A lone Domain Supreme could keep a unit functioning and morale high, while an entire legion of Supremes could dramatically improve the performance of an entire army.

Mage Cannon

sA4pr2V.jpg
Breaking a shard off of the powerful Mage Crystals and laying it in a mobile chassis, these cannons could be pushed around by Zora magic users and overloaded with power. When reaching capacity, a Mage Cannon would explode with tremendous force and unleash a powerful electrical bolt that could incinerate just about anything it hit.

Hydrophant Canopy 

j0Vrevb.jpg
A Unique unit of King Zora Du Bon XVI. These massive Hydrophants were outfitted with canopies on their backs that could garrison and transport units. Ranged units such as Mages could easily attack from on top of the canopy and enjoyed some defense from ranged attacks in return. The Hydrophant itself could attack and crush enemies in melee, though it had a difficult time against large mobs surrounding it.

Nayru's Blessed 

JVnk6zs.jpg
A Unique Unit of Princess Ruto. Nayru's Blessed wielded an extremely rare magic that could create crystalline barriers from their staffs. These mages could use such an ability to create defenses around themselves and their brethren in battle. Units within formation of Naryu's Blessed gained a dramatic boost in their armor, especially against non-magical attacks. 

Healer Supreme 

4RibZsW.jpg
A Unique Unit of Zaleen. Healer Supremes were trained for rapid response in warzones. Their primary duty was to determine quickly if a soldier could be saved, and then quickly bandage them up before moving unto the next. They were also trained in basic combat as well, allowing them to fight off aggressors.

Stormbolter 

0qS3Cei.jpg
A Unique Unit of Telara. Though not a true mage, Stormbolters wielded rods that had been charged with powerful electric magic. These rods could be used as a club in a melee, electrifying and stunning enemy units around the wielder. They were excellent for crowd control, with compliments of melee soldiers moving in behind them to attack stupefied enemies.

 

Time to get all the buildings in now

 

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

I don't think gui scripts are executed for AI. And in any case you should send that command from the AI itself.


They are in different JS contexts and cannot communicate directly. And the game is runnable without any gui.

What the above code does will also break in multiplayer if cheats are not enabled since it relies on sending messages for other players.

As for why there is a method to set starting technologies, well to set starting technologies. Pass what you want when you decide to start a game, or include that in the map JS data. What you seem to be missing is an idea of how all of that interacts, which is at least partially documented on the wiki.

  • Like 1
Link to comment
Share on other sites

8 hours ago, leper said:

As for why there is a method to set starting technologies, well to set starting technologies. Pass what you want when you decide to start a game, or include that in the map JS data. What you seem to be missing is an idea of how all of that interacts, which is at least partially documented on the wiki.

That is my point. You have to edit a file just to start on phase_city or with no phase at all. Then you are pretty much stuck with it. If you can add a 'nomad' option to the settings box that would be nice. Might break a lot of maps though. :/ As well as a 'just for mods' init and postInit function.

 

Zoras! I can't wait for the next update. :) Is that a winged whale? That is awesome.

Edited by SirPope
Link to comment
Share on other sites

No. You just have to pass that setting like all other gameAttributes. Nomad for most maps is probably going to happen for RMS, for Skirmish maps that is already unlikely, and Scenario maps are either nomad or aren't.

Why do mods need a specific init? So far everything has worked without one and there hasn't been any good reason to add something that isn't needed.

  • Like 1
Link to comment
Share on other sites

Meant for the AI. An Init for petra. Add to the 'Config.advanced' building variable without needing to actually edit petra for example. Or adjust the queue priority levels after they've been set. Such as not having any farms and only corrals. Make the corrals more important. Or in this case randomly unlock a tech for the AI at the beginning. Additions to the advanced building variable would be the most used. How do you set it to nomad? I want to barricade myself in a corner. I'm a turtle.

Edited by SirPope
All it'd take is an empty function getting passed gamestate to implement.
Link to comment
Share on other sites

File loading order is alphabetical, a mod can just add a few files to actually extend the AI. As you have to add some code to make the AI do what you want, you can just add that to the AI. I suspect patches to make some parts easier to configure for mods are very likely to be accepted.

  • Like 1
Link to comment
Share on other sites

@SirPope  I'm not convinced it is a good idea to try and adapt petra to hyrule in A22. There are big chances that by the time you have something working nicely, A23 will be out and you'll have to redo big parts as there were a lot of changes in the last months.

I would rather advise you to adapt Hyrule to the svn version (which is something which will have to be done anyway, so will be time well spent), and then only adapt petra to hyrule. Then your work won't be vain and you may get some help (i've no time nor interest to debug A22 problems, but would be ready to help on problems in the current version). And as leper said, patches which improve mod support can be added in the svn version.

  • Thanks 1
Link to comment
Share on other sites

@mimo

You're a bit late on that. I already patched it into petra a22 and got it working, corrals/farmstead combos, the several barracks & blacksmiths built (except for the stupid tech in the beginning). I copied petra into the Hyrule folder before I edited it. The only thing I'm missing is to 'auto-select' an option for the AI... and a way to figure out which barracks is better... I'm just randomly choosing the one it can afford and has the least of atm. I've gave up on that irritation and switched back to delenda_est. I've already patched that one.

 

As for the svn, if you look at worker.js, the update function has a massive if, else if, else statement near the bottom of it. You could put some returns; to exit out of the statements a bit quicker. It's not much but that code is pretty much used for everything and constantly. Near the end of the update, when an if statement is reached, the function has ended or is going to end and do nothing during that time. So it's pretty much wasted time to not exit after or during these if statements. There are a few places that could use a tiny microboost similar to that as well. basemanager's checkResourceLevels could use some continues to shoot it along.

 

Link to comment
Share on other sites

2 hours ago, SirPope said:

@mimo

You're a bit late on that. I already patched it into petra a22 and got it working, corrals/farmstead combos, the several barracks & blacksmiths built (except for the stupid tech in the beginning). I copied petra into the Hyrule folder before I edited it. The only thing I'm missing is to 'auto-select' an option for the AI... and a way to figure out which barracks is better... I'm just randomly choosing the one it can afford and has the least of atm. I've gave up on that irritation and switched back to delenda_est. I've already patched that one.

ok nice   :)   but still, the important comment i wanted to say is that most of these changes won't apply anymore when A23 is released, and a more durable solution is to do these changes in svn (either directly if not mod-specific, or add some way to ease the modding for the others).

 

2 hours ago, SirPope said:

As for the svn, if you look at worker.js, the update function has a massive if, else if, else statement near the bottom of it. You could put some returns; to exit out of the statements a bit quicker. It's not much but that code is pretty much used for everything and constantly. Near the end of the update, when an if statement is reached, the function has ended or is going to end and do nothing during that time. So it's pretty much wasted time to not exit after or during these if statements. There are a few places that could use a tiny microboost similar to that as well. basemanager's checkResourceLevels could use some continues to shoot it along.

 

I'm not sure there will be any time difference, but i agree such early-return would be better for readability. Patch welcome!

  • Like 2
Link to comment
Share on other sites

  • Stan` pinned this topic

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