offworld trade and resources

I have Python logging on, and am not seeing any error. Is it possible that the queue is working fine but it is just invisible for some reason with the layout changes?
 
I have integrated your rar file into my local area, and the HWR screen is working just as before. I give myself a city, some money, and off world trade tech, and I can purchase units from the HWR screen. I tried as Harkonnen and BG. I see the new art for BG, so everything seems to be working for me.
 
Sounds like user error on my part then... it wouldn't be the first time. It's strange though - I've reinstalled 1.5 then 1.5.4 then the new patch and I still get no unit list - I'll wait for the patch.

Koma, can we disable the left click draging on the planet of the left hand side of the screen please? It kind of breaks the mood.
 
Is it possible that the queue is working fine but it is just invisible for some reason with the layout changes?

In screen shots you posted there is no 'TRANSPORT' text, just an empty button. This indicates that a large part of the homeworld screen code isn't executed. Usually that should throw an exception. :confused:

I tried your update:
Spoiler :
civ4screenshot004.jpg


Btw, in general it is no good idea to bundle my latest update with a regular dw patch. I am try to understand the concept of multi threading and make great use of it in the homeworld screen. Currently it is very easy to freeze civ4, i still have to improve that.
 
Ah ha! I was expecting a popup with Python errors, but this only showed up in the log file:

Traceback (most recent call last):

File "CvScreensInterface", line 956, in handleInput

File "CvMainInterface", line 7807, in handleInput

File "CvScreensInterface", line 198, in showHomeworldAdvisorScreen

File "CvHomeworldAdvisor", line 121, in interfaceScreen

File "MercenaryUtils", line 121, in loadMercenaryData

File "MercenaryUtils", line 137, in getMercenaryUnit

File "MercenaryUtils", line 162, in getRandomUnitType

File "MercenaryUtils", line 190, in isInvalidEra

AttributeError: 'NoneType' object has no attribute 'getEra'
ERR: Python function handleInput failed, module CvScreensInterface

This is in 1.5.4 installed clean WITHOUT any other patches. I just gave myself Offworld Trade with WB and founded a city.
 
Btw, in general it is no good idea to bundle my latest update with a regular dw patch.

Ack! I have already integrated this, as part of deliverator's patch, on top of all my other changes. I am not sure how to back it out.

deliverator said:
Ah ha! I was expecting a popup with Python errors, but this only showed up in the log file:

That is curious. I did not get that error when I released 1.5.4, and I do not get that error now. Perhaps part of the interface is missing (I am not sure what it is supposed to look like) but I am able to purchase units correctly.

Offhand, I don't see how elements in PrereqTechList can be None when calling getEra at line 190. The checks against -1 at the previous lines should prevent this.
 
Ack! I have already integrated this, as part of deliverator's patch, on top of all my other changes. I am not sure how to back it out.

I think we should just test the stability before panicking. It may be OK.

That is curious. I did not get that error when I released 1.5.4, and I do not get that error now. Perhaps part of the interface is missing (I am not sure what it is supposed to look like) but I am able to purchase units correctly.

Offhand, I don't see how elements in PrereqTechList can be None when calling getEra at line 190. The checks against -1 at the previous lines should prevent this.

I don't have this problem on my other PC so I wouldn't worry too much. It was working fine up until recently. I would have thought deleting the Dune Wars folder and re-installing would fix anything like this but apparently not.
 
I'm really confused about the homeworld screen thing. It must be something outside of my Mod/Dune Wars folder since I've deleted it completely, rebooted my machine and installed plain 1.5 - still getting the same exception.

Edit: If I change isInvalidEra to always return false, then I get the list of units. So it seems like something in this block of code is not robust enough for my very fussy PC - highlight the line throwing the error:

if UnitInfo.getPrereqAndTech() != -1:
PrereqTechList.append(UnitInfo.getPrereqAndTech())

for i in range(4):
if UnitInfo.getPrereqAndTechs(i) != -1:
PrereqTechList.append(UnitInfo.getPrereqAndTechs(i))

for iTech in PrereqTechList:
if gc.getTechInfo(iTech) != -1:
iTechEra = gc.getTechInfo(iTech).getEra()

