Jump to content

couldn't find building missing to get p3


seeh
 Share

Recommended Posts

  • seeh changed the title to couldn't find building missing to get p3

i read around about phases in wiki and in my memory ;)

 phases explained by wikipedia
https://en.wikipedia.org/wiki/0_A.D._(video_game)#Gameplay

Quote

During the game, the player advances from "village phase", to "town phase", to "city phase". The phases represent the sizes of settlements in history, and every phase unlocks new units, buildings, and technologies.

Such descriptions of development games lead me to assume that the complete development of all developments in one phase enables the step into the next phase.
it is different here. I keep forgetting that often when i try get in phase 3.

in the game, if you MouseHover over III, it tells:

Quote

Remaining: 1 entities of class Town

the description here is much better for me:
https://play0ad.com/8-technologies-and-phases/

Quote

requires having built four buildings of any type that becomes available in the Town Phase

=>therefore i suggest the following formulation for beginners or otherwise experienced players

in the game, if you MouseHover, over III - Button:

Remaining: 1 entities of class Town of any type

 

Edited by seeh
Link to comment
Share on other sites

Could buildings that are needed to progess to the next phase get an icon like II or III? E.g. like this? (look at the icon for the barracks)

Numbers of needed buildings are not shown, though, and I have not paid attention to accuracy - this is just meant as a proposal how it could look like. If it helps, I don't know. ;)

grafik.png.193921b56234a795c349b60ba02beaed.png

  • Like 3
Link to comment
Share on other sites

43 minutes ago, Angen said:

Requirements looks pretty clear to me xx.png

pretty clear to you and for OPs. But bit more clear if you add 3 letters 'any' in.
or even better in my opinion. I think it doesn't bother professionals much who already know that anyway:

Quote

@seeh I believe any three p2 buildings will do (except towers & walls)

 

Edited by seeh
Link to comment
Share on other sites

I'm not sure what you mean about the tutorial: First come to an agreement what we want is certainly needed. Do you want to see the proposal in a tutorial?

About the code - is it there? https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/session/

How do I find my way around, i.e. where do I have to closer look for JS about that panel stuff?

Edited by Ceres
Link to comment
Share on other sites

9 hours ago, Freagarach said:

Towers don't have the class Town, so the description is accurate?

7 hours ago, Angen said:

Requirements looks pretty clear to me

Accurate & clear, but not obvious. ;) One would have to know what counts as 'class town', or dig somewhat deeper.

I think the requirements for phasing up should be explained in the 'information' section.

 

6 hours ago, Ceres said:

Could buildings that are needed to progess to the next phase get an icon like II or III?

I'd like to throw in that they count towards the requirement to phase up, but are not actually needed.

  • Like 1
Link to comment
Share on other sites

Considering that the Phase technologies are already special snowflakes even in the JS templates I think you can just add a Phase part to the top UI. There is a big space to the left of the civilization icon. Just make it display like:

Phase: [current phase] (Build X more of any structure with icon [phase number] to enable next phase tech)

