Questions for the art people (Lightspeed. etc.)

#1
I've been going over some data of what's used in the game to see if more memory can be saved. All of the following is using the current MediaVPs. Excluding the obvious thing of only loaded the weapons able to be used for a mission I have noticed these few things on a small mission:

1 - Maxim_Particle.ani is 256x256 where all others are 128x128. Can this be resized without hurting quality too much? Making it 128x128 would save about 2megs of memory.

2 - Is WarpMap02.ani used? This is listed as the Knossos warp but I don't ever remember seeing it in-game but it could probably be skipped over if not in a Knossos mission. Would save about 4meg.

3 - For WarpMap01.ani, the basic warp graphic, there are 4 LODs but only LOD0 is ever used according to the code. If a new fireball.tbl is included with the MediaVPs it could just have 1 LOD and we wouldn't have to waste slightly more than 1meg on the others.

4 - For exp_05 and exp_06 LOD0 and LOD1 are exactly the same out of the four different ones. If the LOD count was just set to 3 then the extra copy shouldn't be needed and we'd save 12megs total.

5 - Almost choked on this one: exp20 has all four LODs the same thing! A new weapon_expl.tbl specifying one LOD would save 16.5meg.

These things are in memory for every mission which is why I'm bringing them up first. I plan to go through several missions of varying sizes to figure out other areas where it might be possible to save memory.

EDIT: exp20 is in weapon_expl.tbl not fireball.tbl, oops.

#3
Are you going thru this stuff manually? Or do you have some automated tool helping you?
When I started debugging the texture problems I added a quick little function to bmpman that prints out a list of every image that's loaded along with it's handle and filename. I just changed it a little to tell me if an image is loaded into memory or not and how much memory it's using. It's called as soon as a level load is completed.

I just "grep LOCKED fs2_open.log >bmp.txt" and see what it comes up with. I'm not quite sure if I would qualify that as a manual process or an automated tool though. ;)

#5
The Knossos warp is used in the main campaign, but it took me a while to notice it. Basically you only need to load it in the following situations:

1) If a ship has the "special warp" flag enabled, which means it's jumping in through a Knossos.

2) If the mission contains the "special-warpout-name" sexp, which means a ship is jumping out through a Knossos.

3) If the mission contains my "warp-effect" sexp and the sexp is set to display the Knossos warp.
Fortunes of War
Deus Ex Machina

VWBB Survivor: 12/01-7/04, 130 posts

Re: Questions for the art people (Lightspeed. etc.)

#7
I've been going over some data of what's used in the game to see if more memory can be saved. All of the following is using the current MediaVPs.


They're out-dated, quite a bit actually.
1 - Maxim_Particle.ani is 256x256 where all others are 128x128. Can this be resized without hurting quality too much? Making it 128x128 would save about 2megs of memory.
It could, but I don't think the 2MB is worth the loss in visual quality. However things will change (and use a especially optimized 128x128 animation) when I finally update the weapon effects - been working on for quite a while now, and basically I only have to fill in the tables. However, I was about to post a request concerning weapon effects:
Would it be possible to add a simple flag for the "particle spew" code, to render the particle opaque instead of alpha blended? As it is now, a black image will be transparent, a dark one will be added to anything in the background. What I'm asking for is a "render-opaque" flag, that simply renders it as a solid spot. Like this, you can for example create realistic smoke effects through TGA alpha transparency (for example creating black, but solid particles). This would be even more useful with the new .eff code.
2 - Is WarpMap02.ani used? This is listed as the Knossos warp but I don't ever remember seeing it in-game but it could probably be skipped over if not in a Knossos mission. Would save about 4meg.


Depends on the SEXPs IIRC, not the mission or Knossos itself.
3 - For WarpMap01.ani, the basic warp graphic, there are 4 LODs but only LOD0 is ever used according to the code. If a new fireball.tbl is included with the MediaVPs it could just have 1 LOD and we wouldn't have to waste slightly more than 1meg on the others.


