Error when using setSky() on 3.2 master

For AI and campaign script related discussions and questions
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Error when using setSky() on 3.2 master

Post by aubergine » 25 Dec 2012, 00:18

I've edited rules.js to contain just this:

Code: Select all

function eventStartLevel() {
  setSky("clouds01.png");
}
Error in logs is:

Code: Select all

error   |10:17:01: [pie_AddTexPage:130] pie_AddTexPage: non POT texture clouds01.png
I've no idea what a "POT" texture is?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6178
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Error when using setSky() on 3.2 master

Post by NoQ » 25 Dec 2012, 06:32

I think you need to specify a full path to the texture on physfs.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Error when using setSky() on 3.2 master

Post by aubergine » 25 Dec 2012, 14:08

Already tried that:

Code: Select all

function eventStartLevel() {
  setSky("texpages/clouds01.png");
}
But got:

Code: Select all

PHYSFS_openRead(texpages/texpages/couds01.png) failed with error: File not found
error   |11:13:01: [iV_GetTexture:259] Failed to load texpages/texpages/couds01.png
It seems setSky() prefixes the filename with "texpages/".

If I remove .png from the original attempt I get this:

Code: Select all

function eventStartLevel() {
  setSky("clouds01");
}
Gives:

Code: Select all

error   |11:19:04: [iV_loadImage_PNG:85] pie_PNGLoadFile: PHYSFS_openRead(texpages/couds01) failed with error: File not found
error   |11:19:04: [iV_GetTexture:259] Failed to load texpages/couds01
So it seems it was finding the file, but was not happy with the format for some reason.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3750
Joined: 03 Aug 2006, 19:39

Re: Error when using setSky() on 3.2 master

Post by Per » 25 Dec 2012, 15:56

POT = Power Of Two. Early OpenGL versions have a requirement that a texture has to be a size that is a power of two in each direction.

PS Not sure why the error message is missing an 'l'...

User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Error when using setSky() on 3.2 master

Post by Goth Zagog-Thou » 25 Dec 2012, 22:57

Another PhysFS bug, perhaps? Remember you need to either upgrade or downgrade PhysFS to either 2.0.1 or 2.0.3, or else things like this start happening.

If you're on Ubuntu (or a variant) Linux I'll provide the new PhysFS files I compiled myself an hour ago .. solved all my issues on 3.1_RC3 -- if indeed that's the issue.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Error when using setSky() on 3.2 master

Post by aubergine » 26 Dec 2012, 14:06

@Goth: I'm on Mac OS build and dak180 applied physfs patch already, so probably not a physfs bug.

Anyway, while I was offline I tried making skies 512x512 rather than 1280x800 and that fixed the bug I was getting. So, as Per mentions above the skybox currently has to be "POT".

I then did some experimenting with animating the skybox, basically I got a video of some clouds moving, resized to 512x512 and then exported it to a sequence of .png files. It seems the setSky() function causes custom textures because after about 300-500 frames the game crashed with what appeared to be an OOM error.

I noticed that there is some weirdness happening when setting sky - sometimes the minimap gets replaced with the sky, and sometimes the sky gets replaced with the minimap! I managed to catch the minimap being replaced with sky in a video:

Animated sky in WZ 3.2: http://www.youtube.com/watch?v=LvO6Q7l7fYc

P.S. Happy holidays!
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Error when using setSky() on 3.2 master

Post by aubergine » 26 Dec 2012, 14:17

Oh, and regarding the missing 'l' that was a typo on my part.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6178
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Error when using setSky() on 3.2 master

Post by NoQ » 26 Dec 2012, 14:49

aubergine wrote:Animated sky in WZ 3.2: http://www.youtube.com/watch?v=LvO6Q7l7fYc
OMG.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Error when using setSky() on 3.2 master

Post by aubergine » 26 Dec 2012, 16:14

Another experiment, this time with a slightly more suitable sky video. I was hoping to catch the sunrise but unfortunately the game crashed 30 seconds in to the sequence (OOM error again). For this experiment I used 1024x1024 tile size, which started to have a noticeable impact on game performance (loading a >1MB image every 100ms).

I cropped the video this time so that only one panel of the skybox is shown, I think this really gives some idea of the stunning effect that could be achieved in the long run. The video is in HD -- be sure to set quality to 720p for best quality.

Sunrise over a warzone: http://www.youtube.com/watch?v=NnYoqB9iRYs
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3750
Joined: 03 Aug 2006, 19:39

Re: Error when using setSky() on 3.2 master

Post by Per » 26 Dec 2012, 16:30

Wow, pretty impressive. I'll try to hunt down that bug...

Can you make a bug ticket and post your mod there so I can use it to reproduce the bug? Thanks :)

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Error when using setSky() on 3.2 master

Post by aubergine » 26 Dec 2012, 16:57

Commander, Alpha base evacuees have sent us this recording of the nuclear strike. It is imperative that we evacuate Beta base before we meet the same fate.

http://www.youtube.com/watch?v=nHiFbUekdh0 (remember to set HD).

@Per: Yup, I'll create a ticket. Will try and compress the mod to a reasonable size (currently it's 343 MB).

EDIT: Now down to 194 MB....

EDIT: Now down to 69 MB :)

EDIT: Bug ticket: http://developer.wz2100.net/ticket/3842
Last edited by aubergine on 27 Dec 2012, 00:47, edited 3 times in total.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Error when using setSky() on 3.2 master

Post by aubergine » 26 Dec 2012, 16:59

Also, managed to capture the minimap appearing in the skybox on the very first frame of that nuke video (you'll have to pause it then drag playhead to start of vid to see it).
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6178
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Error when using setSky() on 3.2 master

Post by NoQ » 26 Dec 2012, 18:40

Amazing work, even i got inspired (:
Emm, shouldn't the alpha base be in arizona tileset? Also you can probably use some fancy things like Jorzi's trees in your vids.
Attachments
wz2100-20121226_202515-Sk-HighGround.jpg
trees.mod.wz
(331.16 KiB) Downloaded 219 times

Jorzi
Regular
Regular
Posts: 1956
Joined: 11 Apr 2010, 00:14

Re: Error when using setSky() on 3.2 master

Post by Jorzi » 26 Dec 2012, 20:24

Doesn't it use up huge amounts of video memory when having animated textures like that, or is it streaming from the harddrive?
ImageImage
-insert deep philosophical statement here-

User avatar
NoQ
Special
Special
Posts: 6178
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Error when using setSky() on 3.2 master

Post by NoQ » 26 Dec 2012, 20:27

As far as understood (aka blind guess), it loads each frame into video memory, even if the same png file was already loaded, which causes out of memory (?)

Post Reply