Page 1 of 2

Error when using setSky() on 3.2 master

Posted: 25 Dec 2012, 00:18
by aubergine
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?

Re: Error when using setSky() on 3.2 master

Posted: 25 Dec 2012, 06:32
by NoQ
I think you need to specify a full path to the texture on physfs.

Re: Error when using setSky() on 3.2 master

Posted: 25 Dec 2012, 14:08
by aubergine
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.

Re: Error when using setSky() on 3.2 master

Posted: 25 Dec 2012, 15:56
by Per
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'...

Re: Error when using setSky() on 3.2 master

Posted: 25 Dec 2012, 22:57
by Goth Zagog-Thou
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.

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 14:06
by aubergine
@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!

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 14:17
by aubergine
Oh, and regarding the missing 'l' that was a typo on my part.

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 14:49
by NoQ
aubergine wrote:Animated sky in WZ 3.2: http://www.youtube.com/watch?v=LvO6Q7l7fYc
OMG.

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 16:14
by aubergine
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

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 16:30
by Per
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 :)

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 16:57
by aubergine
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

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 16:59
by aubergine
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).

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 18:40
by NoQ
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.

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 20:24
by Jorzi
Doesn't it use up huge amounts of video memory when having animated textures like that, or is it streaming from the harddrive?

Re: Error when using setSky() on 3.2 master

Posted: 26 Dec 2012, 20:27
by NoQ
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 (?)