Sounds fine.
4 - For exp_05 and exp_06 LOD0 and LOD1 are exactly the same out of the four different ones. If the LOD count was just set to 3 then the extra copy shouldn't be needed and we'd save 12megs total.
The problem is with the LOD switching distances. If those could be set individually (and be influenced by the explosion's size - larger size means nearer LOD), we could save quite a lot of performance here.
5 - Almost choked on this one: exp20 has all four LODs the same thing! A new weapon_expl.tbl specifying one LOD would save 16.5meg.


I don't know, but I think I had fixed it. No idea if it ever went into the mediaVPs though; or I may have forgotten. :)
Dance with me
Under the soft moon shining,
In the wide open fields
Far beyond the toil and trouble
Of my busy mind.

Re: Questions for the art people (Lightspeed. etc.)

#8
2 - Is WarpMap02.ani used? This is listed as the Knossos warp but I don't ever remember seeing it in-game but it could probably be skipped over if not in a Knossos mission. Would save about 4meg.


Depends on the SEXPs IIRC, not the mission or Knossos itself.
I looked through the code pretty thoroughly when I coded the warp-effect sexps. The conditions I listed are the ones that do it.

If you want to see it in-mission, load up SM2-06 ("Endgame"). It appears when the Iceni sneaks past the Colossus and jumps into the portal.
Fortunes of War
Deus Ex Machina

VWBB Survivor: 12/01-7/04, 130 posts

Re: Questions for the art people (Lightspeed. etc.)

#9
What I'm asking for is a "render-opaque" flag, that simply renders it as a solid spot. Like this, you can for example create realistic smoke effects through TGA alpha transparency (for example creating black, but solid particles). This would be even more useful with the new .eff code.
It's easy enough to not blend but where would this flag be? It would almost have to be in the EFF to avoid every instance of a blending mistake.
I looked through the code pretty thoroughly when I coded the warp-effect sexps. The conditions I listed are the ones that do it.
Is there a "SEXPs for Dummies" wiki out there anywhere? :) Not having ever really been through that code I'm not sure exactly when they would be evaluated (mission load, right?). I need a way to test if it's needed during fireballs_page_in() but I'm not sure how to check for every condition. I can check if a Knossos device is used in a mission easily enough but I'm not sure how to properly test for the warp-effect sexp.

I've been using the 3d warp since my Linux tree hasn't been updated to current CVS and I think that's why I missed the special version. Using 2d I do see it in the Knossos missions.

#11
well :V: made fredding html tutorials
I was referring more to the internals, how the sexp code interacts with other parts of the game. I probably should have said "SEXPs for Idiot Developers" or perhaps "SEXPs for Developing Dummies"... no wait, that last one doesn't really work. :)

Re: Questions for the art people (Lightspeed. etc.)

#12
Is there a "SEXPs for Dummies" wiki out there anywhere? :)
Hehe. :) No, but I've been through the sexp code so many times I pretty much know it backwards and forwards. You can ask me.
Not having ever really been through that code I'm not sure exactly when they would be evaluated (mission load, right?). I need a way to test if it's needed during fireballs_page_in() but I'm not sure how to check for every condition.
The sexps are parsed during mission_load(), yes. So the mission would load and set all these flags before the fireballs need to be paged in. I was thinking of making a global flag that could be set during the parsing, if the parser encounters one of those conditions. Or, we could just do a straight text search through the mission to look for the flag.

Incidentally I've had to do something like that before, when I made the change-ship-model and change-ship-class sexps. If the sexp needs a model that hasn't been used in-game yet, there's a slight pause while it loads it. To eliminate that pause, I added a rather hackish preloader in the sexp parser. It works, but that's probably not the most elegant way to do it.
I've been using the 3d warp since my Linux tree hasn't been updated to current CVS and I think that's why I missed the special version. Using 2d I do see it in the Knossos missions.
Aha. That's very interesting. Another bug. :p
Fortunes of War
Deus Ex Machina

VWBB Survivor: 12/01-7/04, 130 posts

Re: Questions for the art people (Lightspeed. etc.)

#13
The sexps are parsed during mission_load(), yes. So the mission would load and set all these flags before the fireballs need to be paged in. I was thinking of making a global flag that could be set during the parsing, if the parser encounters one of those conditions. Or, we could just do a straight text search through the mission to look for the flag.
I'll have a look at this when I get the chance. I really need to get more code from my pilot builds in CVS this weekend so that's going to be my priority. A diff of my pilot tree is 13,000+ lines and it's getting a bit difficult to manage things. Not as bad as the 35,000+ line Linux/OSX tree but still a pain.
I've been using the 3d warp since my Linux tree hasn't been updated to current CVS and I think that's why I missed the special version. Using 2d I do see it in the Knossos missions.
Aha. That's very interesting. Another bug. :p
Actually this might have been something specific with my code since it does work now. I just updated to current CVS and even with the 3d warp it was green where it should have been. Not sure what was wrong there but this was my own code tree which others don't get to use so no civilians should have been affected.

Re: Questions for the art people (Lightspeed. etc.)

#15
It's easy enough to not blend but where would this flag be? It would almost have to be in the EFF to avoid every instance of a blending mistake.
Cool :)

Ideally the flag would be in the weapons table in the particle spew tab:

$Pspew:
+Count: 1
+Time: 25
+Vel: 0.60
+Radius: 0.35
+Life: 0.2
+Scale: 0.25
+Bitmap: Kayser_Particle
+RenderOpaque: YES <---- defaults to NO if not present.

What also would own, would be the ability to set a spawning cone for the particles (a bit like $fof for weapons) and a randomize factor for +Time to create "random-ish" particle spews.
Dance with me
Under the soft moon shining,
In the wide open fields
Far beyond the toil and trouble
Of my busy mind.
Locked

Who is online

Users browsing this forum: No registered users and 27 guests

cron