{Phase 1: Village (Build any combination of 5 structures with the [II] Icon to enable Town Research}

Or whatever you want the description to say as long as it has the relevant info.

Edited by MoLAoS
Link to comment
Share on other sites

That would be https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/session/selection_panels_right/construction_panel.xml

As we don't support dynamic object creation in XML (e.g creating as many buttons as buildings) we have to hardcode 40, and hide the remaining buttons if we don't use all of them.

<object name="unitConstructionPanel" size="6 6 100% 100%">
  <object>
    <repeat count="40">
      <object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 38 38" tooltip_style="sessionToolTipBottom">
        <object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 35 35"/>
      </object>
    </repeat>
  </object>
</object>

Then stuff is hardcoded in https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js

Which calls https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/session/unit_commands.js to get the building list

Which calls the GuiInterface

https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js For all units currently selected it checks whether it can build stuff, and whether the stuff it can build was already added to the list

 

GuiInterface.prototype.GetAllBuildableEntities = function(player, cmd)
{
	let buildableEnts = [];
	for (let ent of cmd.entities)
	{
		let cmpBuilder = Engine.QueryInterface(ent, IID_Builder);
		if (!cmpBuilder)
			continue;

		for (let building of cmpBuilder.GetEntitiesList())
			if (buildableEnts.indexOf(building) == -1)
				buildableEnts.push(building);
	}
	return buildableEnts;
};

 

  • Thanks 1
Link to comment
Share on other sites

49 minutes ago, Stan&#x60; said:

That would be https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/session/selection_panels_right/construction_panel.xml

As we don't support dynamic object creation in XML (e.g creating as many buttons as buildings) we have to hardcode 40, and hide the remaining buttons if we don't use all of them.

<object name="unitConstructionPanel" size="6 6 100% 100%">
  <object>
    <repeat count="40">
      <object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 38 38" tooltip_style="sessionToolTipBottom">
        <object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 35 35"/>
      </object>
    </repeat>
  </object>
</object>

Then stuff is hardcoded in https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js

Which calls https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/session/unit_commands.js to get the building list

Which calls the GuiInterface

https://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js For all units currently selected it checks whether it can build stuff, and whether the stuff it can build was already added to the list

 

GuiInterface.prototype.GetAllBuildableEntities = function(player, cmd)
{
	let buildableEnts = [];
	for (let ent of cmd.entities)
	{
		let cmpBuilder = Engine.QueryInterface(ent, IID_Builder);
		if (!cmpBuilder)
			continue;

		for (let building of cmpBuilder.GetEntitiesList())
			if (buildableEnts.indexOf(building) == -1)
				buildableEnts.push(building);
	}
	return buildableEnts;
};

 

Any particular reason we hard code a lot of stuff? I'm not saying there can't be a reason but it isn't immediately obvious to me.

Link to comment
Share on other sites

41 minutes ago, MoLAoS said:

Any particular reason we hard code a lot of stuff? I'm not saying there can't be a reason but it isn't immediately obvious to me.

Sorry hardcoded was an hyperbole on my end. It's just that this part wasn't rewritten to use object oriented programming and still rely on a lot of globals. It's not really harcoded in the sense that the buildings and whatnot are generated from the template. I just meant that the code could probably be nicer :)

https://trac.wildfiregames.com/ticket/5387

Describes the issue

Link to comment
Share on other sites

21 minutes ago, Stan` said:

Sorry hardcoded was an hyperbole on my end. It's just that this part wasn't rewritten to use object oriented programming and still rely on a lot of globals. It's not really harcoded in the sense that the buildings and whatnot are generated from the template. I just meant that the code could probably be nicer :)

https://trac.wildfiregames.com/ticket/5387

Describes the issue

I was assuming you meant non-dynamic by hard coded so hyperbole confusion avoided. Yeah that code looks like a mess. I'm already having some trouble with the regular JS in the component section so that GUI stuff looks scary. I miss my sexy headers from c++. Headers with well defined make it so all code understanding problems for new programmers can be solved by moderate TextCrawler abuse. Of course you have to compile so it isn't all upside.

I am a pro-composition anti-inheritance fanatic so the JS code is painful for me but only for personal preference reasons.

Edited by MoLAoS
Link to comment
Share on other sites

16 hours ago, MoLAoS said:

I mean my monitor isn't that excessively large and I have a huge space. If I set it to window and leave it at the default smallest possible size it does look like that. What is that like 800 or something?

I opened it in windowed mode and made it smaller so as not to have a too large screenshot. Maybe for this special purpose, this was not ideal, I realise. :blush: Usually, I play in fullscreen mode @2560 x 1080, where there is plenty of room. But we have to keep in mind regular/ smaller resolutions such as e.g. 1280 x 1024, right?

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