if iTech == -1:
continue
if iTechEra < iEra:
continue
if iTechEra > iEra:
break

bInvalidEra = false
break
 
I'm really confused about the homeworld screen thing

I agree this is a little disturbing. With the change you have made, units from all eras will be available, which is probably not good. FYI you can use a "code" block instead of a "quote" block to keep the indents. Try moving the comparison against -1 up earlier:
Code:
		for iTech in PrereqTechList:
			[COLOR="Red"]if iTech == -1:
				continue[/COLOR]
			iTechEra = gc.getTechInfo(iTech).getEra()
			if iTechEra < iEra:
				continue
			if iTechEra > iEra:
				break
				
			bInvalidEra = false
			break
I don't see why this would persist after a re-installation for you, unless you have something weird in My Games/CustomAssets. Even if you did, I can't think what kind of stuff in CustomAssets would cause this.
 
I've changed the code as you suggested, but I still get the error:

AttributeError: 'NoneType' object has no attribute 'getEra'

Is there anything more I can do to diagnose the issue? iTech is the id for a technology I take it? And the technology returned by gc.getTechInfo(iTech) is a 'NoneType' object for some reason?
 
OK I don't know if this helps, but if I change this range(4) to range(3) I don't get the issue.

Code:
	def isInvalidEra(self, player, iUnit):
		
		UnitInfo = gc.getUnitInfo(iUnit)
		PrereqTechList = []
		iEra = player.getCurrentEra()
		
		bInvalidEra = true
		
		if UnitInfo.getPrereqAndTech() != -1:
			PrereqTechList.append(UnitInfo.getPrereqAndTech())
				
[B][COLOR="Red"]		for i in range(3):[/COLOR][/B]
			if UnitInfo.getPrereqAndTechs(i) != -1:
				PrereqTechList.append(UnitInfo.getPrereqAndTechs(i))
			
		for iTech in PrereqTechList:
			iTechEra = gc.getTechInfo(iTech).getEra()
			if iTech == -1:
				continue				
			if iTechEra < iEra:
				continue
			if iTechEra > iEra:
				break
				
			bInvalidEra = false
			break
	
		return bInvalidEra

If I then change it back to range(4) and the Python is reloaded I can still see the unit list in the Homeworld screen. However, if I reload the mod again completely with range(4) then I get the exception again.

Edit: As far as I can see we only have one unit that requires more than one tech and that is the Firefly which requires Air Power and Liquid Fuel. If the range value is set to 4 that means that presumably we allowing for units which have 4 Prereq Techs which seems excessive.
 
Hmm, strange. Right now I can only say, that rewriting the gameplay part of the homeworld screen is on my todo list.... Lets see if I can make it more robust.

I still think it is no good idea to add the current Homeworld patch (2.05) to the regular update. You have to be very careful when sequence is playing, don't click on anything. The transition sequence has its on process thread but I forgot to synchronize threads after sequence is played. I just disabled interface input for some time. Now it can happen that input is reenabled to early and if you click with your mouse somewhere, this could lead to more than one thread accessing the same screen output, making your civ4 freeze...
I can fix it, give me some days.

What do you think about the sequence/new screen (when purchasing a unit) in general?
Here some thoughts from me:
- I am not sure but the sequence is maybe too long?
- I can now fade in/out dds graphics :cool:
- I like the old heighliner more...
- the new exit-button position is imho a step backwards, the former exit button was in same place as the homeworld screen button in main interface, making quick checking hw screen more comfortable
 
If the sequence is going to cause stability issues then I'm happy to drop it. The fading out and fading in again of the heighliner might be enough. And yes, the fading is :cool:.

If you can get the sequence stable - we could just have a few Navigator shots, or if you want to revert to the old heighliner then there is a BIK movie in the Emperor:Battle for Dune game which has an old school heighliner transporting.

attachment.php


Personally, I think the miniseries one looks slightly cooler. I would like to add the old school Navigators to the sequence though.

I think the sequence might be a frame too long as well.

I think david was suggesting the buttons should be at the bottom, but you may have a point about ease of checking the screen.

It sounds like david isn't doing a new patch until the weekend so hopefully we have a few days :)
 
Personally, I think the miniseries one looks slightly cooler. I would like to add the old school Navigators to the sequence though.
Ok, I will try making a sequence or bik movie with guild navigators.

It sounds like david isn't doing a new patch until the weekend so hopefully we have a few days
I hope... :) I want to think about having harvesters outside culture borders and ai city placement...
 
I integrated the 2.05 HW screen as part of deliverator's patch, and now I am not sure how to back it out. It seems to cause a python error for deliverator (but not for me), and koma seems uncertain about the stability. Since we have over a thousand downloads, I want to be a little more certain there are no bad side effects, even for patches.

So, I did not put up the 1.5.5 changes I discussed from this past weekend.

@ koma13, if I change only the CvHomeWorldAdvisor.py file back to the 2.04 version, will this be "safer"? This will use your older graphics with no transition sequence. Or, is there some way we can build more confidence that it is "safe"? I can't see the download count of your 2.05 release, or deliverator's art patch which includes 2.05. It is possible nobody tried it except for deliverator and me. It did not crash for either of us, or you either, but this is not very much testing yet.

I had stopped taking elaborate protections against merge changes for the last month or so, and as a result I did not keep copies of some of my local changes before I unpacked deliverator's art patch. My fault. If reverting CvHomeWorldAdvisor.py is not enough, we will have to discuss how to back it out.

deliverator said:
OK I don't know if this helps, but if I change this range(4) to range(3) I don't get the issue.

I investigated a little more, and this is the exact cause. The question is no longer why it fails for deliverator, the right question is why does it *work* for me and koma13. In assets/xml/GlobalDefines.xml we find:
Code:
	<Define>
		<DefineName>NUM_AND_TECH_PREREQS</DefineName>
		<iDefineIntVal>4</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>NUM_UNIT_AND_TECH_PREREQS</DefineName>
		<iDefineIntVal>3</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>NUM_BUILDING_AND_TECH_PREREQS</DefineName>
		<iDefineIntVal>3</iDefineIntVal>
	</Define>

So anything which refers to a fourth unit prereq *should* fail. I'm not sure why one installation would have this problem and another would not. But changing 4 to 3 appears to be the proper solution. I will make this locally.
 
koma13 said:
I can fix it, give me some days.

@David: Hopefully, Koma can tidy up this multi-threading issue soon. So, if you are OK with delaying the new patch until then then I suggest we wait. I may have a few more bits of art by then too.
 
deliverator said:
It sounds like david isn't doing a new patch until the weekend so hopefully we have a few days
I hope... :) I want to think about having harvesters outside culture borders and ai city placement...

I had a read through the 1000 line, uncommented single function AI_foundValue, which computes the AI value for each plot to found a new city. Up till about 1/3 of the way through, I was kind of following it, then I totally lost track. As you had stated before, understanding and then improving this function will be "not fun". If you can get anywhere, more power to you.
 
Here, I made a small video of the new space travel sequence I am currently working on. :)


Link to video.


Up till about 1/3 of the way through, I was kind of following it, then I totally lost track.
I know that. I tried to improve city placement 2 or 3 times and always ended up making the ai to picky about city sites, wasting valuable tiles inbetween. Maybe it's easier to completely rewrite ai_foundvalue from scratch, allowing us to make our own system for valuing city sites. :dunno:
 
Its neat, but it looks like it takes too long, particularly if it does that sequence every time you purchase a unit.

A travel animation should be at most 3-4 seconds each time you purchase a unit.

There could be a long form that activates the first time I guess and then shorter ones afterward, but otherwise it needs to remain quick. A lot of players (including myself) tend to activate "quick combat" because the fight sequence animations can be too long considering how many battles there are.
 
It is fancy, but I agree with Ahriman that it takes too long. It's too much for something that you have to sit through repeatedly.

Did you not like the split screen set-up? I thought the split screen was quite a good way to go. Personally, I'd prefer keeping the split screen design with the stability issues fixed.

Also, minor point, but it looks like you are not using the updated heighliner graphic and homeworld descriptions from my patch. It would be good to make the description area a bit bigger as the Ecaz description is too big for the area and has a scrollbar at the moment.
 
Back
Top Bottom